diff --git a/includes/admin/helper/class-wc-helper-updater.php b/includes/admin/helper/class-wc-helper-updater.php index 02544b15dcb..c4e6cd27f2a 100644 --- a/includes/admin/helper/class-wc-helper-updater.php +++ b/includes/admin/helper/class-wc-helper-updater.php @@ -307,17 +307,8 @@ class WC_Helper_Updater { public static function flush_updates_cache() { delete_transient( '_woocommerce_helper_updates' ); delete_transient( '_woocommerce_helper_updates_count' ); - - // Refresh update transients - $update_plugins = get_site_transient( 'update_plugins' ); - if ( ! empty( $update_plugins ) ) { - set_site_transient( 'update_plugins', $update_plugins ); - } - - $update_themes = get_site_transient( 'update_themes' ); - if ( ! empty( $update_themes ) ) { - set_site_transient( 'update_themes', $update_themes ); - } + delete_site_transient( 'update_plugins' ); + delete_site_transient( 'update_themes' ); } /** diff --git a/includes/admin/helper/class-wc-helper.php b/includes/admin/helper/class-wc-helper.php index d03a4683e38..7a9762dfd91 100644 --- a/includes/admin/helper/class-wc-helper.php +++ b/includes/admin/helper/class-wc-helper.php @@ -741,6 +741,7 @@ class WC_Helper { } self::_flush_subscriptions_cache(); + self::_flush_updates_cache(); // Enable tracking when connected. if ( class_exists( 'WC_Tracker' ) ) { @@ -858,6 +859,8 @@ class WC_Helper { } self::_flush_subscriptions_cache(); + self::_flush_updates_cache(); + $redirect_uri = add_query_arg( array( 'page' => 'wc-addons', @@ -1220,6 +1223,7 @@ class WC_Helper { self::log( 'Auto-activated a subscription for ' . $filename ); self::_flush_subscriptions_cache(); + self::_flush_updates_cache(); } /** @@ -1280,6 +1284,7 @@ class WC_Helper { if ( $deactivated ) { self::log( sprintf( 'Auto-deactivated %d subscription(s) for %s', $deactivated, $filename ) ); self::_flush_subscriptions_cache(); + self::_flush_updates_cache(); } }