Passed
Push — master ( 6ac651...0a307d )
by
unknown
13:21
created
includes/deprecated.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -316,48 +316,48 @@
 block discarded – undo
316 316
 
317 317
 if (!function_exists('monsterinsights_get_ua')) {
318 318
     function monsterinsights_get_ua() {
319
-        return '';
319
+	return '';
320 320
     }
321 321
 }
322 322
 
323 323
 if (!function_exists('monsterinsights_get_network_ua')) {
324 324
     function monsterinsights_get_network_ua() {
325
-        return '';
325
+	return '';
326 326
     }
327 327
 }
328 328
 
329 329
 if (!function_exists('monsterinsights_mp_track_event_call')) {
330 330
     function monsterinsights_mp_track_event_call() {
331
-        return '';
331
+	return '';
332 332
     }
333 333
 }
334 334
 
335 335
 if (!function_exists('monsterinsights_mp_api_call')) {
336 336
     function monsterinsights_mp_api_call() {
337
-        return '';
337
+	return '';
338 338
     }
339 339
 }
340 340
 
341 341
 if (!function_exists('monsterinsights_get_mp_api_url')) {
342 342
     function monsterinsights_get_mp_api_url() {
343
-        return '';
343
+	return '';
344 344
     }
345 345
 }
346 346
 
347 347
 if (!function_exists('monsterinsights_get_tracking_ids')) {
348 348
     function monsterinsights_get_tracking_ids() {
349
-        return '';
349
+	return '';
350 350
     }
351 351
 }
352 352
 
353 353
 if (!function_exists('monsterinsights_is_valid_ua')) {
354 354
     function monsterinsights_is_valid_ua() {
355
-        return false;
355
+	return false;
356 356
     }
357 357
 }
358 358
 
359 359
 if (!function_exists('monsterinsights_get_ua_to_output')) {
360 360
     function monsterinsights_get_ua_to_output() {
361
-        return '';
361
+	return '';
362 362
     }
363 363
 }
364 364
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -314,49 +314,49 @@
 block discarded – undo
314 314
 	<?php
315 315
 }
316 316
 
