[wp-trac] [WordPress Trac] #63017: Compression via PHP documented and in URL but not used anymore
WordPress Trac
noreply at wordpress.org
Tue Mar 18 21:35:46 UTC 2025
#63017: Compression via PHP documented and in URL but not used anymore
--------------------------------------+------------------------------
Reporter: zodiac1978 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version: 5.0
Severity: normal | Resolution:
Keywords: has-patch needs-dev-note | Focuses:
--------------------------------------+------------------------------
Changes (by zodiac1978):
* keywords: changes-requested dev-feedback => has-patch needs-dev-note
* focuses: docs =>
Comment:
@sainathpoojary Thanks for the updated patch! Looks good to me.
In the latest devchat I asked for feedback - starting here:
https://wordpress.slack.com/archives/C02RQBWTW/p1741794112933009
@joemcgill, @desrosj and @joedolson have raised some concerns about the
usage in plugins. I've checked ''every'' search result in the official
directory, and this is only used in system reports / debugging info.
Sometimes it is set to false if not defined, and only one or two times a
very old plugin tries to set it according to its own option.
But **no plugin uses PHP compression if this constant is set to true.**
COMPRESS_CSS (95 matches in 44 plugins)
https://wpdirectory.net/search/01JPNFP946XW7V4MFBP1CRMCNW
COMPRESS_SCRIPTS (97 matches in 46 plugins)
https://wpdirectory.net/search/01JPNFQRT2WGMS9C2HCAHC271K
ENFORCE_GZIP (53 matches in 29 plugins)
https://wpdirectory.net/search/01JPNFRB89HF670GMJB8PWKJ95
As described in the description, core ''does not use this anymore''
intentionally since #44815, but there is a dev note missing about the
deprecation of this constant.
A search for COMPRESS_CSS and ENFORCE_GZIP in core only shows two
findings, one in debug data and one for the mentioned file:
https://github.com/search?q=repo%3AWordPress%2FWordPress%20COMPRESS_CSS&type=code
https://github.com/search?q=repo%3AWordPress%2FWordPress+ENFORCE_GZIP&type=code
Only COMPRESS_SCRIPTS shows more results, but only because the phrase
catches "can_compress_scripts" too:
https://github.com/search?q=repo%3AWordPress%2FWordPress+COMPRESS_SCRIPTS&type=code
With quotes, it shows the same results:
https://github.com/search?q=repo%3AWordPress%2FWordPress+%27COMPRESS_SCRIPTS%27&type=code
As the component maintainer, maybe @azaozz can now decide on this research
that this constant is unused and should be officially announced as
deprecated. I would suggest adding a dev note to inform plugin authors
about it, so they can remove it from those debug reports.
Maybe @SergeyBiryukov can also shed some light to why this wasn't
deprecated at the time of the remove of the underlying code.
Additionally, we should open a new trac ticket for removing those
constants from our own Health Check debug report.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63017#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list