Making WordPress.org


Ignore:
Timestamp:
01/19/2017 06:48:03 AM (8 years ago)
Author:
dd32
Message:

Plugin Directory: Add stat recording for downloads to bump the plugin download counts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-meta-sync.php

    r4423 r4728  
    3434
    3535        $download_count_table = PLUGINS_TABLE_PREFIX . 'download_counts';
    36         $bbpress_topic_slug_table = PLUGINS_TABLE_PREFIX . 'topics';
    3736
    3837        $changed_download_counts = $wpdb->get_results(
    3938            "SELECT p.id as post_id, downloads
    4039            FROM `{$wpdb->posts}` p
    41                 JOIN `{$bbpress_topic_slug_table}` t ON p.post_name = t.topic_slug
    42                 JOIN `{$download_count_table}` c on t.topic_id = c.topic_id
     40                JOIN `{$download_count_table}` c on p.post_name = c.plugin_slug
    4341                LEFT JOIN `{$wpdb->postmeta}` pm ON p.id = pm.post_id AND pm.meta_key = 'downloads'
    4442
Note: See TracChangeset for help on using the changeset viewer.