[wp-trac] [WordPress Trac] #43308: Alter behavior load-scripts.php and load-styles.php to reduce potentially adverse scenarios

WordPress Trac noreply at wordpress.org
Wed Feb 14 15:15:28 UTC 2018


#43308: Alter behavior load-scripts.php and load-styles.php to reduce potentially
adverse scenarios
---------------------------+------------------------------
 Reporter:  youngcp        |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:  4.9.4
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+------------------------------

Comment (by youngcp):

 Replying to [comment:7 Clorith]:
 > Really, what we need is a "new" approach altogether, see this ticket
 spurred by Gutenberg and it's increased demand for JS:
 https://github.com/WordPress/gutenberg/issues/4150

 I like Gutenberg, but I'm not on the bandwagon for waiting for load-
 scripts and load-styles to get the boot. Creating a new version of
 WordPress that drops backwards compatibility would be a good thing, but I
 would hope the concerns introduced by load-scripts and load-styles could
 be mitigated before that.
 There's a lot invested in alternatives to TinyMCE.

 > Basically users are already experiencing issues due to the scripts
 loader on shared hosts where the file fails to load, and thus leads to
 lost functionality on sites. The only fix in those cases is to disable
 concatenation which requires editing `wp-config.php`, and we don't want
 users to need to do this.
 >
 > We could therefore focus this ticket on improving the various overheads
 (memory, processing time and the likes) and hit two birds with one stone
 (hopefully).
 >
 > Some scenarios that cause the concatenation to fail in one way or
 another:
 > - Required too much memory
 > - Execution took too long
 > - Query string too long, some libraries not included

 I suppose it might be possible to seek an earlier exit once memory usage
 or execution exceeds some configurable threshold.
 PHP (FPM, Apache, Nginx, et. al.) provide this functionality intuitively
 once a threshold is reached with varying results.
 Limiting the quantity of loadable files by size or in count is definitely
 something to consider.
 The relative file sizes could be coded alongside/into the white-list to
 allow for a summation of the weight of the request to allow an early
 rejection precluding failure.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43308#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list