@@ 1190-1193 (lines=4) @@ | ||
1187 | public static function is_single_user_site() { |
|
1188 | global $wpdb; |
|
1189 | ||
1190 | if ( false === ( $some_users = get_transient( 'jetpack_is_single_user' ) ) ) { |
|
1191 | $some_users = $wpdb->get_var( "SELECT COUNT(*) FROM (SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '{$wpdb->prefix}capabilities' LIMIT 2) AS someusers" ); |
|
1192 | set_transient( 'jetpack_is_single_user', (int) $some_users, 12 * HOUR_IN_SECONDS ); |
|
1193 | } |
|
1194 | return 1 === (int) $some_users; |
|
1195 | } |
|
1196 | ||
@@ 3207-3211 (lines=5) @@ | ||
3204 | return -1; // Not a real value but should tell us that we are dealing with a large network. |
|
3205 | } |
|
3206 | } |
|
3207 | if ( false === ( $user_count = get_transient( 'jetpack_site_user_count' ) ) ) { |
|
3208 | // It wasn't there, so regenerate the data and save the transient |
|
3209 | $user_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->usermeta WHERE meta_key = '{$wpdb->prefix}capabilities'" ); |
|
3210 | set_transient( 'jetpack_site_user_count', $user_count, DAY_IN_SECONDS ); |
|
3211 | } |
|
3212 | return $user_count; |
|
3213 | } |
|
3214 |