Changeset 48445
- Timestamp:
- 07/12/2020 01:14:01 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r48375 r48445 4463 4463 wp_send_json_error( $status ); 4464 4464 } elseif ( is_array( $result ) && ! empty( $result[ $plugin ] ) ) { 4465 $plugin_update_data = current( $result );4466 4465 4467 4466 /* 4468 * If the `update_plugins` site transient is empty (e.g. when you update 4469 * two plugins in quick succession before the transient repopulates), 4470 * this may be the return. 4467 * Plugin is already at the latest version. 4468 * 4469 * This may also be the return value If the `update_plugins` site transient is empty, 4470 * e.g. when you update two plugins in quick succession before the transient repopulates. 4471 4471 * 4472 4472 * Preferably something can be done to ensure `update_plugins` isn't empty. 4473 4473 * For now, surface some sort of error here. 4474 4474 */ 4475 if ( true === $ plugin_update_data) {4476 $status['errorMessage'] = __( 'Plugin update failed.' );4475 if ( true === $result[ $plugin ] ) { 4476 $status['errorMessage'] = $upgrader->strings['up_to_date']; 4477 4477 wp_send_json_error( $status ); 4478 4478 } … … 4485 4485 $status['newVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] ); 4486 4486 } 4487 4487 4488 wp_send_json_success( $status ); 4488 4489 } elseif ( false === $result ) { -
trunk/src/wp-admin/includes/class-plugin-upgrader.php
r48401 r48445 392 392 unset( $past_failure_emails[ $plugin ] ); 393 393 } 394 394 395 update_option( 'auto_plugin_theme_update_emails', $past_failure_emails ); 395 reset( $results );396 396 397 397 return $results; -
trunk/src/wp-admin/includes/class-theme-upgrader.php
r48401 r48445 501 501 unset( $past_failure_emails[ $theme ] ); 502 502 } 503 503 504 update_option( 'auto_plugin_theme_update_emails', $past_failure_emails ); 504 reset( $results );505 505 506 506 return $results; -
trunk/src/wp-admin/includes/class-wp-upgrader.php
r48399 r48445 661 661 * WP_Upgrader::run(). 662 662 * } 663 * @return array|false|WP_ error The result from self::install_package() on success, otherwise a WP_Error,663 * @return array|false|WP_Error The result from self::install_package() on success, otherwise a WP_Error, 664 664 * or false if unable to connect to the filesystem. 665 665 */ -
trunk/tests/phpunit/tests/ajax/UpdatePlugin.php
r47198 r48445 158 158 'plugin' => 'hello.php', 159 159 'pluginName' => 'Hello Dolly', 160 'errorMessage' => ' Plugin update failed.',160 'errorMessage' => 'The plugin is at the latest version.', 161 161 'oldVersion' => 'Version 1.7.2', 162 162 'newVersion' => '',
Note: See TracChangeset
for help on using the changeset viewer.