Automattic /
jetpack
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | class Jetpack_Stats { |
||
| 4 | static private function woocommerce_loaded() { |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
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 |