317
-if (!function_exists('monsterinsights_get_ua')) {
317
+if ( ! function_exists( 'monsterinsights_get_ua' ) ) {
318 318
     function monsterinsights_get_ua() {
319 319
         return '';
320 320
     }
321 321
 }
322 322
 
323
-if (!function_exists('monsterinsights_get_network_ua')) {
323
+if ( ! function_exists( 'monsterinsights_get_network_ua' ) ) {
324 324
     function monsterinsights_get_network_ua() {
325 325
         return '';
326 326
     }
327 327
 }
328 328
 
329
-if (!function_exists('monsterinsights_mp_track_event_call')) {
329
+if ( ! function_exists( 'monsterinsights_mp_track_event_call' ) ) {
330 330
     function monsterinsights_mp_track_event_call() {
331 331
         return '';
332 332
     }
333 333
 }
334 334
 
335
-if (!function_exists('monsterinsights_mp_api_call')) {
335
+if ( ! function_exists( 'monsterinsights_mp_api_call' ) ) {
336 336
     function monsterinsights_mp_api_call() {
337 337
         return '';
338 338
     }
339 339
 }
340 340
 
341
-if (!function_exists('monsterinsights_get_mp_api_url')) {
341
+if ( ! function_exists( 'monsterinsights_get_mp_api_url' ) ) {
342 342
     function monsterinsights_get_mp_api_url() {
343 343
         return '';
344 344
     }
345 345
 }
346 346
 
347
-if (!function_exists('monsterinsights_get_tracking_ids')) {
347
+if ( ! function_exists( 'monsterinsights_get_tracking_ids' ) ) {
348 348
     function monsterinsights_get_tracking_ids() {
349 349
         return '';
350 350
     }
351 351
 }
352 352
 
353
-if (!function_exists('monsterinsights_is_valid_ua')) {
353
+if ( ! function_exists( 'monsterinsights_is_valid_ua' ) ) {
354 354
     function monsterinsights_is_valid_ua() {
355 355
         return false;
356 356
     }
357 357
 }
358 358
 
359
-if (!function_exists('monsterinsights_get_ua_to_output')) {
359
+if ( ! function_exists( 'monsterinsights_get_ua_to_output' ) ) {
360 360
     function monsterinsights_get_ua_to_output() {
361 361
         return '';
362 362
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -284,8 +284,7 @@  discard block
 block discarded – undo
284 284
  * @since 8.19.0
285 285
  *
286 286
  */
287
-function _monsterinsights_notice_deprecated_facebook_instant_articles()
288
-{
287
+function _monsterinsights_notice_deprecated_facebook_instant_articles() {
289 288
 	?>
290 289
 	<div data-dismissible="deprecated-addon-facebook-instant-articles" class="notice notice-error is-dismissible">
291 290
 		<p>
@@ -303,8 +302,7 @@  discard block
 block discarded – undo
303 302
  * @since 8.20.0
304 303
  *
305 304
  */
306
-function _monsterinsights_notice_deprecated_google_optimize()
307
-{
305
+function _monsterinsights_notice_deprecated_google_optimize() {
308 306
 	?>
309 307
 	<div data-dismissible="deprecated-addon-facebook-instant-articles" class="notice notice-error is-dismissible">
310 308
 		<p>
Please login to merge, or discard this patch.
includes/popular-posts/class-popular-posts.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		monsterinsights_localize_script( 'monsterinsights-popular-posts-js', 'monsterinsights_pp', array(
197 197
 			'ajaxurl' => admin_url( 'admin-ajax.php' ),
198 198
 			'post_id' => get_the_ID(),
199
-			'nonce'   => wp_create_nonce('mi-popular-posts'),
199
+			'nonce'   => wp_create_nonce( 'mi-popular-posts' ),
200 200
 		) );
201 201
 	}
202 202
 
@@ -539,13 +539,13 @@  discard block
 block discarded – undo
539 539
 						continue;
540 540
 					}
541 541
 
542
-					if ( ! empty( $atts[ $atts_key ] ) ) {
543
-						if ( is_bool( $atts[ $atts_key ] ) || 'on' === $atts[ $atts_key ] ) {
542
+					if ( ! empty( $atts[$atts_key] ) ) {
543
+						if ( is_bool( $atts[$atts_key] ) || 'on' === $atts[$atts_key] ) {
544 544
 							continue;
545 545
 						}
546 546
 						if ( 'size' === $style_key ) {
547
-							$style_key         = 'font-size';
548
-							$atts[ $atts_key ] .= 'px';
547
+							$style_key = 'font-size';
548
+							$atts[$atts_key] .= 'px';
549 549
 						}
550 550
 						if ( 'background' === $style_key || 'background' === $element && 'color' === $style_key ) {
551 551
 							$style_key = 'background-color';
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 						if ( 'border' === $element || 'border' === $style_key ) {
554 554
 							$style_key = 'border-color';
555 555
 						}
556
-						$style_css .= $style_key . ':' . $atts[ $atts_key ] . ';';
556
+						$style_css .= $style_key . ':' . $atts[$atts_key] . ';';
557 557
 					}
558 558
 				}
559 559
 			}
@@ -575,11 +575,11 @@  discard block
 block discarded – undo
575 575
 
576 576
 		$class = get_called_class();
577 577
 
578
-		if ( ! isset( self::$instances[ $class ] ) ) {
579
-			self::$instances[ $class ] = new $class;
578
+		if ( ! isset( self::$instances[$class] ) ) {
579
+			self::$instances[$class] = new $class;
580 580
 		}
581 581
 
582
-		return self::$instances[ $class ];
582
+		return self::$instances[$class];
583 583
 
584 584
 	}
585 585
 
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 	public function get_themes_styles_for_output() {
742 742
 
743 743
 		$stored_styles = $this->get_theme_props()->get_theme_stored_styles();
744
-		$themes        = ! empty( $stored_styles[ $this->type ] ) && is_array( $stored_styles[ $this->type ] ) ? $stored_styles[ $this->type ] : array();
744
+		$themes        = ! empty( $stored_styles[$this->type] ) && is_array( $stored_styles[$this->type] ) ? $stored_styles[$this->type] : array();
745 745
 
746 746
 		return $themes;
747 747
 
Please login to merge, or discard this patch.
includes/options.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
  */
50 50
 function monsterinsights_get_option( $key = '', $default = false ) {
51 51
 	global $monsterinsights_settings;
52
-	$value = ! empty( $monsterinsights_settings[ $key ] ) ? $monsterinsights_settings[ $key ] : $default;
52
+	$value = ! empty( $monsterinsights_settings[$key] ) ? $monsterinsights_settings[$key] : $default;
53 53
 	$value = apply_filters( 'monsterinsights_get_option', $value, $key, $default );
54 54
 
55 55
 	return apply_filters( 'monsterinsights_get_option_' . $key, $value, $key, $default );
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	$value = apply_filters( 'monsterinsights_update_option', $value, $key );
190 190
 
191 191
 	// Next let's try to update the value
192
-	$settings[ $key ] = $value;
192
+	$settings[$key] = $value;
193 193
 	$did_update       = false;
194 194
 	//if ( $update_network_option ) {
195 195
 	//    $did_update = update_site_option( $option_name, $settings );
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	// If it updated, let's update the global variable
201 201
 	if ( $did_update ) {
202 202
 		global $monsterinsights_settings;
203
-		$monsterinsights_settings[ $key ] = $value;
203
+		$monsterinsights_settings[$key] = $value;
204 204
 	}
205 205
 
206 206
 	return $did_update;
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
 	//}
238 238
 
239 239
 	// Next let's try to remove the key
240
-	if ( isset( $settings[ $key ] ) ) {
241
-		unset( $settings[ $key ] );
240
+	if ( isset( $settings[$key] ) ) {
241
+		unset( $settings[$key] );
242 242
 	}
243 243
 
244 244
 	$did_update = false;
@@ -289,8 +289,8 @@  discard block
 block discarded – undo
289 289
 
290 290
 	// Next let's try to remove the keys
291 291
 	foreach ( $keys as $key ) {
292
-		if ( isset( $settings[ $key ] ) ) {
293
-			unset( $settings[ $key ] );
292
+		if ( isset( $settings[$key] ) ) {
293
+			unset( $settings[$key] );
294 294
 		}
295 295
 	}
296 296
 
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
 	);
416 416
 
417 417
 	foreach ( $exclude as $e ) {
418
-		if ( ! empty( $settings[ $e ] ) ) {
419
-			unset( $settings[ $e ] );
418
+		if ( ! empty( $settings[$e] ) ) {
419
+			unset( $settings[$e] );
420 420
 		}
421 421
 	}
422 422
 
Please login to merge, or discard this patch.
gutenberg/site-insights/templates/scorecard/class-scorecard-device.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$json_data = $this->get_json_data();
15 15
 
16
-		if (empty($json_data)) {
16
+		if ( empty( $json_data ) ) {
17 17
 			return false;
18 18
 		}
19 19
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	}
24 24
 
25 25
 	protected function get_options() {
26
-		if (empty($this->data['devices'])) {
26
+		if ( empty( $this->data['devices'] ) ) {
27 27
 			return false;
28 28
 		}
29 29
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$json_data = $this->get_json_data();
15 15
 
16 16
 		if (empty($json_data)) {
Please login to merge, or discard this patch.
gutenberg/site-insights/templates/scorecard/class-scorecard-scrolldepth.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$value = $this->get_options();
15 15
 
16
-		if ( empty($value) ) {
16
+		if ( empty( $value ) ) {
17 17
 			return null;
18 18
 		}
19 19
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @return array|false
36 36
 	 */
37 37
 	protected function get_options() {
38
-		if ( !isset($this->data['scroll']) || empty($this->data['scroll']['average'])) {
38
+		if ( ! isset( $this->data['scroll'] ) || empty( $this->data['scroll']['average'] ) ) {
39 39
 			return false;
40 40
 		}
41 41
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$value = $this->get_options();
15 15
 
16 16
 		if ( empty($value) ) {
Please login to merge, or discard this patch.
site-insights/templates/scorecard/class-scorecard-topinterests.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$data = $this->get_options();
15 15
 
16
-		if (empty($data)) {
16
+		if ( empty( $data ) ) {
17 17
 			return false;
18 18
 		}
19 19
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @return array|false
35 35
 	 */
36 36
 	protected function get_options() {
37
-		if ( empty($this->data['interest'])) {
37
+		if ( empty( $this->data['interest'] ) ) {
38 38
 			return false;
39 39
 		}
40 40
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 		$rows = array();
47 47
 
48
-		foreach ($data as $key => $item) {
48
+		foreach ( $data as $key => $item ) {
49 49
 			$rows[$key] = array(
50 50
 				$item['interest'],
51 51
 				$item['percent'] . '%'
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$data = $this->get_options();
15 15
 
16 16
 		if (empty($data)) {
Please login to merge, or discard this patch.
site-insights/templates/scorecard/class-scorecard-top10countries.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$data = $this->get_options();
15 15
 
16
-		if (empty($data)) {
16
+		if ( empty( $data ) ) {
17 17
 			return false;
18 18
 		}
19 19
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @return array|false
35 35
 	 */
36 36
 	protected function get_options() {
37
-		if ( empty($this->data['countries'])) {
37
+		if ( empty( $this->data['countries'] ) ) {
38 38
 			return false;
39 39
 		}
40 40
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 		$rows = array();
47 47
 
48
-		foreach ($data as $key => $country) {
48
+		foreach ( $data as $key => $country ) {
49 49
 			$rows[$key] = array( $country['name'], $country['sessions'] );
50 50
 		}
51 51
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$data = $this->get_options();
15 15
 
16 16
 		if (empty($data)) {
Please login to merge, or discard this patch.
gutenberg/site-insights/templates/scorecard/class-scorecard-sessions.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$data = $this->get_options();
15 15
 
16
-		if (empty($data)) {
16
+		if ( empty( $data ) ) {
17 17
 			return false;
18 18
 		}
19 19
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 		$left = $this->get_card_template(
26 26
 			'left',
27
-			__('Sessions', 'google-analytics-for-wordpress'),
27
+			__( 'Sessions', 'google-analytics-for-wordpress' ),
28 28
 			$sessions,
29 29
 			$prev_sessions,
30 30
 			__( 'vs. Previous 30 days', 'google-analytics-for-wordpress' ),
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 		$right = $this->get_card_template(
35 35
 			'right',
36
-			__('Pageviews', 'google-analytics-for-wordpress'),
36
+			__( 'Pageviews', 'google-analytics-for-wordpress' ),
37 37
 			$pageviews,
38 38
 			$prev_pageviews,
39 39
 			__( 'vs. Previous 30 days', 'google-analytics-for-wordpress' ),
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 * @return array|false
53 53
 	 */
54 54
 	protected function get_options() {
55
-		if ( empty($this->data['infobox'])) {
55
+		if ( empty( $this->data['infobox'] ) ) {
56 56
 			return false;
57 57
 		}
58 58
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$data = $this->get_options();
15 15
 
16 16
 		if (empty($data)) {
Please login to merge, or discard this patch.
site-insights/templates/scorecard/class-scorecard-newvsreturning.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$json_data = $this->get_json_data();
15 15
 
16
-		if (empty($json_data)) {
16
+		if ( empty( $json_data ) ) {
17 17
 			return false;
18 18
 		}
19 19
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	}
24 24
 
25 25
 	protected function get_options() {
26
-		if (empty($this->data['newvsreturn'])) {
26
+		if ( empty( $this->data['newvsreturn'] ) ) {
27 27
 			return false;
28 28
 		}
29 29
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
 	protected $type = 'scorecard';
12 12
 
13
-	public function output(){
13
+	public function output() {
14 14
 		$json_data = $this->get_json_data();
15 15
 
16 16
 		if (empty($json_data)) {
Please login to merge, or discard this patch.