[wp-trac] [WordPress Trac] #55392: Performance improvements to get_user_data_from_wp_global_styles

WordPress Trac noreply at wordpress.org
Tue Mar 15 18:31:07 UTC 2022

#55392: Performance improvements to get_user_data_from_wp_global_styles
 Reporter:  spacedmonkey       |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  5.9
 Severity:  normal             |   Keywords:  has-patch
  Focuses:  performance        |
 The `get_user_data_from_wp_global_styles` in the `WP_Theme_JSON_Resolver`
 class have a number of performance issues. These include by are not
 limited to.

 The following params should be passing the WP_Query object to increase
 'ignore_sticky_posts'    => true,
 'suppress_filters'       => false,
 'update_post_meta_cache' => false,
 'update_post_term_cache' => false,
 'lazy_load_term_meta'    => false,
 'no_found_rows'          => true,
 'suppress_filters'       => false,
 - Cache invalidation now happens when posts are not updated and not just
 on an hour.
 - Handle if `wp_insert_posts` returns a WP_Error.
 - Only return ids in query, to make query simplifier.

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

More information about the wp-trac mailing list