From 25015c0e0ce23e478fd13955fc998686ccea0f27 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 15 Dec 2009 19:09:55 +0000 Subject: [PATCH] Show plugin compatibility for available upgrade versions of WP. see #10973 git-svn-id: http://svn.automattic.com/wordpress/trunk@12407 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/update-core.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 473ec61575..8230feb27e 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -143,6 +143,12 @@ function list_plugin_updates() { if ( empty($plugins) ) return; $form_action = 'update-core.php?action=do-plugin-upgrade'; + + $core_updates = get_core_updates(); + if ( !isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response ) + $core_update_version = false; + else + $core_update_version = $core_updates[0]->current; ?>

@@ -167,12 +173,23 @@ function list_plugin_updates() { $plugin_data) { $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug )); + // Get plugin compat for running version of WordPress. if ( isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) { $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version]; - $compat = ' ' . sprintf(__('Compatibility: %1$d%% (%2$d "works" votes out of %3$d total)'), $compat[0], $compat[2], $compat[1]); + $compat = '
' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]); } else { - $compat = ''; + $compat = '
' . sprintf(__('Compatibility with WordPress %1$s: Unknown)'), $cur_wp_version); } + // Get plugin compat for updated version of WordPress. + if ( $core_update_version ) { + if ( isset($info->compatibility[$core_update_version][$plugin_data->update->new_version]) ) { + $update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version]; + $compat .= '
' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat[0], $update_compat[2], $update_compat[1]); + } else { + $compat .= '
' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version); + } + } + // Get the upgrade notice for the new plugin version. if ( isset($plugin_data->update->upgrade_notice) ) { $upgrade_notice = '
' . strip_tags($plugin_data->update->upgrade_notice); } else {