Updates: Correctly identify more failed update cases. This checks for a WP_Error being raised during an individual update, in addition to just the bootstrap error cases.

The error message in these cases is still not displayed in the UI.

See #32473, #32435


git-svn-id: https://develop.svn.wordpress.org/trunk@32571 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2015-05-24 08:44:09 +00:00
parent 8d64dc4e6b
commit d8dc5d9f63
1 changed files with 7 additions and 2 deletions

View File

@ -2922,10 +2922,15 @@ function wp_ajax_update_plugin() {
wp_update_plugins();
}
$upgrader = new Plugin_Upgrader( new Automatic_Upgrader_Skin() );
$skin = new Automatic_Upgrader_Skin();
$upgrader = new Plugin_Upgrader( $skin );
$result = $upgrader->bulk_upgrade( array( $plugin ) );
if ( is_array( $result ) ) {
if ( is_array( $result ) && empty( $result[$plugin] ) && is_wp_error( $skin->result ) ) {
$result = $skin->result;
}
if ( is_array( $result ) && !empty( $result[ $plugin ] ) ) {
$plugin_update_data = current( $result );
/*