Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .cursor/environment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"start": "sudo service docker start",
"install": "npm ci && npm run build:dev"
}
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
},
"lock": false
"lock": false,
"audit": {
"block-insecure": false
}
},
"scripts": {
"phpstan": "@php ./vendor/bin/phpstan analyse --memory-limit=2G",
Expand Down
4 changes: 3 additions & 1 deletion src/_index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
Expand All @@ -11,7 +13,7 @@
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
42 changes: 22 additions & 20 deletions src/index.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
<?php

declare(strict_types=1);

/**
* Note: this file exists only to remind developers to build the assets.
* For the real index.php that gets built and boots WordPress,
* please refer to _index.php.
*/

/** Define ABSPATH as this file's directory */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
if (! defined('ABSPATH')) {
define('ABSPATH', __DIR__ . '/');
}

/*
* Load the actual index.php file if the assets were already built.
* Note: WPINC is not defined yet, it is defined later in wp-settings.php.
*/
if ( file_exists( ABSPATH . 'wp-includes/js/jquery/jquery.js' ) && is_dir( ABSPATH . 'wp-includes/build' ) ) {
require_once ABSPATH . '_index.php';
return;
if (file_exists(ABSPATH . 'wp-includes/js/jquery/jquery.js') && is_dir(ABSPATH . 'wp-includes/build')) {
require_once ABSPATH . '_index.php';
return;
}

define( 'WPINC', 'wp-includes' );
define('WPINC', 'wp-includes');
require_once ABSPATH . WPINC . '/version.php';
require_once ABSPATH . WPINC . '/compat.php';
require_once ABSPATH . WPINC . '/load.php';
Expand All @@ -31,37 +33,37 @@
// Standardize $_SERVER variables across setups.
wp_fix_server_vars();

define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
require_once ABSPATH . WPINC . '/functions.php';

wp_load_translations_early();

// Die with an error message.
$die = sprintf(
'<p>%s</p>',
__( 'You are running WordPress without JavaScript and CSS files. These need to be built.' )
'<p>%s</p>',
__('You are running WordPress without JavaScript and CSS files. These need to be built.')
);

$die .= '<p>' . sprintf(
/* translators: %s: npm install */
__( 'Before running any build tasks you need to make sure the dependencies are installed. You can install these by running %s.' ),
'<code style="color: green;">npm install</code>'
/* translators: %s: npm install */
__('Before running any build tasks you need to make sure the dependencies are installed. You can install these by running %s.'),
'<code style="color: green;">npm install</code>'
) . '</p>';

$die .= '<ul>';
$die .= '<li>' . __( 'To build WordPress while developing, run:' ) . '<br /><br />';
$die .= '<li>' . __('To build WordPress while developing, run:') . '<br /><br />';
$die .= '<code style="color: green;">npm run dev</code></li>';
$die .= '<li>' . __( 'To build files automatically when changing the source files, run:' ) . '<br /><br />';
$die .= '<li>' . __('To build files automatically when changing the source files, run:') . '<br /><br />';
$die .= '<code style="color: green;">npm run watch</code></li>';
$die .= '<li>' . __( 'To create a production build of WordPress, run:' ) . '<br /><br />';
$die .= '<li>' . __('To create a production build of WordPress, run:') . '<br /><br />';
$die .= '<code style="color: green;">npm run build</code></li>';
$die .= '</ul>';

$die .= '<p>' . sprintf(
/* translators: 1: npm URL, 2: Handbook URL. */
__( 'This requires <a href="%1$s">npm</a>. <a href="%2$s">Learn more about setting up your local development environment</a>.' ),
'https://www.npmjs.com/get-npm',
__( 'https://make.wordpress.org/core/handbook/tutorials/installing-wordpress-locally/' )
/* translators: 1: npm URL, 2: Handbook URL. */
__('This requires <a href="%1$s">npm</a>. <a href="%2$s">Learn more about setting up your local development environment</a>.'),
'https://www.npmjs.com/get-npm',
__('https://make.wordpress.org/core/handbook/tutorials/installing-wordpress-locally/')
) . '</p>';

wp_die( $die, __( 'WordPress &rsaquo; Error' ) );
wp_die($die, __('WordPress &rsaquo; Error'));
Loading