Ticket #33932: patch.5.diff
File patch.5.diff, 3.7 KB (added by , 9 years ago) |
---|
-
wp-admin/includes/class-wp-upgrader.php
3456 3456 */ 3457 3457 protected function send_debug_email() { 3458 3458 $update_count = 0; 3459 foreach ( $this->update_results as $type => $updates ) 3459 $update_results = $this->update_results; 3460 foreach ( $update_results as $type => $updates ) 3460 3461 $update_count += count( $updates ); 3461 3462 3462 3463 $body = array(); … … 3465 3466 $body[] = sprintf( __( 'WordPress site: %s' ), network_home_url( '/' ) ); 3466 3467 3467 3468 // Core 3468 if ( isset( $ this->update_results['core'] ) ) {3469 $result = $ this->update_results['core'][0];3469 if ( isset( $update_results['core'] ) ) { 3470 $result = $update_results['core'][0]; 3470 3471 if ( $result->result && ! is_wp_error( $result->result ) ) { 3471 3472 $body[] = sprintf( __( 'SUCCESS: WordPress was successfully updated to %s' ), $result->name ); 3472 3473 } else { … … 3478 3479 3479 3480 // Plugins, Themes, Translations 3480 3481 foreach ( array( 'plugin', 'theme', 'translation' ) as $type ) { 3481 if ( ! isset( $this->update_results[ $type ] ) ) 3482 3483 /** 3484 * Filter to receive notification emails on plugins/themes/translation. 3485 * 3486 * By default, administrators are notified when the update offer received 3487 * from WordPress.org sets a particular flag. This allows some discretion 3488 * in if and when to notify. 3489 * 3490 * This filter is only evaluated once per plugin update 3491 *. 3492 * 3493 * @since 4.5.0 3494 * 3495 * @param bool $notify Whether the site administrator is notified. 3496 * @param string $type The type of update (plugin, theme, translation). 3497 * @param object $this WP_Automatic_Updater instance 3498 */ 3499 if ( !apply_filters( 'send_update_notification_email', true, $type, $this ) ) { 3500 if ( isset( $update_results[ $type ] ) ) { 3501 unset( $update_results[ $type ] ); 3502 } 3503 } 3504 3505 if ( ! isset( $update_results[ $type ] ) ) 3482 3506 continue; 3483 $success_items = wp_list_filter( $ this->update_results[ $type ], array( 'result' => true ) );3507 $success_items = wp_list_filter( $update_results[ $type ], array( 'result' => true ) ); 3484 3508 if ( $success_items ) { 3485 3509 $messages = array( 3486 3510 'plugin' => __( 'The following plugins were successfully updated:' ), … … 3493 3517 $body[] = ' * ' . sprintf( __( 'SUCCESS: %s' ), $name ); 3494 3518 } 3495 3519 } 3496 if ( $success_items != $ this->update_results[ $type ] ) {3520 if ( $success_items != $update_results[ $type ] ) { 3497 3521 // Failed updates 3498 3522 $messages = array( 3499 3523 'plugin' => __( 'The following plugins failed to update:' ), … … 3502 3526 ); 3503 3527 3504 3528 $body[] = $messages[ $type ]; 3505 foreach ( $ this->update_results[ $type ] as $item ) {3529 foreach ( $update_results[ $type ] as $item ) { 3506 3530 if ( ! $item->result || is_wp_error( $item->result ) ) { 3507 3531 $body[] = ' * ' . sprintf( __( 'FAILED: %s' ), $item->name ); 3508 3532 $failures++; … … 3510 3534 } 3511 3535 } 3512 3536 $body[] = ''; 3537 3513 3538 } 3514 3539 if ( empty( $update_results ) ) { 3540 return; 3541 } 3542 3515 3543 $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ); 3516 3544 if ( $failures ) { 3517 3545 $body[] = trim( __( … … 3538 3566 $body[] = ''; 3539 3567 3540 3568 foreach ( array( 'core', 'plugin', 'theme', 'translation' ) as $type ) { 3541 if ( ! isset( $ this->update_results[ $type ] ) )3569 if ( ! isset( $update_results[ $type ] ) ) 3542 3570 continue; 3543 foreach ( $ this->update_results[ $type ] as $update ) {3571 foreach ( $update_results[ $type ] as $update ) { 3544 3572 $body[] = $update->name; 3545 3573 $body[] = str_repeat( '-', strlen( $update->name ) ); 3546 3574 foreach ( $update->messages as $message )