diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php
index c4682e81ca..9029ad94d2 100644
--- a/wp-admin/update-core.php
+++ b/wp-admin/update-core.php
@@ -253,44 +253,22 @@ function list_plugin_updates() {
$plugin_data ) {
- $info = plugins_api( 'plugin_information', array(
- 'slug' => $plugin_data->update->slug,
- 'fields' => array(
- 'short_description' => false,
- 'sections' => false,
- 'requires' => false,
- 'rating' => false,
- 'ratings' => false,
- 'downloaded' => false,
- 'downloadlink' => false,
- 'last_updated' => false,
- 'added' => false,
- 'tags' => false,
- 'homepage' => false,
- 'donate_link' => false,
- ),
- ) );
-
- if ( is_wp_error( $info ) ) {
- $info = false;
- }
-
// Get plugin compat for running version of WordPress.
- if ( isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=') ) {
+ if ( isset($plugin_data->update->tested) && version_compare($plugin_data->update->tested, $cur_wp_version, '>=') ) {
$compat = '
' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
- } elseif ( 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 with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]);
+ } elseif ( isset($plugin_data->update->compatibility->{$cur_wp_version}) ) {
+ $compat = $plugin_data->update->compatibility->{$cur_wp_version};
+ $compat = '
' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat->percent, $compat->votes, $compat->total_votes);
} else {
$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->tested ) && version_compare( $info->tested, $core_update_version, '>=' ) ) {
+ if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $core_update_version, '>=' ) ) {
$compat .= '
' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $core_update_version );
- } elseif ( 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]);
+ } elseif ( isset( $plugin_data->update->compatibility->{$core_update_version} ) ) {
+ $update_compat = $plugin_data->update->compatibility->{$core_update_version};
+ $compat .= '
' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat->percent, $update_compat->votes, $update_compat->total_votes);
} else {
$compat .= '
' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);
}
diff --git a/wp-includes/update.php b/wp-includes/update.php
index 2104b2eecd..5edd801654 100644
--- a/wp-includes/update.php
+++ b/wp-includes/update.php
@@ -310,8 +310,14 @@ function wp_update_plugins( $extra_stats = array() ) {
$response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
foreach ( $response['plugins'] as &$plugin ) {
$plugin = (object) $plugin;
+ if ( isset( $plugin->compatibility ) ) {
+ $plugin->compatibility = (object) $plugin->compatibility;
+ foreach ( $plugin->compatibility as &$data ) {
+ $data = (object) $data;
+ }
+ }
}
- unset( $plugin );
+ unset( $plugin, $data );
foreach ( $response['no_update'] as &$plugin ) {
$plugin = (object) $plugin;
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 52e7d1956a..ac4c1dee2c 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
-$wp_version = '4.5-alpha-36181';
+$wp_version = '4.5-alpha-36182';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.