Passed
Branch master (82fe3a)
by Chris
04:08
created
includes/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1 1
 <?php
2 2
 //Nothing to see here
3 3
 
4
-header( 'HTTP/1.0 403 Forbidden' );
5 4
\ No newline at end of file
5
+header('HTTP/1.0 403 Forbidden');
6 6
\ No newline at end of file
Please login to merge, or discard this patch.
includes/measurement-protocol.php 2 patches
Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -1,149 +1,149 @@
 block discarded – undo
1 1
 <?php
2 2
 if ( ! defined( 'ABSPATH' ) ) {
3
-	exit; // Exit if accessed directly
3
+  exit; // Exit if accessed directly
4 4
 }
5 5
 
6 6
 function monsterinsights_get_mp_api_url( ) {
7
-	if ( monsterinsights_is_debug_mode() ) {
8
-		return 'https://www.google-analytics.com/debug/collect';
9
-	} else {
10
-		return 'https://ssl.google-analytics.com/collect';
11
-	}
7
+  if ( monsterinsights_is_debug_mode() ) {
8
+    return 'https://www.google-analytics.com/debug/collect';
9
+  } else {
10
+    return 'https://ssl.google-analytics.com/collect';
11
+  }
12 12
 }
13 13
 
14 14
 function monsterinsights_mp_api_call( $args = array() ) {
15
-	$user_agent = '';
16
-	if ( ! empty( $args['user-agent'] ) ) {
17
-		$user_agent = $args['user-agent'];
18
-		unset( $args['user-agent'] );
19
-	}
20
-
21
-	$payment_id = 0;
22
-	if ( ! empty( $args['payment_id'] ) ) {
23
-		$payment_id = $args['payment_id'];
24
-		unset( $args['payment_id'] );
25
-	}
26
-
27
-	$defaults = array(
28
-		't'  => 'event', // Required: Hit type
29
-		'ec' => '',      // Optional: Event category
30
-		'ea' => '', 	 // Optional: Event Action
31
-		'el' => '', 	 // Optional: Event Label
32
-		'ev' => null, 	 // Optional: Event Value
33
-	);
34
-
35
-	$body  = array_merge( $defaults , $args );
36
-
37
-	// We want to get the user's IP address when possible
38
-	$ip     = '';
39
-	if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) && ! filter_var( $_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP ) === false ) {
40
-		$ip = $_SERVER['HTTP_CLIENT_IP'];
41
-	} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && ! filter_var( $_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP ) === false ) {
42
-		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
43
-	} else {
44
-		$ip = $_SERVER['REMOTE_ADDR'];
45
-	}
46
-
47
-	// If possible, let's get the user's language
48
-	$user_language = isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ? explode( ',', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) : array();
49
-	$user_language = reset( $user_language );
50
-	$user_language = sanitize_text_field( $user_language );
51
-
52
-	$default_body = array(
53
-		// Required: Version
54
-		'v'   => '1',
15
+  $user_agent = '';
16
+  if ( ! empty( $args['user-agent'] ) ) {
17
+    $user_agent = $args['user-agent'];
18
+    unset( $args['user-agent'] );
19
+  }
20
+
21
+  $payment_id = 0;
22
+  if ( ! empty( $args['payment_id'] ) ) {
23
+    $payment_id = $args['payment_id'];
24
+    unset( $args['payment_id'] );
25
+  }
26
+
27
+  $defaults = array(
28
+    't'  => 'event', // Required: Hit type
29
+    'ec' => '',      // Optional: Event category
30
+    'ea' => '', 	 // Optional: Event Action
31
+    'el' => '', 	 // Optional: Event Label
32
+    'ev' => null, 	 // Optional: Event Value
33
+  );
34
+
35
+  $body  = array_merge( $defaults , $args );
36
+
37
+  // We want to get the user's IP address when possible
38
+  $ip     = '';
39
+  if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) && ! filter_var( $_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP ) === false ) {
40
+    $ip = $_SERVER['HTTP_CLIENT_IP'];
41
+  } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && ! filter_var( $_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP ) === false ) {
42
+    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
43
+  } else {
44
+    $ip = $_SERVER['REMOTE_ADDR'];
45
+  }
46
+
47
+  // If possible, let's get the user's language
48
+  $user_language = isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ? explode( ',', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) : array();
49
+  $user_language = reset( $user_language );
50
+  $user_language = sanitize_text_field( $user_language );
51
+
52
+  $default_body = array(
53
+    // Required: Version
54
+    'v'   => '1',
55 55
 		
56
-		// Required: UA code
57
-		'tid' => monsterinsights_get_ua_to_output( array( 'ecommerce' => $args ) ),
56
+    // Required: UA code
57
+    'tid' => monsterinsights_get_ua_to_output( array( 'ecommerce' => $args ) ),
58 58
 		
59
-		// Required: User visitor ID
60
-		'cid' => monsterinsights_get_client_id( $payment_id ),
59
+    // Required: User visitor ID
60
+    'cid' => monsterinsights_get_client_id( $payment_id ),
61 61
 
62
-		// Required: Type of hit (either pageview or event)
63
-		't'   => 'pageview', // Required - Hit type
62
+    // Required: Type of hit (either pageview or event)
63
+    't'   => 'pageview', // Required - Hit type
64 64
 
65
-		// Optional: Was the event a non-interaction event (for bounce purposes)
66
-		'ni'  => true,
65
+    // Optional: Was the event a non-interaction event (for bounce purposes)
66
+    'ni'  => true,
67 67
 
68
-		// Optional: Document Host Name
69
-		'dh'  => str_replace( array( 'http://', 'https://' ), '', site_url() ),
68
+    // Optional: Document Host Name
69
+    'dh'  => str_replace( array( 'http://', 'https://' ), '', site_url() ),
70 70
 
71
-		// Optional: Requested URI
72
-		'dp'  => $_SERVER['REQUEST_URI'],
71
+    // Optional: Requested URI
72
+    'dp'  => $_SERVER['REQUEST_URI'],
73 73
 
74
-		// Optional: Page Title
75
-		'dt'  => get_the_title(),
74
+    // Optional: Page Title
75
+    'dt'  => get_the_title(),
76 76
 
77
-		// Optional: User language
78
-		'ul'  => $user_language,
77
+    // Optional: User language
78
+    'ul'  => $user_language,
79 79
 
80
-		// Optional: User IP address
81
-		'uip' => $ip,
80
+    // Optional: User IP address
81
+    'uip' => $ip,
82 82
 
83
-		// Optional: User Agent
84
-		'ua'  => ! empty( $user_agent ) ?  $user_agent : $_SERVER['HTTP_USER_AGENT'],
83
+    // Optional: User Agent
84
+    'ua'  => ! empty( $user_agent ) ?  $user_agent : $_SERVER['HTTP_USER_AGENT'],
85 85
 
86
-		// Optional: Time of the event
87
-		'z'   => time()
88
-	);
86
+    // Optional: Time of the event
87
+    'z'   => time()
88
+  );
89 89
 
90
-	$body = wp_parse_args( $body, $default_body );
91
-	// $body = apply_filters( 'monsterinsights_mp_api_call', $body );
90
+  $body = wp_parse_args( $body, $default_body );
91
+  // $body = apply_filters( 'monsterinsights_mp_api_call', $body );
92 92
 
93 93
 
94
-	// Ensure that the CID is not empty
95
-	if ( empty( $body['cid'] ) ) {
96
-		$body['cid'] = monsterinsights_generate_uuid();
97
-	}
94
+  // Ensure that the CID is not empty
95
+  if ( empty( $body['cid'] ) ) {
96
+    $body['cid'] = monsterinsights_generate_uuid();
97
+  }
98 98
 
99
-	// Unset empty values to reduce request size
100
-	foreach ( $body as $key => $value ) {
101
-		if ( empty( $value ) ) {
102
-			unset( $body[ $key ] );
103
-		}
104
-	}
99
+  // Unset empty values to reduce request size
100
+  foreach ( $body as $key => $value ) {
101
+    if ( empty( $value ) ) {
102
+      unset( $body[ $key ] );
103
+    }
104
+  }
105 105
 
106
-	$debug_mode = monsterinsights_is_debug_mode();
107
-	$args = array(
108
-		'method'   => 'POST',
109
-		'timeout'  => '5',
110
-		'blocking' => ( $debug_mode ) ? true : false,
111
-		'body'     => $body,
112
-	);
106
+  $debug_mode = monsterinsights_is_debug_mode();
107
+  $args = array(
108
+    'method'   => 'POST',
109
+    'timeout'  => '5',
110
+    'blocking' => ( $debug_mode ) ? true : false,
111
+    'body'     => $body,
112
+  );
113 113
 
