Making WordPress.org

Changeset 14154


Ignore:
Timestamp:
10/29/2024 03:31:17 AM (7 months ago)
Author:
dd32
Message:

Plugin Directory: When the close date of a plugin is not known, use the last_updated data as the date instead.

Most of the plugins which are affected by this appear to have been closed before 2018, and so at this point it's better to just consistently return a date to simplify logic.

See #7057.

File:
1 edited

Legend:

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

    r14152 r14154  
    10831083            'public'    => false,
    10841084        ];
     1085
     1086        /*
     1087         * If the date is unknown, fallback to the last_updated time (then to post_modified_gmt, then to post_date_gmt..).
     1088         *
     1089         * This is not strictly correct, but the consistency in data is more important than the exact date, where the plugins
     1090         * without the closed metadata are likely closed pre-2018.
     1091         */
     1092        if ( ! $result['date'] ) {
     1093            $result['date'] = $post->last_updated ?: $post->post_modified_gmt;
     1094            if ( '0000-00-00 00:00:00' === $result['date'] ) {
     1095                $result['date'] = $post->post_date_gmt;
     1096            }
     1097        }
    10851098
    10861099        if (
Note: See TracChangeset for help on using the changeset viewer.