Opened 8 years ago
Closed 7 years ago
#7478 closed enhancement (fixed)
Performance improvement for bp_is_user_spammer in member loops
Reported by: | sbrajesh | Owned by: | djpaul |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Members | Keywords: | has-patch commit |
Cc: | sbrajesh |
Description
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
Brajesh
I like it!