WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/09/2009 06:53:21 PM (10 years ago)
Author:
ryan
Message:

Put site into maintenance mode during bulk plugin upgrade. Skip plugin deactivate/activate. Add compatibility info. see #10973

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/update-core.php

    r12107 r12157  
    134134
    135135function list_plugin_updates() {
     136    global $wp_version;
     137
     138    $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
     139
     140    require_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
    136141    $plugins = get_plugin_updates();
    137142    if ( empty($plugins) )
     
    161166<?php
    162167    foreach ( (array) $plugins as $plugin_file => $plugin_data) {
     168        $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug ));
     169        if ( isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) {
     170            $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version];
     171            $compat = '  ' . sprintf(__('Compatibility: %1$d%% (%2$d "works" votes out of %3$d total)'), $compat[0], $compat[2], $compat[1]);
     172        } else {
     173            $compat = '';
     174        }
    163175        echo "
    164176    <tr class='active'>
    165177        <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>
    166         <td class='plugin-title'><strong>{$plugin_data->Name}</strong>" . sprintf(__('You are running version %1$s. Upgrade to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . "</td>
     178        <td class='plugin-title'><strong>{$plugin_data->Name}</strong>" . sprintf(__('You are running version %1$s. Upgrade to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . "</td>
    167179    </tr>";
    168180    }
     
    301313    $title = __('Upgrade Plugins');
    302314    $nonce = 'upgrade-core';
    303     add_filter('update_plugin_complete_actions', 'no_update_actions');
    304 
    305315    $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );
    306316    $upgrader->bulk_upgrade($plugins);
Note: See TracChangeset for help on using the changeset viewer.