[wp-trac] [WordPress Trac] #61862: Redundant code and potential inaccurate check in script-loader.php

WordPress Trac noreply at wordpress.org
Mon Aug 12 17:00:35 UTC 2024


#61862: Redundant code and potential inaccurate check in script-loader.php
---------------------------+-----------------------------
 Reporter:  MattyRob       |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Script Loader  |    Version:  trunk
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 Since [44651] removed the build steps for a gzipped version of TinyMCE
 that has remained code in script-loader.php that checks if gzip is
 supported on the server, these checks are redundant and superfluous.

 They may also result in the uncompressed files being used when the
 compressed files are available and could be used.

 https://core.trac.wordpress.org/browser/trunk/src/wp-includes/script-
 loader.php#L57

 {{{#!php
 $compressed = $compress_scripts && $concatenate_scripts && isset(
 $_SERVER['HTTP_ACCEPT_ENCODING'] )
                         && false !== stripos(
 $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ! $force_uncompressed;

 }}}
  can are replaced with:

 {{{#!php
 $compressed = $compress_scripts && $concatenate_scripts && !
 $force_uncompressed;
 }}}

 The documentation further down may also need updating.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61862>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list