diff --git a/includes/admin/plugin-updates/class-wc-updates-screen-updates.php b/includes/admin/plugin-updates/class-wc-updates-screen-updates.php index 60510100610..7d2cbb9de8d 100644 --- a/includes/admin/plugin-updates/class-wc-updates-screen-updates.php +++ b/includes/admin/plugin-updates/class-wc-updates-screen-updates.php @@ -6,6 +6,8 @@ * @version 3.2.0 */ +use Automattic\Jetpack\Constants; + if ( ! defined( 'ABSPATH' ) ) { exit; } @@ -37,8 +39,13 @@ class WC_Updates_Screen_Updates extends WC_Plugin_Updates { return; } + $version_type = Constants::get_constant( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ); + if ( ! is_string( $version_type ) ) { + $version_type = 'none'; + } + $this->new_version = wc_clean( $updateable_plugins['woocommerce/woocommerce.php']->update->new_version ); - $this->major_untested_plugins = $this->get_untested_plugins( $this->new_version, 'major' ); + $this->major_untested_plugins = $this->get_untested_plugins( $this->new_version, $version_type ); if ( ! empty( $this->major_untested_plugins ) ) { echo $this->get_extensions_modal_warning(); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped diff --git a/includes/admin/views/html-admin-page-status-report.php b/includes/admin/views/html-admin-page-status-report.php index c1393a42d7e..421040eb023 100644 --- a/includes/admin/views/html-admin-page-status-report.php +++ b/includes/admin/views/html-admin-page-status-report.php @@ -5,16 +5,12 @@ * @package WooCommerce */ +use Automattic\Jetpack\Constants; + defined( 'ABSPATH' ) || exit; global $wpdb; -if ( ! defined( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ) ) { - // Define if we're checking against major or minor versions. - // Since 5.0 all versions are backwards compatible, so there's no more check. - define( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE', 'none' ); -} - $report = wc()->api->get_endpoint_data( '/wc/v3/system_status' ); $environment = $report['environment']; $database = $report['database']; @@ -27,7 +23,7 @@ $security = $report['security']; $settings = $report['settings']; $wp_pages = $report['pages']; $plugin_updates = new WC_Plugin_Updates(); -$untested_plugins = $plugin_updates->get_untested_plugins( WC()->version, WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE ); +$untested_plugins = $plugin_updates->get_untested_plugins( WC()->version, Constants::get_constant( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ) ); ?>