',
+ esc_url( admin_url( 'options-general.php' ) ),
+ __( 'Change these settings' )
+ );
+ }
+
+ return $result;
+ }
+
/**
* Tests if plugin and theme temporary backup directories are writable or can be created.
*
@@ -2755,6 +2791,52 @@ public function get_test_search_engine_visibility() {
return $result;
}
+ /**
+ * Tests if opcode cache is enabled and available.
+ *
+ * @since 7.0.0
+ *
+ * @return array> The test result.
+ */
+ public function get_test_opcode_cache(): array {
+ $opcode_cache_enabled = false;
+ if ( function_exists( 'opcache_get_status' ) ) {
+ $status = @opcache_get_status( false ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- Warning emitted in failure case.
+ if ( $status && true === $status['opcache_enabled'] ) {
+ $opcode_cache_enabled = true;
+ }
+ }
+
+ $result = array(
+ 'label' => __( 'Opcode cache is enabled' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Performance' ),
+ 'color' => 'blue',
+ ),
+ 'description' => sprintf(
+ '
%s
',
+ __( 'Opcode cache improves PHP performance by storing precompiled script bytecode in memory, reducing the need for PHP to load and parse scripts on each request.' )
+ ),
+ 'actions' => sprintf(
+ '
',
+ esc_url( 'https://www.php.net/manual/en/book.opcache.php' ),
+ __( 'Learn more about OPcache.' ),
+ /* translators: Hidden accessibility text. */
+ __( '(opens in a new tab)' )
+ ),
+ 'test' => 'opcode_cache',
+ );
+
+ if ( ! $opcode_cache_enabled ) {
+ $result['status'] = 'recommended';
+ $result['label'] = __( 'Opcode cache is not enabled' );
+ $result['description'] .= '
' . __( 'Enabling this cache can significantly improve the performance of your site.' ) . '
';
+ }
+
+ return $result;
+ }
+
/**
* Returns a set of tests that belong to the site status page.
*
@@ -2843,10 +2925,18 @@ public static function get_tests() {
'label' => __( 'Autoloaded options' ),
'test' => 'autoloaded_options',
),
+ 'insecure_registration' => array(
+ 'label' => __( 'Open Registration with privileged default role' ),
+ 'test' => 'insecure_registration',
+ ),
'search_engine_visibility' => array(
'label' => __( 'Search Engine Visibility' ),
'test' => 'search_engine_visibility',
),
+ 'opcode_cache' => array(
+ 'label' => __( 'Opcode cache' ),
+ 'test' => 'opcode_cache',
+ ),
),
'async' => array(
'dotorg_communication' => array(
@@ -3378,22 +3468,21 @@ public function is_development_environment() {
}
/**
- * Returns a list of headers and its verification callback to verify if page cache is enabled or not.
- *
- * Note: key is header name and value could be callable function to verify header value.
- * Empty value mean existence of header detect page cache is enabled.
+ * Returns a mapping from response headers to an optional callback to verify if page cache is enabled or not.
*
* @since 6.1.0
*
- * @return array List of client caching headers and their (optional) verification callbacks.
+ * @return array Mapping of page caching headers and their (optional) verification callbacks.
+ * A null value means a simple existence check is used for the header.
*/
- public function get_page_cache_headers() {
+ public function get_page_cache_headers(): array {
$cache_hit_callback = static function ( $header_value ) {
- return str_contains( strtolower( $header_value ), 'hit' );
+ return 1 === preg_match( '/(^| |,)HIT(,| |$)/i', $header_value );
};
$cache_headers = array(
+ // Standard HTTP caching headers.
'cache-control' => static function ( $header_value ) {
return (bool) preg_match( '/max-age=[1-9]/', $header_value );
},
@@ -3403,36 +3492,107 @@ public function get_page_cache_headers() {
'age' => static function ( $header_value ) {
return is_numeric( $header_value ) && $header_value > 0;
},
- 'last-modified' => '',
- 'etag' => '',
+ 'last-modified' => null,
+ 'etag' => null,
+ 'via' => null,
+
+ /**
+ * Custom caching headers.
+ *
+ * These do not seem to be actually used by any caching layers. There were first introduced in a Site Health
+ * test in the AMP plugin. They were copied into the Performance Lab plugin's Site Health test before they
+ * were merged into core.
+ *
+ * @link https://github.com/ampproject/amp-wp/pull/6849
+ * @link https://github.com/WordPress/performance/pull/263
+ * @link https://core.trac.wordpress.org/changeset/54043
+ */
'x-cache-enabled' => static function ( $header_value ) {
- return 'true' === strtolower( $header_value );
+ return ( 'true' === strtolower( $header_value ) );
},
'x-cache-disabled' => static function ( $header_value ) {
return ( 'on' !== strtolower( $header_value ) );
},
- 'x-srcache-store-status' => $cache_hit_callback,
- 'x-srcache-fetch-status' => $cache_hit_callback,
- // Generic caching proxies (Nginx, Varnish, etc.)
- 'x-cache' => $cache_hit_callback,
- 'x-cache-status' => $cache_hit_callback,
- 'x-litespeed-cache' => $cache_hit_callback,
- 'x-proxy-cache' => $cache_hit_callback,
- 'via' => '',
+ /**
+ * CloudFlare.
+ *
+ * @link https://developers.cloudflare.com/cache/concepts/cache-responses/
+ */
+ 'cf-cache-status' => $cache_hit_callback,
+
+ /**
+ * Fastly.
+ *
+ * @link https://www.fastly.com/documentation/reference/http/http-headers/X-Cache/
+ */
+ 'x-cache' => $cache_hit_callback,
- // Cloudflare
- 'cf-cache-status' => $cache_hit_callback,
+ /**
+ * LightSpeed.
+ *
+ * @link https://docs.litespeedtech.com/lscache/devguide/controls/#x-litespeed-cache
+ */
+ 'x-litespeed-cache' => $cache_hit_callback,
+
+ /**
+ * OpenResty srcache-nginx-module.
+ *
+ * The `x-srcache-store-status` header indicates if the response was stored in the cache.
+ * Valid values include `STORE` and `BYPASS`.
+ *
+ * The `x-srcache-fetch-status` header indicates if the response was fetched from the cache.
+ * Valid values include `HIT`, `MISS`, and `BYPASS`.
+ *
+ * @link https://github.com/openresty/srcache-nginx-module
+ */
+ 'x-srcache-store-status' => static function ( $header_value ) {
+ return 'store' === strtolower( $header_value );
+ },
+ 'x-srcache-fetch-status' => $cache_hit_callback,
+
+ /**
+ * Nginx.
+ *
+ * @link https://blog.nginx.org/blog/nginx-caching-guide
+ * @link https://www.inmotionhosting.com/support/website/nginx-cache-management/
+ */
+ 'x-cache-status' => $cache_hit_callback,
+ 'x-proxy-cache' => $cache_hit_callback,
+
+ /**
+ * Varnish Cache.
+ *
+ * A header with a single number indicates it was not cached. If there are two numbers (or more), then this
+ * indicates the response was cached.
+ *
+ * @link https://vinyl-cache.org/docs/2.1/faq/http.html
+ * @link https://www.fastly.com/documentation/reference/http/http-headers/X-Varnish/
+ * @link https://www.linuxjournal.com/content/speed-your-web-site-varnish
+ */
+ 'x-varnish' => static function ( $header_value ) {
+ return 1 === preg_match( '/^\d+ \d+/', $header_value );
+ },
);
/**
* Filters the list of cache headers supported by core.
*
+ * This list indicates how each of the specified headers will be checked to indicate if a page cache is enabled
+ * or not. WordPress checks for each of the headers in the returned array. If the callback is provided, it will
+ * be passed the value for the corresponding header and return a boolean value indicating if the header suggests
+ * that a cache is active. If the value is `null` for the header, then WordPress will assume that a cache is
+ * active if the header is present, regardless of its value.
+ *
* @since 6.1.0
*
- * @param array $cache_headers Array of supported cache headers.
+ * @param array $cache_headers Mapping from cache-related HTTP headers to whether they
+ * indicate if a page cache is enabled for the site. `null`
+ * indicates caching in the presence of the header; a callback is
+ * provided the headerβs value and should return `true` if it
+ * implies that a cache is active.
*/
- return apply_filters( 'site_status_page_cache_supported_cache_headers', $cache_headers );
+ return (array) apply_filters( 'site_status_page_cache_supported_cache_headers', $cache_headers );
}
/**
diff --git a/src/wp-admin/includes/class-wp-terms-list-table.php b/src/wp-admin/includes/class-wp-terms-list-table.php
index 7537a499974d5..75e37e45d5c4f 100644
--- a/src/wp-admin/includes/class-wp-terms-list-table.php
+++ b/src/wp-admin/includes/class-wp-terms-list-table.php
@@ -413,10 +413,8 @@ public function column_name( $tag ) {
$edit_link
);
$name = sprintf(
- '%s',
+ '%s',
esc_url( $edit_link ),
- /* translators: %s: Taxonomy term name. */
- esc_attr( sprintf( __( '“%s” (Edit)' ), $tag->name ) ),
$name
);
}
diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php
index bba47a1c3442d..214b6c22c686a 100644
--- a/src/wp-admin/includes/dashboard.php
+++ b/src/wp-admin/includes/dashboard.php
@@ -2129,7 +2129,7 @@ function wp_welcome_panel() {
-
+
diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
index 610125b252ec0..99dc03c6cd656 100644
--- a/src/wp-admin/includes/file.php
+++ b/src/wp-admin/includes/file.php
@@ -202,6 +202,7 @@ function wp_get_plugin_file_editable_extensions( $plugin ) {
'inc',
'include',
'js',
+ 'mjs',
'json',
'jsx',
'less',
@@ -261,6 +262,7 @@ function wp_get_theme_file_editable_extensions( $theme ) {
'inc',
'include',
'js',
+ 'mjs',
'json',
'jsx',
'less',
@@ -2185,7 +2187,7 @@ function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_own
$abstraction_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method );
if ( ! file_exists( $abstraction_file ) ) {
- return;
+ return null;
}
require_once $abstraction_file;
diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
index 9b70dc96cda94..1d45224f5b7e4 100644
--- a/src/wp-admin/includes/media.php
+++ b/src/wp-admin/includes/media.php
@@ -611,7 +611,7 @@ function wp_iframe( $content_func, ...$args ) {
?>
- class="wp-core-ui no-js">
+ class="wp-core-ui no-js ">
@@ -3362,7 +3362,7 @@ function attachment_submitbox_metadata() {
-
+
diff --git a/src/wp-admin/includes/meta-boxes.php b/src/wp-admin/includes/meta-boxes.php
index 506b38b3b9af0..1de3e600b667d 100644
--- a/src/wp-admin/includes/meta-boxes.php
+++ b/src/wp-admin/includes/meta-boxes.php
@@ -215,7 +215,7 @@ function post_submit_meta_box( $post, $args = array() ) {
/>
-
+
/>
diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php
index d3a93a17b48e2..f60e1aedf037a 100644
--- a/src/wp-admin/includes/misc.php
+++ b/src/wp-admin/includes/misc.php
@@ -1004,14 +1004,14 @@ function admin_color_scheme_picker( $user_id ) {
ksort( $_wp_admin_css_colors );
- if ( isset( $_wp_admin_css_colors['fresh'] ) ) {
- // Set Default ('fresh') and Light should go first.
+ if ( isset( $_wp_admin_css_colors['modern'] ) ) {
+ // Set Modern (new default), Classic ('fresh'), and Light first.
$_wp_admin_css_colors = array_filter(
array_merge(
array(
+ 'modern' => '',
'fresh' => '',
'light' => '',
- 'modern' => '',
),
$_wp_admin_css_colors
)
@@ -1021,7 +1021,7 @@ function admin_color_scheme_picker( $user_id ) {
$current_color = get_user_option( 'admin_color', $user_id );
if ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) ) {
- $current_color = 'fresh';
+ $current_color = 'modern';
}
?>
diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php
index 7fcacab9bd6c9..b655af53f0cb6 100644
--- a/src/wp-admin/install.php
+++ b/src/wp-admin/install.php
@@ -15,7 +15,7 @@
Error: PHP is not running
-
+
Error: PHP is not running
WordPress requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.
@@ -72,7 +72,7 @@ function display_header( $body_classes = '' ) {
-
+
-
+
' . __( 'The menu management box at the top of the screen is used to control which menu is opened in the editor below.' ) . '';
$menu_management .= '
' . __( 'To edit an existing menu, choose a menu from the dropdown and click Select' ) . '
';
$menu_management .= '
' . __( 'If you have not yet created any menus, click the ’create a new menu’ link to get started' ) . '
';
- $menu_management .= '
' . __( 'You can assign theme locations to individual menus by selecting the desired settings at the bottom of the menu editor. To assign menus to all theme locations at once, visit the Manage Locations tab at the top of the screen.' ) . '
';
+ $menu_management .= '
' . __( 'You can assign individual menus to the theme’s menu locations by selecting the desired settings at the bottom of the menu editor. To assign menus to all theme menu locations at once, visit the Manage Locations tab at the top of the screen.' ) . '
' . __( 'This screen is used for globally assigning menus to locations defined by your theme.' ) . '
';
- $locations_overview .= '
' . __( 'To assign menus to one or more theme locations, select a menu from each location’s dropdown. When you are finished, click Save Changes' ) . '
';
- $locations_overview .= '
' . __( 'To edit a menu currently assigned to a theme location, click the adjacent ’Edit’ link' ) . '
';
- $locations_overview .= '
' . __( 'To add a new menu instead of assigning an existing one, click the ’Use new menu’ link. Your new menu will be automatically assigned to that theme location' ) . '
';
+ $locations_overview .= '
' . __( 'To assign menus to one or more theme menu locations, select a menu from each location’s dropdown. When you are finished, click Save Changes' ) . '
';
+ $locations_overview .= '
' . __( 'To edit a menu currently assigned to a theme menu location, click the adjacent ’Edit’ link' ) . '
';
+ $locations_overview .= '
' . __( 'To add a new menu instead of assigning an existing one, click the ’Use new menu’ link. Your new menu will be automatically assigned to that location in the theme.' ) . '