buddypress/tests/phpunit/testcases
Mathieu Viet dea2187829 Improve group members count query performance
[13103] introduced a change in 10.0.0 that can be very time consuming when a group has a lot of members.

To keep the main improvements of the referenced commit (only refreshing group members count when a user joins or leaves a group) but optimize queries performance, we are introducing a new way to count group members in the `BP_Group_Member_Query`.

We are also introducing a way to defer group members count when adding a batch of members to a group. Using `bp_groups_defer_group_members_count()` avoids to refresh the count each time a member of this batch is added. For more information about how to use this function, you can have a look at how BuddyPress is using it into `src/bp-groups/bp-groups-admin.php`.

Props dd32, espellcaste

Fixes #8688 (branch 10.0)



git-svn-id: https://buddypress.svn.wordpress.org/branches/10.0@13281 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
2022-05-18 05:46:32 +00:00
..
activity Group the BP_Activity_Activity::get_id() method params into an array 2021-11-14 15:51:15 +00:00
admin Retire Legacy Forums. 2017-12-08 00:22:09 +00:00
blogs Support date queries for Members, Groups and Sites 2021-12-12 14:09:02 +00:00
core Attachments: introduce a new function to retrieve a media mime type 2022-03-15 23:30:04 +00:00
friends Marking deprecated query classes, their methods, arguments as deprecated in the BP_Friends_Friendship and BP_Friends_Friendship classes. 2021-08-22 03:16:06 +00:00
groups Improve group members count query performance 2022-05-18 05:46:32 +00:00
members Make sure member has a type before trying to remove one 2022-02-20 18:10:18 +00:00
messages Spell "enough" the right way in strings & function names 2022-01-24 21:57:01 +00:00
notifications Clear the user notification cache when bulk marking as unread items 2022-02-25 13:45:23 +00:00
routing Adapt BuddyPress to WP 5.1.0 multisite changes & deprecations 2020-03-31 02:45:13 +00:00
settings Improve sanitization of email notification settings. 2015-11-11 03:22:53 +00:00
testsuite Use static factory method throughout PHPUnit tests. 2017-11-03 19:44:10 +00:00
xprofile xProfile: prevent the Name field to override WP Field Types on signup 2021-10-09 17:13:00 +00:00