Making WordPress.org


Ignore:
Timestamp:
10/29/2024 03:18:40 AM (18 months ago)
Author:
dd32
Message:

Plugin Directory: Resolve some closed plugins showing 'Last updated: 55 years ago'.

See #7057.

File:
1 edited

Legend:

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

    r14152 r14153  
    165165        krsort( $result['ratings'] );
    166166
     167        // Determine the last_updated date.
     168        $last_updated = $post->last_updated ?: $post->post_modified_gmt; // Prefer the post_meta unless not set.
     169        if ( '0000-00-00 00:00:00' === $last_updated ) {
     170            $last_updated = $post->post_date_gmt;
     171        }
     172
    167173        $result['num_ratings']              = array_sum( $result['ratings'] );
    168174        $result['support_url']              = 'https://wordpress.org/support/plugin/' . urlencode( $plugin_slug ) . '/';
     
    171177        $result['active_installs']          = intval( get_post_meta( $post_id, 'active_installs', true ) );
    172178        $result['downloaded']               = intval( get_post_meta( $post_id, 'downloads', true ) );
    173         $result['last_updated']             = gmdate( 'Y-m-d g:ia \G\M\T', strtotime( $post->post_modified_gmt ) );
     179        $result['last_updated']             = gmdate( 'Y-m-d g:ia \G\M\T', strtotime( $last_updated ) );
    174180        $result['added']                    = gmdate( 'Y-m-d', strtotime( $post->post_date_gmt ) );
    175181        $result['homepage']                 = get_post_meta( $post_id, 'header_plugin_uri', true );
Note: See TracChangeset for help on using the changeset viewer.