Passed
Push — master ( 9643cd...6fb3cf )
by Chris
08:28
created
includes/license.php 2 patches
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 		$license_key  = ! empty( $license_key ) ? $license_key : MonsterInsights()->license->get_default_license_key();
88 88
 		return $license_key;
89 89
 	}
90
-	public function get_site_license_key(){
90
+	public function get_site_license_key() {
91 91
 		return ( ! empty( $this->site['key'] ) && is_string( $this->site['key'] ) && strlen( $this->site['key'] ) > 10 ) ? $this->site['key'] : '';
92 92
 	}
93
-	public function get_network_license_key(){
93
+	public function get_network_license_key() {
94 94
 		return ( ! empty( $this->network['key'] ) && is_string( $this->network['key'] ) && strlen( $this->network['key'] ) > 10 ) ? $this->network['key'] : '';
95 95
 	}
96 96
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		return $this->licensed;
99 99
 	}
100 100
 
101
-	public function is_site_licensed(){
101
+	public function is_site_licensed() {
102 102
 		return    ! empty( $this->site['key'] ) // has key
103 103
 			   &&   $this->get_site_license_type() // has type
104 104
 			   && ! $this->site_license_expired()  // isn't expired
@@ -117,28 +117,28 @@  discard block
 block discarded – undo
117 117
 	}
118 118
 
119 119
 
120
-	public function get_site_license_updates(){
120
+	public function get_site_license_updates() {
121 121
 		return get_option( 'monsterinsights_license_updates', '' );
122 122
 	}
123
-	public function get_network_license_updates(){
123
+	public function get_network_license_updates() {
124 124
 		return get_site_option( 'monsterinsights_network_license_updates', '' );
125 125
 	}
126 126
 
127
-	public function set_site_license_updates(){
127
+	public function set_site_license_updates() {
128 128
 		update_option( 'monsterinsights_license_updates', strtotime( '+8 hours' ) );
129 129
 	}
130 130
 	public function set_network_license_updates() {
131 131
 		update_site_option( 'monsterinsights_network_license_updates', strtotime( '+8 hours' ) );
132 132
 	}
133 133
 
134
-	public function delete_site_license_updates(){
134
+	public function delete_site_license_updates() {
135 135
 		delete_option( 'monsterinsights_license_updates' );
136 136
 	}
137
-	public function delete_network_license_updates(){
137
+	public function delete_network_license_updates() {
138 138
 		delete_site_option( 'monsterinsights_license_updates' );
139 139
 	}
140 140
 
141
-	public function time_to_check_site_license(){
141
+	public function time_to_check_site_license() {
142 142
 		$timestamp = get_option( 'monsterinsights_license_updates' );
143 143
 		if ( ! $timestamp ) {
144 144
 			 return true;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			}
152 152
 		}
153 153
 	}	
154
-	public function time_to_check_network_license(){
154
+	public function time_to_check_network_license() {
155 155
 		$timestamp = get_site_option( 'monsterinsights_network_license_updates' );
156 156
 		if ( ! $timestamp ) {
157 157
 			 return true;
@@ -165,21 +165,21 @@  discard block
 block discarded – undo
165 165
 		}
166 166
 	}
167 167
 
168
-	public function set_site_license( $data = array() ){
168
+	public function set_site_license( $data = array() ) {
169 169
 		update_option( 'monsterinsights_license', $data );
170 170
 		$this->set_site_license_updates();
171
-		$this->site      = $data;
171
+		$this->site = $data;
172 172
 	}
173
-	public function set_network_license( $data = array() ){
173
+	public function set_network_license( $data = array() ) {
174 174
 		update_site_option( 'monsterinsights_network_license', $data );
175 175
 		$this->set_network_license_updates();
176
-		$this->network   = $data;
176
+		$this->network = $data;
177 177
 	}
178 178
 
179 179
 	public function delete_site_license() {
180 180
 		delete_option( 'monsterinsights_license' );
181 181
 		$this->delete_site_license_updates();
182
-		$this->site      = array();
182
+		$this->site = array();
183 183
 	}
184 184
 	public function delete_network_license() {
185 185
 		delete_site_option( 'monsterinsights_network_license' );
@@ -187,21 +187,21 @@  discard block
 block discarded – undo
187 187
 		$this->network = array();
188 188
 	}
189 189
 
190
-	public function get_license_type(){
190
+	public function get_license_type() {
191 191
 		if ( ! $this->has_license() ) {
192 192
 			return false;
193 193
 		}
194 194
 
195 195
 		return $this->using_network_license() ? $this->get_network_license_type() : $this->get_site_license_type();
196 196
 	}
197
-	public function get_site_license_type(){
197
+	public function get_site_license_type() {
198 198
 		return ( $this->get_site_license_key() && ! empty( $this->site['type'] ) && $this->is_valid_license_type( $this->site['type'] ) ) ? $this->site['type'] : '';
199 199
 	}
200
-	public function get_network_license_type(){
200
+	public function get_network_license_type() {
201 201
 		return ( $this->get_network_license_key() && ! empty( $this->network['type'] ) && $this->is_valid_license_type( $this->network['type'] ) ) ? $this->network['type'] : '';
202 202
 	}
203 203
 
204
-	public function license_has_error(){
204
+	public function license_has_error() {
205 205
 		if ( ! $this->has_license() ) {
206 206
 			return false;
207 207
 		}
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 			   || $this->site_license_invalid()  // is invalid
216 216
 		;
217 217
 	}
218
-	public function network_license_has_error(){
218
+	public function network_license_has_error() {
219 219
 		return 
220 220
 				  $this->network_license_expired()  // is expired
221 221
 			   || $this->network_license_disabled()  // is disabled
@@ -223,21 +223,21 @@  discard block
 block discarded – undo
223 223
 		;
224 224
 	}
225 225
 
226
-	public function license_expired(){
226
+	public function license_expired() {
227 227
 		if ( ! $this->has_license() ) {
228 228
 			return false;
229 229
 		}
230 230
 		
231 231
 		return $this->using_network_license() ? $this->network_license_expired() : $this->site_license_expired();
232 232
 	}
233
-	public function site_license_expired(){
233
+	public function site_license_expired() {
234 234
 		return ! empty( $this->site['is_expired'] );
235 235
 	}
236
-	public function network_license_expired(){
236
+	public function network_license_expired() {
237 237
 		return ! empty( $this->network['is_expired'] );
238 238
 	}
239 239
 
240
-	public function license_disabled(){
240
+	public function license_disabled() {
241 241
 		if ( ! $this->has_license() ) {
242 242
 			return false;
243 243
 		}
@@ -247,11 +247,11 @@  discard block
 block discarded – undo
247 247
 	public function site_license_disabled() {
248 248
 		return ! empty( $this->site['is_disabled'] );
249 249
 	}
250
-	public function network_license_disabled(){
250
+	public function network_license_disabled() {
251 251
 		return ! empty( $this->network['is_disabled'] );
252 252
 	}
253 253
 
254
-	public function license_invalid(){
254
+	public function license_invalid() {
255 255
 		if ( ! $this->has_license() ) {
256 256
 			return false;
257 257
 		}
@@ -261,21 +261,21 @@  discard block
 block discarded – undo
261 261
 	public function site_license_invalid() {
262 262
 		return ! empty( $this->site['is_invalid'] );
263 263
 	}
264
-	public function network_license_invalid(){
264
+	public function network_license_invalid() {
265 265
 		return ! empty( $this->network['is_invalid'] );
266 266
 	}
267 267
 
268 268
 
269
-	public function get_license_error(){
269
+	public function get_license_error() {
270 270
 		if ( ! $this->has_license() ) {
271 271
 			return false;
272 272
 		}
273 273
 		
274 274
 		return $this->using_network_license() ? $this->get_network_license_error() : $this->get_site_license_error();
275 275
 	}
276
-	public function get_site_license_error(){
276
+	public function get_site_license_error() {
277 277
 		if ( $this->site_license_expired() ) {
278
-			return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
278
+			return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
279 279
 		} else if ( $this->site_license_disabled() ) {
280 280
 			return esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
281 281
 		} else if ( $this->site_license_invalid() ) {
@@ -284,9 +284,9 @@  discard block
 block discarded – undo
284 284
 		return '';
285 285
 	}
286 286
 
287
-	public function get_network_license_error(){
287
+	public function get_network_license_error() {
288 288
 		if ( $this->site_license_expired() ) {
289
-			return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
289
+			return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
290 290
 		} else if ( $this->site_license_disabled() ) {
291 291
 			return esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
292 292
 		} else if ( $this->site_license_invalid() ) {
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 		return $can_access;
363 363
 	}
364 364
 
365
-	public function get_default_license_key(){
365
+	public function get_default_license_key() {
366 366
 		if ( defined( 'MONSTERINSIGHTS_LICENSE_KEY' ) && is_string( MONSTERINSIGHTS_LICENSE_KEY ) && strlen( MONSTERINSIGHTS_LICENSE_KEY ) > 10 ) {
367 367
 			return MONSTERINSIGHTS_LICENSE_KEY;
368 368
 		}
Please login to merge, or discard this patch.
Braces   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -87,18 +87,18 @@  discard block
 block discarded – undo
87 87
 		$license_key  = ! empty( $license_key ) ? $license_key : MonsterInsights()->license->get_default_license_key();
88 88
 		return $license_key;
89 89
 	}
90
-	public function get_site_license_key(){
90
+	public function get_site_license_key() {
91 91
 		return ( ! empty( $this->site['key'] ) && is_string( $this->site['key'] ) && strlen( $this->site['key'] ) > 10 ) ? $this->site['key'] : '';
92 92
 	}
93
-	public function get_network_license_key(){
93
+	public function get_network_license_key() {
94 94
 		return ( ! empty( $this->network['key'] ) && is_string( $this->network['key'] ) && strlen( $this->network['key'] ) > 10 ) ? $this->network['key'] : '';
95 95
 	}
96 96
 
97
-	public function has_license() { 
97
+	public function has_license() {
98 98
 		return $this->licensed;
99 99
 	}
100 100
 
101
-	public function is_site_licensed(){
101
+	public function is_site_licensed() {
102 102
 		return    ! empty( $this->site['key'] ) // has key
103 103
 			   &&   $this->get_site_license_type() // has type
104 104
 			   && ! $this->site_license_expired()  // isn't expired
@@ -117,28 +117,28 @@  discard block
 block discarded – undo
117 117
 	}
118 118
 
119 119
 
120
-	public function get_site_license_updates(){
120
+	public function get_site_license_updates() {
121 121
 		return get_option( 'monsterinsights_license_updates', '' );
122 122
 	}
123
-	public function get_network_license_updates(){
123
+	public function get_network_license_updates() {
124 124
 		return get_site_option( 'monsterinsights_network_license_updates', '' );
125 125
 	}
126 126
 
127
-	public function set_site_license_updates(){
127
+	public function set_site_license_updates() {
128 128
 		update_option( 'monsterinsights_license_updates', strtotime( '+8 hours' ) );
129 129
 	}
130 130
 	public function set_network_license_updates() {
131 131
 		update_site_option( 'monsterinsights_network_license_updates', strtotime( '+8 hours' ) );
132 132
 	}
133 133
 
134
-	public function delete_site_license_updates(){
134
+	public function delete_site_license_updates() {
135 135
 		delete_option( 'monsterinsights_license_updates' );
136 136
 	}
137
-	public function delete_network_license_updates(){
137
+	public function delete_network_license_updates() {
138 138
 		delete_site_option( 'monsterinsights_license_updates' );
139 139
 	}
140 140
 
141
-	public function time_to_check_site_license(){
141
+	public function time_to_check_site_license() {
142 142
 		$timestamp = get_option( 'monsterinsights_license_updates' );
143 143
 		if ( ! $timestamp ) {
144 144
 			 return true;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			}
152 152
 		}
153 153
 	}	
154
-	public function time_to_check_network_license(){
154
+	public function time_to_check_network_license() {
155 155
 		$timestamp = get_site_option( 'monsterinsights_network_license_updates' );
156 156
 		if ( ! $timestamp ) {
157 157
 			 return true;
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
 		}
166 166
 	}
167 167
 
168
-	public function set_site_license( $data = array() ){
168
+	public function set_site_license( $data = array() ) {
169 169
 		update_option( 'monsterinsights_license', $data );
170 170
 		$this->set_site_license_updates();
171 171
 		$this->site      = $data;
172 172
 	}
173
-	public function set_network_license( $data = array() ){
173
+	public function set_network_license( $data = array() ) {
174 174
 		update_site_option( 'monsterinsights_network_license', $data );
175 175
 		$this->set_network_license_updates();
176 176
 		$this->network   = $data;
@@ -187,21 +187,21 @@  discard block
 block discarded – undo
187 187
 		$this->network = array();
188 188
 	}
189 189
 
190
-	public function get_license_type(){
190
+	public function get_license_type() {
191 191
 		if ( ! $this->has_license() ) {
192 192
 			return false;
193 193
 		}
194 194
 
195 195
 		return $this->using_network_license() ? $this->get_network_license_type() : $this->get_site_license_type();
196 196
 	}
197
-	public function get_site_license_type(){
197
+	public function get_site_license_type() {
198 198
 		return ( $this->get_site_license_key() && ! empty( $this->site['type'] ) && $this->is_valid_license_type( $this->site['type'] ) ) ? $this->site['type'] : '';
199 199
 	}
200
-	public function get_network_license_type(){
200
+	public function get_network_license_type() {
201 201
 		return ( $this->get_network_license_key() && ! empty( $this->network['type'] ) && $this->is_valid_license_type( $this->network['type'] ) ) ? $this->network['type'] : '';
202 202
 	}
203 203
 
204
-	public function license_has_error(){
204
+	public function license_has_error() {
205 205
 		if ( ! $this->has_license() ) {
206 206
 			return false;
207 207
 		}
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 			   || $this->site_license_invalid()  // is invalid
216 216
 		;
217 217
 	}
218
-	public function network_license_has_error(){
218
+	public function network_license_has_error() {
219 219
 		return 
220 220
 				  $this->network_license_expired()  // is expired
221 221
 			   || $this->network_license_disabled()  // is disabled
@@ -223,21 +223,21 @@  discard block
 block discarded – undo
223 223
 		;
224 224
 	}
225 225
 
226
-	public function license_expired(){
226
+	public function license_expired() {
227 227
 		if ( ! $this->has_license() ) {
228 228
 			return false;
229 229
 		}
230 230
 		
231 231
 		return $this->using_network_license() ? $this->network_license_expired() : $this->site_license_expired();
232 232
 	}
233
-	public function site_license_expired(){
233
+	public function site_license_expired() {
234 234
 		return ! empty( $this->site['is_expired'] );
235 235
 	}
236
-	public function network_license_expired(){
236
+	public function network_license_expired() {
237 237
 		return ! empty( $this->network['is_expired'] );
238 238
 	}
239 239
 
240
-	public function license_disabled(){
240
+	public function license_disabled() {
241 241
 		if ( ! $this->has_license() ) {
242 242
 			return false;
243 243
 		}
@@ -247,11 +247,11 @@  discard block
 block discarded – undo
247 247
 	public function site_license_disabled() {
248 248
 		return ! empty( $this->site['is_disabled'] );
249 249
 	}
250
-	public function network_license_disabled(){
250
+	public function network_license_disabled() {
251 251
 		return ! empty( $this->network['is_disabled'] );
252 252
 	}
253 253
 
254
-	public function license_invalid(){
254
+	public function license_invalid() {
255 255
 		if ( ! $this->has_license() ) {
256 256
 			return false;
257 257
 		}
@@ -261,19 +261,19 @@  discard block
 block discarded – undo
261 261
 	public function site_license_invalid() {
262 262
 		return ! empty( $this->site['is_invalid'] );
263 263
 	}
264
-	public function network_license_invalid(){
264
+	public function network_license_invalid() {
265 265
 		return ! empty( $this->network['is_invalid'] );
266 266
 	}
267 267
 
268 268
 
269
-	public function get_license_error(){
269
+	public function get_license_error() {
270 270
 		if ( ! $this->has_license() ) {
271 271
 			return false;
272 272
 		}
273 273
 		
274 274
 		return $this->using_network_license() ? $this->get_network_license_error() : $this->get_site_license_error();
275 275
 	}
276
-	public function get_site_license_error(){
276
+	public function get_site_license_error() {
277 277
 		if ( $this->site_license_expired() ) {
278 278
 			return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
279 279
 		} else if ( $this->site_license_disabled() ) {
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 		return '';
285 285
 	}
286 286
 
287
-	public function get_network_license_error(){
287
+	public function get_network_license_error() {
288 288
 		if ( $this->site_license_expired() ) {
289 289
 			return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
290 290
 		} else if ( $this->site_license_disabled() ) {
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 		return '';
296 296
 	}
297 297
 
298
-	public function license_can( $requires = 'lite' ) {		
298
+	public function license_can( $requires = 'lite' ) {
299 299
 		if ( ! monsterinsights_is_pro_version() || ! $this->has_license() ) {
300 300
 			return $requires === 'lite';
301 301
 		}
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 		return $can_access;
363 363
 	}
364 364
 
365
-	public function get_default_license_key(){
365
+	public function get_default_license_key() {
366 366
 		if ( defined( 'MONSTERINSIGHTS_LICENSE_KEY' ) && is_string( MONSTERINSIGHTS_LICENSE_KEY ) && strlen( MONSTERINSIGHTS_LICENSE_KEY ) > 10 ) {
367 367
 			return MONSTERINSIGHTS_LICENSE_KEY;
368 368
 		}
Please login to merge, or discard this patch.
includes/admin/common.php 2 patches
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -150,32 +150,32 @@  discard block
 block discarded – undo
150 150
 				'copytoclip'       				=> esc_html__( 'Copy to Clipboard', 'google-analytics-for-wordpress' ),
151 151
 				'failed'           				=> esc_html__( 'Failed!', 'google-analytics-for-wordpress' ),
152 152
 				'admin_nonce'      				=> wp_create_nonce( 'mi-admin-nonce' ),
153
-				'shorten'         				=> esc_html__( 'Shorten URL' ,'google-analytics-for-wordpress'),
154
-				'shortened'        				=> esc_html__( 'Shortened!' ,'google-analytics-for-wordpress'),
155
-				'working'          				=> esc_html__( 'Working...' ,'google-analytics-for-wordpress'),
156
-				'importtext'       				=> esc_html__( 'Import' ,'google-analytics-for-wordpress'),
157
-				'imported'         				=> esc_html__( 'Imported!' ,'google-analytics-for-wordpress'),
158
-				'redirect_loading_title_text'   => esc_html__( 'Preparing to redirect:' ,'google-analytics-for-wordpress'),
159
-				'redirect_loading_text_text'    => esc_html__( "You'll be redirected momentarily to complete authentication. This may take a couple seconds." ,'google-analytics-for-wordpress'),
160
-				'redirect_loading_error_title'  => esc_html__( "Authentication Error:" ,'google-analytics-for-wordpress'),
161
-				'deauth_loading_title_text'  	=> esc_html__( 'Deauthenticating....' ,'google-analytics-for-wordpress'),
162
-				'deauth_loading_text_text'   	=> esc_html__( "We're deactivating your site. This may take a couple seconds." ,'google-analytics-for-wordpress'),
163
-				'deauth_loading_error_title' 	=> esc_html__( "Deactivation Error:" ,'google-analytics-for-wordpress'),
164
-				'deauth_success_title_text'  	=> esc_html__( 'Deactivated Successfully!' ,'google-analytics-for-wordpress'),
165
-				'deauth_success_text_text'   	=> esc_html__( "You've disconnected your site from MonsterInsights. Your site is no longer being tracked by Google Analytics and you won't see reports anymore." ,'google-analytics-for-wordpress'),
166
-				'verify_loading_title_text'  	=> esc_html__( 'Verifying....' ,'google-analytics-for-wordpress'),
167
-				'verify_loading_text_text'   	=> esc_html__( "We're verifying your site. This may take a couple seconds." ,'google-analytics-for-wordpress'),
168
-				'verify_loading_error_title' 	=> esc_html__( "Verification Error:" ,'google-analytics-for-wordpress'),
169
-				'verify_success_title_text' 	=> esc_html__( 'Verified Successfully!' ,'google-analytics-for-wordpress'),
170
-				'verify_success_text_text'  	=> esc_html__( "Your site is connected to MonsterInsights!" ,'google-analytics-for-wordpress'),
171
-				'ok_text' 						=> esc_html__( "OK" ,'google-analytics-for-wordpress'),
172
-				'force_deauth_button_text'  	=> esc_html__( "Force Deauthenticate" ,'google-analytics-for-wordpress'),
153
+				'shorten'         				=> esc_html__( 'Shorten URL', 'google-analytics-for-wordpress' ),
154
+				'shortened'        				=> esc_html__( 'Shortened!', 'google-analytics-for-wordpress' ),
155
+				'working'          				=> esc_html__( 'Working...', 'google-analytics-for-wordpress' ),
156
+				'importtext'       				=> esc_html__( 'Import', 'google-analytics-for-wordpress' ),
157
+				'imported'         				=> esc_html__( 'Imported!', 'google-analytics-for-wordpress' ),
158
+				'redirect_loading_title_text'   => esc_html__( 'Preparing to redirect:', 'google-analytics-for-wordpress' ),
159
+				'redirect_loading_text_text'    => esc_html__( "You'll be redirected momentarily to complete authentication. This may take a couple seconds.", 'google-analytics-for-wordpress' ),
160
+				'redirect_loading_error_title'  => esc_html__( "Authentication Error:", 'google-analytics-for-wordpress' ),
161
+				'deauth_loading_title_text'  	=> esc_html__( 'Deauthenticating....', 'google-analytics-for-wordpress' ),
162
+				'deauth_loading_text_text'   	=> esc_html__( "We're deactivating your site. This may take a couple seconds.", 'google-analytics-for-wordpress' ),
163
+				'deauth_loading_error_title' 	=> esc_html__( "Deactivation Error:", 'google-analytics-for-wordpress' ),
164
+				'deauth_success_title_text'  	=> esc_html__( 'Deactivated Successfully!', 'google-analytics-for-wordpress' ),
165
+				'deauth_success_text_text'   	=> esc_html__( "You've disconnected your site from MonsterInsights. Your site is no longer being tracked by Google Analytics and you won't see reports anymore.", 'google-analytics-for-wordpress' ),
166
+				'verify_loading_title_text'  	=> esc_html__( 'Verifying....', 'google-analytics-for-wordpress' ),
167
+				'verify_loading_text_text'   	=> esc_html__( "We're verifying your site. This may take a couple seconds.", 'google-analytics-for-wordpress' ),
168
+				'verify_loading_error_title' 	=> esc_html__( "Verification Error:", 'google-analytics-for-wordpress' ),
169
+				'verify_success_title_text' 	=> esc_html__( 'Verified Successfully!', 'google-analytics-for-wordpress' ),
170
+				'verify_success_text_text'  	=> esc_html__( "Your site is connected to MonsterInsights!", 'google-analytics-for-wordpress' ),
171
+				'ok_text' 						=> esc_html__( "OK", 'google-analytics-for-wordpress' ),
172
+				'force_deauth_button_text'  	=> esc_html__( "Force Deauthenticate", 'google-analytics-for-wordpress' ),
173 173
 				'refresh_report_title'          => esc_html__( 'Refreshing Report', 'google-analytics-for-wordpress' ),
174 174
 				'refresh_report_text'           => esc_html__( 'Loading new report data...', 'google-analytics-for-wordpress' ),
175 175
 				'refresh_report_success_text'   => esc_html__( 'Success', 'google-analytics-for-wordpress' ),
176 176
 				'refresh_report_success_text'   => esc_html__( 'Retrieved the new report data successfully', 'google-analytics-for-wordpress' ),
177 177
 				'refresh_report_failure_title'  => esc_html__( 'Error', 'google-analytics-for-wordpress' ),
178
-				'timezone'						=> date('e'),
178
+				'timezone'						=> date( 'e' ),
179 179
 			)
180 180
 		);
181 181
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 		'kad_admin_js', // Pinnacle theme
231 231
 		'dt-chart', // DesignThemes core features plugin
232 232
 		'tweeetshare_font_script', // TweetShare - Click To Tweet
233
-		'tweeetshare_jquery_script',  // TweetShare - Click To Tweet
233
+		'tweeetshare_jquery_script', // TweetShare - Click To Tweet
234 234
 		'tweeetshare_jqueryui_script', // TweetShare - Click To Tweet
235 235
 		'tweeetshare_custom_script', // TweetShare - Click To Tweet
236 236
 		'imagify-promise-polyfill', // Imagify 
@@ -249,16 +249,16 @@  discard block
 block discarded – undo
249 249
 		'rml-modal', // WP Real Media Library
250 250
 		'rml-order', // WP Real Media Library
251 251
 		'rml-meta', // WP Real Media Library
252
-		'rml-uploader',  // WP Real Media Library
253
-		'rml-options',  // WP Real Media Library
254
-		'rml-usersettings',  // WP Real Media Library
252
+		'rml-uploader', // WP Real Media Library
253
+		'rml-options', // WP Real Media Library
254
+		'rml-usersettings', // WP Real Media Library
255 255
 		'rml-main', // WP Real Media Library
256 256
 		'control-panel-sweet-alert', // Ken Theme
257 257
 		'sweet-alert-js', // Vitrine Theme
258 258
 		'theme-admin-script', // Vitrine Theme
259 259
 		'sweetalert', //  Church Suite Theme by Webnus
260 260
 		'be_alerts_charts', //  WooCommerce bolder product alerts
261
- 		'magayo-lottery-results',  //  Magayo Lottery Results
261
+ 		'magayo-lottery-results', //  Magayo Lottery Results
262 262
 		'control-panel-sweet-alert', // Ken Theme
263 263
 		'cpm_chart', // WP Project Manager
264 264
 		'adminscripts', //  Artisan Nayma Theme
@@ -314,15 +314,15 @@  discard block
 block discarded – undo
314 314
 
315 315
 	global $wp_styles;
316 316
 	foreach ( $wp_styles->queue as $handle ) {
317
-		if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content') === false ) {
317
+		if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content' ) === false ) {
318 318
 			return;
319 319
 		}
320 320
 		
321
-		if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights') !== false ) {
321
+		if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights' ) !== false ) {
322 322
 			return;
323 323
 		}
324 324
 
325
-		foreach( $third_party as $partial ) {
325
+		foreach ( $third_party as $partial ) {
326 326
 			if ( strpos( $wp_styles->registered[$handle]->handle, $partial ) !== false ) {
327 327
 				wp_dequeue_style( $handle ); // Remove css file from MI screen
328 328
 				wp_deregister_style( $handle );
@@ -337,15 +337,15 @@  discard block
 block discarded – undo
337 337
 
338 338
 	global $wp_scripts;
339 339
 	foreach ( $wp_scripts->queue as $handle ) {
340
-		if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content') === false ) {
340
+		if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content' ) === false ) {
341 341
 			return;
342 342
 		}
343 343
 		
344
-		if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights') !== false ) {
344
+		if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights' ) !== false ) {
345 345
 			return;
346 346
 		}
347 347
 
348
-		foreach( $third_party as $partial ) {
348
+		foreach ( $third_party as $partial ) {
349 349
 			if ( strpos( $wp_scripts->registered[$handle]->handle, $partial ) !== false ) {
350 350
 				wp_dequeue_script( $handle ); // Remove JS file from MI screen
351 351
 				wp_deregister_script( $handle );
@@ -360,13 +360,13 @@  discard block
 block discarded – undo
360 360
 
361 361
 	// Remove actions from themes that are not following best practices and break the admin doing so
362 362
 		// Theme: Newspaper by tagDiv
363
-			remove_action('admin_enqueue_scripts', 'load_wp_admin_js');
364
-			remove_action('admin_enqueue_scripts', 'load_wp_admin_css');
365
-			remove_action('admin_print_scripts-widgets.php', 'td_on_admin_print_scripts_farbtastic');
366
-			remove_action('admin_print_styles-widgets.php', 'td_on_admin_print_styles_farbtastic');
367
-			remove_action('admin_print_footer_scripts', 'check_if_media_uploads_is_loaded', 9999);
368
-			remove_action('print_media_templates', 'td_custom_gallery_settings_hook');
369
-			remove_action('print_media_templates', 'td_change_backbone_js_hook');
363
+			remove_action( 'admin_enqueue_scripts', 'load_wp_admin_js' );
364
+			remove_action( 'admin_enqueue_scripts', 'load_wp_admin_css' );
365
+			remove_action( 'admin_print_scripts-widgets.php', 'td_on_admin_print_scripts_farbtastic' );
366
+			remove_action( 'admin_print_styles-widgets.php', 'td_on_admin_print_styles_farbtastic' );
367
+			remove_action( 'admin_print_footer_scripts', 'check_if_media_uploads_is_loaded', 9999 );
368
+			remove_action( 'print_media_templates', 'td_custom_gallery_settings_hook' );
369
+			remove_action( 'print_media_templates', 'td_change_backbone_js_hook' );
370 370
 }
371 371
 add_action( 'admin_enqueue_scripts', 'monsterinsights_remove_conflicting_asset_files', 9999 );
372 372
 
@@ -378,65 +378,65 @@  discard block
 block discarded – undo
378 378
  *
379 379
  * @return null Return early if not on the proper screen.
380 380
  */
381
-function hide_non_monsterinsights_warnings () {
381
+function hide_non_monsterinsights_warnings() {
382 382
 	// Bail if we're not on a MonsterInsights screen.
383 383
 	if ( empty( $_REQUEST['page'] ) || strpos( $_REQUEST['page'], 'monsterinsights' ) === false ) {
384 384
 		return;
385 385
 	}
386 386
 
387 387
 	global $wp_filter;
388
-	if ( !empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) {
389
-		foreach( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) {
388
+	if ( ! empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) {
389
+		foreach ( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) {
390 390
 			foreach ( $hooks as $name => $arr ) {
391 391
 				if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
392
-					unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] );
392
+					unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] );
393 393
 					continue;
394 394
 				}
395 395
 				if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
396 396
 					continue;
397 397
 				}
398
-				if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
398
+				if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
399 399
 					unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] );
400 400
 				}
401 401
 			}
402 402
 		}
403 403
 	}
404 404
 
405
-	if ( !empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) {
406
-		foreach( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) {
405
+	if ( ! empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) {
406
+		foreach ( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) {
407 407
 			foreach ( $hooks as $name => $arr ) {
408 408
 				if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
409
-					unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] );
409
+					unset( $wp_filter['admin_notices']->callbacks[$priority][$name] );
410 410
 					continue;
411 411
 				}
412 412
 				if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
413 413
 					continue;
414 414
 				}
415
-				if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
415
+				if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
416 416
 					unset( $wp_filter['admin_notices']->callbacks[$priority][$name] );
417 417
 				}
418 418
 			}
419 419
 		}
420 420
 	}
421 421
 
422
-	if ( !empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) {
423
-		foreach( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) {
422
+	if ( ! empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) {
423
+		foreach ( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) {
424 424
 			foreach ( $hooks as $name => $arr ) {
425 425
 				if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
426
-					unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] );
426
+					unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] );
427 427
 					continue;
428 428
 				}
429 429
 				if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
430 430
 					continue;
431 431
 				}
432
-				if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
432
+				if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
433 433
 					unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] );
434 434
 				}
435 435
 			}
436 436
 		}
437 437
 	}
438 438
 }
439
-add_action('admin_print_scripts', 'hide_non_monsterinsights_warnings');  
439
+add_action( 'admin_print_scripts', 'hide_non_monsterinsights_warnings' );  
440 440
 
441 441
 /**
442 442
  * Called whenever an upgrade button / link is displayed in Lite, this function will
@@ -465,33 +465,33 @@  discard block
 block discarded – undo
465 465
 	}
466 466
 
467 467
 	// Get the ShareASale ID
468
-	$shareasale_id   = monsterinsights_get_shareasale_id();
468
+	$shareasale_id = monsterinsights_get_shareasale_id();
469 469
 
470 470
 	// If we have a shareasale ID return the shareasale url
471 471
 	if ( ! empty( $shareasale_id ) ) {
472
-		$shareasale_id  = absint( $shareasale_id );
472
+		$shareasale_id = absint( $shareasale_id );
473 473
 		return esc_url( monsterinsights_get_shareasale_url( $shareasale_id, $url ) );
474 474
 	} else {
475 475
 		return esc_url( $url );
476 476
 	}
477 477
 }
478 478
 
479
-function monsterinsights_get_url( $medium = '', $campaign = '', $url = '', $escape = true  ) {
479
+function monsterinsights_get_url( $medium = '', $campaign = '', $url = '', $escape = true ) {
480 480
 	// Setup Campaign variables
481
-	$source          = monsterinsights_is_pro_version()   ? 'proplugin' : 'liteplugin';
482
-	$medium          = ! empty( $medium )   ? $medium     : 'defaultmedium';
483
-	$campaign        = ! empty( $campaign ) ? $campaign   : 'defaultcampaign';
484
-	$content 		 = MONSTERINSIGHTS_VERSION;
485
-	$default_url     = monsterinsights_is_pro_version()   ? '' : 'lite/';
481
+	$source          = monsterinsights_is_pro_version() ? 'proplugin' : 'liteplugin';
482
+	$medium          = ! empty( $medium ) ? $medium : 'defaultmedium';
483
+	$campaign        = ! empty( $campaign ) ? $campaign : 'defaultcampaign';
484
+	$content = MONSTERINSIGHTS_VERSION;
485
+	$default_url     = monsterinsights_is_pro_version() ? '' : 'lite/';
486 486
 	$url             = ! empty( $url ) ? $url : 'https://www.monsterinsights.com/' . $default_url;
487 487
 
488 488
 	// Put together redirect URL
489 489
 	$url = add_query_arg(
490 490
 		array(
491
-		    'utm_source'   => $source,   // Pro/Lite Plugin
492
-		    'utm_medium'   => sanitize_key( $medium ),   // Area of MonsterInsights (example Reports)
491
+		    'utm_source'   => $source, // Pro/Lite Plugin
492
+		    'utm_medium'   => sanitize_key( $medium ), // Area of MonsterInsights (example Reports)
493 493
 		    'utm_campaign' => sanitize_key( $campaign ), // Which link (example eCommerce Report)
494
-		    'utm_content'  => $content,  // Version number of MI
494
+		    'utm_content'  => $content, // Version number of MI
495 495
 		),
496 496
 		trailingslashit( $url )
497 497
 	);
@@ -529,13 +529,13 @@  discard block
 block discarded – undo
529 529
 	$custom = false;
530 530
 	if ( defined( 'MONSTERINSIGHTS_SHAREASALE_REDIRECT_URL' ) ) {
531 531
 		$shareasale_redirect = MONSTERINSIGHTS_SHAREASALE_REDIRECT_URL;
532
-		$custom 			 = true;
532
+		$custom = true;
533 533
 	}
534 534
 
535 535
 	// If there's no constant, check if there's an option.
536 536
 	if ( empty( $custom ) ) {
537 537
 		$shareasale_redirect = get_option( 'monsterinsights_shareasale_redirect_url', '' );
538
-		$custom 			 = true;
538
+		$custom = true;
539 539
 	}
540 540
 
541 541
 	// Whether we have an ID or not, filter the ID.
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 	return $shareasale_url;
545 545
 }
546 546
 
547
-function monsterinsights_settings_ublock_error_js(){
547
+function monsterinsights_settings_ublock_error_js() {
548 548
 	echo "<script type='text/javascript'>\n";
549 549
 	echo "jQuery( document ).ready( function( $ ) {
550 550
 			if ( window.uorigindetected == null){
@@ -560,9 +560,9 @@  discard block
 block discarded – undo
560 560
 }
561 561
 
562 562
 function monsterinsights_ublock_notice() {
563
-	ob_start();?>
563
+	ob_start(); ?>
564 564
 	<div id="monsterinsights-ublock-origin-error" class="error inline" style="display:none;">
565
-		<?php echo sprintf( esc_html__( 'MonsterInsights has detected that it\'s files are being blocked. This is usually caused by a adblock browser plugin (particularly uBlock Origin), or a conflicting WordPress theme or plugin. This issue only affects the admin side of MonsterInsights. To solve this, ensure MonsterInsights is whitelisted for your website URL in any adblock browser plugin you use. For step by step directions on how to do this, %1$sclick here%2$s. If this doesn\'t solve the issue (rare), send us a ticket %3$shere%2$s and we\'ll be happy to help diagnose the issue.', 'google-analytics-for-wordpress'), '<a href="https://monsterinsights.com/docs/monsterinsights-asset-files-blocked/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>', '<a href="https://monsterinsights.com/contact/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">');
565
+		<?php echo sprintf( esc_html__( 'MonsterInsights has detected that it\'s files are being blocked. This is usually caused by a adblock browser plugin (particularly uBlock Origin), or a conflicting WordPress theme or plugin. This issue only affects the admin side of MonsterInsights. To solve this, ensure MonsterInsights is whitelisted for your website URL in any adblock browser plugin you use. For step by step directions on how to do this, %1$sclick here%2$s. If this doesn\'t solve the issue (rare), send us a ticket %3$shere%2$s and we\'ll be happy to help diagnose the issue.', 'google-analytics-for-wordpress' ), '<a href="https://monsterinsights.com/docs/monsterinsights-asset-files-blocked/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>', '<a href="https://monsterinsights.com/contact/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">' );
566 566
 		?>
567 567
 	</div>
568 568
 	<?php
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -544,7 +544,7 @@
 block discarded – undo
544 544
 	return $shareasale_url;
545 545
 }
546 546
 
547
-function monsterinsights_settings_ublock_error_js(){
547
+function monsterinsights_settings_ublock_error_js() {
548 548
 	echo "<script type='text/javascript'>\n";
549 549
 	echo "jQuery( document ).ready( function( $ ) {
550 550
 			if ( window.uorigindetected == null){
Please login to merge, or discard this patch.
includes/admin/admin.php 3 patches
Indentation   +140 added lines, -140 removed lines patch added patch discarded remove patch
@@ -33,24 +33,24 @@  discard block
 block discarded – undo
33 33
     $hook = 'monsterinsights_settings';
34 34
 
35 35
     if ( $dashboards_disabled || ! $is_authed || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) {
36
-        // If dashboards disabled, first settings page
37
-        add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
38
-        $hook = 'monsterinsights_settings';
36
+	// If dashboards disabled, first settings page
37
+	add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
38
+	$hook = 'monsterinsights_settings';
39 39
 
40
-        add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' );
41
-        add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' );
40
+	add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' );
41
+	add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' );
42 42
     } else {
43
-        // if dashboards enabled, first dashboard
44
-        add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
43
+	// if dashboards enabled, first dashboard
44
+	add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
45 45
 
46
-        $hook = 'monsterinsights_reports';
46
+	$hook = 'monsterinsights_reports';
47 47
 
48
-        add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' );
48
+	add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' );
49 49
 
50
-        // then settings page
51
-        add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' );
50
+	// then settings page
51
+	add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' );
52 52
 
53
-        add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' );
53
+	add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' );
54 54
 
55 55
     }
56 56
     
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     // then addons
61 61
     $network_key = MonsterInsights()->license->get_network_license_key();
62 62
     if ( ! monsterinsights_is_network_active() || ( monsterinsights_is_network_active() && empty( $network_key ) ) ) {
63
-        add_submenu_page( $hook, __( 'Addons:', 'google-analytics-for-wordpress' ), '<span style="color:#7cc048"> ' . __( 'Addons', 'google-analytics-for-wordpress' ) . '</span>', 'monsterinsights_save_settings', 'monsterinsights_addons', 'monsterinsights_addons_page' );
63
+	add_submenu_page( $hook, __( 'Addons:', 'google-analytics-for-wordpress' ), '<span style="color:#7cc048"> ' . __( 'Addons', 'google-analytics-for-wordpress' ) . '</span>', 'monsterinsights_save_settings', 'monsterinsights_addons', 'monsterinsights_addons_page' );
64 64
     }
65 65
 }
66 66
 add_action( 'admin_menu', 'monsterinsights_admin_menu' );
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
     // First, let's see if this is an MS network enabled plugin. If it is, we should load the license 
75 75
     // menu page and the updater on the network panel
76 76
     if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
77
-        require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
77
+	require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
78 78
     }
79 79
 
80 80
     $plugin = plugin_basename( MONSTERINSIGHTS_PLUGIN_FILE );
81 81
     if ( ! is_plugin_active_for_network( $plugin ) ) {
82
-        return;
82
+	return;
83 83
     }
84 84
 
85 85
     $hook = 'monsterinsights_network';
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 function monsterinsights_add_admin_body_class( $classes ) {
104 104
     $screen = get_current_screen(); 
105 105
     if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) {
106
-        return $classes;
106
+	return $classes;
107 107
     }
108 108
        
109 109
     return "$classes monsterinsights_page ";
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
 
124 124
     // If lite, show a link where they can get pro from
125 125
     if ( ! monsterinsights_is_pro_version() ) {
126
-        $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="'. monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>';
127
-        array_unshift( $links, $get_pro );
126
+	$get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="'. monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>';
127
+	array_unshift( $links, $get_pro );
128 128
     }
129 129
 
130 130
     // If Lite, support goes to forum. If pro, it goes to our website
131 131
     if ( monsterinsights_is_pro_version() ) {
132
-        $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
133
-        array_unshift( $links, $support );
132
+	$support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
133
+	array_unshift( $links, $support );
134 134
     } else {
135
-        $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://wordpress.org/support/plugin/google-analytics-for-wordpress" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
136
-        array_unshift( $links, $support );
135
+	$support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://wordpress.org/support/plugin/google-analytics-for-wordpress" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
136
+	array_unshift( $links, $support );
137 137
     }
138 138
 
139 139
     $settings_link = '<a href="' . esc_url( admin_url( 'admin.php?page=monsterinsights_settings' ) ) . '">' . esc_html__( 'Settings', 'google-analytics-for-wordpress' ) . '</a>';
@@ -158,26 +158,26 @@  discard block
 block discarded – undo
158 158
 function monsterinsights_load_admin_partial( $template, $data = array() ) {
159 159
 
160 160
     if ( monsterinsights_is_pro_version() ) {
161
-        $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' );
161
+	$dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' );
162 162
     
163
-        if ( file_exists( $dir . $template . '.php' ) ) {
164
-            require_once(  $dir . $template . '.php' );
165
-            return true;
166
-        }
163
+	if ( file_exists( $dir . $template . '.php' ) ) {
164
+	    require_once(  $dir . $template . '.php' );
165
+	    return true;
166
+	}
167 167
     } else {
168
-        $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' );
168
+	$dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' );
169 169
     
170
-        if ( file_exists( $dir . $template . '.php' ) ) {
171
-            require_once(  $dir . $template . '.php' );
172
-            return true;
173
-        }   
170
+	if ( file_exists( $dir . $template . '.php' ) ) {
171
+	    require_once(  $dir . $template . '.php' );
172
+	    return true;
173
+	}   
174 174
     }
175 175
         
176 176
     $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' );
177 177
 
178 178
     if ( file_exists( $dir . $template . '.php' ) ) {
179
-        require_once(  $dir . $template . '.php' );
180
-        return true;
179
+	require_once(  $dir . $template . '.php' );
180
+	return true;
181 181
     }
182 182
                 
183 183
     return false;
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
     // Get the current screen, and check whether we're viewing a MonsterInsights screen;
194 194
     $screen = get_current_screen(); 
195 195
     if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) {
196
-        return;
196
+	return;
197 197
     }
198 198
 
199 199
     // If here, we're on an MonsterInsights screen, so output the header.
200 200
     monsterinsights_load_admin_partial( 'header', array(
201
-        'mascot'   => plugins_url( 'assets/css/images/mascot.png', MonsterInsights()->file ),
202
-        'logo'     => plugins_url( 'assets/css/images/logo.png', MonsterInsights()->file ),
203
-        '2xmascot' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ),
204
-        '2xlogo'   => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ),
201
+	'mascot'   => plugins_url( 'assets/css/images/mascot.png', MonsterInsights()->file ),
202
+	'logo'     => plugins_url( 'assets/css/images/logo.png', MonsterInsights()->file ),
203
+	'2xmascot' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ),
204
+	'2xlogo'   => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ),
205 205
     ) );
206 206
 }
207 207
 add_action( 'in_admin_header','monsterinsights_admin_header', 100 );
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 function monsterinsights_welcome_redirect() {
210 210
     // Bail if no activation redirect
211 211
     if ( ! get_transient( '_monsterinsights_activation_redirect' ) ) {
212
-        return;
212
+	return;
213 213
     }
214 214
 
215 215
     // Delete the redirect transient
@@ -217,15 +217,15 @@  discard block
 block discarded – undo
217 217
 
218 218
     // Bail if activating from network, or bulk
219 219
     if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
220
-        return;
220
+	return;
221 221
     }
222 222
 
223 223
     $upgrade = get_option( 'monsterinsights_version_upgraded_from' );
224 224
     if( ! $upgrade ) { // First time install
225
-        //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
225
+	//wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
226 226
     } else { // Update
227
-        return;
228
-        //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
227
+	return;
228
+	//wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
229 229
     }
230 230
 }
231 231
 //add_action( 'admin_init', 'monsterinsights_welcome_redirect', 11 ); @todo: Investigate
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 function monsterinsights_admin_footer( $text ) {
242 242
     global $current_screen;
243 243
     if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) {
244
-        $url  = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5';
245
-        $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' .  $url . '" target="_blank" rel="noopener noreferrer">&#9733;&#9733;&#9733;&#9733;&#9733;</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' );
244
+	$url  = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5';
245
+	$text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' .  $url . '" target="_blank" rel="noopener noreferrer">&#9733;&#9733;&#9733;&#9733;&#9733;</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' );
246 246
     }
247 247
     return $text;
248 248
 }
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
     // Don't show on MonsterInsights pages
254 254
     $screen = get_current_screen(); 
255 255
     if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) {
256
-        return;
256
+	return;
257 257
     }
258 258
 
259 259
     // Make sure they have the permissions to do something
260 260
     if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
261
-        return;
261
+	return;
262 262
     }
263 263
 
264 264
     // Priority:
@@ -271,45 +271,45 @@  discard block
 block discarded – undo
271 271
 
272 272
     // 1. Google Analytics not authenticated
273 273
     if ( ! is_network_admin() && ! monsterinsights_get_ua() ) {
274
-        $page = admin_url( 'admin.php?page=monsterinsights_settings' );
275
-        $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' );
276
-        echo '<div class="error"><p>'. $message.'</p></div>';
277
-        return;
274
+	$page = admin_url( 'admin.php?page=monsterinsights_settings' );
275
+	$message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' );
276
+	echo '<div class="error"><p>'. $message.'</p></div>';
277
+	return;
278 278
     }
279 279
 
280 280
     // 2. License key not entered for pro
281 281
     $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : '';
282 282
     if ( monsterinsights_is_pro_version() && empty( $key ) ) {
283
-        $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
284
-        $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' );
285
-        echo '<div class="error"><p>'. $message.'</p></div>';
286
-        return;
283
+	$page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
284
+	$message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' );
285
+	echo '<div class="error"><p>'. $message.'</p></div>';
286
+	return;
287 287
     }
288 288
 
289 289
     // 3. License key not valid/okay for pro
290 290
     if ( monsterinsights_is_pro_version() ) {
291
-        $message = '';
292
-        if ( MonsterInsights()->license->get_site_license_key() ){
293
-            if ( MonsterInsights()->license->site_license_expired() ) {
294
-                $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
295
-            } else if ( MonsterInsights()->license->site_license_disabled() ) {
296
-                $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
297
-            } else if ( MonsterInsights()->license->site_license_invalid() ) {
298
-                $message = esc_html__( 'Your license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' );
299
-            }
300
-        } else if ( MonsterInsights()->license->get_network_license_key() ) {
301
-            if ( MonsterInsights()->license->network_license_expired() ) {
302
-                $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
303
-            } else if ( MonsterInsights()->license->network_license_disabled() ) {
304
-                $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
305
-            } else if ( MonsterInsights()->license->network_license_invalid() ) {
306
-                $message = esc_html__( 'Your network license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' );
307
-            }
308
-        }
309
-        if ( ! empty( $message ) ) {
310
-            echo '<div class="error"><p>'. $message.'</p></div>';
311
-            return;
312
-        }
291
+	$message = '';
292
+	if ( MonsterInsights()->license->get_site_license_key() ){
293
+	    if ( MonsterInsights()->license->site_license_expired() ) {
294
+		$message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
295
+	    } else if ( MonsterInsights()->license->site_license_disabled() ) {
296
+		$message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
297
+	    } else if ( MonsterInsights()->license->site_license_invalid() ) {
298
+		$message = esc_html__( 'Your license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' );
299
+	    }
300
+	} else if ( MonsterInsights()->license->get_network_license_key() ) {
301
+	    if ( MonsterInsights()->license->network_license_expired() ) {
302
+		$message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
303
+	    } else if ( MonsterInsights()->license->network_license_disabled() ) {
304
+		$message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
305
+	    } else if ( MonsterInsights()->license->network_license_invalid() ) {
306
+		$message = esc_html__( 'Your network license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' );
307
+	    }
308
+	}
309
+	if ( ! empty( $message ) ) {
310
+	    echo '<div class="error"><p>'. $message.'</p></div>';
311
+	    return;
312
+	}
313 313
     }
314 314
 
315 315
     // 4. Optin setting not configured
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
     $notices   = get_option( 'monsterinsights_notices' );
341 341
     if ( ! is_array( $notices ) ) {
342
-        $notices = array();
342
+	$notices = array();
343 343
     }
344 344
 
345 345
     // 5. Authenticate, not manual
@@ -347,12 +347,12 @@  discard block
 block discarded – undo
347 347
     $url      = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
348 348
 
349 349
     if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { 
350
-        echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">';
351
-            echo '<p>';
352
-            echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); 
353
-            echo '</p>';
354
-        echo '</div>';
355
-        return;
350
+	echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">';
351
+	    echo '<p>';
352
+	    echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); 
353
+	    echo '</p>';
354
+	echo '</div>';
355
+	return;
356 356
     }
357 357
 
358 358
     // 6. Automatic updates not configured
@@ -372,64 +372,64 @@  discard block
 block discarded – undo
372 372
 
373 373
     // 7. WooUpsell
374 374
     if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
375
-        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { 
376
-            echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
377
-                echo '<div class="monsterinsights-wooedd-upsell-left">';
378
-                    echo '<p><strong>';
379
-                    echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' );
380
-                    echo '</strong></p>';
381
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
382
-                    echo '<p>';
383
-                    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
384
-                    echo '</p>';
385
-                    echo '<p>';
386
-                    echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' );
387
-                    echo '</p>';
388
-                    echo '<p>';
389
-                    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
390
-                    echo '</p>';
391
-                    echo '<p>';
392
-                    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
393
-                    echo '</p>';
394
-                    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' &raquo;</a>' ); 
395
-                    echo '</p>';
396
-                echo '</div><div class="monsterinsights-wooedd-upsell-right">';
397
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
398
-                echo '</div>';
399
-            echo '</div>';
400
-            return;
401
-        }
375
+	if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { 
376
+	    echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
377
+		echo '<div class="monsterinsights-wooedd-upsell-left">';
378
+		    echo '<p><strong>';
379
+		    echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' );
380
+		    echo '</strong></p>';
381
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
382
+		    echo '<p>';
383
+		    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
384
+		    echo '</p>';
385
+		    echo '<p>';
386
+		    echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' );
387
+		    echo '</p>';
388
+		    echo '<p>';
389
+		    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
390
+		    echo '</p>';
391
+		    echo '<p>';
392
+		    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
393
+		    echo '</p>';
394
+		    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' &raquo;</a>' ); 
395
+		    echo '</p>';
396
+		echo '</div><div class="monsterinsights-wooedd-upsell-right">';
397
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
398
+		echo '</div>';
399
+	    echo '</div>';
400
+	    return;
401
+	}
402 402
     }
403 403
 
404 404
     // 8. EDDUpsell
405 405
     if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) {
406
-        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { 
407
-            echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
408
-                echo '<div class="monsterinsights-wooedd-upsell-left">';
409
-                    echo '<p><strong>';
410
-                    echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' );
411
-                    echo '</strong></p>';
412
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
413
-                    echo '<p>';
414
-                    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
415
-                    echo '</p>';
416
-                    echo '<p>';
417
-                    echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' );
418
-                    echo '</p>';
419
-                    echo '<p>';
420
-                    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
421
-                    echo '</p>';
422
-                    echo '<p>';
423
-                    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
424
-                    echo '</p>';
425
-                    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' &raquo;</a>' ); 
426
-                    echo '</p>';
427
-                echo '</div><div class="monsterinsights-wooedd-upsell-right">';
428
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
429
-                echo '</div>';
430
-            echo '</div>';
431
-            return;
432
-        }
406
+	if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { 
407
+	    echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
408
+		echo '<div class="monsterinsights-wooedd-upsell-left">';
409
+		    echo '<p><strong>';
410
+		    echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' );
411
+		    echo '</strong></p>';
412
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
413
+		    echo '<p>';
414
+		    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
415
+		    echo '</p>';
416
+		    echo '<p>';
417
+		    echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' );
418
+		    echo '</p>';
419
+		    echo '<p>';
420
+		    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
421
+		    echo '</p>';
422
+		    echo '<p>';
423
+		    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
424
+		    echo '</p>';
425
+		    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' &raquo;</a>' ); 
426
+		    echo '</p>';
427
+		echo '</div><div class="monsterinsights-wooedd-upsell-right">';
428
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
429
+		echo '</div>';
430
+	    echo '</div>';
431
+	    return;
432
+	}
433 433
     }
434 434
 }
435 435
 add_action( 'admin_notices', 'monsterinsights_admin_setup_notices' );
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 // AM Notices
440 440
 function monsterinsights_am_notice_optout( $super_admin ) {
441 441
     if ( monsterinsights_get_option( 'hide_am_notices', false ) || monsterinsights_get_option( 'network_hide_am_notices', false ) ) {
442
-        return false;
442
+	return false;
443 443
     }
444 444
     return $super_admin;
445 445
 }
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
 
35 35
     if ( $dashboards_disabled || ! $is_authed || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) {
36 36
         // If dashboards disabled, first settings page
37
-        add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
37
+        add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
38 38
         $hook = 'monsterinsights_settings';
39 39
 
40 40
         add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' );
41 41
         add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' );
42 42
     } else {
43 43
         // if dashboards enabled, first dashboard
44
-        add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
44
+        add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
45 45
 
46 46
         $hook = 'monsterinsights_reports';
47 47
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     }
84 84
 
85 85
     $hook = 'monsterinsights_network';
86
-    add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
86
+    add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
87 87
 
88 88
     add_submenu_page( $hook, __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Network Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page' );
89 89
 
@@ -118,21 +118,21 @@  discard block
 block discarded – undo
118 118
  * @return array $links
119 119
  */
120 120
 function monsterinsights_add_action_links( $links ) {
121
-    $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="'. monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) .'"">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>';
121
+    $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="' . monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) . '"">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>';
122 122
     array_unshift( $links, $docs );
123 123
 
124 124
     // If lite, show a link where they can get pro from
125 125
     if ( ! monsterinsights_is_pro_version() ) {
126
-        $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="'. monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>';
126
+        $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '" href="' . monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) . '">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>';
127 127
         array_unshift( $links, $get_pro );
128 128
     }
129 129
 
130 130
     // If Lite, support goes to forum. If pro, it goes to our website
131 131
     if ( monsterinsights_is_pro_version() ) {
132
-        $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
132
+        $support = '<a title="MonsterInsights Pro Support" href="' . monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) . '">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
133 133
         array_unshift( $links, $support );
134 134
     } else {
135
-        $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://wordpress.org/support/plugin/google-analytics-for-wordpress" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
135
+        $support = '<a title="MonsterInsights Lite Support" href="' . monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://wordpress.org/support/plugin/google-analytics-for-wordpress" ) . '">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
136 136
         array_unshift( $links, $support );
137 137
     }
138 138
 
@@ -161,14 +161,14 @@  discard block
 block discarded – undo
161 161
         $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' );
162 162
     
163 163
         if ( file_exists( $dir . $template . '.php' ) ) {
164
-            require_once(  $dir . $template . '.php' );
164
+            require_once( $dir . $template . '.php' );
165 165
             return true;
166 166
         }
167 167
     } else {
168 168
         $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' );
169 169
     
170 170
         if ( file_exists( $dir . $template . '.php' ) ) {
171
-            require_once(  $dir . $template . '.php' );
171
+            require_once( $dir . $template . '.php' );
172 172
             return true;
173 173
         }   
174 174
     }
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' );
177 177
 
178 178
     if ( file_exists( $dir . $template . '.php' ) ) {
179
-        require_once(  $dir . $template . '.php' );
179
+        require_once( $dir . $template . '.php' );
180 180
         return true;
181 181
     }
182 182
                 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         '2xlogo'   => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ),
205 205
     ) );
206 206
 }
207
-add_action( 'in_admin_header','monsterinsights_admin_header', 100 );
207
+add_action( 'in_admin_header', 'monsterinsights_admin_header', 100 );
208 208
 
209 209
 function monsterinsights_welcome_redirect() {
210 210
     // Bail if no activation redirect
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
     }
222 222
 
223 223
     $upgrade = get_option( 'monsterinsights_version_upgraded_from' );
224
-    if( ! $upgrade ) { // First time install
224
+    if ( ! $upgrade ) { // First time install
225 225
         //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
226 226
     } else { // Update
227 227
         return;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     global $current_screen;
243 243
     if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) {
244 244
         $url  = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5';
245
-        $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' .  $url . '" target="_blank" rel="noopener noreferrer">&#9733;&#9733;&#9733;&#9733;&#9733;</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' );
245
+        $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer">&#9733;&#9733;&#9733;&#9733;&#9733;</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' );
246 246
     }
247 247
     return $text;
248 248
 }
@@ -272,8 +272,8 @@  discard block
 block discarded – undo
272 272
     // 1. Google Analytics not authenticated
273 273
     if ( ! is_network_admin() && ! monsterinsights_get_ua() ) {
274 274
         $page = admin_url( 'admin.php?page=monsterinsights_settings' );
275
-        $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' );
276
-        echo '<div class="error"><p>'. $message.'</p></div>';
275
+        $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ), '<a href="' . $page . '">', '</a>' );
276
+        echo '<div class="error"><p>' . $message . '</p></div>';
277 277
         return;
278 278
     }
279 279
 
@@ -281,17 +281,17 @@  discard block
 block discarded – undo
281 281
     $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : '';
282 282
     if ( monsterinsights_is_pro_version() && empty( $key ) ) {
283 283
         $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
284
-        $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' );
285
-        echo '<div class="error"><p>'. $message.'</p></div>';
284
+        $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . esc_url( $page ) . '">', '</a>' );
285
+        echo '<div class="error"><p>' . $message . '</p></div>';
286 286
         return;
287 287
     }
288 288
 
289 289
     // 3. License key not valid/okay for pro
290 290
     if ( monsterinsights_is_pro_version() ) {
291 291
         $message = '';
292
-        if ( MonsterInsights()->license->get_site_license_key() ){
292
+        if ( MonsterInsights()->license->get_site_license_key() ) {
293 293
             if ( MonsterInsights()->license->site_license_expired() ) {
294
-                $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
294
+                $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
295 295
             } else if ( MonsterInsights()->license->site_license_disabled() ) {
296 296
                 $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
297 297
             } else if ( MonsterInsights()->license->site_license_invalid() ) {
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
             }
300 300
         } else if ( MonsterInsights()->license->get_network_license_key() ) {
301 301
             if ( MonsterInsights()->license->network_license_expired() ) {
302
-                $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
302
+                $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
303 303
             } else if ( MonsterInsights()->license->network_license_disabled() ) {
304 304
                 $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
305 305
             } else if ( MonsterInsights()->license->network_license_invalid() ) {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
             }
308 308
         }
309 309
         if ( ! empty( $message ) ) {
310
-            echo '<div class="error"><p>'. $message.'</p></div>';
310
+            echo '<div class="error"><p>' . $message . '</p></div>';
311 311
             return;
312 312
         }
313 313
     }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
     //     }
338 338
     // }
339 339
 
340
-    $notices   = get_option( 'monsterinsights_notices' );
340
+    $notices = get_option( 'monsterinsights_notices' );
341 341
     if ( ! is_array( $notices ) ) {
342 342
         $notices = array();
343 343
     }
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
     $authed   = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed();
347 347
     $url      = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
348 348
 
349
-    if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { 
349
+    if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual'] ) ) { 
350 350
         echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">';
351 351
             echo '<p>';
352
-            echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); 
352
+            echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' ); 
353 353
             echo '</p>';
354 354
         echo '</div>';
355 355
         return;
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 
373 373
     // 7. WooUpsell
374 374
     if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
375
-        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { 
375
+        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available'] ) ) { 
376 376
             echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
377 377
                 echo '<div class="monsterinsights-wooedd-upsell-left">';
378 378
                     echo '<p><strong>';
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
                     echo '<p>';
392 392
                     echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
393 393
                     echo '</p>';
394
-                    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' &raquo;</a>' ); 
394
+                    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="' . monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) . '">', ' &raquo;</a>' ); 
395 395
                     echo '</p>';
396 396
                 echo '</div><div class="monsterinsights-wooedd-upsell-right">';
397 397
                     echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
     // 8. EDDUpsell
405 405
     if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) {
406
-        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { 
406
+        if ( ! isset( $notices['monsterinsights_edd_tracking_available'] ) ) { 
407 407
             echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
408 408
                 echo '<div class="monsterinsights-wooedd-upsell-left">';
409 409
                     echo '<p><strong>';
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                     echo '<p>';
423 423
                     echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
424 424
                     echo '</p>';
425
-                    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' &raquo;</a>' ); 
425
+                    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="' . monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) . '">', ' &raquo;</a>' ); 
426 426
                     echo '</p>';
427 427
                 echo '</div><div class="monsterinsights-wooedd-upsell-right">';
428 428
                     echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -221,9 +221,11 @@  discard block
 block discarded – undo
221 221
     }
222 222
 
223 223
     $upgrade = get_option( 'monsterinsights_version_upgraded_from' );
224
-    if( ! $upgrade ) { // First time install
224
+    if( ! $upgrade ) {
225
+// First time install
225 226
         //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
226
-    } else { // Update
227
+    } else {
228
+// Update
227 229
         return;
228 230
         //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
229 231
     }
@@ -289,7 +291,7 @@  discard block
 block discarded – undo
289 291
     // 3. License key not valid/okay for pro
290 292
     if ( monsterinsights_is_pro_version() ) {
291 293
         $message = '';
292
-        if ( MonsterInsights()->license->get_site_license_key() ){
294
+        if ( MonsterInsights()->license->get_site_license_key() ) {
293 295
             if ( MonsterInsights()->license->site_license_expired() ) {
294 296
                 $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
295 297
             } else if ( MonsterInsights()->license->site_license_disabled() ) {
@@ -346,7 +348,7 @@  discard block
 block discarded – undo
346 348
     $authed   = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed();
347 349
     $url      = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
348 350
 
349
-    if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { 
351
+    if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) {
350 352
         echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">';
351 353
             echo '<p>';
352 354
             echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); 
@@ -372,7 +374,7 @@  discard block
 block discarded – undo
372 374
 
373 375
     // 7. WooUpsell
374 376
     if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
375
-        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { 
377
+        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) {
376 378
             echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
377 379
                 echo '<div class="monsterinsights-wooedd-upsell-left">';
378 380
                     echo '<p><strong>';
@@ -403,7 +405,7 @@  discard block
 block discarded – undo
403 405
 
404 406
     // 8. EDDUpsell
405 407
     if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) {
406
-        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { 
408
+        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) {
407 409
             echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
408 410
                 echo '<div class="monsterinsights-wooedd-upsell-left">';
409 411
                     echo '<p><strong>';
Please login to merge, or discard this patch.
includes/admin/settings/tab-general.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                         <form id="monsterinsights-google-authenticate" method="post">
110 110
                             <?php if ( MonsterInsights()->auth->get_viewname() && MonsterInsights()->auth->get_ua() ) { ?>
111 111
                                 <?php if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->is_site_licensed() ) { ?>
112
-                                    <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.' , 'google-analytics-for-wordpress' ); ?></p>
112
+                                    <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.', 'google-analytics-for-wordpress' ); ?></p>
113 113
                                 <?php } else { ?>
114 114
                                     <p><?php echo esc_html__( 'Profile Active: ', 'google-analytics-for-wordpress' ) . MonsterInsights()->auth->get_viewname(); ?></p>
115 115
                                     <p><?php wp_nonce_field( 'monsterinsights-google-authenticated-nonce', 'monsterinsights-google-authenticated-nonce' ); ?>
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
                                 <?php } ?>
120 120
                             <?php } else { ?>
121 121
                                 <?php if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->is_site_licensed() ) { ?>
122
-                                    <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.' , 'google-analytics-for-wordpress' ); ?></p>
122
+                                    <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.', 'google-analytics-for-wordpress' ); ?></p>
123 123
                                 <?php } else { ?>
124 124
                                     <?php wp_nonce_field( 'monsterinsights-google-authenticate-nonce', 'monsterinsights-google-authenticate-nonce' ); ?>
125 125
                                     <?php submit_button( esc_html__( 'Authenticate with your Google account', 'google-analytics-for-wordpress' ), 'button-action', 'monsterinsights-google-authenticate-submit', false ); ?>
126
-                                    <p class="description"><?php printf( esc_html__( 'Already have a Google Account, but don’t know if you’ve setup Google Analytics? %s Click here to login and find out%s.', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'settings-page', 'already-have-ga-account-doc-link', 'https://www.monsterinsights.com/docs/find-out-if-you-already-have-a-google-analytics-account/?utm_source=monsterinsights-settings' ) .'">', '</a>' ); ?>
126
+                                    <p class="description"><?php printf( esc_html__( 'Already have a Google Account, but don’t know if you’ve setup Google Analytics? %s Click here to login and find out%s.', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'settings-page', 'already-have-ga-account-doc-link', 'https://www.monsterinsights.com/docs/find-out-if-you-already-have-a-google-analytics-account/?utm_source=monsterinsights-settings' ) . '">', '</a>' ); ?>
127 127
                                     <br />
128 128
                                     <?php printf( esc_html__( 'Having issues automatically authenticating? %s Click here to authenticate manually%s.', 'google-analytics-for-wordpress' ), '<a href="javascript:monsterinsights_show_manual()" data-action="show-manual-ua-box">', '</a>' ); ?></p>
129 129
                                 <?php } ?>
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                 <tbody>
143 143
                     <?php if ( ! MonsterInsights()->auth->get_viewname() ) { ?>
144 144
                     <!-- Manual UA -->
145
-                    <tr id="monsterinsights-google-ua-box" <?php echo ( ! MonsterInsights()->auth->get_manual_ua() ? 'class="monsterinsights-hideme"' : ''); ?> >
145
+                    <tr id="monsterinsights-google-ua-box" <?php echo ( ! MonsterInsights()->auth->get_manual_ua() ? 'class="monsterinsights-hideme"' : '' ); ?> >
146 146
                         <th scope="row">
147 147
                             <label for="monsterinsights-google-ua"><?php esc_html_e( 'Manually enter your UA code', 'google-analytics-for-wordpress' ); ?></label>
148 148
                         </th>
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
                         </th>
178 178
                         <td>
179 179
                             <p>
180
-                                <?php echo sprintf( esc_html__( 'Already purchased an upgrade to MonsterInsights Pro? To unlock your Pro features and addons, %sfollow our upgrade guide%s to install MonsterInsights Pro.' ), '<a href="'. monsterinsights_get_url( 'settings-page', 'general-tab-upgrade-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) .'">', '</a>' ); ?>
180
+                                <?php echo sprintf( esc_html__( 'Already purchased an upgrade to MonsterInsights Pro? To unlock your Pro features and addons, %sfollow our upgrade guide%s to install MonsterInsights Pro.' ), '<a href="' . monsterinsights_get_url( 'settings-page', 'general-tab-upgrade-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) . '">', '</a>' ); ?>
181 181
                             </p>
182 182
                             <p>
183
-                                <?php echo sprintf( esc_html__( "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro." ), '<a href="'. monsterinsights_get_upgrade_link( 'settings-page', 'general-tab-upgrade-link' ) .'">', '</a>' ); ?>
183
+                                <?php echo sprintf( esc_html__( "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro." ), '<a href="' . monsterinsights_get_upgrade_link( 'settings-page', 'general-tab-upgrade-link' ) . '">', '</a>' ); ?>
184 184
                             </p>
185 185
                         </td>
186 186
                     </tr>
@@ -193,16 +193,16 @@  discard block
 block discarded – undo
193 193
                     echo monsterinsights_make_checkbox( 'dashboards_disabled', $title, $description );
194 194
                     ?>
195 195
 
196
-                    <?php if ( $automatic_updates !== 'all' && $automatic_updates !== 'minor' ){  ?>
196
+                    <?php if ( $automatic_updates !== 'all' && $automatic_updates !== 'minor' ) {  ?>
197 197
                     <?php $automatic_updates = $automatic_updates ? $automatic_updates : 'none'; ?>
198 198
                     <tr id="monsterinsights-automatic-updates-mode">
199 199
                         <th scope="row">
200 200
                             <label for="monsterinsights-automatic-updates-mode"><?php esc_html_e( 'Automatic Updates', 'google-analytics-for-wordpress' ); ?></label>
201 201
                         </th>
202 202
                         <td>
203
-                            <label><input type="radio" name="automatic_updates" value="all" <?php checked( $automatic_updates, 'all' ); ?> ><?php esc_html_e('Yes (Recommended) - Get the latest features, bugfixes, and security updates as they are released.', 'google-analytics-for-wordpress'); ?> </label>
204
-                            <label><input type="radio" name="automatic_updates" value="minor" <?php checked( $automatic_updates, 'minor' ); ?> ><?php esc_html_e( 'Minor Only - Only get bugfixes and security updates, but not major features.', 'google-analytics-for-wordpress'); ?> </label>
205
-                            <label><input type="radio" name="automatic_updates" value="none" <?php checked( $automatic_updates, 'none' ); ?> ><?php esc_html_e( 'None - Manually update everything.', 'google-analytics-for-wordpress'); ?> </label>
203
+                            <label><input type="radio" name="automatic_updates" value="all" <?php checked( $automatic_updates, 'all' ); ?> ><?php esc_html_e( 'Yes (Recommended) - Get the latest features, bugfixes, and security updates as they are released.', 'google-analytics-for-wordpress' ); ?> </label>
204
+                            <label><input type="radio" name="automatic_updates" value="minor" <?php checked( $automatic_updates, 'minor' ); ?> ><?php esc_html_e( 'Minor Only - Only get bugfixes and security updates, but not major features.', 'google-analytics-for-wordpress' ); ?> </label>
205
+                            <label><input type="radio" name="automatic_updates" value="none" <?php checked( $automatic_updates, 'none' ); ?> ><?php esc_html_e( 'None - Manually update everything.', 'google-analytics-for-wordpress' ); ?> </label>
206 206
                         </td>
207 207
                     </tr>
208 208
                     <?php } ?>
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                     <?php
212 212
                     $title       = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' );
213 213
                     $description = esc_html__( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' );
214
-                    if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ){
214
+                    if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ) {
215 215
                         echo monsterinsights_make_checkbox( 'anonymous_data', $title, $description );
216 216
                     }
217 217
                     ?>
Please login to merge, or discard this patch.
includes/admin/settings/register-settings.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -176,13 +176,13 @@  discard block
 block discarded – undo
176 176
 			)
177 177
 		),
178 178
 		/** Demographics Settings */
179
-		'demographics' => apply_filters('monsterinsights_settings_demographics',
179
+		'demographics' => apply_filters( 'monsterinsights_settings_demographics',
180 180
 			array(
181 181
 				'demographics' => array(
182 182
 					'id'          => 'demographics',
183 183
 					'name'        => __( 'Enable Demographics and Interests Reports for Remarketing and Advertising', 'google-analytics-for-wordpress' ),
184
-					'desc'        => sprintf( esc_html__( 'Check this setting to add the Demographics and Remarketing features to your Google Analytics tracking code. Make sure to enable Demographics and Remarketing in your Google Analytics account. We have a guide for how to do that in our %1$sknowledge base%2$s. For more information about Remarketing, we refer you to %3$sGoogle\'s documentation%2$s. Note that usage of this function is affected by privacy and cookie laws around the world. Be sure to follow the laws that affect your target audience.', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'settings-page', 'demographics-setting-doc-link', 'https://www.monsterinsights.com/docs/enable-demographics-and-interests-report-in-google-analytics/' ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">',
185
-									'</a>','<a href="https://support.google.com/analytics/answer/2444872?hl=' . get_locale() . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">'
184
+					'desc'        => sprintf( esc_html__( 'Check this setting to add the Demographics and Remarketing features to your Google Analytics tracking code. Make sure to enable Demographics and Remarketing in your Google Analytics account. We have a guide for how to do that in our %1$sknowledge base%2$s. For more information about Remarketing, we refer you to %3$sGoogle\'s documentation%2$s. Note that usage of this function is affected by privacy and cookie laws around the world. Be sure to follow the laws that affect your target audience.', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'settings-page', 'demographics-setting-doc-link', 'https://www.monsterinsights.com/docs/enable-demographics-and-interests-report-in-google-analytics/' ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">',
185
+									'</a>', '<a href="https://support.google.com/analytics/answer/2444872?hl=' . get_locale() . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">'
186 186
 					),
187 187
 					'type' 		  => 'checkbox',
188 188
 				),
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 			)
196 196
 		),
197 197
 		/** Enhanced Link Attribution Settings */
198
-		'links' => apply_filters('monsterinsights_settings_links',
198
+		'links' => apply_filters( 'monsterinsights_settings_links',
199 199
 			array(
200 200
 				'enhanced_link_attribution' => array(
201 201
 					'id'          => 'enhanced_link_attribution',
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 			)
231 231
 		),
232 232
 		/** File Download Settings */
233
-		'files' => apply_filters('monsterinsights_settings_files',
233
+		'files' => apply_filters( 'monsterinsights_settings_files',
234 234
 			array(
235 235
 				'track_download_as' => array(
236 236
 					'id'          => 'track_download_as',
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 			)
253 253
 		),
254 254
 		/** Affiliate Tracking Settings */
255
-		'affiliates' => apply_filters('monsterinsights_settings_affiliates',
255
+		'affiliates' => apply_filters( 'monsterinsights_settings_affiliates',
256 256
 			array(
257 257
 				'track_internal_as_outbound' => array(
258 258
 					'id'          => 'track_internal_as_outbound',
@@ -269,68 +269,68 @@  discard block
 block discarded – undo
269 269
 			)
270 270
 		),
271 271
 		/** Social Tracking Settings */
272
-		'social' => apply_filters('monsterinsights_settings_social',
272
+		'social' => apply_filters( 'monsterinsights_settings_social',
273 273
 			array()
274 274
 		),
275 275
 		/** Ad Tracking Settings */
276
-		'ads' => apply_filters('monsterinsights_settings_ads',
276
+		'ads' => apply_filters( 'monsterinsights_settings_ads',
277 277
 			array()
278 278
 		),
279 279
 		/** Forms Tracking Settings */
280
-		'forms' => apply_filters('monsterinsights_settings_forms',
280
+		'forms' => apply_filters( 'monsterinsights_settings_forms',
281 281
 			array()
282 282
 		),
283 283
 		/** eCommerce Tracking Settings */
284
-		'ecommerce' => apply_filters('monsterinsights_settings_ecommerce',
284
+		'ecommerce' => apply_filters( 'monsterinsights_settings_ecommerce',
285 285
 			array()
286 286
 		),
287 287
 		/** Media Tracking Settings */
288
-		'media' => apply_filters('monsterinsights_settings_media',
288
+		'media' => apply_filters( 'monsterinsights_settings_media',
289 289
 			array()
290 290
 		),
291 291
 		/** Members Tracking Settings */
292
-		'memberships' => apply_filters('monsterinsights_settings_memberships',
292
+		'memberships' => apply_filters( 'monsterinsights_settings_memberships',
293 293
 			array()
294 294
 		),
295 295
 		/** Dimensions Tracking Settings */
296
-		'dimensions' => apply_filters('monsterinsights_settings_dimensions',
296
+		'dimensions' => apply_filters( 'monsterinsights_settings_dimensions',
297 297
 			array()
298 298
 		),
299 299
 		/** Performance Tracking Settings */
300
-		'performance' => apply_filters('monsterinsights_settings_performance',
300
+		'performance' => apply_filters( 'monsterinsights_settings_performance',
301 301
 			array()
302 302
 		),
303 303
 		/** AMP Tracking Settings */
304
-		'amp' => apply_filters('monsterinsights_settings_amp',
304
+		'amp' => apply_filters( 'monsterinsights_settings_amp',
305 305
 			array()
306 306
 		),
307 307
 		/** Google Optimize Tracking Settings */
308
-		'goptimize' => apply_filters('monsterinsights_settings_goptimize',
308
+		'goptimize' => apply_filters( 'monsterinsights_settings_goptimize',
309 309
 			array()
310 310
 		),
311 311
 		/** Facebook Instant Articles Tracking Settings */
312
-		'fbia' => apply_filters('monsterinsights_settings_fbia',
312
+		'fbia' => apply_filters( 'monsterinsights_settings_fbia',
313 313
 			array()
314 314
 		),
315 315
 		/** Bounce Reduction Settings */
316
-		'bounce' => apply_filters('monsterinsights_settings_bounce',
316
+		'bounce' => apply_filters( 'monsterinsights_settings_bounce',
317 317
 			array()
318 318
 		),
319 319
 		/** Reporting Tracking Settings */
320
-		'reporting' => apply_filters('monsterinsights_settings_reporting',
320
+		'reporting' => apply_filters( 'monsterinsights_settings_reporting',
321 321
 			array()
322 322
 		),
323 323
 		/** Notifications Tracking Settings */
324
-		'notifications' => apply_filters('monsterinsights_settings_notifications',
324
+		'notifications' => apply_filters( 'monsterinsights_settings_notifications',
325 325
 			array()
326 326
 		),
327 327
 		/** Compatibility Tracking Settings */
328
-		'compatibility' => apply_filters('monsterinsights_settings_compatibility',
328
+		'compatibility' => apply_filters( 'monsterinsights_settings_compatibility',
329 329
 			array(
330 330
 				'subdomain_tracking' => array(
331 331
 					'id'          => 'subdomain_tracking',
332 332
 					'name'        => __( 'Domain to track as:', 'google-analytics-for-wordpress' ),
333
-					'desc'        => sprintf( esc_html__( 'This allows you to %1$sset the domain%2$s that\'s used for tracking. Only is used if set to a value, else defaults to automatic determination. It is very rare that you would need to use this setting.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/tracking-snippet-reference" target="_blank" rel="noopener noreferrer" referrer="no-referrer">' ,'</a>' ),
333
+					'desc'        => sprintf( esc_html__( 'This allows you to %1$sset the domain%2$s that\'s used for tracking. Only is used if set to a value, else defaults to automatic determination. It is very rare that you would need to use this setting.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/tracking-snippet-reference" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ),
334 334
 					'type' 		  => 'text',
335 335
 				),
336 336
 				'custom_code' => array(
@@ -342,22 +342,22 @@  discard block
 block discarded – undo
342 342
 				'debug_mode' => array(
343 343
 					'id'          => 'debug_mode',
344 344
 					'name'        => __( 'Enable Debug Mode', 'google-analytics-for-wordpress' ),
345
-					'desc'        => __( 'Turns on debugging in JS events tracking, logging of eCommerce requests and enables debug settings.', 'google-analytics-for-wordpress'),
345
+					'desc'        => __( 'Turns on debugging in JS events tracking, logging of eCommerce requests and enables debug settings.', 'google-analytics-for-wordpress' ),
346 346
 					'type' 		  => 'checkbox',
347 347
 				),
348 348
 			)
349 349
 		),
350 350
 		/** EU Compliance Tracking Settings */
351
-		'eucompliance' => apply_filters('monsterinsights_settings_eucompliance',
351
+		'eucompliance' => apply_filters( 'monsterinsights_settings_eucompliance',
352 352
 			array()
353 353
 		),
354 354
 		/** Permissions Tracking Settings */
355
-		'permissions' => apply_filters('monsterinsights_settings_permissions',
355
+		'permissions' => apply_filters( 'monsterinsights_settings_permissions',
356 356
 			array(
357 357
 				'view_reports' => array(
358 358
 					'id'          => 'view_reports',
359 359
 					'name'        => __( 'Let these user roles see reports:', 'google-analytics-for-wordpress' ),
360
-					'desc'        => sprintf( esc_html( 'Users that have at least one of these roles will be able to view the reports, along with any user with the %s capability.', 'google-analytics-for-wordpress' ), '<code>manage_options</code>'),
360
+					'desc'        => sprintf( esc_html( 'Users that have at least one of these roles will be able to view the reports, along with any user with the %s capability.', 'google-analytics-for-wordpress' ), '<code>manage_options</code>' ),
361 361
 					'type'        => 'select',
362 362
 					'options'     => monsterinsights_get_roles(),
363 363
 					'select2'     => true,
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 				'save_settings' => array(
368 368
 					'id'          => 'save_settings',
369 369
 					'name'        => __( 'Let these user roles save settings:', 'google-analytics-for-wordpress' ),
370
-					'desc'        => sprintf( esc_html__( 'Users that have at least one of these roles will be able to view and save the settings panel, along with any user with the %s capability.', 'google-analytics-for-wordpress'), '<code>manage_options</code>' ),
370
+					'desc'        => sprintf( esc_html__( 'Users that have at least one of these roles will be able to view and save the settings panel, along with any user with the %s capability.', 'google-analytics-for-wordpress' ), '<code>manage_options</code>' ),
371 371
 					'type'        => 'select',
372 372
 					'options'     => monsterinsights_get_roles(),
373 373
 					'select2'     => true,
Please login to merge, or discard this patch.
includes/admin/settings/settings-api.php 1 patch
Spacing   +55 added lines, -55 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
  * Get the settings for a section
@@ -82,23 +82,23 @@  discard block
 block discarded – undo
82 82
 	// get subtab
83 83
 	$settings = monsterinsights_get_registered_settings();
84 84
 	$tab      = $_POST['monsterinsights_settings_sub_tab'];
85
-	if ( empty( $settings ) || !is_array( $settings ) || empty( $settings[ $tab ] ) || ! is_array( $settings[ $tab ] ) ) {
85
+	if ( empty( $settings ) || ! is_array( $settings ) || empty( $settings[$tab] ) || ! is_array( $settings[$tab] ) ) {
86 86
 		return;
87 87
 	}
88 88
 
89 89
 	// Okay we're good to sanitize, validate, and save this section's settings
90 90
 
91 91
 	// We only care about this sections's settings
92
-	$settings = $settings[ $tab ]; 
92
+	$settings = $settings[$tab]; 
93 93
 
94 94
 	// Run a general sanitization for the tab for special fields
95 95
 	$input    = ! empty( $_POST['monsterinsights_settings'] ) ? $_POST['monsterinsights_settings'] : array();
96 96
 	$input    = apply_filters( 'monsterinsights_settings_' . $tab . '_sanitize', $input );
97 97
 
98
-	foreach( $settings as $id => $setting ) {
98
+	foreach ( $settings as $id => $setting ) {
99 99
 
100 100
 		// If the value wasn't passed in, set to false, which will delete the option
101
-		$value          = isset( $input[ $id ] ) ? $input[ $id ] : false;
101
+		$value          = isset( $input[$id] ) ? $input[$id] : false;
102 102
 		$previous_value = monsterinsights_get_option( $id, false );
103 103
 
104 104
 		// Sanitize/Validate
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
 		) );
139 139
 
140 140
 		// Sanitize settings
141
-		$value = apply_filters( 'monsterinsights_settings_sanitize_' . $id  , $value, $id, $args, $previous_value );
141
+		$value = apply_filters( 'monsterinsights_settings_sanitize_' . $id, $value, $id, $args, $previous_value );
142 142
 		$value = apply_filters( 'monsterinsights_settings_sanitize_' . $type, $value, $id, $args, $previous_value );
143
-		$value = apply_filters( 'monsterinsights_settings_sanitize'         , $value, $id, $args, $previous_value );
143
+		$value = apply_filters( 'monsterinsights_settings_sanitize', $value, $id, $args, $previous_value );
144 144
 
145 145
 		// Save
146 146
 		if ( ! has_action( 'monsterinsights_settings_save_' . $args['type'] ) ) {
@@ -153,13 +153,13 @@  discard block
 block discarded – undo
153 153
 }
154 154
 add_action( 'current_screen', 'monsterinsights_save_settings' );
155 155
 
156
-function monsterinsights_is_settings_tab( $tab = '' ){
156
+function monsterinsights_is_settings_tab( $tab = '' ) {
157 157
 	$tabs = monsterinsights_get_settings_tabs();
158 158
 	if ( empty( $tab ) || empty( $tabs ) || ! is_string( $tab ) || ! is_array( $tabs ) ) {
159 159
 		return false;
160 160
 	}
161 161
 
162
-	return !empty( $tabs[$tab]);
162
+	return ! empty( $tabs[$tab] );
163 163
 }
164 164
 
165 165
 /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 		if ( ! empty( $settings[$section] ) ) {
177 177
 			foreach ( $settings[$section] as $setting ) {
178 178
 				if ( is_array( $setting ) && array_key_exists( 'type', $setting ) ) {
179
-					$setting_types[ $setting['id'] ] = $setting['type'];
179
+					$setting_types[$setting['id']] = $setting['type'];
180 180
 				}
181 181
 			}
182 182
 		}
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		foreach ( $settings as $tab ) {
185 185
 			foreach ( $tab as $setting ) {
186 186
 				if ( is_array( $setting ) && array_key_exists( 'type', $setting ) ) {
187
-					$setting_types[ $setting['id'] ] = $setting['type'];
187
+					$setting_types[$setting['id']] = $setting['type'];
188 188
 				}
189 189
 			}
190 190
 		}
@@ -256,14 +256,14 @@  discard block
 block discarded – undo
256 256
 	function _sanitize_text_fields( $str, $keep_newlines = false ) {
257 257
 		$filtered = wp_check_invalid_utf8( $str );
258 258
 	 
259
-		if ( strpos($filtered, '<') !== false ) {
259
+		if ( strpos( $filtered, '<' ) !== false ) {
260 260
 			$filtered = wp_pre_kses_less_than( $filtered );
261 261
 			// This will strip extra whitespace for us.
262 262
 			$filtered = wp_strip_all_tags( $filtered, false );
263 263
 	 
264 264
 			// Use html entities in a special case to make sure no later
265 265
 			// newline stripping stage could lead to a functional tag
266
-			$filtered = str_replace("<\n", "&lt;\n", $filtered);
266
+			$filtered = str_replace( "<\n", "&lt;\n", $filtered );
267 267
 		}
268 268
 	 
269 269
 		if ( ! $keep_newlines ) {
@@ -272,14 +272,14 @@  discard block
 block discarded – undo
272 272
 		$filtered = trim( $filtered );
273 273
 	 
274 274
 		$found = false;
275
-		while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) {
276
-			$filtered = str_replace($match[0], '', $filtered);
275
+		while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
276
+			$filtered = str_replace( $match[0], '', $filtered );
277 277
 			$found = true;
278 278
 		}
279 279
 	 
280 280
 		if ( $found ) {
281 281
 			// Strip out the whitespace that may now exist after removing the octets.
282
-			$filtered = trim( preg_replace('/ +/', ' ', $filtered) );
282
+			$filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
283 283
 		}
284 284
 	 
285 285
 		return $filtered;
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 function monsterinsights_sanitize_multicheck_field( $value, $id, $setting, $previous_value ) {
318 318
 	$save_value = array();
319 319
 	if ( ! empty( $value ) && is_array( $value ) ) {
320
-		foreach( $setting['options'] as $key => $option ){
320
+		foreach ( $setting['options'] as $key => $option ) {
321 321
 			if ( in_array( $key, $value ) ) {
322 322
 				$save_value[] = $key;
323 323
 			}
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 	if ( ! empty( $value ) && is_array( $value ) ) {
343 343
 		if ( $setting['multiple'] ) {
344 344
 			foreach ( $value as $vid => $vname ) {
345
-				foreach( $setting['options'] as $key => $option ){
345
+				foreach ( $setting['options'] as $key => $option ) {
346 346
 					if ( $key === $vname ) {
347 347
 						$save_value[] = $key;
348 348
 						break;
@@ -350,11 +350,11 @@  discard block
 block discarded – undo
350 350
 				}
351 351
 			}
352 352
 		} else {
353
-			foreach( $setting['options'] as $key => $option ){
353
+			foreach ( $setting['options'] as $key => $option ) {
354 354
 				if ( is_array( $value ) && in_array( $key, $value ) ) {
355 355
 					$save_value = $key;
356 356
 					break;
357
-				} else if ( is_string( $value ) && $key === $value ){
357
+				} else if ( is_string( $value ) && $key === $value ) {
358 358
 					$save_value = $key;
359 359
 					break;
360 360
 				}
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 function monsterinsights_sanitize_radio_field( $value, $id, $setting, $previous_value ) {
376 376
 	$save_value = '';
377 377
 	if ( ! empty( $value ) ) {
378
-		foreach( $setting['options'] as $key => $option ){
378
+		foreach ( $setting['options'] as $key => $option ) {
379 379
 			if ( $key === $value ) {
380 380
 				$save_value = $key;
381 381
 			}
@@ -492,14 +492,14 @@  discard block
 block discarded – undo
492 492
  */
493 493
 function monsterinsights_get_pages( $force = false ) {
494 494
 	$pages_options = array( '' => '' ); // Blank option
495
-	if( ( ! isset( $_GET['page'] ) || 'monsterinsights_settings' != $_GET['page'] ) && ! $force ) {
495
+	if ( ( ! isset( $_GET['page'] ) || 'monsterinsights_settings' != $_GET['page'] ) && ! $force ) {
496 496
 		return $pages_options;
497 497
 	}
498 498
 
499 499
 	$pages = get_pages();
500 500
 	if ( $pages ) {
501 501
 		foreach ( $pages as $page ) {
502
-			$pages_options[ $page->ID ] = $page->post_title;
502
+			$pages_options[$page->ID] = $page->post_title;
503 503
 		}
504 504
 	}
505 505
 
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 	}
541 541
 
542 542
 	$html     = '<input type="checkbox" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']"' . $name . ' value="1" ' . $checked . ' class="' . $class . '" ' . $disabled . ' />';
543
-	$html    .= '<p class="description">'  . wp_kses_post( $args['desc'] ) . '</p>';
543
+	$html    .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
544 544
 
545 545
 	return apply_filters( 'monsterinsights_after_setting_output', $html, $args );
546 546
 }
@@ -562,9 +562,9 @@  discard block
 block discarded – undo
562 562
 
563 563
 	$html = '';
564 564
 	if ( ! empty( $args['options'] ) ) {
565
-		foreach( $args['options'] as $key => $option ):
566
-			if( isset( $monsterinsights_option[ $key ] ) ) { $enabled = $option; } else { $enabled = NULL; }
567
-			$html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="checkbox" value="' . esc_attr( $option ) . '" ' . checked($option, $enabled, false) . '/>&nbsp;';
565
+		foreach ( $args['options'] as $key => $option ):
566
+			if ( isset( $monsterinsights_option[$key] ) ) { $enabled = $option; } else { $enabled = NULL; }
567
+			$html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="checkbox" value="' . esc_attr( $option ) . '" ' . checked( $option, $enabled, false ) . '/>&nbsp;';
568 568
 			$html .= '<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']">' . wp_kses_post( $option ) . '</label><br/>';
569 569
 		endforeach;
570 570
 		$html .= '<p class="description">' . $args['desc'] . '</p>';
@@ -596,12 +596,12 @@  discard block
 block discarded – undo
596 596
 
597 597
 		if ( $monsterinsights_options && $monsterinsights_options == $key ) {
598 598
 			$checked = true;
599
-		} else if( isset( $args['std'] ) && $args['std'] == $key && ! $monsterinsights_options ) {
599
+		} else if ( isset( $args['std'] ) && $args['std'] == $key && ! $monsterinsights_options ) {
600 600
 			$checked = true;
601 601
 		}
602 602
 
603 603
 		$html .= '<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']">';
604
-		$html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="radio" value="' . monsterinsights_sanitize_key( $key ) . '" ' . checked(true, $checked, false) . '/>&nbsp;';
604
+		$html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="radio" value="' . monsterinsights_sanitize_key( $key ) . '" ' . checked( true, $checked, false ) . '/>&nbsp;';
605 605
 		$html .= esc_html( $option ) . '</label>';
606 606
 	endforeach;
607 607
 
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 
626 626
 	if ( $monsterinsights_option ) {
627 627
 		$value = $monsterinsights_option;
628
-	} elseif( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) {
628
+	} elseif ( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) {
629 629
 		$value = '';
630 630
 	} else {
631 631
 		$value = isset( $args['std'] ) ? $args['std'] : '';
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 	$readonly = $args['readonly'] === true ? ' readonly="readonly"' : '';
646 646
 	$size     = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
647 647
 	$html     = '<input type="text" class="' . $class . ' ' . sanitize_html_class( $size ) . '-text" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" ' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"' . $readonly . $disabled . ' placeholder="' . esc_attr( $args['placeholder'] ) . '"/>';
648
-	$html    .= '<p class="description"> '  . wp_kses_post( $args['desc'] ) . '</p>';
648
+	$html    .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>';
649 649
 
650 650
 	return apply_filters( 'monsterinsights_after_setting_output', $html, $args );
651 651
 }
@@ -679,13 +679,13 @@  discard block
 block discarded – undo
679 679
 
680 680
 	$class = monsterinsights_sanitize_html_class( $args['field_class'] );
681 681
 
682
-	$max  = isset( $args['max'] )  ? $args['max']   : 999999;
683
-	$min  = isset( $args['min'] )  ? $args['min']   : 0;
682
+	$max  = isset( $args['max'] ) ? $args['max'] : 999999;
683
+	$min  = isset( $args['min'] ) ? $args['min'] : 0;
684 684
 	$step = isset( $args['step'] ) ? $args['step'] : 1;
685 685
 
686 686
 	$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
687 687
 	$html = '<input type="number" step="' . esc_attr( $step ) . '" max="' . esc_attr( $max ) . '" min="' . esc_attr( $min ) . '" class="' . $class . ' ' . sanitize_html_class( $size ) . '-text" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" ' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"/>';
688
-	$html .= '<p class="description"> '  . wp_kses_post( $args['desc'] ) . '</p>';
688
+	$html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>';
689 689
 
690 690
 	return apply_filters( 'monsterinsights_after_setting_output', $html, $args );
691 691
 }
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 	$class = monsterinsights_sanitize_html_class( $args['field_class'] );
713 713
 
714 714
 	$html = '<textarea class="' . $class . ' large-text" cols="50" rows="5" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
715
-	$html .= '<p class="description"> '  . wp_kses_post( $args['desc'] ) . '</p>';
715
+	$html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>';
716 716
 
717 717
 	return apply_filters( 'monsterinsights_after_setting_output', $html, $args );
718 718
 }
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 		$class = monsterinsights_sanitize_html_class( $args['field_class'] );
743 743
 
744 744
 		$html = '<textarea class="' . $class . ' large-text" cols="50" rows="5" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']">' . stripslashes( $value ) . '</textarea>';
745
-		$html .= '<p class="description"> '  . wp_kses_post( $args['desc'] ) . '</p>';
745
+		$html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>';
746 746
 	} else {
747 747
 		$html .= sprintf( esc_html__( 'You must have the %s capability to view/edit this setting', 'google-analytics-for-wordpress' ), '"unfiltered_html"' );
748 748
 	}
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
  *
789 789
  * @return void
790 790
  */
791
-function monsterinsights_select_callback($args) {
791
+function monsterinsights_select_callback( $args ) {
792 792
 	$monsterinsights_option = monsterinsights_get_option( $args['id'] );
793 793
 
794 794
 	if ( $monsterinsights_option ) {
@@ -810,14 +810,14 @@  discard block
 block discarded – undo
810 810
 	}
811 811
 
812 812
 	$allowclear   = isset( $args['allowclear'] ) ? (bool) $args['allowclear'] : false;
813
-	$multiple     = isset( $args['multiple'] )   ? (bool) $args['multiple'] : false;
813
+	$multiple     = isset( $args['multiple'] ) ? (bool) $args['multiple'] : false;
814 814
 	$multiple     = $multiple ? 'multiple="multiple"' : '';
815 815
 	$multiple_arg = $multiple ? '[]' : '';
816 816
 
817
-	$html = '<select id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']' . $multiple_arg .'" class="' . $class . '" data-placeholder="' . esc_html( $placeholder ) . '" data-allow-clear="' . $allowclear . '" ' . $multiple . ' />';
817
+	$html = '<select id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']' . $multiple_arg . '" class="' . $class . '" data-placeholder="' . esc_html( $placeholder ) . '" data-allow-clear="' . $allowclear . '" ' . $multiple . ' />';
818 818
 
819 819
 	foreach ( $args['options'] as $option => $name ) {
820
-		$selected = ! empty( $value ) && is_array( $value ) ? in_array( $option, $value ) :  $value === $option;
820
+		$selected = ! empty( $value ) && is_array( $value ) ? in_array( $option, $value ) : $value === $option;
821 821
 		$selected = selected( true, $selected, false );
822 822
 		$html .= '<option value="' . esc_attr( $option ) . '" ' . $selected . '>' . esc_html( $name ) . '</option>';
823 823
 	}
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 	if ( $monsterinsights_option ) {
843 843
 		$value = $monsterinsights_option;
844 844
 	} else {
845
-		if( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) {
845
+		if ( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) {
846 846
 			$value = '';
847 847
 		} else {
848 848
 			$value = isset( $args['std'] ) ? $args['std'] : '';
@@ -902,9 +902,9 @@  discard block
 block discarded – undo
902 902
  * @return void
903 903
  */
904 904
 function monsterinsights_upgrade_notice_callback( $args ) {
905
-	$html =   '<div class="monsterinsights-upsell-box"><h2>' . esc_html( $args['name' ] ) . '</h2>'
905
+	$html = '<div class="monsterinsights-upsell-box"><h2>' . esc_html( $args['name'] ) . '</h2>'
906 906
 			. '<p class="monsterinsights-upsell-lite-text">' . $args['desc'] . '</p>'
907
-			. '<p class="monsterinsights-upsell-button-par"><a href="'. monsterinsights_get_upgrade_link( 'settings-page', 'settings-page-upgrade-cta' ) .'" class="monsterinsights-upsell-box-button button button-primary">' . __( 'Click here to Upgrade', 'google-analytics-for-wordpress' ) . '</a></p>'
907
+			. '<p class="monsterinsights-upsell-button-par"><a href="' . monsterinsights_get_upgrade_link( 'settings-page', 'settings-page-upgrade-cta' ) . '" class="monsterinsights-upsell-box-button button button-primary">' . __( 'Click here to Upgrade', 'google-analytics-for-wordpress' ) . '</a></p>'
908 908
 			. '</div>';
909 909
 	return apply_filters( 'monsterinsights_after_setting_output', $html, $args ); 
910 910
 }
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
  * @param array $args Arguments passed by the setting
933 933
  * @return void
934 934
  */
935
-function monsterinsights_missing_callback($args) {
935
+function monsterinsights_missing_callback( $args ) {
936 936
 	return sprintf(
937 937
 		__( 'The callback function used for the %s setting is missing.', 'google-analytics-for-wordpress' ),
938 938
 		'<strong>' . $args['id'] . '</strong>'
@@ -963,12 +963,12 @@  discard block
 block discarded – undo
963 963
 			}
964 964
 		}
965 965
 		if ( $submit_button ) {
966
-			$html .= '<input type="hidden" name="monsterinsights_settings_tab" value="' . esc_attr( $page ). '"/>';
967
-			$html .= '<input type="hidden" name="monsterinsights_settings_sub_tab" value="' .  esc_attr( $section ) . '"/>';
966
+			$html .= '<input type="hidden" name="monsterinsights_settings_tab" value="' . esc_attr( $page ) . '"/>';
967
+			$html .= '<input type="hidden" name="monsterinsights_settings_sub_tab" value="' . esc_attr( $section ) . '"/>';
968 968
 			$html .= wp_nonce_field( 'monsterinsights-settings-nonce', 'monsterinsights-settings-nonce', true, false );
969 969
 			$html .= get_submit_button( esc_html__( 'Save Changes', 'google-analytics-for-wordpress' ), 'primary', 'monsterinsights-settings-submit', false );
970 970
 		}
971
-		$html      = apply_filters( 'monsterinsights_html_after_submit_field', $html, $page, $section );
971
+		$html = apply_filters( 'monsterinsights_html_after_submit_field', $html, $page, $section );
972 972
 	}
973 973
 	return $html;
974 974
 }
@@ -978,10 +978,10 @@  discard block
 block discarded – undo
978 978
  */
979 979
 function monsterinsights_render_field( $args ) {
980 980
 	$output = '';
981
-	$output .='<tr id="monsterinsights-input-' . monsterinsights_sanitize_key( $args['id'] ) .'">';
981
+	$output .= '<tr id="monsterinsights-input-' . monsterinsights_sanitize_key( $args['id'] ) . '">';
982 982
 		if ( ! empty( $args['name'] ) && empty( $args['no_label'] ) ) {
983 983
 			$output .= '<th scope="row">';
984
-				$output .='<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']">' . esc_html( $args["name"] ) . '</label>';
984
+				$output .= '<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']">' . esc_html( $args["name"] ) . '</label>';
985 985
 			$output .= '</th>';
986 986
 		} 
987 987
 
@@ -1029,9 +1029,9 @@  discard block
 block discarded – undo
1029 1029
 	$notices = get_transient( 'monsterinsights_settings_notices' );
1030 1030
 	if ( empty( $notices ) ) {
1031 1031
 		$notices          = array();
1032
-		$notices[ $name ] = array( "type" => $type, "message" => $message );
1032
+		$notices[$name] = array( "type" => $type, "message" => $message );
1033 1033
 	} else {
1034
-		$notices[ $name ] = array( "type" => $type, "message" => $message );
1034
+		$notices[$name] = array( "type" => $type, "message" => $message );
1035 1035
 	}
1036 1036
 	set_transient( 'monsterinsights_settings_notices', $notices );
1037 1037
 }
@@ -1043,8 +1043,8 @@  discard block
 block discarded – undo
1043 1043
 	$notices = get_transient( 'monsterinsights_settings_notices' );
1044 1044
 	$found   = false;
1045 1045
 	if ( ! empty( $notices ) ) {
1046
-		if ( isset( $notices[ $name] ) ) {
1047
-			unset( $notices[ $name] );
1046
+		if ( isset( $notices[$name] ) ) {
1047
+			unset( $notices[$name] );
1048 1048
 			set_transient( 'monsterinsights_settings_notices', $notices );
1049 1049
 			$found = true;
1050 1050
 		} else {
@@ -1057,6 +1057,6 @@  discard block
 block discarded – undo
1057 1057
 /** 
1058 1058
  * @todo  docbloc
1059 1059
  */
1060
-function monsterinsights_get_non_setting_types(){
1061
-	return apply_filters( 'monsterinsights_non_setting_types', array(  'descriptive_text', 'hook', 'upgrade_notice', 'install_notice', 'notice' ) );
1060
+function monsterinsights_get_non_setting_types() {
1061
+	return apply_filters( 'monsterinsights_non_setting_types', array( 'descriptive_text', 'hook', 'upgrade_notice', 'install_notice', 'notice' ) );
1062 1062
 }
1063 1063
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/settings/tab-tracking.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                 $i++;
74 74
                 ?>
75 75
                  <div id="monsterinsights-sub-tab-<?php echo esc_attr( $id ); ?>" class="monsterinsights-sub-nav-tab monsterinsights-nav-tab<?php echo esc_attr( $class ); ?>">
76
-                    <?php if ( $item['level'] === 'lite' ||  $is_pro ) { ?>
76
+                    <?php if ( $item['level'] === 'lite' || $is_pro ) { ?>
77 77
                     <?php echo '<h2 class="monsterinsights-sub-tab-header">' . esc_html( $item['title'] ) . '</h2>'; ?>
78 78
                     <?php } ?>
79 79
                      <div class="monsterinsights-subtab-settings-notices">
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                     </div>
92 92
                     <!-- Settings Form -->
93 93
                     <?php $class = ( $item['level'] !== 'lite' && ! $is_pro ) ? 'monsterinsights-no-settings-shown' : ''; ?>
94
-                    <form id="monsterinsights-tracking-<?php echo esc_attr( $id );?>-tab" class="<?php echo $class; ?>" method="post">
94
+                    <form id="monsterinsights-tracking-<?php echo esc_attr( $id ); ?>-tab" class="<?php echo $class; ?>" method="post">
95 95
                         <table class="form-table">
96 96
                             <tbody>
97 97
                                 <?php
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
                             </tbody>
103 103
                         </table>
104 104
                         <?php echo monsterinsights_render_submit_field( $id, 'tracking' ); ?>
105
-                        <?php if ( $item['level'] === 'lite' && !$is_pro ) { ?>
105
+                        <?php if ( $item['level'] === 'lite' && ! $is_pro ) { ?>
106 106
                             <div class="monsterinsights-upsell-under-box">
107 107
                                 <h2><?php esc_html_e( "Want even more fine tuned control over your website analytics?", 'google-analytics-for-wordpress' ); ?></h2>
108 108
                                 <p class="monsterinsights-upsell-lite-text"><?php esc_html_e( "By upgrading to MonsterInsights Pro, you get access to numerous addons and tools that help you better understand what people are doing on your website, so you can keep doing more of what's working. Some of the features include: Ecommerce tracking, Author tracking, Post Type tracking, Ads tracking, Google AMP tracking, Performance optimization, and so much more!", 'google-analytics-for-wordpress' ); ?></p>
109
-                                <p class="monsterinsights-upsell-button-par"><a href="<?php echo monsterinsights_get_upgrade_link( 'settings-page', 'settings-page-bottom-cta' );?>" class="button button-primary"><?php esc_html_e( "Click here to Upgrade", 'google-analytics-for-wordpress' ); ?></a></p></div>
109
+                                <p class="monsterinsights-upsell-button-par"><a href="<?php echo monsterinsights_get_upgrade_link( 'settings-page', 'settings-page-bottom-cta' ); ?>" class="button button-primary"><?php esc_html_e( "Click here to Upgrade", 'google-analytics-for-wordpress' ); ?></a></p></div>
110 110
                         <?php } ?>
111 111
                     </form>
112 112
                 </div>
Please login to merge, or discard this patch.
includes/admin/pages/addons.php 2 patches
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -18,20 +18,20 @@  discard block
 block discarded – undo
18 18
     global $admin_page_hooks;
19 19
    
20 20
     if ( ! is_object( $current_screen ) || empty( $current_screen->id ) || empty( $admin_page_hooks ) ) {
21
-        return false;
21
+	return false;
22 22
     }
23 23
 
24 24
     $settings_page = false;
25 25
     if ( ! empty( $admin_page_hooks['monsterinsights_dashboard'] ) && $current_screen->id === $admin_page_hooks['monsterinsights_dashboard'] . '_page_monsterinsights_addons' ) {
26
-        $settings_page = true;
26
+	$settings_page = true;
27 27
     }
28 28
 
29 29
     if ( ! empty( $admin_page_hooks['monsterinsights_settings'] ) && $current_screen->id === $admin_page_hooks['monsterinsights_settings'] . '_page_monsterinsights_addons' ) {
30
-        $settings_page = true;
30
+	$settings_page = true;
31 31
     }
32 32
 
33 33
     if ( ! empty( $admin_page_hooks['monsterinsights_network'] ) && $current_screen->id === $admin_page_hooks['monsterinsights_network'] . '_page_monsterinsights_addons-network' ) {
34
-        $settings_page = true;
34
+	$settings_page = true;
35 35
     }
36 36
 
37 37
     return $settings_page;
@@ -46,16 +46,16 @@  discard block
 block discarded – undo
46 46
  */
47 47
 function monsterinsights_maybe_refresh_addons() {
48 48
     if ( ! monsterinsights_is_addons_page() ) {
49
-        return;
49
+	return;
50 50
     }
51 51
 
52 52
 
53 53
     if ( empty( $_POST['google-analytics-for-wordpress-refresh-addons-submit'] ) ) {
54
-        return;
54
+	return;
55 55
     }
56 56
 
57 57
     if ( ! wp_verify_nonce( $_POST['google-analytics-for-wordpress-refresh-addons'], 'google-analytics-for-wordpress-refresh-addons' ) ) {
58
-        return;
58
+	return;
59 59
     }
60 60
 
61 61
     monsterinsights_get_addons_data( MonsterInsights()->license->get_valid_license_key() );
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
     <div id="monsterinsights-addons" class="wrap">
94 94
         <div class="monsterinsights-clear">
95 95
             <?php
96
-            /** 
97
-             * Developer Alert:
98
-             *
99
-             * Per the README, this is considered an internal hook and should
100
-             * not be used by other developers. This hook's behavior may be modified
101
-             * or the hook may be removed at any time, without warning.
102
-             */
103
-            ?>
96
+	    /** 
97
+	     * Developer Alert:
98
+	     *
99
+	     * Per the README, this is considered an internal hook and should
100
+	     * not be used by other developers. This hook's behavior may be modified
101
+	     * or the hook may be removed at any time, without warning.
102
+	     */
103
+	    ?>
104 104
             <?php do_action( 'monsterinsights_addons_section' ); ?>
105 105
         </div>
106 106
     </div>
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
 
118 118
     // If error(s) occurred during license key verification, display them and exit now.
119 119
     if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->get_valid_license_key() ) {
120
-        ?>
120
+	?>
121 121
         <div class="error below-h2">
122 122
             <p>
123 123
                 <?php esc_html_e( 'In order to get access to Addons, you need to resolve your license key errors.', 'google-analytics-for-wordpress' ); ?>
124 124
             </p>
125 125
         </div>
126 126
         <?php
127
-        return;
127
+	return;
128 128
     }
129 129
 
130 130
     // Get Addons
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     // If no Addon(s) were returned, our API call returned an error.
134 134
     // Show an error message with a button to reload the page, which will trigger another API call.
135 135
     if ( ! $addons ) {
136
-        ?>
136
+	?>
137 137
         <form id="monsterinsights-addons-refresh-addons-form" method="post">
138 138
             <p>
139 139
                 <?php esc_html_e( 'There was an issue retrieving the addons for this site. Please click on the button below the refresh the addons data.', 'google-analytics-for-wordpress' ); ?>
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             </p>
144 144
         </form>
145 145
         <?php
146
-        return;
146
+	return;
147 147
     }
148 148
 
149 149
     // If here, we have Addons to display, so let's output them now.
@@ -153,9 +153,9 @@  discard block
 block discarded – undo
153 153
     ?>
154 154
     <div id="monsterinsights-addons">
155 155
         <?php
156
-        // Output Addons the User is licensed to use.
157
-        if ( count( $addons['licensed'] )> 0 ) {
158
-            ?>
156
+	// Output Addons the User is licensed to use.
157
+	if ( count( $addons['licensed'] )> 0 ) {
158
+	    ?>
159 159
             <div class="monsterinsights-addons-area licensed" class="monsterinsights-clear">
160 160
                 <h3><?php esc_html_e( 'Available Addons:', 'google-analytics-for-wordpress' ); ?></h3>
161 161
                 
@@ -163,19 +163,19 @@  discard block
 block discarded – undo
163 163
                     <!-- list container class required for list.js -->
164 164
                     <div class="list">
165 165
                         <?php
166
-                        foreach ( (array) $addons['licensed'] as $i => $addon ) {
167
-                            monsterinsights_get_addon_card( $addon, $i, true, $installed_plugins );
168
-                        }
169
-                        ?>
166
+			foreach ( (array) $addons['licensed'] as $i => $addon ) {
167
+			    monsterinsights_get_addon_card( $addon, $i, true, $installed_plugins );
168
+			}
169
+			?>
170 170
                     </div>
171 171
                 </div>
172 172
             </div>
173 173
             <?php
174
-        } // Close licensed addons
174
+	} // Close licensed addons
175 175
 
176
-        // Output Addons the User isn't licensed to use.
177
-        if ( count( $addons['unlicensed'] ) > 0 ) {
178
-            ?>
176
+	// Output Addons the User isn't licensed to use.
177
+	if ( count( $addons['unlicensed'] ) > 0 ) {
178
+	    ?>
179 179
             <div class="monsterinsights-addons-area unlicensed" class="monsterinsights-clear">
180 180
                 <h3><?php esc_html_e( 'Unlock More Addons', 'google-analytics-for-wordpress' ); ?></h3>
181 181
                 <p><?php echo sprintf( esc_html__( '%1$sWant even more addons?%2$sUpgrade your MonsterInsights account%3$s and unlock the following addons:', 'google-analytics-for-wordpress' ), '<strong>', '</strong> <a href="' . $upgrade_url. '">', '</a>' ); ?></p>
@@ -184,16 +184,16 @@  discard block
 block discarded – undo
184 184
                     <!-- list container class required for list.js -->
185 185
                     <div class="list">
186 186
                         <?php
187
-                        foreach ( (array) $addons['unlicensed'] as $i => $addon ) {
188
-                            monsterinsights_get_addon_card( $addon, $i, false, $installed_plugins );
189
-                        }
190
-                        ?>
187
+			foreach ( (array) $addons['unlicensed'] as $i => $addon ) {
188
+			    monsterinsights_get_addon_card( $addon, $i, false, $installed_plugins );
189
+			}
190
+			?>
191 191
                     </div>
192 192
                 </div>
193 193
             </div>
194 194
             <?php
195
-        } // Close unlicensed addons
196
-        ?>
195
+	} // Close unlicensed addons
196
+	?>
197 197
     </div>
198 198
     <?php
199 199
 
@@ -215,37 +215,37 @@  discard block
 block discarded – undo
215 215
     
216 216
     // Get addons data from transient or perform API query if no transient.
217 217
     if ( false === ( $addons = get_transient( '_monsterinsights_addons' ) ) ) {
218
-        $addons = monsterinsights_get_addons_data( $key );
218
+	$addons = monsterinsights_get_addons_data( $key );
219 219
     }
220 220
 
221 221
     // If no Addons exist, return false
222 222
     if ( ! $addons ) {
223
-        return false;
223
+	return false;
224 224
     }
225 225
 
226 226
     // Iterate through Addons, to build two arrays: 
227 227
     // - Addons the user is licensed to use,
228 228
     // - Addons the user isn't licensed to use.
229 229
     $results = array(
230
-        'licensed'  => array(),
231
-        'unlicensed'=> array(),
230
+	'licensed'  => array(),
231
+	'unlicensed'=> array(),
232 232
     );
233 233
     foreach ( (array) $addons as $i => $addon ) {
234 234
 
235
-        // Determine whether the user is licensed to use this Addon or not.
236
-        if ( 
237
-            empty( $type ) ||
238
-            ( in_array( 'Pro', $addon->categories ) && ( $type != 'pro' && $type != 'master' ) ) ||
239
-            ( in_array( 'Plus', $addon->categories ) && $type != 'plus' && $type != 'pro' && $type != 'master' ) ||
240
-            ( in_array( 'Basic', $addon->categories ) && ( $type != 'basic' && $type != 'plus' && $type != 'pro' && $type != 'master' ) )
241
-        ) {
242
-            // Unlicensed
243
-            $results['unlicensed'][] = $addon;
244
-            continue;
245
-        }
246
-
247
-        // Licensed
248
-        $results['licensed'][] = $addon;
235
+	// Determine whether the user is licensed to use this Addon or not.
236
+	if ( 
237
+	    empty( $type ) ||
238
+	    ( in_array( 'Pro', $addon->categories ) && ( $type != 'pro' && $type != 'master' ) ) ||
239
+	    ( in_array( 'Plus', $addon->categories ) && $type != 'plus' && $type != 'pro' && $type != 'master' ) ||
240
+	    ( in_array( 'Basic', $addon->categories ) && ( $type != 'basic' && $type != 'plus' && $type != 'pro' && $type != 'master' ) )
241
+	) {
242
+	    // Unlicensed
243
+	    $results['unlicensed'][] = $addon;
244
+	    continue;
245
+	}
246
+
247
+	// Licensed
248
+	$results['licensed'][] = $addon;
249 249
 
250 250
     }
251 251
 
@@ -268,21 +268,21 @@  discard block
 block discarded – undo
268 268
     // Get Addons
269 269
     // If the key is valid, we'll get personalised upgrade URLs for each Addon (if necessary) and plugin update information.
270 270
     if ( $key ) {
271
-        $addons = MonsterInsights()->license_actions->perform_remote_request( 'get-addons-data-v600', array( 'tgm-updater-key' => $key ) ); 
271
+	$addons = MonsterInsights()->license_actions->perform_remote_request( 'get-addons-data-v600', array( 'tgm-updater-key' => $key ) ); 
272 272
     } else {
273
-        $addons = MonsterInsights()->license_actions->perform_remote_request( 'get-all-addons-data', array() ); 
273
+	$addons = MonsterInsights()->license_actions->perform_remote_request( 'get-all-addons-data', array() ); 
274 274
     }
275 275
     
276 276
     // If there was an API error, set transient for only 10 minutes.
277 277
     if ( ! $addons ) {
278
-        set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS );
279
-        return false;
278
+	set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS );
279
+	return false;
280 280
     }
281 281
 
282 282
     // If there was an error retrieving the addons, set the error.
283 283
     if ( isset( $addons->error ) ) {
284
-        set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS );
285
-        return false;
284
+	set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS );
285
+	return false;
286 286
     }
287 287
 
288 288
     // Otherwise, our request worked. Save the data and return it.
@@ -303,9 +303,9 @@  discard block
 block discarded – undo
303 303
     $keys = array_keys( get_plugins() );
304 304
 
305 305
     foreach ( $keys as $key ) {
306
-        if ( preg_match( '|^' . $slug . '|', $key ) ) {
307
-            return $key;
308
-        }
306
+	if ( preg_match( '|^' . $slug . '|', $key ) ) {
307
+	    return $key;
308
+	}
309 309
     }
310 310
 
311 311
     return $slug;
@@ -328,24 +328,24 @@  discard block
 block discarded – undo
328 328
     $slug = str_replace( 'monsterinsights-', '', $addon->slug );
329 329
     $slug = 'monsterinsights-' . $addon->slug;
330 330
     if ( $slug === 'monsterinsights-ecommerce' ) {
331
-        $slug = 'ga-ecommerce';
331
+	$slug = 'ga-ecommerce';
332 332
     } 
333 333
 
334 334
     $plugin_basename   = monsterinsights_get_plugin_basename_from_slug( $slug );
335 335
     $categories = implode( ',', $addon->categories );
336 336
     if ( ! $installed_plugins ) {
337
-        $installed_plugins = get_plugins();
337
+	$installed_plugins = get_plugins();
338 338
     }
339 339
    
340 340
     // If the Addon doesn't supply an upgrade_url key, it's because the user hasn't provided a license
341 341
     // get_upgrade_link() will return the Lite or Pro link as necessary for us.
342 342
     if ( ! isset( $addon->upgrade_url ) ) {
343
-        $addon->upgrade_url = monsterinsights_get_upgrade_link();
343
+	$addon->upgrade_url = monsterinsights_get_upgrade_link();
344 344
     }
345 345
 
346 346
     // Link user to doc to install MI pro to install addons
347 347
     if ( ! monsterinsights_is_pro_version() && $is_licensed && ! isset( $installed_plugins[ $plugin_basename ] ) ) {
348
-        $addon->url = monsterinsights_get_url( 'addons-page', 'install-addons-link', "https://www.monsterinsights.com/docs/install-monsterinsights-pro-to-use-addons" );
348
+	$addon->url = monsterinsights_get_url( 'addons-page', 'install-addons-link', "https://www.monsterinsights.com/docs/install-monsterinsights-pro-to-use-addons" );
349 349
     }
350 350
 
351 351
     // Output the card
@@ -353,19 +353,19 @@  discard block
 block discarded – undo
353 353
     <div class="monsterinsights-addon">
354 354
         <h3 class="monsterinsights-addon-title"><?php echo esc_html( $addon->title ); ?></h3>
355 355
         <?php
356
-        if ( ! empty( $addon->image ) ) {
357
-            ?>
356
+	if ( ! empty( $addon->image ) ) {
357
+	    ?>
358 358
             <img class="monsterinsights-addon-thumb" src="<?php echo esc_attr( esc_url( $addon->image ) ); ?>" alt="<?php echo esc_attr( $addon->title ); ?>" />
359 359
             <?php
360
-        }
361
-        ?>
360
+	}
361
+	?>
362 362
 
363 363
         <p class="monsterinsights-addon-excerpt"><?php echo esc_html( $addon->excerpt ); ?></p>
364 364
 
365 365
         <?php
366
-        // If the Addon is unlicensed, show the upgrade button 
367
-        if ( ! $is_licensed ) {
368
-            ?>
366
+	// If the Addon is unlicensed, show the upgrade button 
367
+	if ( ! $is_licensed ) {
368
+	    ?>
369 369
             <div class="monsterinsights-addon-active monsterinsights-addon-message">
370 370
                 <div class="interior">
371 371
                     <div class="monsterinsights-addon-upgrade">
@@ -377,15 +377,15 @@  discard block
 block discarded – undo
377 377
                 </div>
378 378
             </div>
379 379
             <?php
380
-        } else {
381
-            // Addon is licensed
382
-
383
-            // If the plugin is not installed, display an install message and button.
384
-            if ( ! isset( $installed_plugins[ $plugin_basename ] ) ) {
385
-                if ( empty( $addon->url ) ) {
386
-                    $addon->url = '';
387
-                }
388
-                ?>
380
+	} else {
381
+	    // Addon is licensed
382
+
383
+	    // If the plugin is not installed, display an install message and button.
384
+	    if ( ! isset( $installed_plugins[ $plugin_basename ] ) ) {
385
+		if ( empty( $addon->url ) ) {
386
+		    $addon->url = '';
387
+		}
388
+		?>
389 389
                 <div class="monsterinsights-addon-not-installed monsterinsights-addon-message">
390 390
                     <div class="interior">
391 391
                          <?php if ( monsterinsights_is_pro_version() ) { ?>
@@ -408,22 +408,22 @@  discard block
 block discarded – undo
408 408
                     </div>
409 409
                 </div>
410 410
                 <?php
411
-            } else {
412
-                // Plugin is installed.
411
+	    } else {
412
+		// Plugin is installed.
413 413
                 
414
-                $active = false;
415
-                $ms_active = is_plugin_active_for_network( $plugin_basename );
416
-                $ss_active = is_plugin_active( $plugin_basename );
417
-
418
-                if ( is_multisite() && is_network_admin() ) {
419
-                    $active = is_plugin_active_for_network( $plugin_basename );
420
-                } else {
421
-                    $active = is_plugin_active( $plugin_basename );
422
-                }
423
-
424
-                if ( $active ) {
425
-                    // Plugin is active. Display the active message and deactivate button.
426
-                    ?>
414
+		$active = false;
415
+		$ms_active = is_plugin_active_for_network( $plugin_basename );
416
+		$ss_active = is_plugin_active( $plugin_basename );
417
+
418
+		if ( is_multisite() && is_network_admin() ) {
419
+		    $active = is_plugin_active_for_network( $plugin_basename );
420
+		} else {
421
+		    $active = is_plugin_active( $plugin_basename );
422
+		}
423
+
424
+		if ( $active ) {
425
+		    // Plugin is active. Display the active message and deactivate button.
426
+		    ?>
427 427
                     <div class="monsterinsights-addon-active monsterinsights-addon-message">
428 428
                         <div class="interior">
429 429
                             <?php if ( $ms_active ) { ?>
@@ -449,9 +449,9 @@  discard block
 block discarded – undo
449 449
                         </div>
450 450
                     </div>
451 451
                     <?php
452
-                } else {
453
-                    // Plugin is inactivate. Display the inactivate mesage and activate button.
454
-                    ?>
452
+		} else {
453
+		    // Plugin is inactivate. Display the inactivate mesage and activate button.
454
+		    ?>
455 455
                     <div class="monsterinsights-addon-inactive monsterinsights-addon-message">
456 456
                         <div class="interior">
457 457
                             <?php if ( $ms_active ) { ?>
@@ -474,10 +474,10 @@  discard block
 block discarded – undo
474 474
                         </div>
475 475
                     </div>
476 476
                     <?php
477
-                }
478
-            }
479
-        }
480
-        ?>
477
+		}
478
+	    }
479
+	}
480
+	?>
481 481
     </div>
482 482
     <?php
483 483
 }
484 484
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * not be used by other developers. This hook's behavior may be modified
77 77
      * or the hook may be removed at any time, without warning.
78 78
      */
79
-    do_action('monsterinsights_head');
79
+    do_action( 'monsterinsights_head' );
80 80
     ?>
81 81
     <?php echo monsterinsights_ublock_notice(); ?>
82 82
     <div id="monsterinsights-addon-heading" class="monsterinsights-addons-subheading monsterinsights-clearfix-after">
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     <div id="monsterinsights-addons">
155 155
         <?php
156 156
         // Output Addons the User is licensed to use.
157
-        if ( count( $addons['licensed'] )> 0 ) {
157
+        if ( count( $addons['licensed'] ) > 0 ) {
158 158
             ?>
159 159
             <div class="monsterinsights-addons-area licensed" class="monsterinsights-clear">
160 160
                 <h3><?php esc_html_e( 'Available Addons:', 'google-analytics-for-wordpress' ); ?></h3>
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             ?>
179 179
             <div class="monsterinsights-addons-area unlicensed" class="monsterinsights-clear">
180 180
                 <h3><?php esc_html_e( 'Unlock More Addons', 'google-analytics-for-wordpress' ); ?></h3>
181
-                <p><?php echo sprintf( esc_html__( '%1$sWant even more addons?%2$sUpgrade your MonsterInsights account%3$s and unlock the following addons:', 'google-analytics-for-wordpress' ), '<strong>', '</strong> <a href="' . $upgrade_url. '">', '</a>' ); ?></p>
181
+                <p><?php echo sprintf( esc_html__( '%1$sWant even more addons?%2$sUpgrade your MonsterInsights account%3$s and unlock the following addons:', 'google-analytics-for-wordpress' ), '<strong>', '</strong> <a href="' . $upgrade_url . '">', '</a>' ); ?></p>
182 182
                 
183 183
                 <div id="monsterinsights-addons-unlicensed" class="monsterinsights-addons">
184 184
                     <!-- list container class required for list.js -->
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         $slug = 'ga-ecommerce';
332 332
     } 
333 333
 
334
-    $plugin_basename   = monsterinsights_get_plugin_basename_from_slug( $slug );
334
+    $plugin_basename = monsterinsights_get_plugin_basename_from_slug( $slug );
335 335
     $categories = implode( ',', $addon->categories );
336 336
     if ( ! $installed_plugins ) {
337 337
         $installed_plugins = get_plugins();
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
     }
345 345
 
346 346
     // Link user to doc to install MI pro to install addons
347
-    if ( ! monsterinsights_is_pro_version() && $is_licensed && ! isset( $installed_plugins[ $plugin_basename ] ) ) {
347
+    if ( ! monsterinsights_is_pro_version() && $is_licensed && ! isset( $installed_plugins[$plugin_basename] ) ) {
348 348
         $addon->url = monsterinsights_get_url( 'addons-page', 'install-addons-link', "https://www.monsterinsights.com/docs/install-monsterinsights-pro-to-use-addons" );
349 349
     }
350 350
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             // Addon is licensed
382 382
 
383 383
             // If the plugin is not installed, display an install message and button.
384
-            if ( ! isset( $installed_plugins[ $plugin_basename ] ) ) {
384
+            if ( ! isset( $installed_plugins[$plugin_basename] ) ) {
385 385
                 if ( empty( $addon->url ) ) {
386 386
                     $addon->url = '';
387 387
                 }
@@ -427,17 +427,17 @@  discard block
 block discarded – undo
427 427
                     <div class="monsterinsights-addon-active monsterinsights-addon-message">
428 428
                         <div class="interior">
429 429
                             <?php if ( $ms_active ) { ?>
430
-                            <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sNetwork Active%2$s', 'google-analytics-for-wordpress'), '<span>', '</span>' ); ?></span>
430
+                            <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sNetwork Active%2$s', 'google-analytics-for-wordpress' ), '<span>', '</span>' ); ?></span>
431 431
                             <?php } else { ?>
432
-                            <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sActive%2$s', 'google-analytics-for-wordpress'), '<span>', '</span>' ); ?></span>
432
+                            <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sActive%2$s', 'google-analytics-for-wordpress' ), '<span>', '</span>' ); ?></span>
433 433
                             <?php } ?> 
434
-                            <?php if ( ( is_multisite() && is_network_admin() && $ms_active ) || ! is_multisite() || ( is_multisite() && !is_network_admin() && !$ms_active && $ss_active ) ) { ?>
434
+                            <?php if ( ( is_multisite() && is_network_admin() && $ms_active ) || ! is_multisite() || ( is_multisite() && ! is_network_admin() && ! $ms_active && $ss_active ) ) { ?>
435 435
                             <div class="monsterinsights-addon-action">
436 436
                                 <a class="button button-primary monsterinsights-addon-action-button monsterinsights-deactivate-addon" href="#" rel="<?php echo esc_attr( $plugin_basename ); ?>">
437 437
                                     <i class="monsterinsights-toggle-on"></i>
438 438
                                     <?php if ( is_multisite() && is_network_admin() && $ms_active ) { ?>
439 439
                                         <?php esc_html_e( 'Network deactivate', 'google-analytics-for-wordpress' ); ?> 
440
-                                    <?php } else if ( is_multisite() && !is_network_admin() && !$ms_active && $ss_active ) { ?>
440
+                                    <?php } else if ( is_multisite() && ! is_network_admin() && ! $ms_active && $ss_active ) { ?>
441 441
                                         <?php esc_html_e( 'Deactivate', 'google-analytics-for-wordpress' ); ?> 
442 442
                                     <?php } else { ?>
443 443
                                         <?php esc_html_e( 'Deactivate', 'google-analytics-for-wordpress' ); ?> 
@@ -455,9 +455,9 @@  discard block
 block discarded – undo
455 455
                     <div class="monsterinsights-addon-inactive monsterinsights-addon-message">
456 456
                         <div class="interior">
457 457
                             <?php if ( $ms_active ) { ?>
458
-                            <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sNetwork Inactive%2$s', 'google-analytics-for-wordpress'), '<span>', '</span>' ); ?></span>
458
+                            <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sNetwork Inactive%2$s', 'google-analytics-for-wordpress' ), '<span>', '</span>' ); ?></span>
459 459
                             <?php } else { ?>
460
-                            <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sInactive%2$s', 'google-analytics-for-wordpress'), '<span>', '</span>' ); ?></span>
460
+                            <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sInactive%2$s', 'google-analytics-for-wordpress' ), '<span>', '</span>' ); ?></span>
461 461
                             <?php } ?> 
462 462
                             <div class="monsterinsights-addon-action">
463 463
                                 <a class="button button-primary monsterinsights-addon-action-button monsterinsights-activate-addon" href="#" rel="<?php echo esc_attr( $plugin_basename ); ?>">
Please login to merge, or discard this patch.
includes/admin/pages/network-settings.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
                      */
49 49
                     do_action( 'monsterinsights_network_settings_general_tab_notice' );
50 50
                     ?>
51
-                    <h1><?php esc_html_e( 'Network Settings', 'google-analytics-for-wordpress'); ?></h1>
52
-                    <p><?php esc_html_e( 'Activate your MonsterInsights license key on this panel to hide the license key settings and addon pages for subsites.', 'google-analytics-for-wordpress'); ?></p>
51
+                    <h1><?php esc_html_e( 'Network Settings', 'google-analytics-for-wordpress' ); ?></h1>
52
+                    <p><?php esc_html_e( 'Activate your MonsterInsights license key on this panel to hide the license key settings and addon pages for subsites.', 'google-analytics-for-wordpress' ); ?></p>
53 53
                     <table class="form-table">
54 54
                         <tbody>
55 55
                             <?php if ( monsterinsights_is_pro_version() ) { 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                                     <form id="monsterinsights-google-authenticate" method="post">
113 113
                                         <?php if ( MonsterInsights()->auth->get_network_viewname() && MonsterInsights()->auth->get_network_ua() ) { ?>
114 114
                                             <?php if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->is_network_licensed() ) { ?>
115
-                                                <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.' , 'google-analytics-for-wordpress' ); ?></p>
115
+                                                <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.', 'google-analytics-for-wordpress' ); ?></p>
116 116
                                             <?php } else { ?>
117 117
                                                 <p><?php echo esc_html__( 'Profile Active: ', 'google-analytics-for-wordpress' ) . MonsterInsights()->auth->get_network_viewname(); ?></p>
118 118
                                                 <p><?php wp_nonce_field( 'monsterinsights-google-authenticated-nonce', 'monsterinsights-google-authenticated-nonce' ); ?>
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                                             <?php } ?>
123 123
                                         <?php } else { ?>
124 124
                                             <?php if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->is_network_licensed() ) { ?>
125
-                                                <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.' , 'google-analytics-for-wordpress' ); ?></p>
125
+                                                <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.', 'google-analytics-for-wordpress' ); ?></p>
126 126
                                             <?php } else { ?>
127 127
                                                 <?php wp_nonce_field( 'monsterinsights-google-authenticate-nonce', 'monsterinsights-google-authenticate-nonce' ); ?>
128 128
                                                 <?php submit_button( esc_html__( 'Authenticate with your Google account', 'google-analytics-for-wordpress' ), 'button-action', 'monsterinsights-google-authenticate-submit', false ); ?>
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                             <?php if ( ! MonsterInsights()->auth->get_network_viewname() ) {
137 137
                                 $network_ua = MonsterInsights()->auth->get_network_manual_ua();
138 138
                             ?>
139
-                            <tr id="monsterinsights-google-ua-box" <?php echo (empty( $network_ua ) ? 'class="monsterinsights-hideme"' : ''); ?> >
139
+                            <tr id="monsterinsights-google-ua-box" <?php echo ( empty( $network_ua ) ? 'class="monsterinsights-hideme"' : '' ); ?> >
140 140
                                 <form id="monsterinsights-network-general-tab" method="post">
141 141
                                     <th scope="row">
142 142
                                         <label for="monsterinsights-google-ua"><?php esc_html_e( 'Network UA code', 'google-analytics-for-wordpress' ); ?></label>
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
                                 </th>
158 158
                                 <td>
159 159
                                     <p>
160
-                                        <?php echo sprintf( esc_html__( 'Already purchased an upgrade to MonsterInsights Pro? To unlock your Pro features and addons, %sfollow our upgrade guide%s to install MonsterInsights Pro.' ), '<a href="'. monsterinsights_get_url( 'network-settings-page', 'go-lite-pro-link', "https://www.monsterinsights.com/docs/go-lite-pro" ) .'">', '</a>' ); ?>
160
+                                        <?php echo sprintf( esc_html__( 'Already purchased an upgrade to MonsterInsights Pro? To unlock your Pro features and addons, %sfollow our upgrade guide%s to install MonsterInsights Pro.' ), '<a href="' . monsterinsights_get_url( 'network-settings-page', 'go-lite-pro-link', "https://www.monsterinsights.com/docs/go-lite-pro" ) . '">', '</a>' ); ?>
161 161
                                     </p>
162 162
                                     <p>
163
-                                        <?php echo sprintf( esc_html__( "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro." ), '<a href="'. monsterinsights_get_upgrade_link( 'network-settings-page', 'upgrade-to-pro-link' ) .'">', '</a>' ); ?>
163
+                                        <?php echo sprintf( esc_html__( "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro." ), '<a href="' . monsterinsights_get_upgrade_link( 'network-settings-page', 'upgrade-to-pro-link' ) . '">', '</a>' ); ?>
164 164
                                     </p>
165 165
                                 </td>
166 166
                             </tr>
Please login to merge, or discard this patch.