[wp-trac] [WordPress Trac] #50448: Add tolerance to plugin and theme auto-update failure emails
WordPress Trac
noreply at wordpress.org
Mon Jul 6 16:09:56 UTC 2020
#50448: Add tolerance to plugin and theme auto-update failure emails
-------------------------------------+---------------------
Reporter: desrosj | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.5
Component: Administration | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+---------------------
Comment (by arpitgshah):
@desrosj - Have you checked with this logic for manually update or
removed by admin?
{{{#!php
<?php
// remove from the failed_plugin_theme_update_emails list if plugin or
theme version was update manually or removed by admin
if( $successful_plugins || $successful_themes || $failed_plugins ||
$failed_themes )
{
$temp_merge_all = array();
if( $successful_plugins ) {
foreach ( $successful_updates['plugin'] as $item ) {
// set key for the intersect
$temp_merge_all[ $item->item->plugin ] = $item->name;
}
}
if( $successful_themes ) {
foreach ( $successful_updates['theme'] as $item ) {
// set key for the intersect
$temp_merge_all[ $item->item->theme ] = $item->name;
}
}
if( $failed_plugins ) {
foreach ( $failed_updates['plugin'] as $item ) {
// set key for the intersect
$temp_merge_all[ $item->item->plugin ] = $item->name;
}
}
if( $failed_themes ) {
foreach ( $failed_updates['theme'] as $item ) {
// set key for the intersect
$temp_merge_all[ $item->item->theme ] = $item->name;
}
}
$failure_emails = array_intersect_key( $failure_emails,
$temp_merge_all );
}
}}}
If user has been updated manually or removed then one of these 4 variables
are going to set and that can be intersect with our database variables and
difference gives us the final values that plugins were updated manually or
removed by admin.
Does this make sense?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50448#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list