Opened 12 days ago
Last modified 2 days ago
#63017 new defect (bug)
Compression via PHP documented and in URL but not used anymore
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.0 |
Component: | Script Loader | Keywords: | changes-requested dev-feedback |
Focuses: | docs | Cc: |
Description
It looks like these three constants are not used anymore:
define( ‘COMPRESS_CSS’, true ); define( ‘COMPRESS_SCRIPTS’, true ); define( ‘ENFORCE_GZIP’, true )
In #44815 the check for the "c" parameter (for compression) in load-scripts.php and load-styles.php was removed.
But it is still used in this file:
https://github.com/WordPress/WordPress/blob/master/wp-includes/script-loader.php#L2199
and
https://github.com/WordPress/WordPress/blob/master/wp-includes/script-loader.php#L2377
And documented at the beginning of the file:
https://github.com/WordPress/WordPress/blob/master/wp-includes/script-loader.php#L8-L10
It looks like we can safely remove this or is there a reason to keep it?
Change History (6)
This ticket was mentioned in PR #8409 on WordPress/wordpress-develop by @sainathpoojary.
12 days ago
#1
- Keywords has-patch added; needs-patch removed
#2
@
11 days ago
- Keywords needs-patch added; has-patch removed
Hi @sainathpoojary
thanks for the patch! It looks great.
I think we could modify some more of the inline docs:
* Several constants are used to manage the loading, concatenating and compression of scripts and CSS:
could maybe changed to something like:
* These constants are used to manage the loading and concatenating of scripts and CSS:
And
* The globals $concatenate_scripts, $compress_scripts and $compress_css can be set by plugins * to temporarily override the above settings. Also a compression test is run once and the result is saved
could maybe changed to:
* The global $concatenate_scripts can be set by plugins to temporarily override the above * setting.
Remove legacy compression constants (COMPRESS_SCRIPTS, COMPRESS_CSS, ENFORCE_GZIP) and related code.
Trac ticket: #63017