[wp-trac] [WordPress Trac] #59595: Improve performance of WP_Theme_JSON::compute_style_properties

WordPress Trac noreply at wordpress.org
Fri Jul 12 05:11:21 UTC 2024


#59595: Improve performance of WP_Theme_JSON::compute_style_properties
-----------------------------------------+--------------------------
 Reporter:  spacedmonkey                 |       Owner:  thekt12
     Type:  enhancement                  |      Status:  reopened
 Priority:  normal                       |   Milestone:  6.6
Component:  Editor                       |     Version:  5.8
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch changes-requested  |     Focuses:  performance
-----------------------------------------+--------------------------
Changes (by andrewserong):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Hi folks, it looks like the updated caching strategy here has resulted in
 a regression in WP 6.6 (I'm testing in RC 3), where styles that a user
 sets in global styles for a block within the site editor become stuck on
 the site frontend.

 To reproduce:

 1. Open the site editor on a WP 6.6 RC3 site running Twenty Twenty Four
 theme
 2. Click the editor preview to go into edit mode
 3. Open the Global Styles sidebar panel on the right hand side
 4. Click Blocks
 5. Select the Button block
 6. Give the Button block a style, e.g. Background color set to a gradient
 7. Save the global styles
 8. Load the site frontend — notice that the styling on the Button is
 applied
 9. Go back to global styles and give the Button block another style, e.g.
 large font size
 10. Save the global styles
 11. Load the site frontend and notice that the Button block's styling has
 not changed — it'll be cached with the previous styles that were
 originally saved

 It sounds like the culprit is the caching strategy used in
 `wp_add_global_styles_for_blocks`.

 Can this be looked at, or reverted for 6.6?

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


More information about the wp-trac mailing list