114
-	if ( ! empty( $user_agent ) ) {
115
-		$args['user-agent'] = $user_agent;
116
-	}
114
+  if ( ! empty( $user_agent ) ) {
115
+    $args['user-agent'] = $user_agent;
116
+  }
117 117
 
118
-	$response = wp_remote_post( monsterinsights_get_mp_api_url(), $args );
118
+  $response = wp_remote_post( monsterinsights_get_mp_api_url(), $args );
119 119
 
120
-	//
121
-	//if ( $debug_mode ) {
122
-	//	monsterinsights_debug_output( $body );
123
-	//	monsterinsights_debug_output( $response );
124
-	//}
125
-	return $response;
120
+  //
121
+  //if ( $debug_mode ) {
122
+  //	monsterinsights_debug_output( $body );
123
+  //	monsterinsights_debug_output( $response );
124
+  //}
125
+  return $response;
126 126
 }
127 127
 
128 128
 function monsterinsights_mp_track_event_call( $args = array() ) {
129
-	$default_args = array(
130
-		// Change the default type to event
131
-		't'  => 'event',
129
+  $default_args = array(
130
+    // Change the default type to event
131
+    't'  => 'event',
132 132
 
133
-		// Required: Event Category
134
-		'ec' => '',
133
+    // Required: Event Category
134
+    'ec' => '',
135 135
 		
136
-		// Required: Event Action
137
-		'ea' => '',
136
+    // Required: Event Action
137
+    'ea' => '',
138 138
 
139
-		// Required: Event Label
140
-		'el' => '',
139
+    // Required: Event Label
140
+    'el' => '',
141 141
 
142
-		// Optional: Event Value
143
-		'ev' => null,
144
-	);
145
-	$args  = wp_parse_args( $args, $default_args );
146
-	//$args = apply_filters( 'monsterinsights_mp_track_event_call', $args );
142
+    // Optional: Event Value
143
+    'ev' => null,
144
+  );
145
+  $args  = wp_parse_args( $args, $default_args );
146
+  //$args = apply_filters( 'monsterinsights_mp_track_event_call', $args );
147 147
 
148
-	return monsterinsights_mp_api_call( $args );
148
+  return monsterinsights_mp_api_call( $args );
149 149
 }
150 150
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,63 +1,63 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if ( ! defined('ABSPATH')) {
3 3
 	exit; // Exit if accessed directly
4 4
 }
5 5
 
