Superficially this is crazy. I mean it’s just a simple filter wrapping!
But then I try to think a bit more conspiracistly: the notification where arbitrarly turned on with wp 5.5 (if I remember right), so maybe it was wpcore devs themselves that asked the plugin devs not to subvert this thing, maybe for “security” reasons, maybe in the waiting for a proper solution (that never came). A big stretch and a long shot, I know.
Anyway I’ve had enough to add filters in my mail clients, I think I’m rolling out a mu-plugin on the lines (actually 3 lines literally) of this article.
I don’t think you’re right. There are other plugins that turn off email notifications, like this one https://wordpress.org/plugins/companion-auto-update/ and it’s doing a better job.
>I don’t think you’re right.
I don’t either. But I am baffled: this plugin has always been very good, and also the team at UpdraftBackup is very good at communicating, fixing and developing. So I really have a hard time explaining why two goods make one (slightly) worse.
>There are other plugins that turn off email notifications, like this one https://wordpress.org/plugins/companion-auto-update/ and it’s doing a better job.
Apart from the notifications debacle I think I have no complaints, so I went for the self written mu-plugin.
I paste it here since it’s so small:
/**
* Plugin Name: InnerspaceZeta Customizations disable some useless email notifications
* Plugin URI:
* Description: 2021
* Author: InnerspaceZeta + VS49 + UnDinosauro
*/
function wpb_stop_update_emails( $send, $type, $core_update, $result ) {
if ( ! empty( $type ) && $type == 'success' ) {
return false;
}
return true;
}
add_filter( 'auto_core_update_send_email', 'wpb_stop_auto_update_emails', 10, 4 );
add_filter( 'auto_plugin_update_send_email', 'wpb_stop_auto_update_emails', 10, 4 );
add_filter( 'auto_theme_update_send_email', 'wpb_stop_auto_update_emails', 10, 4 );
It’s been working fine for a week now in a no-traffic site but consider it untested.
I took the code mainly from here
There was a typo!
/**
* Plugin Name: InnerspaceZeta Customizations disable some useless email notifications
* Plugin URI:
* Description: 2021
* Author: InnerspaceZeta + VS49 + UnDinosauro
*/
// https://developer.wordpress.org/plugins/plugin-basics/header-requirements/
//require_once WPMU_PLUGIN_DIR.'/includes/debuglibZ.php';
//isz_log("innerspaceZeta mu plugin loaded");
// call_user_func(function (){ // prevents polluting the global namespace
// });
function iszDontNotifySuccessfulUpdates( $send, $type, $core_update, $result ) {
if ( ! empty( $type ) && $type == 'success' ) {
return false;
}
return true;
}
add_filter( 'auto_core_update_send_email', 'iszDontNotifySuccessfulUpdates', 10, 4 );
// add_filter( 'auto_plugin_update_send_email', '__return_false' );
// add_filter( 'auto_theme_update_send_email', '__return_false' );
add_filter( 'auto_plugin_update_send_email', 'iszDontNotifySuccessfulUpdates', 10, 4 );