Merge pull request #19842 from woocommerce/fix/19831

Extensions helper caching fixes
This commit is contained in:
Gerhard Potgieter 2018-04-30 14:18:40 +02:00 committed by GitHub
commit a48fababe2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 11 deletions

View File

@ -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' );
}
/**

View File

@ -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();
}
}