From e61e865a4a414b0c181de8861dd28b18f0922a1c Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Thu, 12 Mar 2020 11:54:18 -0300 Subject: [PATCH] Change string for untested WC extensions to avoid confusions This commit changes the string that is displayed to the users in the system status report page when an old version of a WC extension is installed and it doesn't declare support for the current WC core version. The original message was: "WooCommerce Min/Max Quantities - by WooCommerce - 2.4.11 - 2.4.12 is available - Not tested with the active version of WooCommerce" The new message is: "WooCommerce Min/Max Quantities - by WooCommerce - 2.4.11 - This version is not tested with the active version of WooCommerce (update is available)" The problem with the original message is that it gives users the impression that even the newest version (2.4.12 in the example above) is not tested with the active version of WooCommerce. --- includes/admin/class-wc-admin-status.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/includes/admin/class-wc-admin-status.php b/includes/admin/class-wc-admin-status.php index efe27f51839..997d07f77ec 100644 --- a/includes/admin/class-wc-admin-status.php +++ b/includes/admin/class-wc-admin-status.php @@ -356,12 +356,11 @@ class WC_Admin_Status { $plugin_name = '' . $plugin_name . ''; } - $version_string = ''; - $network_string = ''; + $has_newer_version = false; + $network_string = ''; if ( strstr( $plugin['url'], 'woothemes.com' ) || strstr( $plugin['url'], 'woocommerce.com' ) ) { if ( ! empty( $plugin['version_latest'] ) && version_compare( $plugin['version_latest'], $plugin['version'], '>' ) ) { - /* translators: %s: plugin latest version */ - $version_string = ' – ' . sprintf( esc_html__( '%s is available', 'woocommerce' ), $plugin['version_latest'] ) . ''; + $has_newer_version = true; } if ( false !== $plugin['network_activated'] ) { @@ -370,7 +369,15 @@ class WC_Admin_Status { } $untested_string = ''; if ( array_key_exists( $plugin['plugin'], $untested_plugins ) ) { - $untested_string = ' – ' . esc_html__( 'Not tested with the active version of WooCommerce', 'woocommerce' ) . ''; + $untested_string = ' – '; + + if ( $has_newer_version ) { + $untested_string .= esc_html__( 'This version is not tested with the active version of WooCommerce (update is available)', 'woocommerce' ); + } else { + $untested_string .= esc_html__( 'This version is not tested with the active version of WooCommerce', 'woocommerce' ); + } + + $untested_string .= ''; } ?>