From ae80df8975685cd8cd65f4dd652cdcb9aa359fd6 Mon Sep 17 00:00:00 2001 From: Jb Date: Wed, 6 May 2020 18:50:01 +0200 Subject: [PATCH 1/2] Remove constants from the feature plugin --- functions.php | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/functions.php b/functions.php index 389d1d9..4269285 100755 --- a/functions.php +++ b/functions.php @@ -169,7 +169,7 @@ function wp_autoupdates_prepare_themes_for_js( $prepared_themes ) { * @return bool True if plugins auto-update is enabled, false otherwise. */ function wp_autoupdates_is_plugins_auto_update_enabled() { - $enabled = ! defined( 'WP_DISABLE_PLUGINS_AUTO_UPDATE' ) || ! WP_DISABLE_PLUGINS_AUTO_UPDATE; + $enabled = true; /** * Filters whether plugins manual auto-update is enabled. @@ -186,7 +186,7 @@ function wp_autoupdates_is_plugins_auto_update_enabled() { * @return bool True if themes auto-update is enabled, false otherwise. */ function wp_autoupdates_is_themes_auto_update_enabled() { - $enabled = ! defined( 'WP_DISABLE_THEMES_AUTO_UPDATE' ) || ! WP_DISABLE_THEMES_AUTO_UPDATE; + $enabled = true; /** * Filters whether themes manual auto-update is enabled. @@ -909,21 +909,6 @@ function wp_autoupdates_debug_information( $info ) { } } - // Populate constants informations. - $plugins_enabled = defined( 'WP_DISABLE_PLUGINS_AUTO_UPDATE' ) ? WP_DISABLE_PLUGINS_AUTO_UPDATE : __( 'Undefined', 'wp-autoupdates' ); - $info['wp-constants']['fields']['WP_DISABLE_PLUGINS_AUTO_UPDATE'] = array( - 'label' => 'WP_DISABLE_PLUGINS_AUTO_UPDATE', - 'value' => $plugins_enabled, - 'debug' => strtolower( $plugins_enabled ), - ); - - $themes_enabled = defined( 'WP_DISABLE_THEMES_AUTO_UPDATE' ) ? WP_DISABLE_THEMES_AUTO_UPDATE : __( 'Undefined', 'wp-autoupdates' ); - $info['wp-constants']['fields']['WP_DISABLE_THEMES_AUTO_UPDATE'] = array( - 'label' => 'WP_DISABLE_THEMES_AUTO_UPDATE', - 'value' => $themes_enabled, - 'debug' => strtolower( $themes_enabled ), - ); - return $info; } add_filter( 'debug_information', 'wp_autoupdates_debug_information' ); @@ -935,7 +920,7 @@ function wp_autoupdates_debug_information( $info ) { * @return bool True if plugins notifications are enabled, false otherwise. */ function wp_autoupdates_is_plugins_auto_update_email_enabled() { - $enabled = ! defined( 'WP_DISABLE_PLUGINS_AUTO_UPDATE_EMAIL' ) || ! WP_DISABLE_PLUGINS_AUTO_UPDATE; + $enabled = true; /** * Filters whether plugins auto-update email notifications are enabled. @@ -952,7 +937,7 @@ function wp_autoupdates_is_plugins_auto_update_email_enabled() { * @return bool True if themes notifications are enabled, false otherwise. */ function wp_autoupdates_is_themes_auto_update_email_enabled() { - $enabled = ! defined( 'WP_DISABLE_THEMES_AUTO_UPDATE_EMAIL' ) || ! WP_DISABLE_THEMES_AUTO_UPDATE; + $enabled = true; /** * Filters whether themes auto-update email notifications are enabled. From 112ed26112494fb6b286d8b1e3a905a5eeb77d07 Mon Sep 17 00:00:00 2001 From: Jb Date: Wed, 6 May 2020 19:23:03 +0200 Subject: [PATCH 2/2] remove useless var --- functions.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/functions.php b/functions.php index 4269285..9692089 100755 --- a/functions.php +++ b/functions.php @@ -169,14 +169,12 @@ function wp_autoupdates_prepare_themes_for_js( $prepared_themes ) { * @return bool True if plugins auto-update is enabled, false otherwise. */ function wp_autoupdates_is_plugins_auto_update_enabled() { - $enabled = true; - /** * Filters whether plugins manual auto-update is enabled. * * @param bool $enabled True if plugins auto-update is enabled, false otherwise. */ - return apply_filters( 'wp_plugins_auto_update_enabled', $enabled ); + return apply_filters( 'wp_plugins_auto_update_enabled', true ); } @@ -186,14 +184,12 @@ function wp_autoupdates_is_plugins_auto_update_enabled() { * @return bool True if themes auto-update is enabled, false otherwise. */ function wp_autoupdates_is_themes_auto_update_enabled() { - $enabled = true; - /** * Filters whether themes manual auto-update is enabled. * * @param bool $enabled True if themes auto-update is enabled, false otherwise. */ - return apply_filters( 'wp_themes_auto_update_enabled', $enabled ); + return apply_filters( 'wp_themes_auto_update_enabled', true ); } @@ -920,14 +916,12 @@ function wp_autoupdates_debug_information( $info ) { * @return bool True if plugins notifications are enabled, false otherwise. */ function wp_autoupdates_is_plugins_auto_update_email_enabled() { - $enabled = true; - /** * Filters whether plugins auto-update email notifications are enabled. * * @param bool $enabled True if plugins notifications are enabled, false otherwise. */ - return apply_filters( 'send_plugins_auto_update_email', $enabled ); + return apply_filters( 'send_plugins_auto_update_email', true ); } @@ -937,14 +931,12 @@ function wp_autoupdates_is_plugins_auto_update_email_enabled() { * @return bool True if themes notifications are enabled, false otherwise. */ function wp_autoupdates_is_themes_auto_update_email_enabled() { - $enabled = true; - /** * Filters whether themes auto-update email notifications are enabled. * * @param bool $enabled True if themes notifications are enabled, false otherwise. */ - return apply_filters( 'send_themes_auto_update_email', $enabled ); + return apply_filters( 'send_themes_auto_update_email', true ); }