Making WordPress.org

Changeset 11840


Ignore:
Timestamp:
05/13/2022 03:29:05 AM (3 years ago)
Author:
dd32
Message:

Plugin Directory: Validate that the 'stable_tag' used for plugin updates is correct, in addition to the version field.

This cron task is only to catch data inconsistencies, and shouldn't be required, but sometimes it catches an inconsistency and fixes it for us.

File:
1 edited

Legend:

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

    r10970 r11840  
    2525                LEFT JOIN {$wpdb->prefix}update_source u ON p.ID = u.plugin_id
    2626                LEFT JOIN {$wpdb->postmeta} pm ON p.ID = pm.post_id AND pm.meta_key = 'version'
     27                LEFT JOIN {$wpdb->postmeta} pm_stable ON p.ID = pm_stable.post_id AND pm_stable.meta_key = 'stable_tag'
    2728            WHERE
    2829                p.post_type = 'plugin'
     
    3536                    u.last_updated != p.post_modified OR
    3637                    ( u.version != pm.meta_value AND u.version != left( pm.meta_value, 128 ) ) OR
     38                    ( u.stable_tag != pm_stable.meta_value AND u.stable_tag != left( pm_stable.meta_value, 128 ) ) OR
    3739                    ( u.available = 1 AND (p.post_status != 'publish' AND p.post_status != 'disabled' ) ) OR
    3840                    ( u.available = 0 AND (p.post_status = 'publish' OR p.post_status = 'disabled' ) )
Note: See TracChangeset for help on using the changeset viewer.