#50663 closed defect (bug) (fixed)
Add filter for the plugin/theme auto-update message in the Info tab of Site health
| Reported by: | pbiron | Owned by: | whyisjake |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.5 |
| Component: | Site Health | Version: | |
| Severity: | normal | Keywords: | has-patch has-dev-note |
| Cc: | Focuses: |
Description
#50052 introduced a new UI for managing auto-updates for plugins/themes.
That UI can be disabled with the (plugins|themes)_auto_update_enabled filters. When the UI is not disabled, additional information about whether auto-updates are enabled/disabled for specific plugins/themes are added in the debug info in the Site Health tool.
#50280 introduced the (theme|plugin)_auto_update_setting_html and theme_auto_update_setting_template filters that allow plugins to control what is presented in the UI for specific plugins/themes (e.g., by displaying a text message that "Auto-updates are not available for this plugin.").
We should introduce equivalent filters so that the debug info auto-update message can similarly be filtered.
Without these additional new filters, the debug message could be incorrect/misleading.
Attachments (4)
Change History (16)
#2
@
6 years ago
- Keywords needs-dev-note added
@audrasjb Is this still on your list for 5.5? Also, I tagged as needs-dev-note for the new filters.
#3
@
6 years ago
Yes @davidbaumwald it's on my list for 5.5, my patch is almost ready, just need a quick review before sending.
This ticket was mentioned in Slack in #core by whyisjake. View the logs.
6 years ago
#5
@
6 years ago
- Keywords has-patch added; needs-patch removed
To test this patch, you can use the following snippet:
<?php function jba_plugin_auto_update_debug_str( $str, $plugin, $enabled ) { if ( in_array( $plugin['Name'], [ 'Hello Dolly', 'Reusable Blocks Extended', 'GDPR Data Request Form' ], true ) ) { $str = __( 'Auto-updates are not available for this plugin' ); } return $str; } add_filter( 'plugin_auto_update_debug_str', 'jba_plugin_auto_update_debug_str', 10, 3 ); function jba_theme_auto_update_debug_str( $str, $theme, $enabled ) { if ( in_array( $theme->name, [ 'Twenty Twenty', 'Twenty Nineteen', 'Twenty Eleven' ], true ) ) { $str = __( 'Auto-updates are not available for this theme' ); } return $str; } add_filter( 'theme_auto_update_debug_str', 'jba_theme_auto_update_debug_str', 10, 3 );
Of course, don't forget to replace the plugin names :-)
Cheers,
jb
#6
@
6 years ago
50663.diff LGTM, thanx!
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks @pbiron
Let's add this ticket in milestone 5.5 as it is a small and self contained change related to auto-updates feature :)