1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Jetpack_Google_Analytics_Options provides a single interface to module options |
5
|
|
|
* |
6
|
|
|
* @author allendav |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Bail if accessed directly |
11
|
|
|
*/ |
12
|
|
|
if ( ! defined( 'ABSPATH' ) ) { |
13
|
|
|
exit; |
14
|
|
|
} |
15
|
|
|
|
16
|
|
|
class Jetpack_Google_Analytics_Options { |
17
|
|
|
public static function get_option( $option_name, $default = false ) { |
18
|
|
|
$o = get_option( 'jetpack_wga' ); |
19
|
|
|
return isset( $o[ $option_name ] ) ? $o[ $option_name ] : $default; |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
public static function get_tracking_code() { |
23
|
|
|
return self::get_option( 'code', '' ); |
|
|
|
|
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
public static function has_tracking_code() { |
27
|
|
|
$code = self::get_tracking_code(); |
28
|
|
|
return ! empty( $code ); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
// Options used by both legacy and universal analytics |
32
|
|
|
public static function anonymize_ip_is_enabled() { |
33
|
|
|
return self::get_option( 'anonymize_ip' ); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
// eCommerce options used by both legacy and universal analytics |
37
|
|
|
public static function track_purchases_is_enabled() { |
38
|
|
|
return self::get_option( 'ec_track_purchases' ); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public static function track_add_to_cart_is_enabled() { |
42
|
|
|
return self::get_option( 'ec_track_add_to_cart' ); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
// Enhanced eCommerce options |
46
|
|
|
public static function enhanced_ecommerce_tracking_is_enabled() { |
47
|
|
|
return self::get_option( 'enh_ec_tracking' ); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public static function track_remove_from_cart_is_enabled() { |
51
|
|
|
return self::get_option( 'enh_ec_track_remove_from_cart' ); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public static function track_product_impressions_is_enabled() { |
55
|
|
|
return self::get_option( 'enh_ec_track_prod_impression' ); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public static function track_product_clicks_is_enabled() { |
59
|
|
|
return self::get_option( 'enh_ec_track_prod_click' ); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public static function track_product_detail_view_is_enabled() { |
63
|
|
|
return self::get_option( 'enh_ec_track_prod_detail_view' ); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public static function track_checkout_started_is_enabled() { |
67
|
|
|
return self::get_option( 'enh_ec_track_checkout_started' ); |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: