for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Jetpack_Google_Analytics_Options provides a single interface to module options
*
* @author allendav
*/
* Bail if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Jetpack_Google_Analytics_Options {
public static function get_option( $option_name, $default = false ) {
$o = get_option( 'jetpack_wga' );
return isset( $o[ $option_name ] ) ? $o[ $option_name ] : $default;
public static function get_tracking_code() {
return self::get_option( 'code', '' );
''
string
boolean
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:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
public static function has_tracking_code() {
$code = self::get_tracking_code();
return ! empty( $code );
// Options used by both legacy and universal analytics
public static function anonymize_ip_is_enabled() {
return self::get_option( 'anonymize_ip' );
// eCommerce options used by both legacy and universal analytics
public static function track_purchases_is_enabled() {
return self::get_option( 'ec_track_purchases' );
public static function track_add_to_cart_is_enabled() {
return self::get_option( 'ec_track_add_to_cart' );
// Enhanced eCommerce options
public static function enhanced_ecommerce_tracking_is_enabled() {
return self::get_option( 'enh_ec_tracking' );
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: