From c8280c0aee50545c583857bf8a5e154d9a982bbd Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Mon, 28 Mar 2022 10:45:08 +0200 Subject: [PATCH] Remove the admin notice about the upcoming PHP 7.2 requirement --- .../includes/admin/class-wc-admin-notices.php | 43 +------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/plugins/woocommerce/includes/admin/class-wc-admin-notices.php b/plugins/woocommerce/includes/admin/class-wc-admin-notices.php index 7dd08f7b48e..408e7d356bd 100644 --- a/plugins/woocommerce/includes/admin/class-wc-admin-notices.php +++ b/plugins/woocommerce/includes/admin/class-wc-admin-notices.php @@ -54,13 +54,7 @@ class WC_Admin_Notices { add_action( 'woocommerce_installed', array( __CLASS__, 'reset_admin_notices' ) ); add_action( 'wp_loaded', array( __CLASS__, 'add_redirect_download_method_notice' ) ); add_action( 'admin_init', array( __CLASS__, 'hide_notices' ), 20 ); - add_action( - 'admin_init', - function() { - self::maybe_remove_php72_required_notice(); - }, - 20 - ); + // @TODO: This prevents Action Scheduler async jobs from storing empty list of notices during WC installation. // That could lead to OBW not starting and 'Run setup wizard' notice not appearing in WP admin, which we want // to avoid. @@ -122,41 +116,6 @@ class WC_Admin_Notices { self::add_notice( 'template_files' ); self::add_min_version_notice(); self::add_maxmind_missing_license_key_notice(); - self::maybe_add_php72_required_notice(); - } - - /** - * Add an admin notice about the bump of the required PHP version in WooCommerce 6.5 - * if the current PHP version is too old. - * - * TODO: Remove this method in WooCommerce 6.5. - */ - private static function maybe_add_php72_required_notice() { - if ( version_compare( phpversion(), '7.2', '>=' ) ) { - return; - } - - self::add_custom_notice( - 'php72_required_in_woo_65', - __( '

PHP version requirements will change soon

WooCommerce 6.5, scheduled for May 2022, will require PHP 7.2 or newer to work. Your server is currently running an older version of PHP, so this change will impact your store. Upgrading to at least PHP 7.4 is recommended. Learn more about this change.

', 'woocommerce' ) - ); - - $wp_version_is_ok = version_compare( get_bloginfo( 'version' ), WC_NOTICE_MIN_WP_VERSION, '>=' ); - if ( $wp_version_is_ok ) { - self::hide_notice( WC_PHP_MIN_REQUIREMENTS_NOTICE ); - } - } - - /** - * Remove the admin notice about the bump of the required PHP version in WooCommerce 6.5 - * if the current PHP version is good. - * - * TODO: Remove this method in WooCommerce 6.5. - */ - private static function maybe_remove_php72_required_notice() { - if ( version_compare( phpversion(), '7.2', '>=' ) && self::has_notice( 'php72_required_in_woo_65' ) ) { - self::remove_notice( 'php72_required_in_woo_65' ); - } } /**