Opened 10 years ago
Closed 4 months ago
#6155 closed enhancement (fixed)
bp_core_get_active_member_count() multisite query does not exclude 'spam' status
Reported by: | johnjamesjacoby | Owned by: | espellcaste |
---|---|---|---|
Milestone: | 15.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Members | Keywords: | has-patch has-unit-tests |
Cc: |
Description (last modified by )
If multisite, it's possible for spam users to be included in the active member count query.
The query was introduced in r5987:
"SELECT ID FROM {$wpdb->users} WHERE (user_status != 0 OR deleted != 0 OR user_status != 0)"
It should likely be:
"SELECT ID FROM {$wpdb->users} WHERE (user_status != 0 OR deleted != 0 OR spam != 0)"
Attachments (2)
Change History (13)
This ticket was mentioned in Slack in #buddypress by jjj. View the logs.
10 years ago
#4
follow-up:
↓ 5
@
10 years ago
What happens if users are marked as spam in WordPress multisite but not via BuddyPress? Does the user_status change to 1 also?
#5
in reply to:
↑ 4
@
10 years ago
Replying to johnjamesjacoby:
What happens if users are marked as spam in WordPress multisite but not via BuddyPress? Does the user_status change to 1 also?
In multisite, BuddyPress is adding a row action "Spam/Unspam" that uses bp_core_process_spammer_status()
.
In network Administration, WordPress is adding 2 bulk actions "Spam/Unspam" that uses update_user_status()
. We're hooking it using ''make_spam_user'
and ''make_ham_user'
so that it passes in bp_core_process_spammer_status()
.
6155.02.unittests.patch is 6155.unittests.patch + a unit tests for multite bulk spam action.
#6
@
10 years ago
- Keywords needs-patch added; needs-testing removed
- Milestone changed from 2.3 to Future Release
#7
@
6 months ago
- Milestone changed from Awaiting Contributions to Up Next
- Owner set to espellcaste
- Status changed from new to assigned
This ticket was mentioned in PR #328 on buddypress/buddypress by renatonascalves.
5 months ago
#9
- Keywords has-patch has-unit-tests added; needs-unit-tests needs-patch removed
Trac ticket: https://buddypress.trac.wordpress.org/ticket/6155
Just wrote a unit test to check. Actually the count is ok because of this part of the query
user_status != 0
. In multisite, as we also add a value in the user_status field of the users table, there's no problem.But we should fix it :)