Any problems with not optimizing WooCommerce inline Javascript?
-
Hi there,
I’m using Actionable Google Analytics for WooCommerce that uses the WooCommerce
wc_enqueue_js
to include specific per page unique javscript.This WooCommerce function is using the
wp_footer
action to add inline JS to the page.As the javascript is now unique per page, this is making Autoptimize create thousands of js files.
So i’ve done is this to NOT optimize the WooCommerce inline Javascript at all:
/* WooCommerce Javascript should not be optimized */ remove_action('wp_footer', 'wc_print_js', 25); add_action('wp_footer', function() { echo '<!--noptimize-->'; }, 25); add_action('wp_footer', 'wc_print_js', 25); add_action('wp_footer', function() { echo '<!--/noptimize-->'; }, 25);
has anyone done this before and run into problems?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Any problems with not optimizing WooCommerce inline Javascript?’ is closed to new replies.