Changeset 36182
- Timestamp:
- 01/06/2016 07:52:53 AM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/update-core.php
r35952 r36182 254 254 <?php 255 255 foreach ( (array) $plugins as $plugin_file => $plugin_data ) { 256 $info = plugins_api( 'plugin_information', array(257 'slug' => $plugin_data->update->slug,258 'fields' => array(259 'short_description' => false,260 'sections' => false,261 'requires' => false,262 'rating' => false,263 'ratings' => false,264 'downloaded' => false,265 'downloadlink' => false,266 'last_updated' => false,267 'added' => false,268 'tags' => false,269 'homepage' => false,270 'donate_link' => false,271 ),272 ) );273 274 if ( is_wp_error( $info ) ) {275 $info = false;276 }277 278 256 // Get plugin compat for running version of WordPress. 279 if ( isset($ info->tested) && version_compare($info->tested, $cur_wp_version, '>=') ) {257 if ( isset($plugin_data->update->tested) && version_compare($plugin_data->update->tested, $cur_wp_version, '>=') ) { 280 258 $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version); 281 } elseif ( isset($ info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) {282 $compat = $ info->compatibility[$cur_wp_version][$plugin_data->update->new_version];283 $compat = '<br />' . 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]);259 } elseif ( isset($plugin_data->update->compatibility->{$cur_wp_version}) ) { 260 $compat = $plugin_data->update->compatibility->{$cur_wp_version}; 261 $compat = '<br />' . 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); 284 262 } else { 285 263 $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version); … … 287 265 // Get plugin compat for updated version of WordPress. 288 266 if ( $core_update_version ) { 289 if ( isset( $ info->tested ) && version_compare( $info->tested, $core_update_version, '>=' ) ) {267 if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $core_update_version, '>=' ) ) { 290 268 $compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $core_update_version ); 291 } elseif ( isset( $ info->compatibility[ $core_update_version ][ $plugin_data->update->new_version ]) ) {292 $update_compat = $ info->compatibility[$core_update_version][$plugin_data->update->new_version];293 $compat .= '<br />' . 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]);269 } elseif ( isset( $plugin_data->update->compatibility->{$core_update_version} ) ) { 270 $update_compat = $plugin_data->update->compatibility->{$core_update_version}; 271 $compat .= '<br />' . 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); 294 272 } else { 295 273 $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version); -
trunk/src/wp-includes/update.php
r36180 r36182 311 311 foreach ( $response['plugins'] as &$plugin ) { 312 312 $plugin = (object) $plugin; 313 } 314 unset( $plugin ); 313 if ( isset( $plugin->compatibility ) ) { 314 $plugin->compatibility = (object) $plugin->compatibility; 315 foreach ( $plugin->compatibility as &$data ) { 316 $data = (object) $data; 317 } 318 } 319 } 320 unset( $plugin, $data ); 315 321 foreach ( $response['no_update'] as &$plugin ) { 316 322 $plugin = (object) $plugin;
Note: See TracChangeset
for help on using the changeset viewer.