Make WordPress Core

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: zodiac1978's profile zodiac1978 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

Remove legacy compression constants (COMPRESS_SCRIPTS, COMPRESS_CSS, ENFORCE_GZIP) and related code.

Trac ticket: #63017

#2 @zodiac1978
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.

#3 @zodiac1978
11 days ago

  • Keywords changes-requested added; needs-patch removed

This ticket was mentioned in Slack in #core by zodiac1978. View the logs.


11 days ago

#5 @zodiac1978
2 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.

#6 @zodiac1978
2 days ago

  • Keywords dev-feedback added
Note: See TracTickets for help on using tickets.