Making WordPress.org

Changeset 14501


Ignore:
Timestamp:
07/31/2025 03:41:53 AM (11 months ago)
Author:
dd32
Message:

Plugin Directory: API: Correct some variable typos in [14500] which caused it to not apply.

See #8009, [14500].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/standalone/plugin-update-helpers.php

    r14500 r14501  
    1616 * This function acts as a filter on the update that's presented to the site.
    1717 *
    18  * @param object $plugin_info       The plugin update details.
    19  * @param object $plugin_details    The plugin details.
     18 * @param object $plugin_info       The plugin update details, returned to the client.
     19 * @param object $plugin_details    The plugin details, from WordPress.org database.
    2020 * @param string $installed_version The currently installed version of the plugin.
    2121 * @param string $wp_version        The WordPress version. Empty if not a WordPress client. Excludes `-alpha` type suffixes.
     
    3636 * @see https://meta.trac.wordpress.org/ticket/8009
    3737 *
    38  * @param object $plugin_info       The plugin update details.
    39  * @param object $plugin_details    The plugin details.
     38 * @param object $plugin_info       The plugin update details, returned to the client.
     39 * @param object $plugin_details    The plugin details, from WordPress.org database.
    4040 * @param string $installed_version The currently installed version of the plugin.
    4141 * @return object The updated plugin update details.
    4242 */
    4343function phased_rollout( $plugin_info, $plugin_details, $installed_version ) {
    44     $strategy = $plugin_info->meta->rollout['strategy'] ?? false;
     44    $strategy = $plugin_details->meta->rollout['strategy'] ?? false;
    4545
    4646    // If no strategy is set, or it's immediate, return the plugin info unchanged.
     
    5050
    5151    // Calculate the number of hours since the plugin was released.
    52     $hours_since_release = ( time() - ( $plugin_details->meta->release_time ?? '' ) ) / 3600 /* HOUR_IN_SECONDS */;
     52    $hours_since_release = ( time() - ( $plugin_details->meta->release_time ?? 0 ) ) / 3600 /* HOUR_IN_SECONDS */;
    5353
    5454    // If more than 5 days have passed, always assume the update is available.
     
    6262        $hours_since_release <= 24
    6363    ) {
    64         $plugin_info->disable_autoupdates = true;
     64        $plugin_info->disable_autoupdate = true;
    6565    }
    6666
Note: See TracChangeset for help on using the changeset viewer.