Verifica la presenza di potenziali problemi con gli aggiornamenti automatici di plugin e temi.

Descrizione

Sebbene non sia possibile determinare al 100% se gli aggiornamenti automatici di plugin e temi sono configurati correttamente, si possono fare alcune ipotesi per segnalare eventuali condizioni che potrebbero causare comportamenti inaspettati.

Ritorno

(oggetto) I risultati del test.

Fonte

File: wp-admin/includes/class-wp-site-health.php

functiondetect_plugin_theme_auto_update_issues(){$mock_plugin=(object)array('id'=>'w.org/plugins/a-fake-plugin','slug'=>'a-fake-plugin','plugin'=>'a-fake-plugin/a-fake-plugin.php','new_version'=>'9.9','url'=>'https://wordpress.org/plugins/a-fake-plugin/','package'=>'https://downloads.wordpress.org/plugin/a-fake-plugin.9.9.zip','icons'=>array('2x'=>'https://ps.w.org/a-fake-plugin/assets/icon-256x256.png','1x'=>'https://ps.w.org/a-fake-plugin/assets/icon-128x128.png',),'banners'=>array('2x'=>'https://ps.w.org/a-fake-plugin/assets/banner-1544x500.png','1x'=>'https://ps.w.org/a-fake-plugin/assets/banner-772x250.png',),'banners_rtl'=>array(),'tested'=>'5.5.0','requires_php'=>'5.6.20','compatibility'=>newstdClass(),);$mock_theme=(object)array('theme'=>'a-fake-theme','new_version'=>'9.9','url'=>'https://wordpress.org/themes/a-fake-theme/','package'=>'https://downloads.wordpress.org/theme/a-fake-theme.9.9.zip','requires'=>'5.0.0','requires_php'=>'5.6.20',);$test_plugins_enabled=wp_is_auto_update_forced_for_item('plugin',true,$mock_plugin);$test_themes_enabled=wp_is_auto_update_forced_for_item('theme',true,$mock_theme);$ui_enabled_for_plugins=wp_is_auto_update_enabled_for_type('plugin');$ui_enabled_for_themes=wp_is_auto_update_enabled_for_type('theme');$plugin_filter_present=has_filter('auto_update_plugin');$theme_filter_present=has_filter('auto_update_theme');if((!$test_plugins_enabled&&$ui_enabled_for_plugins)||(!$test_themes_enabled&&$ui_enabled_for_themes)){return(object)array('status'=>'critical','message'=>__('Auto-updates for plugins and/or themes appear to be disabled, but settings are still set to be displayed. This could cause auto-updates to not work as expected.'),);}if((!$test_plugins_enabled&&$plugin_filter_present)&&(!$test_themes_enabled&&$theme_filter_present)){return(object)array('status'=>'recommended','message'=>__('Auto-updates for plugins and themes appear to be disabled. This will prevent your site from receiving new versions automatically when available.'),);}elseif(!$test_plugins_enabled&&$plugin_filter_present){return(object)array('status'=>'recommended','message'=>__('Auto-updates for plugins appear to be disabled. This will prevent your site from receiving new versions automatically when available.'),);}elseif(!$test_themes_enabled&&$theme_filter_present){return(object)array('status'=>'recommended','message'=>__('Auto-updates for themes appear to be disabled. This will prevent your site from receiving new versions automatically when available.'),);}return(object)array('status'=>'good','message'=>__('There appear to be no issues with plugin and theme auto-updates.'),);}

Correlato

Utilizzi

Usi Descrizione
wp-admin/includes/update.php: wp_is_auto_update_forzato_per_item()

Verifica se gli aggiornamenti automatici sono forzati per un elemento.

wp-admin/includes/update.php: wp_is_auto_update_enabled_for_type()

Controlla se gli aggiornamenti automatici sono abilitati.

wp-includes/l10n.php: __()

Recupera la traduzione di $testo.

wp-includes/plugin.php: has_filter()

Controlla se un filtro è stato registrato per un gancio.

Usato da

Usato da Descrizione
wp-admin/includes/class-wp-site-health.php: WP_Site_Health::get_test_plugin_theme_auto_updates()

Verifica se gli aggiornamenti automatici di plugin e temi sono configurati correttamente.

Changelog

Versione Descrizione
5.5.0 Introdotto.