1
0
Fork 0
mirror of https://github.com/buddypress/buddypress.git synced 2026-07-22 20:56:55 +08:00
buddypress/tests/phpunit/testcases/groups
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
..
functions Improving the group member count routine and the function helper. 2021-09-09 14:01:40 +00:00
template Adding the newly created helper functions bp_get_group_by and bp_get_group for Groups related functions 2021-08-26 01:29:03 +00:00
activity.php Improve i18n of Groups activity updates action string 2019-05-11 13:33:14 +00:00
avatars.php Use static factory method throughout PHPUnit tests. 2017-11-03 19:44:10 +00:00
cache.php Improving the group member count routine and the function helper. 2021-09-09 14:01:40 +00:00
class-bp-group-extension.php Improve behavior of bp_init_group_extensions(). 2021-12-23 14:27:58 +00:00
class-bp-group-member-query.php Update BP_Group_Member_Query for Invitation API compatibility. 2019-08-12 20:43:44 +00:00
class-bp-groups-group.php Support date queries for Members, Groups and Sites 2021-12-12 14:09:02 +00:00
class-bp-groups-member.php Change how groups_get_invites_for_user() reports total. 2020-10-08 14:31:49 +00:00
functions.php Improve group members count query performance 2022-05-18 05:46:32 +00:00
notifications.php Invitations: Clean up notifications on acceptance. 2019-08-12 20:45:04 +00:00
template.php Adding the newly created helper functions bp_get_group_by and bp_get_group for Groups related functions 2021-08-26 01:29:03 +00:00
types.php BP Types: add functions to generate the Group types WP Admin screens 2020-09-21 01:36:43 +00:00
user_can.php Invitations: Allow invitations to public groups. 2019-08-12 20:45:50 +00:00