[wp-trac] [WordPress Trac] #61312: Add section styling via extended block style variations

WordPress Trac noreply at wordpress.org
Mon Jun 17 08:45:56 UTC 2024


#61312: Add section styling via extended block style variations
-------------------------------------------------+-------------------------
 Reporter:  aaronrobertshaw                      |       Owner:
                                                 |  aaronrobertshaw
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.6
Component:  Editor                               |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  gutenberg-merge has-unit-tests       |     Focuses:
  needs-patch                                    |  performance
-------------------------------------------------+-------------------------
Changes (by swissspidy):

 * keywords:  gutenberg-merge has-patch has-unit-tests commit => gutenberg-
     merge has-unit-tests needs-patch
 * status:  closed => reopened
 * focuses:   => performance
 * resolution:  fixed =>


Comment:

 Looks like this causes some issues with PHPUnit tests in plugins/themes
 and also the WP-CLI tests. Example: https://github.com/wp-cli/wp-
 cli/actions/runs/9543036240/job/26298897213?pr=5958

 This logic causes a database query very early on, even when WP is not
 installed yet.

 The backtrace is essentially this:

 `do_action('init')` -> `wp_register_block_style_variations_from_theme` ->
 `WP_Theme_JSON_Resolver::get_user_data` ->
 `WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles` ->
 `WP_Query`


 Why is this query done on `init` on every page load? Can this lazy loaded
 instead and only in the relevant areas?

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


More information about the wp-trac mailing list