Repository navigation
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Flips the fallback in `script_concat_settings()` so an undefined `CONCATENATE_SCRIPTS` resolves to `false` instead of `true`, making `load-scripts.php` and `load-styles.php` opt-in. Sites that want the previous behaviour can define the constant as `true`. The concatenation code paths are unchanged, and the surrounding guard already forces the global to `false` outside of `is_admin()` and `login_init`, so only wp-admin and the login screen are affected. See #57548.
b5d66ea to
1e34129
Compare
Trunk moved the default for the `$concatenate_scripts` global out of `script_concat_settings()` and into `wp_should_concatenate_admin_scripts()`, which the login screen's prefetching also uses to predict whether the admin will concatenate. The conflict in `script_concat_settings()` is resolved to trunk's version, and this branch's change, making an undefined `CONCATENATE_SCRIPTS` mean `false` rather than `true`, is applied in `wp_should_concatenate_admin_scripts()` instead, along with the function's description and its filter's `@param`, which state the default. The prefetching therefore follows the new default too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fault Two tests still expected an undefined `CONCATENATE_SCRIPTS` to mean concatenation unless `SCRIPT_DEBUG` is on. They passed when run from `src/`, where `SCRIPT_DEBUG` is on and turns concatenation off whatever the default, but would fail where it is off. They now expect no concatenation unless the constant is defined as true. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TinyMCE was registered as the prebuilt `wp-tinymce.js` bundle only when scripts were both concatenated and compressed, and otherwise as TinyMCE core plus the compat3x plugin. Both conditions are on their way out: concatenation is now off by default, and `$compress_scripts` has not compressed anything since PHP compression was removed from the loaders in r43580 and from `wp-tinymce.php` in r44651. TinyMCE is now registered as the separate files regardless, which is how it is served on the front end and in the admin by default. The bundle holds the modern theme and all 22 plugins, which TinyMCE otherwise loads itself only when an editor is initialized. The block editor loads TinyMCE on every screen but only initializes it for a Classic block, so most screens skip about 300 KB. The `$force_uncompressed` parameter is now unused. The script_concat_settings() call stays, since this is where an admin screen settles the concatenation settings, as the `wp_should_concatenate_admin_scripts` filter documents. A site can still register the bundle under the `wp-tinymce` handle itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `$wp_scripts` global is typed as `mixed`, which PHPStan rejects as the `WP_Scripts` argument to wp_register_tinymce_scripts(). The wp_scripts() accessor returns a `WP_Scripts` instance, initializing the global first if needed. The `true` passed as the second argument is dropped too, since that parameter is no longer used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since TinyMCE is always registered as separate files, the `$force_uncompressed` parameter has nothing left to force. It is renamed to `$deprecated` and typed with `@phpstan-param false`, as for other deprecated parameters, so that PHPStan reports any caller still passing `true`. Passing a truthy value also triggers _deprecated_argument(), which uses the parameter and so resolves its `function.unusedParameter` error. _WP_Editors::force_uncompressed_tinymce() no longer passes `true`, so it does not trigger the notice. The signature also gains a `void` return type, which resolves the `missingType.return` error reported on the changed line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The deprecation notice in wp_register_tinymce_scripts() was triggered only for a non-empty `$deprecated`, so a caller passing `null`, `0` or an empty string went unnoticed. Since `false` is the only value the parameter accepts, as its `@phpstan-param` says, any other value now triggers the notice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
With Dashboard--- trunk.html 2026-10-12 20:49:55
+++ pr.html 2026-10-12 20:50:08
@@ -24,8 +24,9 @@
<script>
Object.assign( window, {"ajaxurl":"/wp-admin/admin-ajax.php","pagenow":"dashboard","typenow":"","adminpage":"index-php","thousandsSeparator":",","decimalPoint":".","isRtl":0} );
</script>
-<link rel='stylesheet' href='http://localhost:8000/wp-admin/load-styles.php?c=1&dir=ltr&load%5Bchunk_0%5D=dashicons,admin-bar,site-health,common,forms,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-poi&load%5Bchunk_1%5D=nter,widgets,site-icon,l10n,wp-tooltip,buttons,wp-auth-check&ver=7.2-alpha-63166-src' media='all' />
-<style>
+<link rel='stylesheet' id='dashicons-css' href='http://localhost:8000/wp-includes/css/dashicons.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='admin-bar-css' href='http://localhost:8000/wp-includes/css/admin-bar.min.css?ver=7.2-alpha-63166-src' media='all' />
+<style id="admin-bar-inline-css">
#wpadminbar .quicklinks li img.blavatar {
border-radius: 2px;
}
@@ -54,11 +55,30 @@
}
}
@media print { #wpadminbar { display:none; } }
-/*# sourceURL=css-inline-concat-dashicons%2Cadmin-bar%2Csite-health%2Ccommon%2Cforms%2Cadmin-menu%2Cdashboard%2Clist-tables%2Cedit%2Crevisions%2Cmedia%2Cthemes%2Cabout%2Cnav-menus%2Cwp-pointer%2Cwidgets%2Csite-icon%2Cl10n%2Cwp-tooltip%2Cbuttons%2Cwp-auth-check */
+/*# sourceURL=admin-bar-inline-css */
</style>
+<link rel='stylesheet' id='site-health-css' href='http://localhost:8000/wp-admin/css/site-health.min.css?ver=7.2-alpha-63166-src' media='all' />
<link rel='stylesheet' id='thickbox-css' href='http://localhost:8000/wp-includes/js/thickbox/thickbox.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='common-css' href='http://localhost:8000/wp-admin/css/common.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='forms-css' href='http://localhost:8000/wp-admin/css/forms.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='admin-menu-css' href='http://localhost:8000/wp-admin/css/admin-menu.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='dashboard-css' href='http://localhost:8000/wp-admin/css/dashboard.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='list-tables-css' href='http://localhost:8000/wp-admin/css/list-tables.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='edit-css' href='http://localhost:8000/wp-admin/css/edit.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='revisions-css' href='http://localhost:8000/wp-admin/css/revisions.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='media-css' href='http://localhost:8000/wp-admin/css/media.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='themes-css' href='http://localhost:8000/wp-admin/css/themes.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='about-css' href='http://localhost:8000/wp-admin/css/about.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='nav-menus-css' href='http://localhost:8000/wp-admin/css/nav-menus.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='wp-pointer-css' href='http://localhost:8000/wp-includes/css/wp-pointer.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='widgets-css' href='http://localhost:8000/wp-admin/css/widgets.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='site-icon-css' href='http://localhost:8000/wp-admin/css/site-icon.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='l10n-css' href='http://localhost:8000/wp-admin/css/l10n.min.css?ver=7.2-alpha-63166-src' media='all' />
<link rel='stylesheet' id='wp-base-styles-css' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/base-styles/admin-schemes.min.css?ver=trunk' media='all' />
+<link rel='stylesheet' id='wp-tooltip-css' href='http://localhost:8000/wp-admin/css/wp-tooltip.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='buttons-css' href='http://localhost:8000/wp-includes/css/buttons.min.css?ver=7.2-alpha-63166-src' media='all' />
<link rel='stylesheet' id='colors-css' href='http://localhost:8000/wp-admin/css/colors/modern/colors.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='wp-auth-check-css' href='http://localhost:8000/wp-includes/css/wp-auth-check.min.css?ver=7.2-alpha-63166-src' media='all' />
<link rel='stylesheet' id='wp-theme-css' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/theme/design-tokens.min.css?ver=trunk' media='all' />
<link rel='stylesheet' id='wp-components-css' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/components/style.min.css?ver=24.1.0' media='all' />
<link rel='stylesheet' id='wp-preferences-css' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/preferences/style.min.css?ver=24.1.0' media='all' />
@@ -66,9 +86,11 @@
<style id="wp-view-transitions-admin-inline-css">
/*! This file is auto-generated */
@media (prefers-reduced-motion:no-preference){@view-transition{navigation:auto}#adminmenu>.menu-top{view-transition-name:attr(id type(<custom-ident>),none)}}
+/*# sourceURL=wp-view-transitions-admin-inline-css */
</style>
<style id="dominant-color-admin-styles-inline-css">
.wp-core-ui .attachment-preview[data-dominant-color]:not(.has-transparency) { background-color: var(--dominant-color); }
+/*# sourceURL=dominant-color-admin-styles-inline-css */
</style>
<link rel='stylesheet' id='wp-notices-css' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/notices/style.min.css?ver=24.1.0' media='all' />
<link rel='stylesheet' id='wp-block-editor-css' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/block-editor/style.min.css?ver=24.1.0' media='all' />
@@ -89,6 +111,7 @@
background: none !important;
padding: 0 !important;
}
+/*# sourceURL=wp-emoji-styles-inline-css */
</style>
<style class="wp-fonts-local">
@font-face{font-family:Manrope;font-style:normal;font-weight:200 800;font-display:fallback;src:url('http://localhost:8000/wp-content/themes/twentytwentyfive/assets/fonts/manrope/Manrope-VariableFont_wght.woff2') format('woff2');}
@@ -289,11 +312,14 @@
@font-face{font-family:"Fira Sans";font-style:normal;font-weight:900;font-display:fallback;src:url('http://localhost:8000/wp-content/themes/twentytwentyfive/assets/fonts/fira-sans/FiraSans-Black.woff2') format('woff2');}
@font-face{font-family:"Fira Sans";font-style:italic;font-weight:900;font-display:fallback;src:url('http://localhost:8000/wp-content/themes/twentytwentyfive/assets/fonts/fira-sans/FiraSans-BlackItalic.woff2') format('woff2');}
</style>
-<script>
-var userSettings = {"url":"/","uid":"1","time":"1791863384","secure":""};
-//# sourceURL=js-inline-concat-jquery-core%2Cjquery-migrate%2Cutils%2Cwp-polyfill
+<script id="jquery-core-js" src="http://localhost:8000/wp-includes/js/jquery/jquery.min.js?ver=3.7.1"></script>
+<script id="jquery-migrate-js" src="http://localhost:8000/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.6.0"></script>
+<script id="utils-js-extra">
+var userSettings = {"url":"/","uid":"1","time":"1791863402","secure":""};
+//# sourceURL=utils-js-extra
</script>
-<script src="http://localhost:8000/wp-admin/load-scripts.php?c=1&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill&ver=7.2-alpha-63166-src"></script>
+<script id="utils-js" src="http://localhost:8000/wp-includes/js/utils.min.js?ver=7.2-alpha-63166-src"></script>
+<script id="wp-polyfill-js" src="http://localhost:8000/wp-includes/js/dist/vendor/wp-polyfill.min.js?ver=3.15.0"></script>
<script id="react-js" src="http://localhost:8000/wp-content/plugins/gutenberg/build/scripts/vendors/react-19.min.js?ver=19.3.0"></script>
<script id="react-dom-js" src="http://localhost:8000/wp-content/plugins/gutenberg/build/scripts/vendors/react-dom-19.min.js?ver=19.3.0"></script>
<script id="react-jsx-runtime-js" src="http://localhost:8000/wp-content/plugins/gutenberg/build/scripts/vendors/react-jsx-runtime-19.min.js?ver=19.3.0"></script>
@@ -304,7 +330,55 @@
window.history.replaceState( null, null, document.getElementById( 'wp-admin-canonical' ).href + window.location.hash );
}
</script>
- <meta name="viewport" content="width=device-width,initial-scale=1.0"></head>
+ <meta name="viewport" content="width=device-width,initial-scale=1.0"><link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/edit-post/style.min.css?ver=24.1.0' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/block-directory/style.min.css?ver=24.1.0' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/format-library/style.min.css?ver=24.1.0' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-includes/css/editor.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-includes/css/media-views.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-includes/js/imgareaselect/imgareaselect.css?ver=0.9.8' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/block-library/style.min.css?ver=trunk' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/widgets/style.min.css?ver=24.1.0' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/block-library/editor.min.css?ver=trunk' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-includes/js/mediaelement/wp-mediaelement.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/block-library/reset.min.css?ver=trunk' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/block-editor/content.min.css?ver=trunk' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-includes/js/mediaelement/mediaelementplayer-legacy.min.css?ver=4.2.17' as='style' />
+<script>
+( /**
+ * Prefetches the page's rel=prefetch links with fetch() in browsers that do not support rel=prefetch.
+ *
+ * @see https://caniuse.com/link-rel-prefetch
+ */
+() => {
+ if ( document.createElement( 'link' ).relList?.supports?.( 'prefetch' ) ) {
+ return;
+ }
+
+ const prefetch = () => {
+ for ( const link of /** @type {NodeListOf<HTMLLinkElement>} */ ( document.querySelectorAll( 'link[rel~="prefetch"][href]' ) ) ) {
+ fetch( link.href, { mode: 'no-cors', credentials: 'include', priority: 'low' } )
+ .then( ( response ) => response.blob() )
+ .catch( () => {} );
+ }
+ };
+
+ const schedule = () => {
+ if ( 'requestIdleCallback' in window ) {
+ window.requestIdleCallback( prefetch );
+ } else {
+ setTimeout( prefetch, 0 );
+ }
+ };
+
+ if ( 'complete' === document.readyState ) {
+ schedule();
+ } else {
+ window.addEventListener( 'load', schedule, { once: true } );
+ }
+} )();
+//# sourceURL=wp_prefetch_admin_assets
+</script>
+</head>
<body class="wp-admin wp-core-ui no-js index-php auto-fold admin-bar branch-7-2 version-7-2 admin-color-modern locale-en-us no-customize-support svg wp-theme-twentytwentyfive">
<script>
document.body.className = document.body.className.replace( 'no-js', 'js' );
@@ -1059,7 +1133,7 @@
<script id="wp-script-module-data-@nocache-bfcache/bfcache-invalidation" type="application/json">
{"cookieName":"wordpress_bfcache_session_70490311fe7c84acda8886406a6d884b","initialSessionToken":"YqIe5DT40YwcqIdEUqe4hT50twOABommTsp3nqStC7f","debug":true,"i18n":{"logPrefix":"[Instant Back/Forward]","pageRestored":"Page restored from bfcache.","pageInvalidating":"Cached page is stale. Reloading...","pageInvalidated":"Page invalidated from cache via pageshow event handler.","notRestoredReasons":"Reasons page navigation not restored from bfcache:","infiniteReloadPrevented":"Prevented infinite reload."}}
</script>
-<script src="http://localhost:8000/wp-admin/load-scripts.php?c=1&load%5Bchunk_0%5D=hoverIntent&ver=7.2-alpha-63166-src"></script>
+<script id="hoverIntent-js" src="http://localhost:8000/wp-includes/js/hoverIntent.min.js?ver=1.10.2"></script>
<script id="wp-dom-ready-js" src="http://localhost:8000/wp-content/plugins/gutenberg/build/scripts/dom-ready/index.min.js?ver=3fe927cab37bf38d6a23"></script>
<script id="wp-hooks-js" src="http://localhost:8000/wp-content/plugins/gutenberg/build/scripts/hooks/index.min.js?ver=f0f188028580e8dc1255"></script>
<script id="wp-i18n-js" src="http://localhost:8000/wp-content/plugins/gutenberg/build/scripts/i18n/index.min.js?ver=1dfe7db3940c23ea9216"></script>Login Screen--- trunk.html 2026-10-12 20:53:15
+++ pr.html 2026-10-12 20:52:57
@@ -7,8 +7,13 @@
if("sessionStorage" in window){try{for(var key in sessionStorage){if(key.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(key)}}}catch(e){}};
</script>
<meta name='robots' content='max-image-preview:large, noindex, noarchive' />
-<link rel='stylesheet' href='http://localhost:8000/wp-admin/load-styles.php?c=1&dir=ltr&load%5Bchunk_0%5D=dashicons,buttons,forms,l10n,wp-tooltip,login&ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='dashicons-css' href='http://localhost:8000/wp-includes/css/dashicons.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='buttons-css' href='http://localhost:8000/wp-includes/css/buttons.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='forms-css' href='http://localhost:8000/wp-admin/css/forms.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='l10n-css' href='http://localhost:8000/wp-admin/css/l10n.min.css?ver=7.2-alpha-63166-src' media='all' />
<link rel='stylesheet' id='wp-base-styles-css' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/base-styles/admin-schemes.min.css?ver=trunk' media='all' />
+<link rel='stylesheet' id='wp-tooltip-css' href='http://localhost:8000/wp-admin/css/wp-tooltip.min.css?ver=7.2-alpha-63166-src' media='all' />
+<link rel='stylesheet' id='login-css' href='http://localhost:8000/wp-admin/css/login.min.css?ver=7.2-alpha-63166-src' media='all' />
<link rel='stylesheet' id='nocache-bfcache-opt-in-css' href='http://localhost:8000/wp-content/plugins/nocache-bfcache/css/bfcache-opt-in.css?ver=1.3.3' media='all' />
<meta name='referrer' content='strict-origin-when-cross-origin' />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -99,11 +104,14 @@
<script id="wp-script-module-data-@nocache-bfcache/detect-scripting-enabled-at-login" type="application/json">
{"cookieName":"nocache_bfcache_js_enabled","cookiePath":"/","siteCookiePath":"/","loginPostUrl":"http://localhost:8000/wp-login.php"}
</script>
-<script>
+<script id="clipboard-js" src="http://localhost:8000/wp-includes/js/clipboard.min.js?ver=2.0.11"></script>
+<script id="jquery-core-js" src="http://localhost:8000/wp-includes/js/jquery/jquery.min.js?ver=3.7.1"></script>
+<script id="jquery-migrate-js" src="http://localhost:8000/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.6.0"></script>
+<script id="zxcvbn-async-js-extra">
var _zxcvbnSettings = {"src":"http://localhost:8000/wp-includes/js/zxcvbn.min.js"};
-//# sourceURL=js-inline-concat-clipboard%2Cjquery-core%2Cjquery-migrate%2Czxcvbn-async
+//# sourceURL=zxcvbn-async-js-extra
</script>
-<script src="http://localhost:8000/wp-admin/load-scripts.php?c=1&load%5Bchunk_0%5D=clipboard,jquery-core,jquery-migrate,zxcvbn-async&ver=7.2-alpha-63166-src"></script>
+<script id="zxcvbn-async-js" src="http://localhost:8000/wp-includes/js/zxcvbn-async.min.js?ver=1.0"></script>
<script id="wp-hooks-js" src="http://localhost:8000/wp-content/plugins/gutenberg/build/scripts/hooks/index.min.js?ver=f0f188028580e8dc1255"></script>
<script id="wp-i18n-js" src="http://localhost:8000/wp-content/plugins/gutenberg/build/scripts/i18n/index.min.js?ver=1dfe7db3940c23ea9216"></script>
<script id="wp-i18n-js-after">
@@ -129,6 +137,61 @@
</script>
<script id="user-profile-js" src="http://localhost:8000/wp-admin/js/user-profile.min.js?ver=7.2-alpha-63166-src"></script>
<script id="wp-tooltip-js" src="http://localhost:8000/wp-includes/js/wp-tooltip.js?ver=7.2-alpha-63166-src"></script>
+<link rel='prefetch' href='http://localhost:8000/wp-includes/js/utils.min.js?ver=7.2-alpha-63166-src' as='script' />
+<link rel='prefetch' href='http://localhost:8000/wp-includes/css/admin-bar.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-includes/css/wp-auth-check.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/commands/style.min.css?ver=24.1.0' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/common.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/admin-menu.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/dashboard.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/list-tables.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/edit.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/revisions.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/media.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/themes.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/about.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/nav-menus.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/widgets.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-admin/css/site-icon.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/components/style.min.css?ver=24.1.0' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/preferences/style.min.css?ver=24.1.0' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-includes/css/wp-pointer.min.css?ver=7.2-alpha-63166-src' as='style' />
+<link rel='prefetch' href='http://localhost:8000/wp-content/plugins/gutenberg/build/styles/theme/design-tokens.min.css?ver=trunk' as='style' />
+<script>
+( /**
+ * Prefetches the page's rel=prefetch links with fetch() in browsers that do not support rel=prefetch.
+ *
+ * @see https://caniuse.com/link-rel-prefetch
+ */
+() => {
+ if ( document.createElement( 'link' ).relList?.supports?.( 'prefetch' ) ) {
+ return;
+ }
+
+ const prefetch = () => {
+ for ( const link of /** @type {NodeListOf<HTMLLinkElement>} */ ( document.querySelectorAll( 'link[rel~="prefetch"][href]' ) ) ) {
+ fetch( link.href, { mode: 'no-cors', credentials: 'include', priority: 'low' } )
+ .then( ( response ) => response.blob() )
+ .catch( () => {} );
+ }
+ };
+
+ const schedule = () => {
+ if ( 'requestIdleCallback' in window ) {
+ window.requestIdleCallback( prefetch );
+ } else {
+ setTimeout( prefetch, 0 );
+ }
+ };
+
+ if ( 'complete' === document.readyState ) {
+ schedule();
+ } else {
+ window.addEventListener( 'load', schedule, { once: true } );
+ }
+} )();
+//# sourceURL=wp_prefetch_admin_assets
+</script>
</body>
</html> |
Scripts and styles in the admin and on the login screen are no longer concatenated by default. When the `CONCATENATE_SCRIPTS` constant is not defined, `wp_should_concatenate_admin_scripts()` now returns `false`, so `load-scripts.php` and `load-styles.php` are only used when a site opts in with `define( 'CONCATENATE_SCRIPTS', true )`. This is the next step toward retiring concatenation. It also puts into effect the prefetching of the admin's assets added in r64120, which only applies when concatenation is off. With an empty browser cache, logging in and then opening the Dashboard, the Posts list and the block editor was measured to be faster this way than with concatenation on. TinyMCE is now always registered as two separate files instead of the prebuilt `wp-tinymce.js` bundle: TinyMCE core and the compat3x plugin. The bundle was registered only when scripts were both concatenated and compressed, and since r43580 and r44651 the `$compress_scripts` global has not compressed anything, so the registration no longer depends on either. The block editor loads TinyMCE on every screen but initializes it only when a Classic block is edited, so it now downloads 369 KB for the two files instead of 671 KB for the bundle, which also holds the theme and all 22 plugins. When TinyMCE is initialized, in the classic editor or for a Classic block, it now requests them itself and takes longer to become ready, a cost deemed acceptable since the role TinyMCE is increasingly diminished. A site can still register the bundle under the `wp-tinymce` handle. The unused second parameter of `wp_register_tinymce_scripts()` is deprecated. Developed in #13090. Follow-up to r43580, r44114, r44651, r64120. Props adnan007, westonruter. See #57548, #66053. git-svn-id: https://develop.svn.wordpress.org/trunk@64320 602fd350-edb4-49c9-b593-d223f7449a82
Scripts and styles in the admin and on the login screen are no longer concatenated by default. When the `CONCATENATE_SCRIPTS` constant is not defined, `wp_should_concatenate_admin_scripts()` now returns `false`, so `load-scripts.php` and `load-styles.php` are only used when a site opts in with `define( 'CONCATENATE_SCRIPTS', true )`. This is the next step toward retiring concatenation. It also puts into effect the prefetching of the admin's assets added in r64120, which only applies when concatenation is off. With an empty browser cache, logging in and then opening the Dashboard, the Posts list and the block editor was measured to be faster this way than with concatenation on. TinyMCE is now always registered as two separate files instead of the prebuilt `wp-tinymce.js` bundle: TinyMCE core and the compat3x plugin. The bundle was registered only when scripts were both concatenated and compressed, and since r43580 and r44651 the `$compress_scripts` global has not compressed anything, so the registration no longer depends on either. The block editor loads TinyMCE on every screen but initializes it only when a Classic block is edited, so it now downloads 369 KB for the two files instead of 671 KB for the bundle, which also holds the theme and all 22 plugins. When TinyMCE is initialized, in the classic editor or for a Classic block, it now requests them itself and takes longer to become ready, a cost deemed acceptable since the role TinyMCE is increasingly diminished. A site can still register the bundle under the `wp-tinymce` handle. The unused second parameter of `wp_register_tinymce_scripts()` is deprecated. Developed in WordPress/wordpress-develop#13090. Follow-up to r43580, r44114, r44651, r64120. Props adnan007, westonruter. See #57548, #66053. Built from https://develop.svn.wordpress.org/trunk@64320 git-svn-id: http://core.svn.wordpress.org/trunk@63470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
✅ Committed in r64320 (cc891ab).
Trac ticket: https://core.trac.wordpress.org/ticket/57548
Flips the fallback in
wp_should_concatenate_admin_scripts()so an undefinedCONCATENATE_SCRIPTSresolves tofalseinstead oftrue.load-scripts.phpandload-styles.phpbecome opt-in — sites that want the current behavior candefine( 'CONCATENATE_SCRIPTS', true ).Since r64120,
wp_should_concatenate_admin_scripts()holds the default thatscript_concat_settings()gives the$concatenate_scriptsglobal, and it is also what the login screen's prefetching uses to predict whether the admin will concatenate. Flipping the default there changes both at once, so they cannot disagree. (This PR originally flipped it inline inscript_concat_settings(); the merge with trunk after r64120 moved the change into the new function, along with the function's docs and its filter's@param, which state the default, and updated the tests of the default.)Scope is narrower than the constant's name suggests.
script_concat_settings()only applies this default on admin screens and the login screen, and leaves the globalfalseeverywhere else, so only wp-admin and the login screen change. The concatenation code paths themselves are untouched.Separately, TinyMCE is now always registered as separate files instead of the prebuilt
wp-tinymce.jsbundle, whether or not scripts are concatenated. See "Notes about TinyMCE" below.Two reasons to make this the default:
SCRIPT_DEBUGbeing ignored (#52879), translations not printing for concatenated handles (#50999), and"use strict"leaking between bundled scripts (#65515) are all conditions a stock install currently ships into. Defaulting off takes wp-admin off that path.Performance
The cold-cache performance trade-off was the open question when this PR was opened. The benchmarks on #13084 answer it for the main path into the admin: logging in with an empty browser cache. They compare today's default (concatenation on) with this PR's configuration (concatenation off, with r64120's prefetching), and with concatenation off and nothing prefetched as a control. Medians, with prefetching relative to today's default:
loadFull method and raw numbers: login → Dashboard (10 runs per arm) and login → Dashboard → Posts list → block editor (3 runs per arm).
Turning concatenation off with prefetching is faster than today's default because a concatenated bundle is only reused when its exact list of handles matches. The Posts list and the editor each build bundles that differ from the Dashboard's, so they download the common admin CSS and jQuery again, while individual files carry over from screen to screen. The login screen's higher
loadtime comes from concatenation being off there, not from the prefetching, and its FCP barely moves.What the benchmarks do not cover:
Notes about TinyMCE
TinyMCE is now always registered as separate files: TinyMCE core (
wp-tinymce-root) and the compat3x plugin (wp-tinymce). When an editor is initialized, TinyMCE fetches its theme, plugins and skin itself. The prebuiltwp-tinymce.jsbundle is no longer registered.Until now, the bundle was registered only when scripts were both concatenated and compressed. Concatenation is now off by default.
$compress_scriptshasn't compressed anything since r43580 and r44651, and it is slated for removal (Core-66053). So TinyMCE's registration no longer depends on either. The second parameter ofwp_register_tinymce_scripts()is unused, so it is deprecated and renamed to$deprecated. A site that wants the bundle can still register it under thewp-tinymcehandle:The bundle holds TinyMCE core, the modern theme and all 22 plugins: 671 KB, versus 369 KB for core plus compat3x. Whether leaving it out helps depends on whether TinyMCE is initialized.
Loaded but not initialized: smaller and faster. The block editor loads TinyMCE on every screen. It initializes TinyMCE only when a Classic block's "Edit" button is clicked, even if the post already contains a Classic block. Block editor page load, before any click:
loadInitialized: slower. This covers the classic editor, and a Classic block once "Edit" is clicked:
loadThe bytes are about the same: 233 KB versus 228 KB of TinyMCE in the classic editor, over 20 more requests. The delay comes from the order the files load in. Once its core has run, TinyMCE requests the rest in three rounds, each waiting for the last:
With the bundle, the "Edit" click needs 2 requests (27 KB). Without it, the click needs 21 requests (127 KB).
TinyMCE is being phased out, so this cost is accepted. It could be reduced by registering the theme and plugins as their own handles and enqueuing them where the classic editor initializes TinyMCE. They would then load from the page's HTML instead of waiting for TinyMCE to request them. That would not help the Classic block, which only fetches them when "Edit" is clicked.
Method: medians of 5 cold-cache runs per arm, run alternately, with a real login each run. Chrome over HTTP/1.1 on localhost with DevTools throttling, concatenation and
SCRIPT_DEBUGoff, all plugins disabled. HTTP/2 should shrink the cost of the extra requests.Testing instructions
CONCATENATE_SCRIPTSnorSCRIPT_DEBUGdefined inwp-config.php.load-scripts.phporload-styles.php— every handle appears as its own<script src>or<link href>.tinymce.min.jsandplugins/compat3x/plugin.min.js, followed by the modern theme and the editor plugins as separate requests, with nowp-tinymce.js. Do the same in the classic editor (e.g. with the Classic Editor plugin active), confirming the Visual tab works.wp-login.phpand view source. There should be<link rel="prefetch">tags for the admin's stylesheets and head scripts near the end of the page, since the login screen now predicts that the admin will not concatenate.define( 'CONCATENATE_SCRIPTS', true );towp-config.phpand reload the same screens. Bothload-scripts.phpandload-styles.phpshould reappear on the admin screen, confirming the opt-in path still works, and the login screen should print no prefetch links. TinyMCE should still load as separate files, not aswp-tinymce.js.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5, Claude Opus 5.5
Used for: Making the change, running the test suite and confirming the pre-existing failures against baseline, and drafting this description. Reviewed by me.
The merge with trunk after r64120, moving the change into
wp_should_concatenate_admin_scripts()and updating its tests and this description (including the performance summary from the #13084 benchmarks), was done by @westonruter with Claude Code (Claude Opus 5.5).Always registering TinyMCE as separate files, deprecating the second parameter of
wp_register_tinymce_scripts(), benchmarking TinyMCE with and without the bundle, and the matching updates to this description were also done by @westonruter with Claude Code (Claude Opus 5.5).