From 95fe91e622c442f867183289bfb76dd3424295ca Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 21 Aug 2017 16:04:06 +0100 Subject: [PATCH] Tweak version code --- .../plugin-updates/class-wc-plugins-screen-updates.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 91dc30e12e9..c093645abfa 100644 --- a/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php +++ b/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php @@ -45,8 +45,13 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates { $current_version_parts = explode( '.', WC_VERSION ); $new_version_parts = explode( '.', $this->new_version ); + // If user has already moved to the minor version, we don't need to flag up anything. + if ( version_compare( $current_version_parts[0] . $current_version_parts[1], $new_version_parts[0] . $new_version_parts[1], '=' ) ) { + return; + } + // If user has already moved to the major version, we should only shown minor notices and assume everything is "ok" for major. - if ( version_compare( $current_version_parts[0] . $current_version_parts[1], $new_version_parts[0] . '0', '>' ) ) { + if ( version_compare( $current_version_parts[0] . $current_version_parts[1], $new_version_parts[0] . '0', '>=' ) ) { $this->major_untested_plugins = array(); }