PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.5.1
Forumax – AI Powered Advanced Community Forum Plugin v2.5.1
2.5.1 2.5.0 2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 All 31 releases
← All changes | includes/Blocks/Render/forum-overview.php +9 -2 2.4.3 → 2.5.1 View file →
@@ -223,11 +223,18 @@
223 223 );
224 224 }
225 225
226 226 if ( $show_members ) {
227 - $member_count = count_users();
227 + // get_user_count() is cached on single sites since WP 6.0; count_users()
228 + // scans all user meta on every page view.
229 + if ( ! is_multisite() && function_exists( 'get_user_count' ) && version_compare( get_bloginfo( 'version' ), '6.0', '>=' ) ) {
230 + $total_users = get_user_count();
231 + } else {
232 + $member_count = count_users();
233 + $total_users = isset( $member_count['total_users'] ) ? $member_count['total_users'] : 0;
234 + }
228 235 $stats[] = array(
229 - 'count' => isset( $member_count['total_users'] ) ? absint( $member_count['total_users'] ) : 0,
236 + 'count' => absint( $total_users ),
230 237 'label' => esc_html( $label_members ),
231 238 'icon' => $this->icon_members(),
232 239 'key' => 'members',
233 240 );