Make sure to init the upgrader and clean plugins cache before activate.

This commit is contained in:
Akeda Bagus 2019-07-01 16:26:51 +07:00
parent b57f05fde9
commit 7ac8232d2c
No known key found for this signature in database
GPG Key ID: B21A9FC4B7761412
1 changed files with 4 additions and 0 deletions

View File

@ -111,6 +111,7 @@ class WC_Helper_Product_Install {
WP_Filesystem();
$upgrader = new WP_Upgrader( new Automatic_Upgrader_Skin() );
$upgrader->init();
wp_clean_plugins_cache();
foreach ( $products as $product_id ) {
@ -250,6 +251,9 @@ class WC_Helper_Product_Install {
* @param int $product_id Product ID.
*/
private static function activate_product( $product_id ) {
// Clear plugins cache used in `WC_Helper::get_local_woo_plugins`.
wp_clean_plugins_cache();
$plugins = wp_list_filter(
WC_Helper::get_local_woo_plugins(),
array(