Making WordPress.org

Changeset 6875


Ignore:
Timestamp:
03/14/2018 05:21:08 AM (7 years ago)
Author:
dd32
Message:

Plugin Directory: Stats Tool: Switch the plugins requested stat to using the _submitted_date postmeta, seems like it'll be a more accurate data field.

See #3447.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-stats-report.php

    r6874 r6875  
    108108
    109109        $stats[ 'plugin_new' ] = (int) $wpdb->get_var( $wpdb->prepare(
    110             "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'plugin' AND post_date >= %s AND post_date < %s",
    111             date( 'Y-m-d', strtotime( $args['date'] ) - ( $args['num_days'] * DAY_IN_SECONDS ) ),
    112             date( 'Y-m-d', strtotime( $args['date'] ) )
     110            "SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = '_submitted_date' AND meta_value >= %d AND meta_value < %d",
     111            strtotime( $args['date'] ) - ( $args['num_days'] * DAY_IN_SECONDS ),
     112            strtotime( $args['date'] ) + DAY_IN_SECONDS
    113113        ) );
    114114
Note: See TracChangeset for help on using the changeset viewer.