[wp-trac] [WordPress Trac] #38828: update_blog_details() performance improvement ideas

WordPress Trac noreply at wordpress.org
Wed Nov 16 16:42:55 UTC 2016


#38828: update_blog_details() performance improvement ideas
-------------------------------------------------+-------------------------
 Reporter:  boonebgorges                         |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  General                              |  Release
 Severity:  normal                               |     Version:
 Keywords:  needs-patch needs-unit-tests good-   |  Resolution:
  first-bug                                      |     Focuses:  multisite,
                                                 |  performance
-------------------------------------------------+-------------------------

Comment (by johnjamesjacoby):

 We are slowly starting to replace the `_blog_` functions with `_site_`
 equivalents where possible, so this may be achievable sooner than later
 with a new `update_site_details()` function.

 Or (and this is starting to be my preference) an `update()` method in the
 `WP_Site` object instead.

 If I understand the callstack correctly, `update_blog_details()` should
 only trigger 2 `update` calls:
 * To `wp_blogs` which basically accepts whatever is passed in (yikes?)
 * To `update_option()` which does a `$value === $old_value` check before
 proceeding

 I wonder if it might be easier to unhook your call to
 `update_blog_details()` when the bulk-action starts, then hook it back in
 when it's done, and manually call `update_blog_details()` once at the end
 vs. when each `deleted_post`action fires (which is my assumption, but
 seems like the obvious one.)

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


More information about the wp-trac mailing list