From ffe2257f2d0e1f51410f0b612d8d2ed435f2f38c Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Wed, 3 Jun 2020 14:36:06 -0700 Subject: [PATCH] Removed the notice for untested minor version updates With the increased cadence of releases it becomes necessary that we address the `WC tested up to` header's usefulness. It isn't practical to require everyone to update their extensions every month, especially given that we are only doing backwards compatible minor releases. The only case I can think of where we might want to check the minor version is if the Stable tag on Core is downgraded, but due to the naming of the header, this doesn't make any sense. I considered making this a wildcard of some kind but I think most would bind to a full major version anyway and so this isn't worth the time to add it. As an aside, the tests in `plugin-updates.php` seem to indicate that a header of `WC tested up to: 4` would apply to the entire major version cycle, so wildcards already exist! --- .../class-wc-plugin-updates.php | 30 ------------------- .../class-wc-plugins-screen-updates.php | 5 ---- 2 files changed, 35 deletions(-) diff --git a/includes/admin/plugin-updates/class-wc-plugin-updates.php b/includes/admin/plugin-updates/class-wc-plugin-updates.php index fb838c726fa..fa64bcce0b4 100644 --- a/includes/admin/plugin-updates/class-wc-plugin-updates.php +++ b/includes/admin/plugin-updates/class-wc-plugin-updates.php @@ -45,13 +45,6 @@ class WC_Plugin_Updates { */ protected $major_untested_plugins = array(); - /** - * Array of plugins lacking testing with the minor version. - * - * @var array - */ - protected $minor_untested_plugins = array(); - /** * Common JS for initializing and managing thickbox-based modals. */ @@ -103,29 +96,6 @@ class WC_Plugin_Updates { | Methods for getting messages. */ - /** - * Get the inline warning notice for minor version updates. - * - * @return string - */ - protected function get_extensions_inline_warning_minor() { - $upgrade_type = 'minor'; - $plugins = ! empty( $this->major_untested_plugins ) ? array_diff_key( $this->minor_untested_plugins, $this->major_untested_plugins ) : $this->minor_untested_plugins; - $version_parts = explode( '.', $this->new_version ); - $new_version = $version_parts[0] . '.' . $version_parts[1]; - - if ( empty( $plugins ) ) { - return; - } - - /* translators: %s: version number */ - $message = sprintf( __( "Heads up! The versions of the following plugins you're running haven't been tested with the latest version of WooCommerce (%s).", 'woocommerce' ), $new_version ); - - ob_start(); - include 'views/html-notice-untested-extensions-inline.php'; - return ob_get_clean(); - } - /** * Get the inline warning notice for major version updates. * diff --git a/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php b/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php index f544f408582..a7a048db15a 100644 --- a/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php +++ b/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php @@ -45,7 +45,6 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates { $this->new_version = $response->new_version; $this->upgrade_notice = $this->get_upgrade_notice( $response->new_version ); $this->major_untested_plugins = $this->get_untested_plugins( $response->new_version, 'major' ); - $this->minor_untested_plugins = $this->get_untested_plugins( $response->new_version, 'minor' ); $current_version_parts = explode( '.', Constants::get_constant( 'WC_VERSION' ) ); $new_version_parts = explode( '.', $this->new_version ); @@ -59,10 +58,6 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates { $this->upgrade_notice .= $this->get_extensions_inline_warning_major(); } - if ( ! empty( $this->minor_untested_plugins ) ) { - $this->upgrade_notice .= $this->get_extensions_inline_warning_minor(); - } - if ( ! empty( $this->major_untested_plugins ) ) { $this->upgrade_notice .= $this->get_extensions_modal_warning(); add_action( 'admin_print_footer_scripts', array( $this, 'plugin_screen_modal_js' ) );