WordPress.org

Make WordPress Core

Ticket #12548: 13563.diff

File 13563.diff, 794 bytes (added by jorbin, 8 years ago)

diff vs. the ms-functions.php file that was updated in version 13563

  • ms-functions.php

     
    1010
    1111        $stats['blogs'] = get_blog_count();
    1212
    13         $count_ts = get_site_option( 'user_count_ts' );
    14         if ( time() - $count_ts > 3600 ) {
    15                 $count = $wpdb->get_var( "SELECT COUNT(ID) FROM $wpdb->users" );
    16                 update_site_option( 'user_count', $count );
    17                 update_site_option( 'user_count_ts', time() );
     13        if ( $stats['users'] = get_site_transient( 'user_count')) {
     14
    1815        } else {
    19                 $count = get_site_option( 'user_count' );
     16                $stats['users'] = $wpdb->get_var( "SELECT COUNT(ID) FROM $wpdb->users");
     17                set_site_transient('user_count', $stats['users'], '3600');
    2018        }
    21         $stats['users'] = $count;
     19
    2220        return $stats;
    2321}
    2422