Making WordPress.org

Changeset 14492


Ignore:
Timestamp:
07/28/2025 03:42:58 AM (11 months ago)
Author:
dd32
Message:

Plugin Directory: Store the time & previous stable-tag details when the version changes.

See #8009.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
2 edited

Legend:

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

    r14443 r14492  
    516516
    517517        $this->rebuild_affected_zips( $plugin_slug, $stable_tag, $current_stable_tag, $svn_changed_tags, $svn_revision_triggered );
     518
     519        // If we've got a new version, store the last version in the plugin meta.
     520        if ( $version && $version !== $post->version ) {
     521            update_post_meta( $plugin->ID, 'last_version', wp_slash( $post->version ) );
     522            update_post_meta( $plugin->ID, 'last_stable_tag', wp_slash( $current_stable_tag ) );
     523            update_post_meta( $plugin->ID, 'last_version_date', wp_slash( $post->version_date ) );
     524
     525            // Keep the date of the last version change, this often differs from the last_updated/post_modified dates.
     526            update_post_meta( $plugin->ID, 'version_date', wp_slash( current_time( 'mysql' ) ) );
     527        }
    518528
    519529        // Finally, set the new version live.
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-api-update-updater.php

    r14155 r14492  
    8080        $version          = get_post_meta( $post->ID, 'version', true );
    8181        $requires_plugins = get_post_meta( $post->ID, 'requires_plugins', true );
    82         $meta             = array();
     82        $meta             = array(
     83            'release_time' => strtotime( $post->version_date ?: $post->post_modified ),
     84        );
    8385
    8486        if ( in_array( $post->post_status, array( 'disabled', 'closed' ) ) ) {
     
    9193                }
    9294            }
     95        }
     96
     97        $release = Plugin_Directory::get_release( $post->ID, $version );
     98        if ( $release ) {
     99            $meta['release_time'] = max( $release['confirmations'] );
    93100        }
    94101
Note: See TracChangeset for help on using the changeset viewer.