[wp-trac] [WordPress Trac] #32472: is_user_member_of_blog() can be very slow when a user is a member of hundreds of sites

WordPress Trac noreply at wordpress.org
Wed Jun 24 01:42:59 UTC 2015


#32472: is_user_member_of_blog() can be very slow when a user is a member of
hundreds of sites
-------------------------------------+-------------------------------------
 Reporter:  sammybeats               |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  Users                    |     Version:  3.0
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  multisite, performance
-------------------------------------+-------------------------------------
Changes (by johnbillion):

 * keywords:  has-patch needs-unit-tests => has-patch needs-testing
 * milestone:  Awaiting Review => Future Release


Comment:

 Sorry I missed your comment @BinaryKitten.

 The core handbook contains [https://make.wordpress.org/core/handbook
 /automated-testing/ information on unit testing]. The section on writing
 new tests is bare, but there are already two tests for
 `is_user_member_of_blog()`.
 [https://core.trac.wordpress.org/browser/tags/4.2.2/tests/phpunit/tests/user.php#L344
 The single site test is here] and
 [https://core.trac.wordpress.org/browser/tags/4.2.2/tests/phpunit/tests/user/multisite.php#L134
 the multisite test is here].

 With [attachment:is_user_member_of_blog_(v4).diff] applied, the single
 site test fails with the following error:

 {{{
 1) Tests_User::test_is_user_member_of_blog
 Failed asserting that true is false.
 ~/tests/phpunit/tests/user.php:365
 }}}

 This means that there may be a caching issue when users are deleted, or
 your patch fails to account for deleted users. Take a look and see where
 you get to.

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


More information about the wp-trac mailing list