buddypress/tests/phpunit
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
..
assets Update all references from wp_parse_args to bp_parse_args. 2021-09-12 20:43:39 +00:00
includes Raise WordPress required version to 5.4 2021-11-07 17:22:42 +00:00
testcases Improve group members count query performance 2022-05-18 05:46:32 +00:00
bootstrap.php Build/Test Tools: include @wordpress/env into BuddyPress 2020-08-30 17:53:06 +00:00
codecoverage.xml Travis-CI: disable xdebug globally and switch travis:codecoverage to use xdebug instead of phpdbg. 2016-08-08 13:36:32 +00:00
env.multisite.xml Build/Test Tools: include @wordpress/env into BuddyPress 2020-08-30 17:53:06 +00:00
env.xml Build/Test Tools: include @wordpress/env into BuddyPress 2020-08-30 17:53:06 +00:00
multisite.xml Tests: Fix missing 'name' attribute warning for PHPUnit 7. 2020-06-16 04:34:24 +00:00