[wp-trac] [WordPress Trac] #58394: Performance of wp_maybe_inline_styles

WordPress Trac noreply at wordpress.org
Thu Jun 8 13:52:57 UTC 2023


#58394: Performance of wp_maybe_inline_styles
---------------------------+---------------------------
 Reporter:  spacedmonkey   |       Owner:  spacedmonkey
     Type:  enhancement    |      Status:  reopened
 Priority:  normal         |   Milestone:  6.3
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  performance
---------------------------+---------------------------

Comment (by spacedmonkey):

 We need to change the following

 {{{#!php

 foreach ( $wp_styles->queue as $handle ) {
     $src  = $wp_styles->registered[ $handle ]->src;
 }}}

 to

 {{{#!php

 foreach ( $wp_styles->queue as $handle ) {
     if( ! isset( $this->registered[ $handle ] ) ){
        continue;
     }
     $src  = $wp_styles->registered[ $handle ]->src;
 }}}

 There should also be a unit test for this ^.

 Thoughts @dd32 @flixos90.

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


More information about the wp-trac mailing list