Skip to content

Commit 57541dc

Browse files
authored
Woo Analytics: bail early when WooCommerce is not active. (#36278)
I missed this when bringing the codebase to the package and moving to a singleton.
1 parent 9cc41bb commit 57541dc

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
General: bail early when WooCommerce is not active.

projects/packages/woocommerce-analytics/src/class-woocommerce-analytics.php

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class Woocommerce_Analytics {
2929
* @return void
3030
*/
3131
public static function init() {
32+
if ( ! self::should_track_store() ) {
33+
return;
34+
}
35+
3236
// loading _wca.
3337
add_action( 'wp_head', array( __CLASS__, 'wp_head_top' ), 1 );
3438

0 commit comments

Comments
 (0)