6 6
 function monsterinsights_get_mp_api_url( ) {
7
-	if ( monsterinsights_is_debug_mode() ) {
7
+	if (monsterinsights_is_debug_mode()) {
8 8
 		return 'https://www.google-analytics.com/debug/collect';
9 9
 	} else {
10 10
 		return 'https://ssl.google-analytics.com/collect';
11 11
 	}
12 12
 }
13 13
 
14
-function monsterinsights_mp_api_call( $args = array() ) {
14
+function monsterinsights_mp_api_call($args = array()) {
15 15
 	$user_agent = '';
16
-	if ( ! empty( $args['user-agent'] ) ) {
16
+	if ( ! empty($args['user-agent'])) {
17 17
 		$user_agent = $args['user-agent'];
18
-		unset( $args['user-agent'] );
18
+		unset($args['user-agent']);
19 19
 	}
20 20
 
21 21
 	$payment_id = 0;
22
-	if ( ! empty( $args['payment_id'] ) ) {
22
+	if ( ! empty($args['payment_id'])) {
23 23
 		$payment_id = $args['payment_id'];
24
-		unset( $args['payment_id'] );
24
+		unset($args['payment_id']);
25 25
 	}
26 26
 
27 27
 	$defaults = array(
28 28
 		't'  => 'event', // Required: Hit type
29
-		'ec' => '',      // Optional: Event category
30
-		'ea' => '', 	 // Optional: Event Action
31
-		'el' => '', 	 // Optional: Event Label
32
-		'ev' => null, 	 // Optional: Event Value
29
+		'ec' => '', // Optional: Event category
30
+		'ea' => '', // Optional: Event Action
31
+		'el' => '', // Optional: Event Label
32
+		'ev' => null, // Optional: Event Value
33 33
 	);
34 34
 
35
-	$body  = array_merge( $defaults , $args );
35
+	$body = array_merge($defaults, $args);
36 36
 
37 37
 	// We want to get the user's IP address when possible
38
-	$ip     = '';
39
-	if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) && ! filter_var( $_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP ) === false ) {
38
+	$ip = '';
39
+	if ( ! empty($_SERVER['HTTP_CLIENT_IP']) && ! filter_var($_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP) === false) {
40 40
 		$ip = $_SERVER['HTTP_CLIENT_IP'];
41
-	} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && ! filter_var( $_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP ) === false ) {
41
+	} elseif ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR']) && ! filter_var($_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP) === false) {
42 42
 		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
43 43
 	} else {
44 44
 		$ip = $_SERVER['REMOTE_ADDR'];
45 45
 	}
46 46
 
47 47
 	// If possible, let's get the user's language
48
-	$user_language = isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ? explode( ',', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) : array();
49
-	$user_language = reset( $user_language );
50
-	$user_language = sanitize_text_field( $user_language );
48
+	$user_language = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) : array();
49
+	$user_language = reset($user_language);
50
+	$user_language = sanitize_text_field($user_language);
51 51
 
52 52
 	$default_body = array(
53 53
 		// Required: Version
54 54
 		'v'   => '1',
55 55
 		
56 56
 		// Required: UA code
57
-		'tid' => monsterinsights_get_ua_to_output( array( 'ecommerce' => $args ) ),
57
+		'tid' => monsterinsights_get_ua_to_output(array('ecommerce' => $args)),
58 58
 		
59 59
 		// Required: User visitor ID
60
-		'cid' => monsterinsights_get_client_id( $payment_id ),
60
+		'cid' => monsterinsights_get_client_id($payment_id),
61 61
 
62 62
 		// Required: Type of hit (either pageview or event)
63 63
 		't'   => 'pageview', // Required - Hit type
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		'ni'  => true,
67 67
 
68 68
 		// Optional: Document Host Name
69
-		'dh'  => str_replace( array( 'http://', 'https://' ), '', site_url() ),
69
+		'dh'  => str_replace(array('http://', 'https://'), '', site_url()),
70 70
 
71 71
 		// Optional: Requested URI
72 72
 		'dp'  => $_SERVER['REQUEST_URI'],
@@ -81,25 +81,25 @@  discard block
 block discarded – undo
81 81
 		'uip' => $ip,
82 82
 
83 83
 		// Optional: User Agent
84
-		'ua'  => ! empty( $user_agent ) ?  $user_agent : $_SERVER['HTTP_USER_AGENT'],
84
+		'ua'  => ! empty($user_agent) ? $user_agent : $_SERVER['HTTP_USER_AGENT'],
85 85
 
86 86
 		// Optional: Time of the event
87 87
 		'z'   => time()
88 88
 	);
89 89
 
90
-	$body = wp_parse_args( $body, $default_body );
90
+	$body = wp_parse_args($body, $default_body);
91 91
 	// $body = apply_filters( 'monsterinsights_mp_api_call', $body );
92 92
 
93 93
 
94 94
 	// Ensure that the CID is not empty
95
-	if ( empty( $body['cid'] ) ) {
95
+	if (empty($body['cid'])) {
96 96
 		$body['cid'] = monsterinsights_generate_uuid();
97 97
 	}
98 98
 
99 99
 	// Unset empty values to reduce request size
100
-	foreach ( $body as $key => $value ) {
101
-		if ( empty( $value ) ) {
102
-			unset( $body[ $key ] );
100
+	foreach ($body as $key => $value) {
101
+		if (empty($value)) {
102
+			unset($body[$key]);
103 103
 		}
104 104
 	}
105 105
 
@@ -107,15 +107,15 @@  discard block
 block discarded – undo
107 107
 	$args = array(
108 108
 		'method'   => 'POST',
109 109
 		'timeout'  => '5',
110
-		'blocking' => ( $debug_mode ) ? true : false,
110
+		'blocking' => ($debug_mode) ? true : false,
111 111
 		'body'     => $body,
112 112
 	);
113 113
 
114
-	if ( ! empty( $user_agent ) ) {
114
+	if ( ! empty($user_agent)) {
115 115
 		$args['user-agent'] = $user_agent;
116 116
 	}
117 117
 
118
-	$response = wp_remote_post( monsterinsights_get_mp_api_url(), $args );
118
+	$response = wp_remote_post(monsterinsights_get_mp_api_url(), $args);
119 119
 
120 120
 	//
121 121
 	//if ( $debug_mode ) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	return $response;
126 126
 }
127 127
 
128
-function monsterinsights_mp_track_event_call( $args = array() ) {
128
+function monsterinsights_mp_track_event_call($args = array()) {
129 129
 	$default_args = array(
130 130
 		// Change the default type to event
131 131
 		't'  => 'event',
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 		// Optional: Event Value
143 143
 		'ev' => null,
144 144
 	);
145
-	$args  = wp_parse_args( $args, $default_args );
145
+	$args = wp_parse_args($args, $default_args);
146 146
 	//$args = apply_filters( 'monsterinsights_mp_track_event_call', $args );
147 147
 
148
-	return monsterinsights_mp_api_call( $args );
148
+	return monsterinsights_mp_api_call($args);
149 149
 }
150 150
\ No newline at end of file
Please login to merge, or discard this patch.
lite/includes/admin/addons.php 2 patches
Indentation   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -2,172 +2,172 @@
 block discarded – undo
2 2
 
3 3
 // Exit if accessed directly
4 4
 if ( ! defined( 'ABSPATH' ) ) { 
5
-	exit;
5
+  exit;
6 6
 }
7 7
 
8 8
 function monsterinsights_registered_settings_filter( $settings ) {
9
-	$tracking_mode   = monsterinsights_get_option( 'tracking_mode', 'analytics' );
10
-	$events_tracking = monsterinsights_get_option( 'events_mode', 'js' );
11
-
12
-	// both
13
-	if ( ! empty( $settings['engagement']['events_mode'] ) ) {
14
-		if ( $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
15
-			// if we're not using Universal Analytics, we can't do JS events tracking
16
-			unset( $settings['engagement']['events_mode']['options']['js'] );
17
-		} else {
18
-			if ( $tracking_mode !== 'ga' && $events_tracking !== 'php' && ! monsterinsights_is_debug_mode() ) {
19
-			   // if we're not using PHP events tracking, turn it off
20
-				unset( $settings['engagement']['events_mode']['options']['php'] );
21
-			}
22
-		}
23
-	}
24
-	if ( ! empty( $settings['demographics']['demographics'] ) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
25
-		// Events relies on universal tracking
26
-		$url = esc_url( wp_nonce_url( add_query_arg( array( 'monsterinsights-action' => 'switch_to_analyticsjs', 'return' => 'demographics' ) ), 'monsterinsights-switch-to-analyticsjs-nonce' ) );
27
-		$settings['demographics']['demographics']['type'] = 'notice';
28
-		$settings['demographics']['demographics']['desc'] = sprintf( esc_html__( 'Demographics and Interests tracking is only available on Universal Tracking (analytics.js). You\'re currently using deprecated ga.js tracking. We recommend switching to analytics.js, as it is significantly more accurate than ga.js, and allows for additional functionality (like the more accurate Javascript based events tracking we offer). Further Google Analytics has deprecated support for ga.js, and it may stop working at any time when Google decides to disable it from their server. To switch to using the newer Universal Analytics (analytics.js) %1$sclick here%2$s.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
29
-	}
30
-	if ( ! empty( $settings['links']['enhanced_link_attribution'] ) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
31
-		// This relies on universal tracking
32
-		$url = esc_url( wp_nonce_url( add_query_arg( array( 'monsterinsights-action' => 'switch_to_analyticsjs', 'return' => 'demographics' ) ), 'monsterinsights-switch-to-analyticsjs-nonce' ) );
33
-		$settings['links']['enhanced_link_attribution']['type'] = 'notice';
34
-		$settings['links']['enhanced_link_attribution']['desc'] = sprintf( esc_html__( 'Enhanced Link Attribution tracking is only available on Universal Tracking (analytics.js). You\'re currently using deprecated ga.js tracking. We recommend switching to analytics.js, as it is significantly more accurate than ga.js, and allows for additional functionality (like the more accurate Javascript based events tracking we offer). Further Google Analytics has deprecated support for ga.js, and it may stop working at any time when Google decides to disable it from their server. To switch to using the newer Universal Analytics (analytics.js) %1$sclick here%2$s.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
35
-	}
36
-
37
-
38
-	if ( ! empty( $settings['compatibility']['subdomain_tracking'] ) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
39
-		$settings['links']['enhanced_link_attribution']['name'] = __( 'Subdomain tracking:', 'google-analytics-for-wordpress' );
40
-		$settings['links']['enhanced_link_attribution']['desc'] = sprintf( esc_html__( 'This allows you to set the domain that\'s set by %1$s for tracking subdomains. If empty, this will not be set. Can be used to set localhost for ga.js tracking.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory#_gat.GA_Tracker_._setDomainName" target="_blank" rel="noopener noreferrer" referrer="no-referrer"><code>_setDomainName</code></a>' );
41
-	}
42
-
43
-
44
-	// Addons:
45
-		// Social
46
-			$settings['social']['social_notice'] = array( 
47
-				'id' => 'social_notice',
48
-				'no_label' => true,
49
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
50
-				'type' => 'upgrade_notice',
51
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Social tracking to see who's clicking on your social share links, so you can track and maximize your social sharing exposure.", 'google-analytics-for-wordpress' )
52
-			);
53
-
54
-		// Ads
55
-			$settings['ads']['ads_notice'] = array( 
56
-				'id' => 'ads_notice',
57
-				'no_label' => true,
58
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
59
-				'type' => 'upgrade_notice',
60
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Ads tracking to see who's clicking on your Google Ads, so you can increase your revenue.", 'google-analytics-for-wordpress' )
61
-			);
62
-
63
-		// Forms
64
-			$settings['forms']['forms_notice'] = array( 
65
-				'id' => 'forms_notice',
66
-				'no_label' => true,
67
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
68
-				'type' => 'upgrade_notice',
69
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Forms tracking to see who's seeing and submitting your forms, so you can increase your conversion rate.", 'google-analytics-for-wordpress' )
70
-			);
71
-
72
-		// Media
73
-			$settings['media']['media_notice'] = array( 
74
-				'id' => 'media_notice',
75
-				'no_label' => true,
76
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
77
-				'type' => 'upgrade_notice',
78
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Media tracking to see who's interacting with the media on your site, so you know what your users are most interested in on your site. You can use this to tailor future content to meet your audience's interest to promote repeat visitors and expand your average user's time spent visiting your website on each visit.", 'google-analytics-for-wordpress' )
79
-			);
80
-
81
-		// Membership
82
-			$settings['membership']['membership_notice'] = array( 
83
-				'id' => 'membership_notice',
84
-				'no_label' => true,
85
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
86
-				'type' => 'upgrade_notice',
87
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Membership tracking.", 'google-analytics-for-wordpress' )
88
-			);
89
-
90
-			// Dimensions
91
-			$settings['dimensions']['dimensions_notice'] = array( 
92
-				'id' => 'dimensions_notice',
93
-				'no_label' => true,
94
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
95
-				'type' => 'upgrade_notice',
96
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Custom Dimensions and track who's the most popular author on your site, which post types get the most traffic, and more. Why not check it out?", 'google-analytics-for-wordpress' )
97
-			);
98
-
99
-			// Performance
100
-			$settings['performance']['performance_notice'] = array( 
101
-				'id' => 'performance_notice',
102
-				'no_label' => true,
103
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
104
-				'type' => 'upgrade_notice',
105
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can adjust the sample rate so you don't exceed Google Analytics' processing limit. You can also use it to enable Google Optimize for A/B testing and personalization.", 'google-analytics-for-wordpress' )
106
-			);
107
-
108
-			// Reporting
109
-			$settings['reporting']['reporting_notice'] = array( 
110
-				'id' => 'reporting_notice',
111
-				'no_label' => true,
112
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
113
-				'type' => 'upgrade_notice',
114
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable enhanced reporting.", 'google-analytics-for-wordpress' )
115
-			);
116
-
117
-			// Google AMP
118
-			$settings['amp']['amp_notice'] = array( 
119
-				'id' => 'amp_notice',
120
-				'no_label' => true,
121
-				'name' => __( 'Want to use track users visiting your AMP pages?', 'google-analytics-for-wordpress'),
122
-				'type' => 'upgrade_notice',
123
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable AMP page tracking.", 'google-analytics-for-wordpress' )
124
-			);
125
-
126
-			// Google Optimize
127
-			$settings['goptimize']['goptimize_notice'] = array( 
128
-				'id' => 'goptimize_notice',
129
-				'no_label' => true,
130
-				'name' => __( 'Want to use Google Optimize to retarget your website vistors and perform A/B split tests with ease?', 'google-analytics-for-wordpress'),
131
-				'type' => 'upgrade_notice',
132
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable Google Optimize.", 'google-analytics-for-wordpress' )
133
-			);
134
-
135
-			// Facebook Instant Articles
136
-			$settings['fbia']['fbia_notice'] = array( 
137
-				'id' => 'fbia_notice',
138
-				'no_label' => true,
139
-				'name' => __( 'Want to expand your website audience beyond your website with Facebook Instant Articles?', 'google-analytics-for-wordpress'),
140
-				'type' => 'upgrade_notice',
141
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can track your Facebook Instant Article visitors with MonsterInsights.", 'google-analytics-for-wordpress' )
142
-			);
143
-
144
-			// Bounce Reduction
145
-			$settings['bounce']['bounce_notice'] = array( 
146
-				'id' => 'bounce_notice',
147
-				'no_label' => true,
148
-				'name' => __( 'Want to adjust your website bounce rate?', 'google-analytics-for-wordpress'),
149
-				'type' => 'upgrade_notice',
150
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can adjust your Google Analytics bounce rate with MonsterInsights.", 'google-analytics-for-wordpress' )
151
-			);
152
-
153
-			// Notifications
154
-			$settings['notifications']['notifications_notice'] = array( 
155
-				'id' => 'notifications_notice',
156
-				'no_label' => true,
157
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
158
-				'type' => 'upgrade_notice',
159
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable notifications.", 'google-analytics-for-wordpress' )
160
-			);
161
-
162
-			// eCommerce
163
-			$settings['ecommerce']['ecommerce_notice'] = array( 
164
-				'id' => 'ecommerce_notice',
165
-				'no_label' => true,
166
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
167
-				'type' => 'upgrade_notice',
168
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Ecommerce tracking to see who's buying your product, what's the most popular item on your store, the average order value, and tons more.", 'google-analytics-for-wordpress' )
169
-			);
170
-
171
-	return $settings;
9
+  $tracking_mode   = monsterinsights_get_option( 'tracking_mode', 'analytics' );
10
+  $events_tracking = monsterinsights_get_option( 'events_mode', 'js' );
11
+
12
+  // both
13
+  if ( ! empty( $settings['engagement']['events_mode'] ) ) {
14
+    if ( $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
15
+      // if we're not using Universal Analytics, we can't do JS events tracking
16
+      unset( $settings['engagement']['events_mode']['options']['js'] );
17
+    } else {
18
+      if ( $tracking_mode !== 'ga' && $events_tracking !== 'php' && ! monsterinsights_is_debug_mode() ) {
19
+          // if we're not using PHP events tracking, turn it off
20
+        unset( $settings['engagement']['events_mode']['options']['php'] );
21
+      }
22
+    }
23
+  }
24
+  if ( ! empty( $settings['demographics']['demographics'] ) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
25
+    // Events relies on universal tracking
26
+    $url = esc_url( wp_nonce_url( add_query_arg( array( 'monsterinsights-action' => 'switch_to_analyticsjs', 'return' => 'demographics' ) ), 'monsterinsights-switch-to-analyticsjs-nonce' ) );
27
+    $settings['demographics']['demographics']['type'] = 'notice';
28
+    $settings['demographics']['demographics']['desc'] = sprintf( esc_html__( 'Demographics and Interests tracking is only available on Universal Tracking (analytics.js). You\'re currently using deprecated ga.js tracking. We recommend switching to analytics.js, as it is significantly more accurate than ga.js, and allows for additional functionality (like the more accurate Javascript based events tracking we offer). Further Google Analytics has deprecated support for ga.js, and it may stop working at any time when Google decides to disable it from their server. To switch to using the newer Universal Analytics (analytics.js) %1$sclick here%2$s.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
29
+  }
30
+  if ( ! empty( $settings['links']['enhanced_link_attribution'] ) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
31
+    // This relies on universal tracking
32
+    $url = esc_url( wp_nonce_url( add_query_arg( array( 'monsterinsights-action' => 'switch_to_analyticsjs', 'return' => 'demographics' ) ), 'monsterinsights-switch-to-analyticsjs-nonce' ) );
33
+    $settings['links']['enhanced_link_attribution']['type'] = 'notice';
34
+    $settings['links']['enhanced_link_attribution']['desc'] = sprintf( esc_html__( 'Enhanced Link Attribution tracking is only available on Universal Tracking (analytics.js). You\'re currently using deprecated ga.js tracking. We recommend switching to analytics.js, as it is significantly more accurate than ga.js, and allows for additional functionality (like the more accurate Javascript based events tracking we offer). Further Google Analytics has deprecated support for ga.js, and it may stop working at any time when Google decides to disable it from their server. To switch to using the newer Universal Analytics (analytics.js) %1$sclick here%2$s.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
35
+  }
36
+
37
+
38
+  if ( ! empty( $settings['compatibility']['subdomain_tracking'] ) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
39
+    $settings['links']['enhanced_link_attribution']['name'] = __( 'Subdomain tracking:', 'google-analytics-for-wordpress' );
40
+    $settings['links']['enhanced_link_attribution']['desc'] = sprintf( esc_html__( 'This allows you to set the domain that\'s set by %1$s for tracking subdomains. If empty, this will not be set. Can be used to set localhost for ga.js tracking.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory#_gat.GA_Tracker_._setDomainName" target="_blank" rel="noopener noreferrer" referrer="no-referrer"><code>_setDomainName</code></a>' );
41
+  }
42
+
43
+
44
+  // Addons:
45
+    // Social
46
+      $settings['social']['social_notice'] = array( 
47
+        'id' => 'social_notice',
48
+        'no_label' => true,
49
+        'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
50
+        'type' => 'upgrade_notice',
51
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Social tracking to see who's clicking on your social share links, so you can track and maximize your social sharing exposure.", 'google-analytics-for-wordpress' )
52
+      );
53
+
54
+    // Ads
55
+      $settings['ads']['ads_notice'] = array( 
56
+        'id' => 'ads_notice',
57
+        'no_label' => true,
58
+        'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
59
+        'type' => 'upgrade_notice',
60
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Ads tracking to see who's clicking on your Google Ads, so you can increase your revenue.", 'google-analytics-for-wordpress' )
61
+      );
62
+
63
+    // Forms
64
+      $settings['forms']['forms_notice'] = array( 
65
+        'id' => 'forms_notice',
66
+        'no_label' => true,
67
+        'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
68
+        'type' => 'upgrade_notice',
69
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Forms tracking to see who's seeing and submitting your forms, so you can increase your conversion rate.", 'google-analytics-for-wordpress' )
70
+      );
71
+
72
+    // Media
73
+      $settings['media']['media_notice'] = array( 
74
+        'id' => 'media_notice',
75
+        'no_label' => true,
76
+        'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
77
+        'type' => 'upgrade_notice',
78
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Media tracking to see who's interacting with the media on your site, so you know what your users are most interested in on your site. You can use this to tailor future content to meet your audience's interest to promote repeat visitors and expand your average user's time spent visiting your website on each visit.", 'google-analytics-for-wordpress' )
79
+      );
80
+
81
+    // Membership
82
+      $settings['membership']['membership_notice'] = array( 
83
+        'id' => 'membership_notice',
84
+        'no_label' => true,
85
+        'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
86
+        'type' => 'upgrade_notice',
87
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Membership tracking.", 'google-analytics-for-wordpress' )
88
+      );
89
+
90
+      // Dimensions
91
+      $settings['dimensions']['dimensions_notice'] = array( 
92
+        'id' => 'dimensions_notice',
93
+        'no_label' => true,
94
+        'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
95
+        'type' => 'upgrade_notice',
96
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Custom Dimensions and track who's the most popular author on your site, which post types get the most traffic, and more. Why not check it out?", 'google-analytics-for-wordpress' )
97
+      );
98
+
99
+      // Performance
100
+      $settings['performance']['performance_notice'] = array( 
101
+        'id' => 'performance_notice',
102
+        'no_label' => true,
103
+        'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
104
+        'type' => 'upgrade_notice',
105
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can adjust the sample rate so you don't exceed Google Analytics' processing limit. You can also use it to enable Google Optimize for A/B testing and personalization.", 'google-analytics-for-wordpress' )
106
+      );
107
+
108
+      // Reporting
109
+      $settings['reporting']['reporting_notice'] = array( 
110
+        'id' => 'reporting_notice',
111
+        'no_label' => true,
112
+        'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
113
+        'type' => 'upgrade_notice',
114
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable enhanced reporting.", 'google-analytics-for-wordpress' )
115
+      );
116
+
117
+      // Google AMP
118
+      $settings['amp']['amp_notice'] = array( 
119
+        'id' => 'amp_notice',
120
+        'no_label' => true,
121
+        'name' => __( 'Want to use track users visiting your AMP pages?', 'google-analytics-for-wordpress'),
122
+        'type' => 'upgrade_notice',
123
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable AMP page tracking.", 'google-analytics-for-wordpress' )
124
+      );
125
+
126
+      // Google Optimize
127
+      $settings['goptimize']['goptimize_notice'] = array( 
128
+        'id' => 'goptimize_notice',
129
+        'no_label' => true,
130
+        'name' => __( 'Want to use Google Optimize to retarget your website vistors and perform A/B split tests with ease?', 'google-analytics-for-wordpress'),
131
+        'type' => 'upgrade_notice',
132
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable Google Optimize.", 'google-analytics-for-wordpress' )
133
+      );
134
+
135
+      // Facebook Instant Articles
136
+      $settings['fbia']['fbia_notice'] = array( 
137
+        'id' => 'fbia_notice',
138
+        'no_label' => true,
139
+        'name' => __( 'Want to expand your website audience beyond your website with Facebook Instant Articles?', 'google-analytics-for-wordpress'),
140
+        'type' => 'upgrade_notice',
141
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can track your Facebook Instant Article visitors with MonsterInsights.", 'google-analytics-for-wordpress' )
142
+      );
143
+
144
+      // Bounce Reduction
145
+      $settings['bounce']['bounce_notice'] = array( 
146
+        'id' => 'bounce_notice',
147
+        'no_label' => true,
148
+        'name' => __( 'Want to adjust your website bounce rate?', 'google-analytics-for-wordpress'),
149
+        'type' => 'upgrade_notice',
150
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can adjust your Google Analytics bounce rate with MonsterInsights.", 'google-analytics-for-wordpress' )
151
+      );
152
+
153
+      // Notifications
154
+      $settings['notifications']['notifications_notice'] = array( 
155
+        'id' => 'notifications_notice',
156
+        'no_label' => true,
157
+        'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
158
+        'type' => 'upgrade_notice',
159
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable notifications.", 'google-analytics-for-wordpress' )
160
+      );
161
+
162
+      // eCommerce
163
+      $settings['ecommerce']['ecommerce_notice'] = array( 
164
+        'id' => 'ecommerce_notice',
165
+        'no_label' => true,
166
+        'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
167
+        'type' => 'upgrade_notice',
168
+        'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Ecommerce tracking to see who's buying your product, what's the most popular item on your store, the average order value, and tons more.", 'google-analytics-for-wordpress' )
169
+      );
170
+
171
+  return $settings;
172 172
 }
173 173
 add_filter( 'monsterinsights_registered_settings', 'monsterinsights_registered_settings_filter' );
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -1,43 +1,43 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Exit if accessed directly
4
-if ( ! defined( 'ABSPATH' ) ) { 
4
+if ( ! defined('ABSPATH')) { 
5 5
 	exit;
6 6
 }
7 7
 
8
-function monsterinsights_registered_settings_filter( $settings ) {
9
-	$tracking_mode   = monsterinsights_get_option( 'tracking_mode', 'analytics' );
10
-	$events_tracking = monsterinsights_get_option( 'events_mode', 'js' );
8
+function monsterinsights_registered_settings_filter($settings) {
9
+	$tracking_mode   = monsterinsights_get_option('tracking_mode', 'analytics');
10
+	$events_tracking = monsterinsights_get_option('events_mode', 'js');
11 11
 
12 12
 	// both
13
-	if ( ! empty( $settings['engagement']['events_mode'] ) ) {
14
-		if ( $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
13
+	if ( ! empty($settings['engagement']['events_mode'])) {
14
+		if ($tracking_mode === 'ga' && ! monsterinsights_is_debug_mode()) {
15 15
 			// if we're not using Universal Analytics, we can't do JS events tracking
16
-			unset( $settings['engagement']['events_mode']['options']['js'] );
16
+			unset($settings['engagement']['events_mode']['options']['js']);
17 17
 		} else {
18
-			if ( $tracking_mode !== 'ga' && $events_tracking !== 'php' && ! monsterinsights_is_debug_mode() ) {
18
+			if ($tracking_mode !== 'ga' && $events_tracking !== 'php' && ! monsterinsights_is_debug_mode()) {
19 19
 			   // if we're not using PHP events tracking, turn it off
20
-				unset( $settings['engagement']['events_mode']['options']['php'] );
20
+				unset($settings['engagement']['events_mode']['options']['php']);
21 21
 			}
22 22
 		}
23 23
 	}
24
-	if ( ! empty( $settings['demographics']['demographics'] ) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
24
+	if ( ! empty($settings['demographics']['demographics']) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode()) {
25 25
 		// Events relies on universal tracking
26
-		$url = esc_url( wp_nonce_url( add_query_arg( array( 'monsterinsights-action' => 'switch_to_analyticsjs', 'return' => 'demographics' ) ), 'monsterinsights-switch-to-analyticsjs-nonce' ) );
26
+		$url = esc_url(wp_nonce_url(add_query_arg(array('monsterinsights-action' => 'switch_to_analyticsjs', 'return' => 'demographics')), 'monsterinsights-switch-to-analyticsjs-nonce'));
27 27
 		$settings['demographics']['demographics']['type'] = 'notice';
28
-		$settings['demographics']['demographics']['desc'] = sprintf( esc_html__( 'Demographics and Interests tracking is only available on Universal Tracking (analytics.js). You\'re currently using deprecated ga.js tracking. We recommend switching to analytics.js, as it is significantly more accurate than ga.js, and allows for additional functionality (like the more accurate Javascript based events tracking we offer). Further Google Analytics has deprecated support for ga.js, and it may stop working at any time when Google decides to disable it from their server. To switch to using the newer Universal Analytics (analytics.js) %1$sclick here%2$s.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
28
+		$settings['demographics']['demographics']['desc'] = sprintf(esc_html__('Demographics and Interests tracking is only available on Universal Tracking (analytics.js). You\'re currently using deprecated ga.js tracking. We recommend switching to analytics.js, as it is significantly more accurate than ga.js, and allows for additional functionality (like the more accurate Javascript based events tracking we offer). Further Google Analytics has deprecated support for ga.js, and it may stop working at any time when Google decides to disable it from their server. To switch to using the newer Universal Analytics (analytics.js) %1$sclick here%2$s.', 'google-analytics-for-wordpress'), '<a href="' . $url . '">', '</a>');
29 29
 	}
30
-	if ( ! empty( $settings['links']['enhanced_link_attribution'] ) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
30
+	if ( ! empty($settings['links']['enhanced_link_attribution']) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode()) {
31 31
 		// This relies on universal tracking
32
-		$url = esc_url( wp_nonce_url( add_query_arg( array( 'monsterinsights-action' => 'switch_to_analyticsjs', 'return' => 'demographics' ) ), 'monsterinsights-switch-to-analyticsjs-nonce' ) );
32
+		$url = esc_url(wp_nonce_url(add_query_arg(array('monsterinsights-action' => 'switch_to_analyticsjs', 'return' => 'demographics')), 'monsterinsights-switch-to-analyticsjs-nonce'));
33 33
 		$settings['links']['enhanced_link_attribution']['type'] = 'notice';
34
-		$settings['links']['enhanced_link_attribution']['desc'] = sprintf( esc_html__( 'Enhanced Link Attribution tracking is only available on Universal Tracking (analytics.js). You\'re currently using deprecated ga.js tracking. We recommend switching to analytics.js, as it is significantly more accurate than ga.js, and allows for additional functionality (like the more accurate Javascript based events tracking we offer). Further Google Analytics has deprecated support for ga.js, and it may stop working at any time when Google decides to disable it from their server. To switch to using the newer Universal Analytics (analytics.js) %1$sclick here%2$s.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
34
+		$settings['links']['enhanced_link_attribution']['desc'] = sprintf(esc_html__('Enhanced Link Attribution tracking is only available on Universal Tracking (analytics.js). You\'re currently using deprecated ga.js tracking. We recommend switching to analytics.js, as it is significantly more accurate than ga.js, and allows for additional functionality (like the more accurate Javascript based events tracking we offer). Further Google Analytics has deprecated support for ga.js, and it may stop working at any time when Google decides to disable it from their server. To switch to using the newer Universal Analytics (analytics.js) %1$sclick here%2$s.', 'google-analytics-for-wordpress'), '<a href="' . $url . '">', '</a>');
35 35
 	}
36 36
 
37 37
 
38
-	if ( ! empty( $settings['compatibility']['subdomain_tracking'] ) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode() ) {
39
-		$settings['links']['enhanced_link_attribution']['name'] = __( 'Subdomain tracking:', 'google-analytics-for-wordpress' );
40
-		$settings['links']['enhanced_link_attribution']['desc'] = sprintf( esc_html__( 'This allows you to set the domain that\'s set by %1$s for tracking subdomains. If empty, this will not be set. Can be used to set localhost for ga.js tracking.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory#_gat.GA_Tracker_._setDomainName" target="_blank" rel="noopener noreferrer" referrer="no-referrer"><code>_setDomainName</code></a>' );
38
+	if ( ! empty($settings['compatibility']['subdomain_tracking']) && $tracking_mode === 'ga' && ! monsterinsights_is_debug_mode()) {
39
+		$settings['links']['enhanced_link_attribution']['name'] = __('Subdomain tracking:', 'google-analytics-for-wordpress');
40
+		$settings['links']['enhanced_link_attribution']['desc'] = sprintf(esc_html__('This allows you to set the domain that\'s set by %1$s for tracking subdomains. If empty, this will not be set. Can be used to set localhost for ga.js tracking.', 'google-analytics-for-wordpress'), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory#_gat.GA_Tracker_._setDomainName" target="_blank" rel="noopener noreferrer" referrer="no-referrer"><code>_setDomainName</code></a>');
41 41
 	}
42 42
 
43 43
 
@@ -46,128 +46,128 @@  discard block
 block discarded – undo
46 46
 			$settings['social']['social_notice'] = array( 
47 47
 				'id' => 'social_notice',
48 48
 				'no_label' => true,
49
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
49
+				'name' => __('Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
50 50
 				'type' => 'upgrade_notice',
51
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Social tracking to see who's clicking on your social share links, so you can track and maximize your social sharing exposure.", 'google-analytics-for-wordpress' )
51
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can add Social tracking to see who's clicking on your social share links, so you can track and maximize your social sharing exposure.", 'google-analytics-for-wordpress')
52 52
 			);
53 53
 
54 54
 		// Ads
55 55
 			$settings['ads']['ads_notice'] = array( 
56 56
 				'id' => 'ads_notice',
57 57
 				'no_label' => true,
58
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
58
+				'name' => __('Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
59 59
 				'type' => 'upgrade_notice',
60
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Ads tracking to see who's clicking on your Google Ads, so you can increase your revenue.", 'google-analytics-for-wordpress' )
60
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can add Ads tracking to see who's clicking on your Google Ads, so you can increase your revenue.", 'google-analytics-for-wordpress')
61 61
 			);
62 62
 
63 63
 		// Forms
64 64
 			$settings['forms']['forms_notice'] = array( 
65 65
 				'id' => 'forms_notice',
66 66
 				'no_label' => true,
67
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
67
+				'name' => __('Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
68 68
 				'type' => 'upgrade_notice',
69
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Forms tracking to see who's seeing and submitting your forms, so you can increase your conversion rate.", 'google-analytics-for-wordpress' )
69
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can add Forms tracking to see who's seeing and submitting your forms, so you can increase your conversion rate.", 'google-analytics-for-wordpress')
70 70
 			);
71 71
 
72 72
 		// Media
73 73
 			$settings['media']['media_notice'] = array( 
74 74
 				'id' => 'media_notice',
75 75
 				'no_label' => true,
76
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
76
+				'name' => __('Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
77 77
 				'type' => 'upgrade_notice',
78
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Media tracking to see who's interacting with the media on your site, so you know what your users are most interested in on your site. You can use this to tailor future content to meet your audience's interest to promote repeat visitors and expand your average user's time spent visiting your website on each visit.", 'google-analytics-for-wordpress' )
78
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can add Media tracking to see who's interacting with the media on your site, so you know what your users are most interested in on your site. You can use this to tailor future content to meet your audience's interest to promote repeat visitors and expand your average user's time spent visiting your website on each visit.", 'google-analytics-for-wordpress')
79 79
 			);
80 80
 
81 81
 		// Membership
82 82
 			$settings['membership']['membership_notice'] = array( 
83 83
 				'id' => 'membership_notice',
84 84
 				'no_label' => true,
85
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
85
+				'name' => __('Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
86 86
 				'type' => 'upgrade_notice',
87
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Membership tracking.", 'google-analytics-for-wordpress' )
87
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can add Membership tracking.", 'google-analytics-for-wordpress')
88 88
 			);
89 89
 
90 90
 			// Dimensions
91 91
 			$settings['dimensions']['dimensions_notice'] = array( 
92 92
 				'id' => 'dimensions_notice',
93 93
 				'no_label' => true,
94
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
94
+				'name' => __('Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
95 95
 				'type' => 'upgrade_notice',
96
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Custom Dimensions and track who's the most popular author on your site, which post types get the most traffic, and more. Why not check it out?", 'google-analytics-for-wordpress' )
96
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can add Custom Dimensions and track who's the most popular author on your site, which post types get the most traffic, and more. Why not check it out?", 'google-analytics-for-wordpress')
97 97
 			);
98 98
 
99 99
 			// Performance
100 100
 			$settings['performance']['performance_notice'] = array( 
101 101
 				'id' => 'performance_notice',
102 102
 				'no_label' => true,
103
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
103
+				'name' => __('Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
104 104
 				'type' => 'upgrade_notice',
105
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can adjust the sample rate so you don't exceed Google Analytics' processing limit. You can also use it to enable Google Optimize for A/B testing and personalization.", 'google-analytics-for-wordpress' )
105
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can adjust the sample rate so you don't exceed Google Analytics' processing limit. You can also use it to enable Google Optimize for A/B testing and personalization.", 'google-analytics-for-wordpress')
106 106
 			);
107 107
 
108 108
 			// Reporting
109 109
 			$settings['reporting']['reporting_notice'] = array( 
110 110
 				'id' => 'reporting_notice',
111 111
 				'no_label' => true,
112
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
112
+				'name' => __('Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
113 113
 				'type' => 'upgrade_notice',
114
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable enhanced reporting.", 'google-analytics-for-wordpress' )
114
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can enable enhanced reporting.", 'google-analytics-for-wordpress')
115 115
 			);
116 116
 
117 117
 			// Google AMP
118 118
 			$settings['amp']['amp_notice'] = array( 
119 119
 				'id' => 'amp_notice',
120 120
 				'no_label' => true,
121
-				'name' => __( 'Want to use track users visiting your AMP pages?', 'google-analytics-for-wordpress'),
121
+				'name' => __('Want to use track users visiting your AMP pages?', 'google-analytics-for-wordpress'),
122 122
 				'type' => 'upgrade_notice',
123
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable AMP page tracking.", 'google-analytics-for-wordpress' )
123
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can enable AMP page tracking.", 'google-analytics-for-wordpress')
124 124
 			);
125 125
 
126 126
 			// Google Optimize
127 127
 			$settings['goptimize']['goptimize_notice'] = array( 
128 128
 				'id' => 'goptimize_notice',
129 129
 				'no_label' => true,
130
-				'name' => __( 'Want to use Google Optimize to retarget your website vistors and perform A/B split tests with ease?', 'google-analytics-for-wordpress'),
130
+				'name' => __('Want to use Google Optimize to retarget your website vistors and perform A/B split tests with ease?', 'google-analytics-for-wordpress'),
131 131
 				'type' => 'upgrade_notice',
132
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable Google Optimize.", 'google-analytics-for-wordpress' )
132
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can enable Google Optimize.", 'google-analytics-for-wordpress')
133 133
 			);
134 134
 
135 135
 			// Facebook Instant Articles
136 136
 			$settings['fbia']['fbia_notice'] = array( 
137 137
 				'id' => 'fbia_notice',
138 138
 				'no_label' => true,
139
-				'name' => __( 'Want to expand your website audience beyond your website with Facebook Instant Articles?', 'google-analytics-for-wordpress'),
139
+				'name' => __('Want to expand your website audience beyond your website with Facebook Instant Articles?', 'google-analytics-for-wordpress'),
140 140
 				'type' => 'upgrade_notice',
141
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can track your Facebook Instant Article visitors with MonsterInsights.", 'google-analytics-for-wordpress' )
141
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can track your Facebook Instant Article visitors with MonsterInsights.", 'google-analytics-for-wordpress')
142 142
 			);
143 143
 
144 144
 			// Bounce Reduction
145 145
 			$settings['bounce']['bounce_notice'] = array( 
146 146
 				'id' => 'bounce_notice',
147 147
 				'no_label' => true,
148
-				'name' => __( 'Want to adjust your website bounce rate?', 'google-analytics-for-wordpress'),
148
+				'name' => __('Want to adjust your website bounce rate?', 'google-analytics-for-wordpress'),
149 149
 				'type' => 'upgrade_notice',
150
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can adjust your Google Analytics bounce rate with MonsterInsights.", 'google-analytics-for-wordpress' )
150
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can adjust your Google Analytics bounce rate with MonsterInsights.", 'google-analytics-for-wordpress')
151 151
 			);
152 152
 
153 153
 			// Notifications
154 154
 			$settings['notifications']['notifications_notice'] = array( 
155 155
 				'id' => 'notifications_notice',
156 156
 				'no_label' => true,
157
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
157
+				'name' => __('Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
158 158
 				'type' => 'upgrade_notice',
159
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable notifications.", 'google-analytics-for-wordpress' )
159
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can enable notifications.", 'google-analytics-for-wordpress')
160 160
 			);
161 161
 
162 162
 			// eCommerce
163 163
 			$settings['ecommerce']['ecommerce_notice'] = array( 
164 164
 				'id' => 'ecommerce_notice',
165 165
 				'no_label' => true,
166
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
166
+				'name' => __('Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
167 167
 				'type' => 'upgrade_notice',
168
-				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Ecommerce tracking to see who's buying your product, what's the most popular item on your store, the average order value, and tons more.", 'google-analytics-for-wordpress' )
168
+				'desc' => esc_html__("By upgrading to MonsterInsights Pro, you can add Ecommerce tracking to see who's buying your product, what's the most popular item on your store, the average order value, and tons more.", 'google-analytics-for-wordpress')
169 169
 			);
170 170
 
171 171
 	return $settings;
172 172
 }
173
-add_filter( 'monsterinsights_registered_settings', 'monsterinsights_registered_settings_filter' );
173
+add_filter('monsterinsights_registered_settings', 'monsterinsights_registered_settings_filter');
Please login to merge, or discard this patch.
lite/includes/admin/tools.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly
3 3
 if ( ! defined( 'ABSPATH' ) ) {
4
-	exit;
4
+  exit;
5 5
 }
6 6
 
7 7
 function monsterinsights_tools_url_builder() {
8
-	ob_start();?>
8
+  ob_start();?>
9 9
 	<div class="monsterinsights-upsell-under-box">
10 10
 		<h2><?php esc_html_e( "Want even more fine tuned control over your website analytics?", 'google-analytics-for-wordpress' ); ?></h2>
11 11
 		<p class="monsterinsights-upsell-lite-text"><?php esc_html_e( "By upgrading to MonsterInsights Pro, you can unlock the MonsterInsights URL builder that helps you better track your advertising and email marketing campaigns.", 'google-analytics-for-wordpress' ); ?></p>
12 12
 		<p><a href="<?php echo monsterinsights_get_upgrade_link(); ?>" class="button button-primary"><?php esc_html_e( "Click here to Upgrade", 'google-analytics-for-wordpress' ); ?></a></p>
13 13
 	</div>
14 14
 	<?php
15
-	echo ob_get_clean();
15
+  echo ob_get_clean();
16 16
 }
17 17
 add_action( 'monsterinsights_tools_url_builder_tab', 'monsterinsights_tools_url_builder' );
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if ( ! defined('ABSPATH')) {
4 4
 	exit;
5 5
 }
6 6
 
7 7
 function monsterinsights_tools_url_builder() {
8
-	ob_start();?>
8
+	ob_start(); ?>
9 9
 	<div class="monsterinsights-upsell-under-box">
10
-		<h2><?php esc_html_e( "Want even more fine tuned control over your website analytics?", 'google-analytics-for-wordpress' ); ?></h2>
11
-		<p class="monsterinsights-upsell-lite-text"><?php esc_html_e( "By upgrading to MonsterInsights Pro, you can unlock the MonsterInsights URL builder that helps you better track your advertising and email marketing campaigns.", 'google-analytics-for-wordpress' ); ?></p>
12
-		<p><a href="<?php echo monsterinsights_get_upgrade_link(); ?>" class="button button-primary"><?php esc_html_e( "Click here to Upgrade", 'google-analytics-for-wordpress' ); ?></a></p>
10
+		<h2><?php esc_html_e("Want even more fine tuned control over your website analytics?", 'google-analytics-for-wordpress'); ?></h2>
11
+		<p class="monsterinsights-upsell-lite-text"><?php esc_html_e("By upgrading to MonsterInsights Pro, you can unlock the MonsterInsights URL builder that helps you better track your advertising and email marketing campaigns.", 'google-analytics-for-wordpress'); ?></p>
12
+		<p><a href="<?php echo monsterinsights_get_upgrade_link(); ?>" class="button button-primary"><?php esc_html_e("Click here to Upgrade", 'google-analytics-for-wordpress'); ?></a></p>
13 13
 	</div>
14 14
 	<?php
15 15
 	echo ob_get_clean();
16 16
 }
17
-add_action( 'monsterinsights_tools_url_builder_tab', 'monsterinsights_tools_url_builder' );
18 17
\ No newline at end of file
18
+add_action('monsterinsights_tools_url_builder_tab', 'monsterinsights_tools_url_builder');
19 19
\ No newline at end of file
Please login to merge, or discard this patch.
lite/includes/admin/tab-support.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) exit;
13
+if ( ! defined('ABSPATH')) exit;
14 14
 
15 15
 /**
16 16
  * Callback for displaying the UI for support tab.
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     <div id="monsterinsights-settings-general">
26 26
         <?php 
27 27
         // Output any notices now
28
-        do_action( 'monsterinsights_settings_support_tab_notice' );
28
+        do_action('monsterinsights_settings_support_tab_notice');
29 29
         ?>
30 30
         <?php //Status page coming soon. ?>
31 31
         <!-- <hr /> -->
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) exit;
13
+if ( ! defined( 'ABSPATH' ) ) {
14
+  exit;
15
+}
14 16
 
15 17
 /**
16 18
  * Callback for displaying the UI for support tab.
Please login to merge, or discard this patch.
lite/includes/admin/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1 1
 <?php
2 2
 //Nothing to see here
3 3
 
4
-header( 'HTTP/1.0 403 Forbidden' );
5 4
\ No newline at end of file
5
+header('HTTP/1.0 403 Forbidden');
6 6
\ No newline at end of file
Please login to merge, or discard this patch.
lite/includes/install.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 // Exit if accessed directly
13 13
 if ( ! defined( 'ABSPATH' ) ) { 
14
-	exit;
14
+  exit;
15 15
 }
16 16
 
17 17
 // @todo: Add defaults for new installs
@@ -23,22 +23,22 @@  discard block
 block discarded – undo
23 23
 //do_action( 'monsterinsights_after_install_routine', $version );
24 24
 
25 25
 function monsterinsights_lite_upgrade_from_yoast( $key, $network ) {
26
-	if ( $network ) {
27
-		$option                = array();
28
-		$option['key']         = $key;
29
-		$option['type']        = '';
30
-		$option['is_expired']  = false;
31
-		$option['is_disabled'] = false;
32
-		$option['is_invalid']  = false;
33
-		update_site_option( 'monsterinsights_license', $option );
34
-	} else {
35
-		$option                = array();
36
-		$option['key']         = $key;
37
-		$option['type']        = '';
38
-		$option['is_expired']  = false;
39
-		$option['is_disabled'] = false;
40
-		$option['is_invalid']  = false;
41
-		update_option( 'monsterinsights_license', $option );        
42
-	}
26
+  if ( $network ) {
27
+    $option                = array();
28
+    $option['key']         = $key;
29
+    $option['type']        = '';
30
+    $option['is_expired']  = false;
31
+    $option['is_disabled'] = false;
32
+    $option['is_invalid']  = false;
33
+    update_site_option( 'monsterinsights_license', $option );
34
+  } else {
35
+    $option                = array();
36
+    $option['key']         = $key;
37
+    $option['type']        = '';
38
+    $option['is_expired']  = false;
39
+    $option['is_disabled'] = false;
40
+    $option['is_invalid']  = false;
41
+    update_option( 'monsterinsights_license', $option );        
42
+  }
43 43
 }
44 44
 add_action( 'monsterinsights_upgrade_from_yoast', 'monsterinsights_lite_upgrade_from_yoast', 10, 2 );
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) { 
13
+if ( ! defined('ABSPATH')) { 
14 14
 	exit;
15 15
 }
16 16
 
@@ -22,15 +22,15 @@  discard block
 block discarded – undo
22 22
 // Add default 
23 23
 //do_action( 'monsterinsights_after_install_routine', $version );
24 24
 
25
-function monsterinsights_lite_upgrade_from_yoast( $key, $network ) {
26
-	if ( $network ) {
25
+function monsterinsights_lite_upgrade_from_yoast($key, $network) {
26
+	if ($network) {
27 27
 		$option                = array();
28 28
 		$option['key']         = $key;
29 29
 		$option['type']        = '';
30 30
 		$option['is_expired']  = false;
31 31
 		$option['is_disabled'] = false;
32 32
 		$option['is_invalid']  = false;
33
-		update_site_option( 'monsterinsights_license', $option );
33
+		update_site_option('monsterinsights_license', $option);
34 34
 	} else {
35 35
 		$option                = array();
36 36
 		$option['key']         = $key;
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		$option['is_expired']  = false;
39 39
 		$option['is_disabled'] = false;
40 40
 		$option['is_invalid']  = false;
41
-		update_option( 'monsterinsights_license', $option );        
41
+		update_option('monsterinsights_license', $option);        
42 42
 	}
43 43
 }
44
-add_action( 'monsterinsights_upgrade_from_yoast', 'monsterinsights_lite_upgrade_from_yoast', 10, 2 );
44
+add_action('monsterinsights_upgrade_from_yoast', 'monsterinsights_lite_upgrade_from_yoast', 10, 2);
Please login to merge, or discard this patch.
lite/includes/google.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,49 +1,49 @@
 block discarded – undo
1 1
 <?php
2 2
 function monsterinsights_google_app_config() {
3
-	// We'll go ahead and ask for these permissions on new installs
4
-	$scopes = array( 
5
-		'https://www.googleapis.com/auth/analytics.readonly',
6
-		'https://www.googleapis.com/auth/analytics',
7
-	//	'https://www.googleapis.com/auth/analytics.manage.users',
8
-	//	'https://www.googleapis.com/auth/tagmanager.readonly',
9
-	//	'https://www.googleapis.com/auth/webmasters.readonly'
10
-	);
11
-	$config = array(
12
-		'application_name' => 'Google Analytics by MonsterInsights',
13
-		'client_id'        => '346753076522-21smrc6aq0hq8oij8001s57dfoo8igf5.apps.googleusercontent.com',
14
-		'client_secret'    => '5oWaEGFgp-bSrY6vWBmdPfIF',
15
-		'redirect_uri'     => 'urn:ietf:wg:oauth:2.0:oob',
16
-		'scopes'           => $scopes,
17
-	);
3
+  // We'll go ahead and ask for these permissions on new installs
4
+  $scopes = array( 
5
+    'https://www.googleapis.com/auth/analytics.readonly',
6
+    'https://www.googleapis.com/auth/analytics',
7
+  //	'https://www.googleapis.com/auth/analytics.manage.users',
8
+  //	'https://www.googleapis.com/auth/tagmanager.readonly',
9
+  //	'https://www.googleapis.com/auth/webmasters.readonly'
10
+  );
11
+  $config = array(
12
+    'application_name' => 'Google Analytics by MonsterInsights',
13
+    'client_id'        => '346753076522-21smrc6aq0hq8oij8001s57dfoo8igf5.apps.googleusercontent.com',
14
+    'client_secret'    => '5oWaEGFgp-bSrY6vWBmdPfIF',
15
+    'redirect_uri'     => 'urn:ietf:wg:oauth:2.0:oob',
16
+    'scopes'           => $scopes,
17
+  );
18 18
 
19
-	$config = apply_filters( 'monsterinsights_lite_google_app_config', $config );
20
-	$config['scopes'] = $scopes; // Scopes requested are not changeable to minimize breakage.
21
-	return $config;
19
+  $config = apply_filters( 'monsterinsights_lite_google_app_config', $config );
20
+  $config['scopes'] = $scopes; // Scopes requested are not changeable to minimize breakage.
21
+  return $config;
22 22
 }
23 23
 
24 24
 function monsterinsights_create_client() {
25
-	require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/src/Google/autoload.php';
26
-	require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/class-ga-client.php';
27
-	$config = monsterinsights_google_app_config();
28
-	$client = new MonsterInsights_GA_Client( $config, 'lite' );
29
-	return $client;
25
+  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/src/Google/autoload.php';
26
+  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/class-ga-client.php';
27
+  $config = monsterinsights_google_app_config();
28
+  $client = new MonsterInsights_GA_Client( $config, 'lite' );
29
+  return $client;
30 30
 }
31 31
 
32 32
 function monsterinsights_create_test_client() {
33
-	require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/src/Google/autoload.php';
34
-	require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/class-ga-client.php';
35
-	$config = monsterinsights_google_app_config();
36
-	$client = new MonsterInsights_GA_Client( $config, 'test_lite' );
37
-	return $client;
33
+  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/src/Google/autoload.php';
34
+  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/class-ga-client.php';
35
+  $config = monsterinsights_google_app_config();
36
+  $client = new MonsterInsights_GA_Client( $config, 'test_lite' );
37
+  return $client;
38 38
 }
39 39
 
40 40
 function monsterinsights_set_client_oauth_version(){
41
-	monsterinsights_update_option( 'oauth_version', '1.0' );
41
+  monsterinsights_update_option( 'oauth_version', '1.0' );
42 42
 }
43 43
 
44 44
 function monsterinsights_get_report_date_range() {
45
-	return array(
46
-		'start' => date( 'Y-m-d', strtotime( '-1 month' ) ),
47
-		'end'   => date( 'Y-m-d', strtotime( 'yesterday' ) ),
48
-	);
45
+  return array(
46
+    'start' => date( 'Y-m-d', strtotime( '-1 month' ) ),
47
+    'end'   => date( 'Y-m-d', strtotime( 'yesterday' ) ),
48
+  );
49 49
 }
50 50
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 		'scopes'           => $scopes,
17 17
 	);
18 18
 
19
-	$config = apply_filters( 'monsterinsights_lite_google_app_config', $config );
19
+	$config = apply_filters('monsterinsights_lite_google_app_config', $config);
20 20
 	$config['scopes'] = $scopes; // Scopes requested are not changeable to minimize breakage.
21 21
 	return $config;
22 22
 }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/src/Google/autoload.php';
26 26
 	require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/class-ga-client.php';
27 27
 	$config = monsterinsights_google_app_config();
28
-	$client = new MonsterInsights_GA_Client( $config, 'lite' );
28
+	$client = new MonsterInsights_GA_Client($config, 'lite');
29 29
 	return $client;
30 30
 }
31 31
 
@@ -33,17 +33,17 @@  discard block
 block discarded – undo
33 33
 	require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/src/Google/autoload.php';
34 34
 	require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/google/class-ga-client.php';
35 35
 	$config = monsterinsights_google_app_config();
36
-	$client = new MonsterInsights_GA_Client( $config, 'test_lite' );
36
+	$client = new MonsterInsights_GA_Client($config, 'test_lite');
37 37
 	return $client;
38 38
 }
39 39
 
40
-function monsterinsights_set_client_oauth_version(){
41
-	monsterinsights_update_option( 'oauth_version', '1.0' );
40
+function monsterinsights_set_client_oauth_version() {
41
+	monsterinsights_update_option('oauth_version', '1.0');
42 42
 }
43 43
 
44 44
 function monsterinsights_get_report_date_range() {
45 45
 	return array(
46
-		'start' => date( 'Y-m-d', strtotime( '-1 month' ) ),
47
-		'end'   => date( 'Y-m-d', strtotime( 'yesterday' ) ),
46
+		'start' => date('Y-m-d', strtotime('-1 month')),
47
+		'end'   => date('Y-m-d', strtotime('yesterday')),
48 48
 	);
49 49
 }
50 50
\ No newline at end of file
Please login to merge, or discard this patch.
lite/includes/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1 1
 <?php
2 2
 //Nothing to see here
3 3
 
4
-header( 'HTTP/1.0 403 Forbidden' );
5 4
\ No newline at end of file
5
+header('HTTP/1.0 403 Forbidden');
6 6
\ No newline at end of file
Please login to merge, or discard this patch.