Making WordPress.org


Ignore:
Timestamp:
04/10/2018 02:42:42 AM (8 years ago)
Author:
dd32
Message:

Plugin Directory: Use geopattern icon assets in the plugins/update-check API response.

This change populates the update_source table which the update-check API uses, another change is needed to the update check itself to pull them through.
Additionally a bin script to trigger an update for a single row (or all) is included.

See #3265.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/bin/rebuild-update_source-table.php

    r7071 r7072  
    4040
    4141$slugs = $wpdb->get_col( $sql );
     42if ( ! $slugs ) {
     43    fwrite( STDERR, "Error! The plugin(s) could not be located.\n" );
     44    die();
     45}
    4246
    4347foreach ( $slugs as $i => $slug ) {
     48    echo ++$i . '/' . count( $slugs ) . "\t" . $slug . "\n";
    4449
    45     $post = Plugin_Directory::get_plugin_post( $slug );
    46     if ( ! $post ) {
    47             continue;
    48     }
    49 
    50     echo $i . '/' . count( $slugs ) . "\t" . $post->post_name . "\n";
    51 
    52     update_post_meta(
    53             $post->ID,
    54             'rating',
    55             \WPORG_Ratings::get_avg_rating( 'plugin', $post->post_name )
    56     );
    57 
    58     update_post_meta(
    59             $post->ID,
    60             'ratings',
    61             \WPORG_Ratings::get_rating_counts( 'plugin', $post->post_name )
    62     );
     50    Jobs\API_Update_Updater::update_single_plugin( $slug );
    6351
    6452    clear_memory_caches();
Note: See TracChangeset for help on using the changeset viewer.