Make WordPress Core


Ignore:
Timestamp:
07/07/2020 06:58:32 PM (4 years ago)
Author:
desrosj
Message:

Administration: Prevent repeat emails for identical plugin or theme auto-update attempt failures.

This change adds a throttle mechanism to plugin and theme auto-update failure emails using similar logic to the email sent for a Core auto-update.

The first time a plugin or theme auto-update fails, the package and new_version will be tracked in the auto_plugin_theme_update_emails option. An email for this specific update attempt will not be resent.

However, if this update fails again and non-repeat failures or successful updates are also present, then the failure information will be included in that email (an email needs to be sent for the new events regardless).

Props johnbillion, arpitgshah, desrosj, audrasjb, pbiron, earnjam.
Fixes #50448.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/schema.php

    r48121 r48397  
    535535        'blocklist_keys'                  => '',
    536536        'comment_previously_approved'     => 1,
     537        'auto_plugin_theme_update_emails' => array(),
    537538    );
    538539
     
    553554
    554555    // Set autoload to no for these options.
    555     $fat_options = array( 'moderation_keys', 'recently_edited', 'blocklist_keys', 'uninstall_plugins' );
     556    $fat_options = array(
     557        'moderation_keys',
     558        'recently_edited',
     559        'blocklist_keys',
     560        'uninstall_plugins',
     561        'auto_plugin_theme_update_emails',
     562    );
    556563
    557564    $keys             = "'" . implode( "', '", array_keys( $options ) ) . "'";
Note: See TracChangeset for help on using the changeset viewer.