Opened 3 weeks ago
Last modified 4 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 (8)
This ticket was mentioned in PR #8409 on WordPress/wordpress-develop by @sainathpoojary.
3 weeks ago
#1
- Keywords has-patch added; needs-patch removed
#2
@
3 weeks 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.
This ticket was mentioned in Slack in #core by zodiac1978. View the logs.
3 weeks ago
#5
@
9 days ago
- Version set to 5.0
#44815 was from milestone 4.9.9, but in the version dropdown 4.9.9 is missing, so I chose 5.0 which was the first major version with this change.
#7
@
4 days ago
Hey @zodiac1978,
I’ve updated the documentation based on your suggestion. Whenever you have a moment, I’d appreciate it if you could take a look. Thank you!
Remove legacy compression constants (COMPRESS_SCRIPTS, COMPRESS_CSS, ENFORCE_GZIP) and related code.
Trac ticket: #63017