[buddypress-trac] [BuddyPress Trac] #7478: Performance improvement for bp_is_user_spammer in member loops

buddypress-trac noreply at wordpress.org
Wed Mar 22 22:04:07 UTC 2017

#7478: Performance improvement for bp_is_user_spammer in member loops
 Reporter:  sbrajesh     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Members      |    Version:
 Severity:  normal       |   Keywords:  has-patch
 bp_is_user_spammer() causes O(n) queries in member loop. This can be cut
 down to zero by adding another case in the switch/case block.

 We already have the members info available for the looping member and even
 though it is not WP_User, It does have the properties needed in the
 function for checking status.

 Please see the attached patch.

 If you want to test the behaviour, Please try adding some information in
 members loop based on bp_is_user_spammer condition. yes, the spam users
 won't be listed in the members directory but there are cases, where we
 need this test in members loop.

 It will be nice to have this enhancement.

 Thank you

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7478>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list