[wp-trac] [WordPress Trac] #57548: Stop concatenating scripts and stylesheets in wp-admin and retire load-scripts.php and load-styles.php
WordPress Trac
noreply at wordpress.org
Thu Feb 26 20:01:32 UTC 2026
#57548: Stop concatenating scripts and stylesheets in wp-admin and retire load-
scripts.php and load-styles.php
---------------------------+-----------------------------
Reporter: azaozz | Owner: westonruter
Type: enhancement | Status: accepted
Priority: normal | Milestone: Future Release
Component: Script Loader | Version:
Severity: normal | Resolution:
Keywords: | Focuses: performance
---------------------------+-----------------------------
Comment (by jerclarke):
Coming in from #64087 as the ghost of WordPress past.
Here's a good reason to get rid of this system: It's riddled with PHP
warnings that have been intentionally suppressed.
At the top of `load-styles.php` and `load-scripts.php` is the following
code:
{{{
/*
* The error_reporting() function can be disabled in php.ini. On systems
where that is the case,
* it's best to add a dummy function to the wp-config.php file, but as
this call to the function
* is run prior to wp-config.php loading, it is wrapped in a
function_exists() check.
*/
if ( function_exists( 'error_reporting' ) ) {
/*
* Disable error reporting.
*
* Set this to error_reporting( -1 ) for debugging.
*/
error_reporting( 0 );
}
}}}
It's there because without it, any call to `load-styles.php` will generate
multiple warnings, especially because the `noop.php` zeroes out all
filters to return `null`, which triggers PHP8 warnings for things like
`file_exists()` that don't accept `null`. Thanks to @westonruter for
helping me figure that part out.
I stumbled on to this weird detail because on our live server we have an
alternate error handler that doesn't respect `error_reporting()` and
effectively always runs in `E_ALL`, so the warnings were being triggered
after we updated to PHP 8.
As I said in the other ticket, the particular warnings I noticed don't
even seem worth fixing, because the whole system assumes there are
warnings/errors and intentionally ignores them.
If there's no great argument to keep this system, I vote to nuke it from
space. I've been running in `define( 'CONCATENATE_SCRIPTS', false );` mode
for months now and it works fine and resolves all the warnings.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57548#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list