private static function get_site_user_count()
{
global $wpdb;
if (function_exists('wp_is_large_network')) {
if (wp_is_large_network('users')) {
return -1;
// Not a real value but should tell us that we are dealing with a large network.
}
}
if (false === ($user_count = get_transient('jetpack_site_user_count'))) {
// It wasn't there, so regenerate the data and save the transient
$user_count = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->usermeta} WHERE meta_key = '{$wpdb->prefix}capabilities'");
set_transient('jetpack_site_user_count', $user_count, DAY_IN_SECONDS);
}
return $user_count;
}