[wp-trac] [WordPress Trac] #31746: get_blogs_of_user() can be very slow when a user is a member of thousands of sites

WordPress Trac noreply at wordpress.org
Mon Sep 28 18:32:12 UTC 2015


#31746: get_blogs_of_user() can be very slow when a user is a member of thousands
of sites
--------------------------+-----------------------------
 Reporter:  jtsternberg   |       Owner:  johnbillion
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  Future Release
Component:  Users         |     Version:  3.0
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  multisite
--------------------------+-----------------------------
Changes (by johnbillion):

 * keywords:  has-patch => needs-patch
 * milestone:  4.4 => Future Release


Comment:

 Couple of issues with this patch.

  * The use of the static means this isn't unit testable when the function
 is re-called with a different user ID, and thus causes the tests in
 `Tests_Multisite_User` to fail. The static could be an array keyed by user
 ID, maybe.
  * If the `pre_get_blogs_of_user` filter returns an empty array because
 the user doesn't have any blogs, the rest of the processing in the
 function still runs. The `empty()` check should probably be removed.

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


More information about the wp-trac mailing list