Making WordPress.org

Changeset 7274


Ignore:
Timestamp:
06/06/2018 05:25:49 AM (6 years ago)
Author:
dd32
Message:

Plugin Directory: Include the version field in the comparisons for which plugins update_source records are out of date.

Fixes #3654

File:
1 edited

Legend:

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

    r7075 r7274  
    1919        global $wpdb;
    2020
     21        // Note: `left( pm.meta_value, 128 )` is due to the short `version` field length and some plugins with absurdly long version strings.
    2122        $out_of_date_plugins = $wpdb->get_col(
    2223            "SELECT p.post_name
    2324            FROM {$wpdb->posts} p
    2425                LEFT JOIN {$wpdb->prefix}update_source u ON p.ID = u.plugin_id
     26                LEFT JOIN {$wpdb->postmeta} pm ON p.ID = pm.post_id AND pm.meta_key = 'version'
    2527            WHERE
    2628                p.post_type = 'plugin'
     
    3234                    u.plugin_id IS NULL OR
    3335                    u.last_updated != p.post_modified OR
     36                    ( u.version != pm.meta_value AND u.version != left( pm.meta_value, 128 ) ) OR
    3437                    ( u.available = 1 AND (p.post_status != 'publish' AND p.post_status != 'disabled' ) ) OR
    3538                    ( u.available = 0 AND (p.post_status = 'publish' OR p.post_status = 'disabled' ) )
Note: See TracChangeset for help on using the changeset viewer.