fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Luca Capula

Hi, KINSTA our server host updated to PHP8. Since then we are encountering a fatal error due to your plugin everytime we try to modify any product.

When your plugin is deactivated the error message disappear and everything works fine.

This is the error message:

2022/12/03 16:09:34 [error] 34656#34656: *104386 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Call to undefined method WP_Object_Cache::flush_group() in /www/sonofabarista_986/public/wp-includes/cache-compat.php:183
Stack trace:
#0 /www/sonofabarista_986/public/wp-content/plugins/woo-variation-swatches/includes/class-woo-variation-swatches-manage-cache.php(202): wp_cache_flush_group(‘woo_variation_s…’)
#1 /www/sonofabarista_986/public/wp-content/plugins/woo-variation-swatches/includes/class-woo-variation-swatches-manage-cache.php(109): Woo_Variation_Swatches_Manage_Cache->clear_cache_by_group()
#2 /www/sonofabarista_986/public/wp-includes/class-wp-hook.php(308): Woo_Variation_Swatches_Manage_Cache->clear_cache_on_delete_product_transients(285)
#3 /www/sonofabarista_986/public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array)
#4 /www/sonofabarista_986/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#5 /www/sonofabarista_986/public/wp-content/plugins/woocommerce/includes/wc-product-functions.php(153): do_actio” while reading response header from upstream, client: 108.233.72.202, server: www.sonofabarista.com, request: “POST /wp-admin/post.php HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php8.0-fpm-sonofabarista.sock:”, host: “www.sonofabarista.com:50663”, referrer: “https://www.sonofabarista.com/wp-admin/post.php?post=285&action=edit”

Hakik Zaman

Hi Luca,

Thanks for reaching us. Sorry for your inconvenience.

Did you clear your transient- https://paste.pics/K749I?

Please let me know if it helps.

Thank You

Luca Capula

I did. and it generate this error again. See below. Upon checking today we are having hundreds more errors like this both on the server log and on the wpcron log.

 

2022/12/04 16:35:52 [error] 34656#34656: *151956 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Call to undefined method WP_Object_Cache::flush_group() in /www/sonofabarista_986/public/wp-includes/cache-compat.php:183
Stack trace:
#0 /www/sonofabarista_986/public/wp-content/plugins/woo-variation-swatches/includes/class-woo-variation-swatches-manage-cache.php(202): wp_cache_flush_group(‘woo_variation_s…’)
#1 /www/sonofabarista_986/public/wp-content/plugins/woo-variation-swatches/includes/class-woo-variation-swatches-manage-cache.php(109): Woo_Variation_Swatches_Manage_Cache->clear_cache_by_group()
#2 /www/sonofabarista_986/public/wp-includes/class-wp-hook.php(308): Woo_Variation_Swatches_Manage_Cache->clear_cache_on_delete_product_transients(0)
#3 /www/sonofabarista_986/public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array)
#4 /www/sonofabarista_986/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#5 /www/sonofabarista_986/public/wp-content/plugins/woocommerce/includes/wc-product-functions.php(153): do_action(” while reading response header from upstream, client: 108.233.72.202, server: http://www.sonofabarista.com, request: “GET /wp-admin/admin.php?_wpnonce=93d3134bd1&page=wc-status&tab=tools&action=clear_transients HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php8.0-fpm-sonofabarista.sock:”, host: “http://www.sonofabarista.com:50663“, referrer: “https://www.sonofabarista.com/wp-admin/admin.php?page=wc-status&tab=tools

Luca Capula

Please see attachment. the situation is unsustainable. screen grab of the server log and wp-cron log

Hakik Zaman

Hi Luca,

Sorry for your inconvenience.

Please add the below snippet using the Code Snippets Plugin:

add_action('woo_variation_swatches_manage_cache_loaded', function( $woo_variation_swatches_manage_cache_loaded ){ remove_action( 'woocommerce_save_product_variation', array( $woo_variation_swatches_manage_cache_loaded, 'clear_cache_on_product_modify' ) ); remove_action( 'woocommerce_update_product_variation', array( $woo_variation_swatches_manage_cache_loaded, 'clear_cache_on_product_modify' ) ); remove_action( 'woocommerce_delete_product_variation', array( $woo_variation_swatches_manage_cache_loaded, 'clear_cache_on_product_modify' ) ); remove_action( 'woocommerce_trash_product_variation', array( $woo_variation_swatches_manage_cache_loaded, 'clear_cache_on_product_modify' ) ); }, 10, 1);

Then try again and let me know if it resolves your issue or not.

Thank You