Completed
Push — try/tracks-store-stats ( dfee34...2ab7e3 )
by
unknown
09:17
created

Jetpack_Stats   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A woocommerce_loaded() 0 9 1
A init() 0 13 4
1
<?php
2
3
class Jetpack_Stats {
4
	static private function woocommerce_loaded() {
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
5
		echo "<pre>";
6
//		print_r( WC_Data::get_data_store() );
7
//		print_r( WC_Cart::get_cart_from_session() );
8
		print_r( WC()->cart->cart_contents );
9
//		global $wp_query;
10
//		print_r($wp_query);
11
		echo "</pre>";
12
	}
13
	static function init() {
14
		if ( is_admin() ) {
15
			return;
16
		}
17
		if ( ! Jetpack::is_active() ) {
18
			return;
19
		}
20
		if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
21
			return;
22
		}
23
		Jetpack_Stats::woocommerce_loaded();
24
//		add_action( ‘woocommerce_init’, array( $this, ‘woocommerce_loaded’ ) );
25
	}
26
}
27
28
add_action( 'init', array( 'Jetpack_Stats', 'init' ) );
29