Passed
Push — master ( 6f0a6d...90a9ca )
by
unknown
09:41
created
includes/admin/common.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 		'kad_admin_js', // Pinnacle theme
354 354
 		'dt-chart', // DesignThemes core features plugin
355 355
 		'tweeetshare_font_script', // TweetShare - Click To Tweet
356
-		'tweeetshare_jquery_script',  // TweetShare - Click To Tweet
356
+		'tweeetshare_jquery_script', // TweetShare - Click To Tweet
357 357
 		'tweeetshare_jqueryui_script', // TweetShare - Click To Tweet
358 358
 		'tweeetshare_custom_script', // TweetShare - Click To Tweet
359 359
 		'imagify-promise-polyfill', // Imagify
@@ -372,16 +372,16 @@  discard block
 block discarded – undo
372 372
 		'rml-modal', // WP Real Media Library
373 373
 		'rml-order', // WP Real Media Library
374 374
 		'rml-meta', // WP Real Media Library
375
-		'rml-uploader',  // WP Real Media Library
376
-		'rml-options',  // WP Real Media Library
377
-		'rml-usersettings',  // WP Real Media Library
375
+		'rml-uploader', // WP Real Media Library
376
+		'rml-options', // WP Real Media Library
377
+		'rml-usersettings', // WP Real Media Library
378 378
 		'rml-main', // WP Real Media Library
379 379
 		'control-panel-sweet-alert', // Ken Theme
380 380
 		'sweet-alert-js', // Vitrine Theme
381 381
 		'theme-admin-script', // Vitrine Theme
382 382
 		'sweetalert', //  Church Suite Theme by Webnus
383 383
 		'be_alerts_charts', //  WooCommerce bolder product alerts
384
-		'magayo-lottery-results',  //  Magayo Lottery Results
384
+		'magayo-lottery-results', //  Magayo Lottery Results
385 385
 		'control-panel-sweet-alert', // Ken Theme
386 386
 		'cpm_chart', // WP Project Manager
387 387
 		'adminscripts', //  Artisan Nayma Theme
@@ -472,20 +472,20 @@  discard block
 block discarded – undo
472 472
 
473 473
 	global $wp_styles;
474 474
 	foreach ( $wp_styles->queue as $handle ) {
475
-		if ( strpos( $wp_styles->registered[ $handle ]->src, 'wp-content' ) === false ) {
475
+		if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content' ) === false ) {
476 476
 			return;
477 477
 		}
478 478
 
479
-		if ( strpos( $wp_styles->registered[ $handle ]->handle, 'monsterinsights' ) !== false ) {
479
+		if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights' ) !== false ) {
480 480
 			return;
481 481
 		}
482 482
 
483 483
 		foreach ( $third_party as $partial ) {
484
-			if ( strpos( $wp_styles->registered[ $handle ]->handle, $partial ) !== false ) {
484
+			if ( strpos( $wp_styles->registered[$handle]->handle, $partial ) !== false ) {
485 485
 				wp_dequeue_style( $handle ); // Remove css file from MI screen
486 486
 				wp_deregister_style( $handle );
487 487
 				break;
488
-			} else if ( strpos( $wp_styles->registered[ $handle ]->src, $partial ) !== false ) {
488
+			} else if ( strpos( $wp_styles->registered[$handle]->src, $partial ) !== false ) {
489 489
 				wp_dequeue_style( $handle ); // Remove css file from MI screen
490 490
 				wp_deregister_style( $handle );
491 491
 				break;
@@ -495,20 +495,20 @@  discard block
 block discarded – undo
495 495
 
496 496
 	global $wp_scripts;
497 497
 	foreach ( $wp_scripts->queue as $handle ) {
498
-		if ( strpos( $wp_scripts->registered[ $handle ]->src, 'wp-content' ) === false ) {
498
+		if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content' ) === false ) {
499 499
 			return;
500 500
 		}
501 501
 
502
-		if ( strpos( $wp_scripts->registered[ $handle ]->handle, 'monsterinsights' ) !== false ) {
502
+		if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights' ) !== false ) {
503 503
 			return;
504 504
 		}
505 505
 
506 506
 		foreach ( $third_party as $partial ) {
507
-			if ( strpos( $wp_scripts->registered[ $handle ]->handle, $partial ) !== false ) {
507
+			if ( strpos( $wp_scripts->registered[$handle]->handle, $partial ) !== false ) {
508 508
 				wp_dequeue_script( $handle ); // Remove JS file from MI screen
509 509
 				wp_deregister_script( $handle );
510 510
 				break;
511
-			} else if ( strpos( $wp_scripts->registered[ $handle ]->src, $partial ) !== false ) {
511
+			} else if ( strpos( $wp_scripts->registered[$handle]->src, $partial ) !== false ) {
512 512
 				wp_dequeue_script( $handle ); // Remove JS file from MI screen
513 513
 				wp_deregister_script( $handle );
514 514
 				break;
@@ -582,14 +582,14 @@  discard block
 block discarded – undo
582 582
 		foreach ( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) {
583 583
 			foreach ( $hooks as $name => $arr ) {
584 584
 				if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
585
-					unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] );
585
+					unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] );
586 586
 					continue;
587 587
 				}
588 588
 				if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
589 589
 					continue;
590 590
 				}
591 591
 				if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
592
-					unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] );
592
+					unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] );
593 593
 				}
594 594
 			}
595 595
 		}
@@ -599,14 +599,14 @@  discard block
 block discarded – undo
599 599
 		foreach ( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) {
600 600
 			foreach ( $hooks as $name => $arr ) {
601 601
 				if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
602
-					unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] );
602
+					unset( $wp_filter['admin_notices']->callbacks[$priority][$name] );
603 603
 					continue;
604 604
 				}
605 605
 				if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
606 606
 					continue;
607 607
 				}
608 608
 				if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
609
-					unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] );
609
+					unset( $wp_filter['admin_notices']->callbacks[$priority][$name] );
610 610
 				}
611 611
 			}
612 612
 		}
@@ -616,14 +616,14 @@  discard block
 block discarded – undo
616 616
 		foreach ( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) {
617 617
 			foreach ( $hooks as $name => $arr ) {
618 618
 				if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
619
-					unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] );
619
+					unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] );
620 620
 					continue;
621 621
 				}
622 622
 				if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
623 623
 					continue;
624 624
 				}
625 625
 				if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
626
-					unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] );
626
+					unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] );
627 627
 				}
628 628
 			}
629 629
 		}
@@ -684,10 +684,10 @@  discard block
 block discarded – undo
684 684
 	// Put together redirect URL
685 685
 	$url = add_query_arg(
686 686
 		array(
687
-			'utm_source'   => $source,   // Pro/Lite Plugin
688
-			'utm_medium'   => sanitize_key( $medium ),   // Area of MonsterInsights (example Reports)
687
+			'utm_source'   => $source, // Pro/Lite Plugin
688
+			'utm_medium'   => sanitize_key( $medium ), // Area of MonsterInsights (example Reports)
689 689
 			'utm_campaign' => sanitize_key( $campaign ), // Which link (example eCommerce Report)
690
-			'utm_content'  => $content,  // Version number of MI
690
+			'utm_content'  => $content, // Version number of MI
691 691
 		),
692 692
 		trailingslashit( $url )
693 693
 	);
Please login to merge, or discard this patch.
googleanalytics.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -347,11 +347,11 @@  discard block
 block discarded – undo
347 347
 		}
348 348
 
349 349
 		if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_DIR' ) ) {
350
-			define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file )  );
350
+			define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) );
351 351
 		}
352 352
 
353 353
 		if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_URL' ) ) {
354
-			define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file )  );
354
+			define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) );
355 355
 		}
356 356
 	}
357 357
 
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 		}
372 372
 
373 373
 		// Traditional WordPress plugin locale filter.
374
-		$mi_locale  = apply_filters( 'plugin_locale',  $mi_locale, 'google-analytics-for-wordpress' );
374
+		$mi_locale  = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' );
375 375
 		$mi_mofile  = sprintf( '%1$s-%2$s.mo', 'google-analytics-for-wordpress', $mi_locale );
376 376
 
377 377
 		// Look for wp-content/languages/google-analytics-for-wordpress/google-analytics-for-wordpress-{lang}_{country}.mo
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	public function monsterinsights_wp_notice() {
411 411
 		$url = admin_url( 'plugins.php' );
412 412
 		// Check for MS dashboard
413
-		if( is_network_admin() ) {
413
+		if ( is_network_admin() ) {
414 414
 			$url = network_admin_url( 'plugins.php' );
415 415
 		}
416 416
 		?>
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 	public function monsterinsights_pro_notice() {
432 432
 		$url = admin_url( 'plugins.php' );
433 433
 		// Check for MS dashboard
434
-		if( is_network_admin() ) {
434
+		if ( is_network_admin() ) {
435 435
 			$url = network_admin_url( 'plugins.php' );
436 436
 		}
437 437
 		?>
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 		require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/options.php';
458 458
 		require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/helpers.php';
459 459
 		require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/deprecated.php';
460
-		$monsterinsights_settings  = monsterinsights_get_options();
460
+		$monsterinsights_settings = monsterinsights_get_options();
461 461
 	}
462 462
 
463 463
 
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 	 *
472 472
 	 * @return void
473 473
 	 */
474
-	public function load_licensing(){
474
+	public function load_licensing() {
475 475
 		if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
476 476
 			require_once MONSTERINSIGHTS_PLUGIN_DIR . 'lite/includes/license-compat.php';
477 477
 			self::$instance->license = new MonsterInsights_License_Compat();
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 			$instance->api_auth->delete_auth();
641 641
 
642 642
 			// Delete data
643
-			$instance->reporting->delete_aggregate_data('site');
643
+			$instance->reporting->delete_aggregate_data( 'site' );
644 644
 
645 645
 			restore_current_blog();
646 646
 		}
@@ -648,22 +648,22 @@  discard block
 block discarded – undo
648 648
 		$instance->api_auth->uninstall_network_auth();
649 649
 
650 650
 		// Delete network data
651
-		$instance->reporting->delete_aggregate_data('network');
651
+		$instance->reporting->delete_aggregate_data( 'network' );
652 652
 	} else {
653 653
 		// Delete auth
654 654
 		$instance->api_auth->delete_auth();
655 655
 
656 656
 		// Delete data
657
-		$instance->reporting->delete_aggregate_data('site');
657
+		$instance->reporting->delete_aggregate_data( 'site' );
658 658
 	}
659 659
 
660 660
 	// Clear notification cron schedules
661 661
 	$schedules = wp_get_schedules();
662 662
 
663
-	if  ( is_array( $schedules ) && ! empty( $schedules ) ) {
663
+	if ( is_array( $schedules ) && ! empty( $schedules ) ) {
664 664
 		foreach ( $schedules as $key => $value ) {
665
-			if ( 0 === strpos($key, "monsterinsights_notification_") ) {
666
-				$cron_hook = implode("_", explode( "_", $key, -2 ) ) . '_cron';
665
+			if ( 0 === strpos( $key, "monsterinsights_notification_" ) ) {
666
+				$cron_hook = implode( "_", explode( "_", $key, -2 ) ) . '_cron';
667 667
 				wp_clear_scheduled_hook( $cron_hook );
668 668
 			}
669 669
 		}
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
  *
755 755
  * @return void
756 756
  */
757
-function monsterinsights_lite_call_install_and_upgrade(){
757
+function monsterinsights_lite_call_install_and_upgrade() {
758 758
 	add_action( 'wp_loaded', 'monsterinsights_lite_install_and_upgrade' );
759 759
 }
760 760
 
Please login to merge, or discard this patch.
includes/helpers.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 		$user = new WP_User( $user_id );
33 33
 	}
34 34
 
35
-	$track_user  = true;
36
-	$roles     = monsterinsights_get_option( 'ignore_users', array() );
35
+	$track_user = true;
36
+	$roles = monsterinsights_get_option( 'ignore_users', array() );
37 37
 
38 38
 	if ( ! empty( $roles ) && is_array( $roles ) ) {
39 39
 		foreach ( $roles as $role ) {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
 
184 184
 function monsterinsights_generate_ga_client_id() {
185
-	return rand(100000000,999999999) . '.' . time();
185
+	return rand( 100000000, 999999999 ) . '.' . time();
186 186
 }
187 187
 
188 188
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		$stop = time();
203 203
 	}
204 204
 
205
-	$diff = (int) abs( $stop -  $start );
205
+	$diff = (int) abs( $stop - $start );
206 206
 	$hours = round( $diff / HOUR_IN_SECONDS );
207 207
 	return $hours;
208 208
 }
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 	$editable_roles = apply_filters( 'editable_roles', $all_roles );
261 261
 
262 262
 	foreach ( $editable_roles as $id => $name ) {
263
-		$roles[ $id ] = translate_user_role( $name['name'] );
263
+		$roles[$id] = translate_user_role( $name['name'] );
264 264
 	}
265 265
 
266 266
 	return $roles;
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
 	foreach ( $editable_roles as $id => $role ) {
288 288
 		if ( isset( $role['capabilities']['manage_options'] ) && $role['capabilities']['manage_options'] ) {
289
-			$roles[ $id ] = translate_user_role( $role['name'] );
289
+			$roles[$id] = translate_user_role( $role['name'] );
290 290
 		}
291 291
 	}
292 292
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
 		}
334 334
 		if ( substr_count( $host, '.' ) > 1 ) {
335
-			$subdomains_to_check =  array( 'dev.', '*.staging.', 'beta.', 'test.' );
335
+			$subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' );
336 336
 			foreach ( $subdomains_to_check as $subdomain ) {
337 337
 				$subdomain = str_replace( '.', '(.)', $subdomain );
338 338
 				$subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain );
@@ -348,16 +348,16 @@  discard block
 block discarded – undo
348 348
 
349 349
 // Set cookie to expire in 2 years
350 350
 function monsterinsights_get_cookie_expiration_date( $time ) {
351
-	return date('D, j F Y H:i:s', time() + $time );
351
+	return date( 'D, j F Y H:i:s', time() + $time );
352 352
 }
353 353
 
354 354
 function monsterinsights_string_ends_with( $string, $ending ) {
355
-	$strlen = strlen($string);
356
-	$endinglen = strlen($ending);
355
+	$strlen = strlen( $string );
356
+	$endinglen = strlen( $ending );
357 357
 	if ( $endinglen > $strlen ) {
358 358
 		return false;
359 359
 	}
360
-	return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen) === 0;
360
+	return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen ) === 0;
361 361
 }
362 362
 
363 363
 function monsterinsights_string_starts_with( $string, $start ) {
@@ -887,11 +887,11 @@  discard block
 block discarded – undo
887 887
 	return $countries;
888 888
 }
889 889
 
890
-function monsterinsights_get_api_url(){
890
+function monsterinsights_get_api_url() {
891 891
 	return apply_filters( 'monsterinsights_get_api_url', 'api.monsterinsights.com/v2/' );
892 892
 }
893 893
 
894
-function monsterinsights_get_licensing_url(){
894
+function monsterinsights_get_licensing_url() {
895 895
 	return apply_filters( 'monsterinsights_get_licensing_url', 'https://www.monsterinsights.com' );
896 896
 }
897 897
 
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 	}
936 936
 }
937 937
 
938
-if ( ! function_exists ( 'remove_class_filter' ) ) {
938
+if ( ! function_exists( 'remove_class_filter' ) ) {
939 939
 	/**
940 940
 	 * Remove Class Filter Without Access to Class Object
941 941
 	 *
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 	function remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) {
957 957
 		global $wp_filter;
958 958
 		// Check that filter actually exists first
959
-		if ( ! isset( $wp_filter[ $tag ] ) ) return FALSE;
959
+		if ( ! isset( $wp_filter[$tag] ) ) return FALSE;
960 960
 		/**
961 961
 		 * If filter config is an object, means we're using WordPress 4.7+ and the config is no longer
962 962
 		 * a simple array, rather it is an object that implements the ArrayAccess interface.
@@ -965,33 +965,33 @@  discard block
 block discarded – undo
965 965
 		 *
966 966
 		 * @see https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/
967 967
 		 */
968
-		if ( is_object( $wp_filter[ $tag ] ) && isset( $wp_filter[ $tag ]->callbacks ) ) {
969
-			$callbacks = &$wp_filter[ $tag ]->callbacks;
968
+		if ( is_object( $wp_filter[$tag] ) && isset( $wp_filter[$tag]->callbacks ) ) {
969
+			$callbacks = &$wp_filter[$tag]->callbacks;
970 970
 		} else {
971
-			$callbacks = &$wp_filter[ $tag ];
971
+			$callbacks = &$wp_filter[$tag];
972 972
 		}
973 973
 		// Exit if there aren't any callbacks for specified priority
974
-		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) return FALSE;
974
+		if ( ! isset( $callbacks[$priority] ) || empty( $callbacks[$priority] ) ) return FALSE;
975 975
 		// Loop through each filter for the specified priority, looking for our class & method
976
-		foreach( (array) $callbacks[ $priority ] as $filter_id => $filter ) {
976
+		foreach ( (array) $callbacks[$priority] as $filter_id => $filter ) {
977 977
 			// Filter should always be an array - array( $this, 'method' ), if not goto next
978
-			if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) continue;
978
+			if ( ! isset( $filter['function'] ) || ! is_array( $filter['function'] ) ) continue;
979 979
 			// If first value in array is not an object, it can't be a class
980
-			if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) continue;
980
+			if ( ! is_object( $filter['function'][0] ) ) continue;
981 981
 			// Method doesn't match the one we're looking for, goto next
982
-			if ( $filter[ 'function' ][ 1 ] !== $method_name ) continue;
982
+			if ( $filter['function'][1] !== $method_name ) continue;
983 983
 			// Method matched, now let's check the Class
984
-			if ( get_class( $filter[ 'function' ][ 0 ] ) === $class_name ) {
984
+			if ( get_class( $filter['function'][0] ) === $class_name ) {
985 985
 				// Now let's remove it from the array
986
-				unset( $callbacks[ $priority ][ $filter_id ] );
986
+				unset( $callbacks[$priority][$filter_id] );
987 987
 				// and if it was the only filter in that priority, unset that priority
988
-				if ( empty( $callbacks[ $priority ] ) ) unset( $callbacks[ $priority ] );
988
+				if ( empty( $callbacks[$priority] ) ) unset( $callbacks[$priority] );
989 989
 				// and if the only filter for that tag, set the tag to an empty array
990 990
 				if ( empty( $callbacks ) ) $callbacks = array();
991 991
 				// If using WordPress older than 4.7
992
-				if ( ! is_object( $wp_filter[ $tag ] ) ) {
992
+				if ( ! is_object( $wp_filter[$tag] ) ) {
993 993
 					// Remove this filter from merged_filters, which specifies if filters have been sorted
994
-					unset( $GLOBALS[ 'merged_filters' ][ $tag ] );
994
+					unset( $GLOBALS['merged_filters'][$tag] );
995 995
 				}
996 996
 				return TRUE;
997 997
 			}
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
 	}
1001 1001
 } // End function exists
1002 1002
 
1003
-if ( ! function_exists ( 'remove_class_action' ) ) {
1003
+if ( ! function_exists( 'remove_class_action' ) ) {
1004 1004
 	/**
1005 1005
 	 * Remove Class Action Without Access to Class Object
1006 1006
 	 *
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
 		}
1071 1071
 
1072 1072
 		foreach ( $translations->entries as $msgid => $entry ) {
1073
-			$locale[ $msgid ] = $entry->translations;
1073
+			$locale[$msgid] = $entry->translations;
1074 1074
 		}
1075 1075
 
1076 1076
 		return $locale;
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
 
1214 1214
 		$pattern = '/UA-[0-9-]+/';
1215 1215
 		if ( isset( $options['ga-UID'] ) && preg_match( $pattern, $options['ga-UID'] ) ) {
1216
-			++ $count;
1216
+			++$count;
1217 1217
 		}
1218 1218
 	}
1219 1219
 
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
 
1225 1225
 		$pattern = '/UA-[0-9-]+/';
1226 1226
 		if ( ! empty( $code ) && preg_match( $pattern, $code ) ) {
1227
-			++ $count;
1227
+			++$count;
1228 1228
 		}
1229 1229
 	}
1230 1230
 
@@ -1443,22 +1443,22 @@  discard block
 block discarded – undo
1443 1443
  *
1444 1444
  * @return trimed sentence
1445 1445
  */
1446
-function monsterinsights_trim_text( $text, $count ){
1447
-	$text 	= str_replace("  ", " ", $text);
1448
-	$string = explode(" ", $text);
1446
+function monsterinsights_trim_text( $text, $count ) {
1447
+	$text = str_replace( "  ", " ", $text );
1448
+	$string = explode( " ", $text );
1449 1449
 	$trimed = "";
1450 1450
 
1451 1451
 	for ( $wordCounter = 0; $wordCounter <= $count; $wordCounter++ ) {
1452 1452
 		$trimed .= isset( $string[$wordCounter] ) ? $string[$wordCounter] : '';
1453 1453
 
1454
-		if ( $wordCounter < $count ){
1454
+		if ( $wordCounter < $count ) {
1455 1455
 			$trimed .= " ";
1456 1456
 		} else {
1457 1457
 			$trimed .= "...";
1458 1458
 		}
1459 1459
 	}
1460 1460
 
1461
-	$trimed = trim($trimed);
1461
+	$trimed = trim( $trimed );
1462 1462
 
1463 1463
 	return $trimed;
1464 1464
 }
@@ -1534,7 +1534,7 @@  discard block
 block discarded – undo
1534 1534
 	$monsterinsights_reference = isset( $_GET['monsterinsights_reference'] ) ? $_GET['monsterinsights_reference'] : '';
1535 1535
 
1536 1536
 	if ( 'post-new.php' === $pagenow && 'pretty-link' === $post_type && 'url_builder' === $monsterinsights_reference ) {
1537
-		$onboard  = get_option( 'prli_onboard' );
1537
+		$onboard = get_option( 'prli_onboard' );
1538 1538
 
1539 1539
 		if ( $onboard == 'welcome' || $onboard == 'update' ) {
1540 1540
 			update_option( 'monsterinsights_backup_prli_onboard_value', $onboard );
@@ -1554,7 +1554,7 @@  discard block
 block discarded – undo
1554 1554
 	$post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : '';
1555 1555
 
1556 1556
 	if ( 'edit.php' === $pagenow && 'pretty-link' === $post_type ) {
1557
-		$onboard   = get_option( 'monsterinsights_backup_prli_onboard_value' );
1557
+		$onboard = get_option( 'monsterinsights_backup_prli_onboard_value' );
1558 1558
 
1559 1559
 		if ( class_exists( 'PrliBaseController' ) && ( $onboard == 'welcome' || $onboard == 'update' ) ) {
1560 1560
 			update_option( 'prli_onboard', $onboard );
Please login to merge, or discard this patch.
includes/frontend/tracking/class-tracking-analytics.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 
99 99
 		if ( $create && ! empty( $create ) && is_array( $create ) ) {
100 100
 			$create = json_encode( $create );
101
-			$create = str_replace( '"', "'",  $create );
102
-			$options['create'] = "'create', '" . esc_js( $ua_code ). "', '" . esc_js( $domain ) . "', " . $create;
101
+			$create = str_replace( '"', "'", $create );
102
+			$options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "', " . $create;
103 103
 		} else {
104 104
 			$options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "'";
105 105
 		}
@@ -191,37 +191,37 @@  discard block
 block discarded – undo
191 191
 	 * @return string Javascript to output.
192 192
 	 */
193 193
 	public function frontend_output( ) {
194
-		$options        = $this->frontend_tracking_options();
194
+		$options = $this->frontend_tracking_options();
195 195
 		$src     	    = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics.js' );
196
-		$compat_mode     = monsterinsights_get_option( 'gatracker_compatibility_mode', false );
196
+		$compat_mode = monsterinsights_get_option( 'gatracker_compatibility_mode', false );
197 197
 		$compat    	 	= $compat_mode ? 'window.ga = __gaTracker;' : '';
198 198
 		$track_user 	= monsterinsights_track_user();
199 199
 		$ua         	= monsterinsights_get_ua();
200 200
 		$output     	= '';
201 201
 		$reason     	= '';
202
-		$attr_string    = monsterinsights_get_frontend_analytics_script_atts();
202
+		$attr_string = monsterinsights_get_frontend_analytics_script_atts();
203 203
 		ob_start();
204 204
 		?>
205 205
 <!-- This site uses the Google Analytics by MonsterInsights plugin v<?php echo MONSTERINSIGHTS_VERSION; ?> - Using Analytics tracking - https://www.monsterinsights.com/ -->
206 206
 <?php if ( ! $track_user ) {
207 207
 	if ( empty( $ua ) ) {
208 208
 		$reason = __( 'Note: MonsterInsights is not currently configured on this site. The site owner needs to authenticate with Google Analytics in the MonsterInsights settings panel.', 'google-analytics-for-wordpress' );
209
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
209
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
210 210
 	} else if ( current_user_can( 'monsterinsights_save_settings' ) ) {
211
-		$reason = __( 'Note: MonsterInsights does not track you as a logged-in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.'. PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' );
212
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
211
+		$reason = __( 'Note: MonsterInsights does not track you as a logged-in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.' . PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' );
212
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
213 213
 	} else {
214 214
 		$reason = __( 'Note: The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' );
215
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
215
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
216 216
 	}
217 217
 	echo $output;
218 218
 } ?>
219 219
 <?php if ( $ua ) { ?>
220
-<script<?php echo $attr_string;?>>
220
+<script<?php echo $attr_string; ?>>
221 221
     (window.gaDevIds=window.gaDevIds||[]).push("dZGIzZG");
222 222
 	var mi_version         = '<?php echo MONSTERINSIGHTS_VERSION; ?>';
223 223
 	var mi_track_user      = <?php echo ( $track_user ? 'true' : 'false' ); ?>;
224
-	var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason)  . "'": "''" ); ?>;
224
+	var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason ) . "'" : "''" ); ?>;
225 225
 	<?php do_action( 'monsterinsights_tracking_analytics_frontend_output_after_mi_track_user' ); ?>
226 226
 
227 227
 <?php if ( $this->should_do_optout() ) { ?>
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 	?>
276 276
 	} else {
277 277
 <?php if ( $this->should_do_optout() ) { ?>
278
-		console.log( "<?php echo esc_js( $reason );?>" );
278
+		console.log( "<?php echo esc_js( $reason ); ?>" );
279 279
 		(function() {
280 280
 			/* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */
281 281
 			var noopfn = function() {
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 				}
299 299
 				var f = arguments[len-1];
300 300
 				if ( typeof f !== 'object' || f === null || typeof f.hitCallback !== 'function' ) {
301
-					console.log( '<?php echo esc_js( __("Not running function", "google-analytics-for-wordpress" ) );?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) );?> " + mi_no_track_reason );
301
+					console.log( '<?php echo esc_js( __( "Not running function", "google-analytics-for-wordpress" ) ); ?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) ); ?> " + mi_no_track_reason );
302 302
 					return;
303 303
 				}
304 304
 				try {
Please login to merge, or discard this patch.
includes/measurement-protocol.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
 
23 23
 	$defaults = array(
24 24
 		't'  => 'event', // Required: Hit type
25
-		'ec' => '',      // Optional: Event category
26
-		'ea' => '', 	 // Optional: Event Action
27
-		'el' => '', 	 // Optional: Event Label
28
-		'ev' => null, 	 // Optional: Event Value
25
+		'ec' => '', // Optional: Event category
26
+		'ea' => '', // Optional: Event Action
27
+		'el' => '', // Optional: Event Label
28
+		'ev' => null, // Optional: Event Value
29 29
 	);
30 30
 
31
-	$body  = array_merge( $defaults , $args );
31
+	$body = array_merge( $defaults, $args );
32 32
 
33 33
 	// We want to get the user's IP address when possible
34
-	$ip     = '';
34
+	$ip = '';
35 35
 	if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) && ! filter_var( $_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP ) === false ) {
36 36
 		$ip = $_SERVER['HTTP_CLIENT_IP'];
37 37
 	} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && ! filter_var( $_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP ) === false ) {
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 		'uip' => $ip,
80 80
 
81 81
 		// Optional: User Agent
82
-		'ua'  => ! empty( $user_agent ) ?  $user_agent : $_SERVER['HTTP_USER_AGENT'],
82
+		'ua'  => ! empty( $user_agent ) ? $user_agent : $_SERVER['HTTP_USER_AGENT'],
83 83
 
84 84
 		// Optional: Time of the event
85 85
 		'z'   => time(),
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	// Unset empty values to reduce request size
101 101
 	foreach ( $body as $key => $value ) {
102 102
 		if ( empty( $value ) ) {
103
-			unset( $body[ $key ] );
103
+			unset( $body[$key] );
104 104
 		}
105 105
 	}
106 106
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		// Optional: Event Value
139 139
 		'ev' => null,
140 140
 	);
141
-	$args  = wp_parse_args( $args, $default_args );
141
+	$args = wp_parse_args( $args, $default_args );
142 142
 	//$args = apply_filters( 'monsterinsights_mp_track_event_call', $args );
143 143
 
144 144
 	return monsterinsights_mp_api_call( $args );
Please login to merge, or discard this patch.
includes/popular-posts/class-popular-posts-themes.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 		if ( method_exists( $this, 'get_themes_' . $type ) ) {
65 65
 			$this->themes = call_user_func( array( $this, 'get_themes_' . $type ) );
66 66
 			if ( ! empty( $theme ) ) {
67
-				$this->theme = isset( $this->themes[ $theme ] ) ? $this->themes[ $theme ] : array();
67
+				$this->theme = isset( $this->themes[$theme] ) ? $this->themes[$theme] : array();
68 68
 
69 69
 				return $this->theme;
70 70
 			} else {
@@ -114,14 +114,14 @@  discard block
 block discarded – undo
114 114
 
115 115
 		$settings = $this->get_theme_stored_styles();
116 116
 
117
-		if ( ! empty( $settings[ $type ] ) ) {
117
+		if ( ! empty( $settings[$type] ) ) {
118 118
 			foreach ( $themes as $theme_key => $theme_values ) {
119
-				if ( ! empty( $settings[ $type ][ $theme_key ] ) ) {
120
-					foreach ( $themes[ $theme_key ]['styles'] as $object => $props ) {
121
-						if ( ! empty( $settings[ $type ][ $theme_key ][ $object ] ) ) {
119
+				if ( ! empty( $settings[$type][$theme_key] ) ) {
120
+					foreach ( $themes[$theme_key]['styles'] as $object => $props ) {
121
+						if ( ! empty( $settings[$type][$theme_key][$object] ) ) {
122 122
 							foreach ( $props as $style_key => $style_value ) {
123
-								if ( ! empty( $settings[ $type ][ $theme_key ][ $object ][ $style_key ] ) ) {
124
-									$themes[ $theme_key ]['styles'][ $object ][ $style_key ] = $settings[ $type ][ $theme_key ][ $object ][ $style_key ];
123
+								if ( ! empty( $settings[$type][$theme_key][$object][$style_key] ) ) {
124
+									$themes[$theme_key]['styles'][$object][$style_key] = $settings[$type][$theme_key][$object][$style_key];
125 125
 								}
126 126
 							}
127 127
 						}
Please login to merge, or discard this patch.
includes/popular-posts/class-popular-posts.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -521,13 +521,13 @@  discard block
 block discarded – undo
521 521
 						continue;
522 522
 					}
523 523
 
524
-					if ( ! empty( $atts[ $atts_key ] ) ) {
525
-						if ( is_bool( $atts[ $atts_key ] ) || 'on' === $atts[ $atts_key ] ) {
524
+					if ( ! empty( $atts[$atts_key] ) ) {
525
+						if ( is_bool( $atts[$atts_key] ) || 'on' === $atts[$atts_key] ) {
526 526
 							continue;
527 527
 						}
528 528
 						if ( 'size' === $style_key ) {
529
-							$style_key         = 'font-size';
530
-							$atts[ $atts_key ] .= 'px';
529
+							$style_key = 'font-size';
530
+							$atts[$atts_key] .= 'px';
531 531
 						}
532 532
 						if ( 'background' === $style_key || 'background' === $element && 'color' === $style_key ) {
533 533
 							$style_key = 'background-color';
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 						if ( 'border' === $element || 'border' === $style_key ) {
536 536
 							$style_key = 'border-color';
537 537
 						}
538
-						$style_css .= $style_key . ':' . $atts[ $atts_key ] . ';';
538
+						$style_css .= $style_key . ':' . $atts[$atts_key] . ';';
539 539
 					}
540 540
 				}
541 541
 			}
@@ -558,11 +558,11 @@  discard block
 block discarded – undo
558 558
 
559 559
 		$class = get_called_class();
560 560
 
561
-		if ( ! isset( self::$instances[ $class ] ) ) {
562
-			self::$instances[ $class ] = new $class;
561
+		if ( ! isset( self::$instances[$class] ) ) {
562
+			self::$instances[$class] = new $class;
563 563
 		}
564 564
 
565
-		return self::$instances[ $class ];
565
+		return self::$instances[$class];
566 566
 
567 567
 	}
568 568
 
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 	public function get_themes_styles_for_output() {
724 724
 
725 725
 		$stored_styles = $this->get_theme_props()->get_theme_stored_styles();
726
-		$themes        = ! empty( $stored_styles[ $this->type ] ) && is_array( $stored_styles[ $this->type ] ) ? $stored_styles[ $this->type ] : array();
726
+		$themes        = ! empty( $stored_styles[$this->type] ) && is_array( $stored_styles[$this->type] ) ? $stored_styles[$this->type] : array();
727 727
 
728 728
 		return $themes;
729 729
 
Please login to merge, or discard this patch.
includes/admin/admin.php 1 patch
Indentation   +176 added lines, -176 removed lines patch added patch discarded remove patch
@@ -27,22 +27,22 @@  discard block
 block discarded – undo
27 27
     $menu_icon_inline = monsterinsights_get_inline_menu_icon();
28 28
 
29 29
     if ( $hook === 'monsterinsights_settings' ) {
30
-        // If dashboards disabled, first settings page
31
-        add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page',  $menu_icon_inline, '100.00013467543' );
32
-        $hook = 'monsterinsights_settings';
30
+	// If dashboards disabled, first settings page
31
+	add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page',  $menu_icon_inline, '100.00013467543' );
32
+	$hook = 'monsterinsights_settings';
33 33
 
34
-        add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' );
34
+	add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' );
35 35
     } else {
36
-        // if dashboards enabled, first dashboard
37
-        add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page',  $menu_icon_inline, '100.00013467543' );
36
+	// if dashboards enabled, first dashboard
37
+	add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page',  $menu_icon_inline, '100.00013467543' );
38 38
 
39
-        add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' );
39
+	add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' );
40 40
 
41
-        // then settings page
42
-        add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' );
41
+	// then settings page
42
+	add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' );
43 43
 
44
-        // Add dashboard submenu.
45
-        add_submenu_page( 'index.php', __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'admin.php?page=monsterinsights_reports' );
44
+	// Add dashboard submenu.
45
+	add_submenu_page( 'index.php', __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'admin.php?page=monsterinsights_reports' );
46 46
     }
47 47
 
48 48
     $submenu_base = add_query_arg( 'page', 'monsterinsights_settings', admin_url( 'admin.php' ) );
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     // then addons
57 57
     $network_key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_network_license_key() : '';
58 58
     if ( ! monsterinsights_is_network_active() || ( monsterinsights_is_network_active() && empty( $network_key ) ) ) {
59
-        add_submenu_page( $hook, __( 'Addons:', 'google-analytics-for-wordpress' ), '<span style="color:' . monsterinsights_menu_highlight_color() . '"> ' . __( 'Addons', 'google-analytics-for-wordpress' ) . '</span>', 'monsterinsights_save_settings', $submenu_base . '#/addons' );
59
+	add_submenu_page( $hook, __( 'Addons:', 'google-analytics-for-wordpress' ), '<span style="color:' . monsterinsights_menu_highlight_color() . '"> ' . __( 'Addons', 'google-analytics-for-wordpress' ) . '</span>', 'monsterinsights_save_settings', $submenu_base . '#/addons' );
60 60
     }
61 61
 
62 62
     // Add About us page.
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
 function monsterinsights_get_menu_hook() {
68 68
     $dashboards_disabled = monsterinsights_get_option( 'dashboards_disabled', false );
69 69
     if ( $dashboards_disabled || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) {
70
-        return 'monsterinsights_settings';
70
+	return 'monsterinsights_settings';
71 71
     } else {
72
-        return 'monsterinsights_reports';
72
+	return 'monsterinsights_reports';
73 73
     }
74 74
 }
75 75
 
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
     // First, let's see if this is an MS network enabled plugin. If it is, we should load the license
81 81
     // menu page and the updater on the network panel
82 82
     if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
83
-        require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
83
+	require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
84 84
     }
85 85
 
86 86
     $plugin = plugin_basename( MONSTERINSIGHTS_PLUGIN_FILE );
87 87
     if ( ! is_plugin_active_for_network( $plugin ) ) {
88
-        return;
88
+	return;
89 89
     }
90 90
 
91 91
     $menu_icon_inline = monsterinsights_get_inline_menu_icon();
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 function monsterinsights_add_admin_body_class( $classes ) {
117 117
     $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
118 118
     if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) {
119
-        return $classes;
119
+	return $classes;
120 120
     }
121 121
 
122 122
     return "$classes monsterinsights_page ";
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
134 134
 
135 135
     if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id  ) {
136
-        return $classes;
136
+	return $classes;
137 137
     }
138 138
 
139 139
     return "$classes insights_page_monsterinsights_tools ";
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 function monsterinsights_add_admin_body_class_addons_page( $classes ) {
150 150
     $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
151 151
     if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id  ) {
152
-        return $classes;
152
+	return $classes;
153 153
     }
154 154
 
155 155
     return "$classes insights_page_monsterinsights_addons ";
@@ -169,17 +169,17 @@  discard block
 block discarded – undo
169 169
 
170 170
     // If lite, show a link where they can get pro from
171 171
     if ( ! monsterinsights_is_pro_version() ) {
172
-        $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>';
173
-        array_unshift( $links, $get_pro );
172
+	$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>';
173
+	array_unshift( $links, $get_pro );
174 174
     }
175 175
 
176 176
     // If Lite, support goes to forum. If pro, it goes to our website
177 177
     if ( monsterinsights_is_pro_version() ) {
178
-        $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>';
179
-        array_unshift( $links, $support );
178
+	$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>';
179
+	array_unshift( $links, $support );
180 180
     } else {
181
-        $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
182
-        array_unshift( $links, $support );
181
+	$support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
182
+	array_unshift( $links, $support );
183 183
     }
184 184
 
185 185
 	if ( is_network_admin() ) {
@@ -208,26 +208,26 @@  discard block
 block discarded – undo
208 208
 function monsterinsights_load_admin_partial( $template, $data = array() ) {
209 209
 
210 210
     if ( monsterinsights_is_pro_version() ) {
211
-        $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' );
211
+	$dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' );
212 212
 
213
-        if ( file_exists( $dir . $template . '.php' ) ) {
214
-            require_once(  $dir . $template . '.php' );
215
-            return true;
216
-        }
213
+	if ( file_exists( $dir . $template . '.php' ) ) {
214
+	    require_once(  $dir . $template . '.php' );
215
+	    return true;
216
+	}
217 217
     } else {
218
-        $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' );
218
+	$dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' );
219 219
 
220
-        if ( file_exists( $dir . $template . '.php' ) ) {
221
-            require_once(  $dir . $template . '.php' );
222
-            return true;
223
-        }
220
+	if ( file_exists( $dir . $template . '.php' ) ) {
221
+	    require_once(  $dir . $template . '.php' );
222
+	    return true;
223
+	}
224 224
     }
225 225
 
226 226
     $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' );
227 227
 
228 228
     if ( file_exists( $dir . $template . '.php' ) ) {
229
-        require_once(  $dir . $template . '.php' );
230
-        return true;
229
+	require_once(  $dir . $template . '.php' );
230
+	return true;
231 231
     }
232 232
 
233 233
     return false;
@@ -244,9 +244,9 @@  discard block
 block discarded – undo
244 244
 function monsterinsights_admin_footer( $text ) {
245 245
     global $current_screen;
246 246
     if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) {
247
-        $url  = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5';
248
-        // Translators: Placeholders add a link to the wordpress.org repository.
249
-        $text = sprintf( esc_html__( 'Please rate %1$sMonsterInsights%2$s on %3$s %4$sWordPress.org%5$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"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' );
247
+	$url  = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5';
248
+	// Translators: Placeholders add a link to the wordpress.org repository.
249
+	$text = sprintf( esc_html__( 'Please rate %1$sMonsterInsights%2$s on %3$s %4$sWordPress.org%5$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"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' );
250 250
     }
251 251
     return $text;
252 252
 }
@@ -257,12 +257,12 @@  discard block
 block discarded – undo
257 257
     // Don't show on MonsterInsights pages
258 258
     $screen = get_current_screen();
259 259
     if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) {
260
-        return;
260
+	return;
261 261
     }
262 262
 
263 263
     // Make sure they have the permissions to do something
264 264
     if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
265
-        return;
265
+	return;
266 266
     }
267 267
 
268 268
     // Priority:
@@ -280,89 +280,89 @@  discard block
 block discarded – undo
280 280
     // 1. Google Analytics not authenticated
281 281
 	if ( ! is_network_admin() && ! monsterinsights_get_ua() && ! defined( 'MONSTERINSIGHTS_DISABLE_TRACKING' ) ) {
282 282
 
283
-        $submenu_base = is_network_admin() ? add_query_arg( 'page', 'monsterinsights_network', network_admin_url( 'admin.php' ) ) : add_query_arg( 'page', 'monsterinsights_settings', admin_url( 'admin.php' ) );
284
-        $title     = esc_html__( 'Please Setup Website Analytics to See Audience Insights', 'google-analytics-for-wordpress' );
285
-        $primary   = esc_html__( 'Connect MonsterInsights and Setup Website Analytics', 'google-analytics-for-wordpress' );
286
-        $urlone    = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights-onboarding' ) : admin_url( 'admin.php?page=monsterinsights-onboarding' );
287
-        $secondary = esc_html__( 'Learn More', 'google-analytics-for-wordpress' );
288
-        $urltwo    = $submenu_base . '#/about/getting-started';
289
-        $message   = esc_html__( 'MonsterInsights, WordPress analytics plugin, helps you connect your website with Google Analytics, so you can see how people find and use your website. Over 2 million website owners use MonsterInsights to see the stats that matter and grow their business.', 'google-analytics-for-wordpress' );
290
-        echo '<div class="notice notice-info"><p style="font-weight:700">'. $title .'</p><p>'. $message.'</p><p><a href="'. $urlone .'" class="button-primary">'. $primary .'</a>&nbsp;&nbsp;&nbsp;<a href="'. $urltwo .'" class="button-secondary">'. $secondary .'</a></p></div>';
291
-        return;
283
+	$submenu_base = is_network_admin() ? add_query_arg( 'page', 'monsterinsights_network', network_admin_url( 'admin.php' ) ) : add_query_arg( 'page', 'monsterinsights_settings', admin_url( 'admin.php' ) );
284
+	$title     = esc_html__( 'Please Setup Website Analytics to See Audience Insights', 'google-analytics-for-wordpress' );
285
+	$primary   = esc_html__( 'Connect MonsterInsights and Setup Website Analytics', 'google-analytics-for-wordpress' );
286
+	$urlone    = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights-onboarding' ) : admin_url( 'admin.php?page=monsterinsights-onboarding' );
287
+	$secondary = esc_html__( 'Learn More', 'google-analytics-for-wordpress' );
288
+	$urltwo    = $submenu_base . '#/about/getting-started';
289
+	$message   = esc_html__( 'MonsterInsights, WordPress analytics plugin, helps you connect your website with Google Analytics, so you can see how people find and use your website. Over 2 million website owners use MonsterInsights to see the stats that matter and grow their business.', 'google-analytics-for-wordpress' );
290
+	echo '<div class="notice notice-info"><p style="font-weight:700">'. $title .'</p><p>'. $message.'</p><p><a href="'. $urlone .'" class="button-primary">'. $primary .'</a>&nbsp;&nbsp;&nbsp;<a href="'. $urltwo .'" class="button-secondary">'. $secondary .'</a></p></div>';
291
+	return;
292 292
     }
293 293
 
294 294
     // 2. License key not entered for pro
295 295
     $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : '';
296 296
     if ( monsterinsights_is_pro_version() && empty( $key ) ) {
297
-        $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
298
-        // Translators: Adds a link to retrieve the license.
299
-        $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>' );
300
-        echo '<div class="error"><p>'. $message.'</p></div>';
301
-        return;
297
+	$page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
298
+	// Translators: Adds a link to retrieve the license.
299
+	$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>' );
300
+	echo '<div class="error"><p>'. $message.'</p></div>';
301
+	return;
302 302
     }
303 303
 
304 304
     // 3. License key not valid/okay for pro
305 305
     if ( monsterinsights_is_pro_version() ) {
306
-        $message = '';
307
-        if ( MonsterInsights()->license->get_site_license_key() ){
308
-            if ( MonsterInsights()->license->site_license_expired() ) {
309
-	            // Translators: Adds a link to the license renewal.
310
-                $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>' );
311
-            } else if ( MonsterInsights()->license->site_license_disabled() ) {
312
-                $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
313
-            } else if ( MonsterInsights()->license->site_license_invalid() ) {
314
-                $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' );
315
-            }
316
-        } else if ( MonsterInsights()->license->get_network_license_key() ) {
317
-            if ( MonsterInsights()->license->network_license_expired() ) {
318
-            	// Translators: Adds a link to renew license.
319
-                $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>' );
320
-            } else if ( MonsterInsights()->license->network_license_disabled() ) {
321
-                $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
322
-            } else if ( MonsterInsights()->license->network_license_invalid() ) {
323
-                $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' );
324
-            }
325
-        }
326
-        if ( ! empty( $message ) ) {
327
-            echo '<div class="error"><p>'. $message.'</p></div>';
328
-            return;
329
-        }
306
+	$message = '';
307
+	if ( MonsterInsights()->license->get_site_license_key() ){
308
+	    if ( MonsterInsights()->license->site_license_expired() ) {
309
+		    // Translators: Adds a link to the license renewal.
310
+		$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>' );
311
+	    } else if ( MonsterInsights()->license->site_license_disabled() ) {
312
+		$message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
313
+	    } else if ( MonsterInsights()->license->site_license_invalid() ) {
314
+		$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' );
315
+	    }
316
+	} else if ( MonsterInsights()->license->get_network_license_key() ) {
317
+	    if ( MonsterInsights()->license->network_license_expired() ) {
318
+	    	// Translators: Adds a link to renew license.
319
+		$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>' );
320
+	    } else if ( MonsterInsights()->license->network_license_disabled() ) {
321
+		$message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
322
+	    } else if ( MonsterInsights()->license->network_license_invalid() ) {
323
+		$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' );
324
+	    }
325
+	}
326
+	if ( ! empty( $message ) ) {
327
+	    echo '<div class="error"><p>'. $message.'</p></div>';
328
+	    return;
329
+	}
330 330
     }
331 331
 
332 332
     // 4. Notices for PHP/WP version deprecations
333 333
     if ( current_user_can( 'update_core' ) ) {
334
-        global $wp_version;
335
-
336
-        // PHP 5.2-5.5
337
-        if ( version_compare( phpversion(), '5.6', '<' ) ) {
338
-            $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' );
339
-            // Translators: Placeholders add the PHP version, a link to the MonsterInsights blog and a line break.
340
-            $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress stopped supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' );
341
-            echo '<div class="error"><p>'. $message.'</p></div>';
342
-            return;
343
-        }
344
-        // WordPress 3.0 - 4.5
345
-        else if ( version_compare( $wp_version, '4.9', '<' ) ) {
346
-            $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' );
347
-            // Translators: Placeholders add the current WordPress version and links to the MonsterInsights blog
348
-            $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.9 in 2020.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' );
349
-            echo '<div class="error"><p>'. $message.'</p></div>';
350
-            return;
351
-        }
352
-        // PHP 5.4/5.5
353
-        // else if ( version_compare( phpversion(), '5.6', '<' ) ) {
354
-        //  $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' );
355
-        //  $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress will stop supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' );
356
-        //  echo '<div class="error"><p>'. $message.'</p></div>';
357
-        //  return;
358
-        // }
359
-        // // WordPress 4.6 - 4.8
360
-        // else if ( version_compare( $wp_version, '4.9', '<' ) ) {
361
-        //  $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' );
362
-        //  $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.9 in October, 2019.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' );
363
-        //  echo '<div class="error"><p>'. $message.'</p></div>';
364
-        //  return;
365
-        // }
334
+	global $wp_version;
335
+
336
+	// PHP 5.2-5.5
337
+	if ( version_compare( phpversion(), '5.6', '<' ) ) {
338
+	    $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' );
339
+	    // Translators: Placeholders add the PHP version, a link to the MonsterInsights blog and a line break.
340
+	    $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress stopped supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' );
341
+	    echo '<div class="error"><p>'. $message.'</p></div>';
342
+	    return;
343
+	}
344
+	// WordPress 3.0 - 4.5
345
+	else if ( version_compare( $wp_version, '4.9', '<' ) ) {
346
+	    $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' );
347
+	    // Translators: Placeholders add the current WordPress version and links to the MonsterInsights blog
348
+	    $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.9 in 2020.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' );
349
+	    echo '<div class="error"><p>'. $message.'</p></div>';
350
+	    return;
351
+	}
352
+	// PHP 5.4/5.5
353
+	// else if ( version_compare( phpversion(), '5.6', '<' ) ) {
354
+	//  $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' );
355
+	//  $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress will stop supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' );
356
+	//  echo '<div class="error"><p>'. $message.'</p></div>';
357
+	//  return;
358
+	// }
359
+	// // WordPress 4.6 - 4.8
360
+	// else if ( version_compare( $wp_version, '4.9', '<' ) ) {
361
+	//  $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' );
362
+	//  $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.9 in October, 2019.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' );
363
+	//  echo '<div class="error"><p>'. $message.'</p></div>';
364
+	//  return;
365
+	// }
366 366
     }
367 367
 
368 368
     // 5. Optin setting not configured
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 
393 393
     $notices   = get_option( 'monsterinsights_notices' );
394 394
     if ( ! is_array( $notices ) ) {
395
-        $notices = array();
395
+	$notices = array();
396 396
     }
397 397
 
398 398
     // 6. Authenticate, not manual
@@ -436,75 +436,75 @@  discard block
 block discarded – undo
436 436
 
437 437
     // 8. WooUpsell
438 438
     if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
439
-        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) {
440
-            echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
441
-                echo '<div class="monsterinsights-wooedd-upsell-left">';
442
-                    echo '<p><strong>';
443
-                    echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' );
444
-                    echo '</strong></p>';
445
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
446
-                    echo '<p>';
447
-                    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
448
-                    echo '</p>';
449
-                    echo '<p>';
450
-                    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' );
451
-                    echo '</p>';
452
-                    echo '<p>';
453
-                    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
454
-                    echo '</p>';
455
-                    echo '<p>';
456
-                    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
457
-                    echo '</p>';
458
-                    // Translators: Placeholders add a link to the MonsterInsights website.
459
-                    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>' );
460
-                    echo '</p>';
461
-                echo '</div><div class="monsterinsights-wooedd-upsell-right">';
462
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
463
-                echo '</div>';
464
-            echo '</div>';
465
-            echo '<style type="text/css">.monsterinsights-wooedd-upsell-left{width:50%;display:table-cell;float:left}.monsterinsights-wooedd-upsell-right{width:50%;display:table-cell;float:left}.monsterinsights-wooedd-upsell-image{width:100%;height:auto;padding:20px}.monsterinsights-wooedd-upsell-image-small{display:none}.monsterinsights-wooedd-upsell-row{display:table}.monsterinsights-wooedd-upsell-left p{margin:1em 0;font-size:16px}@media (max-width:900px){.monsterinsights-wooedd-upsell-left{width:100%}.monsterinsights-wooedd-upsell-right{display:none}.monsterinsights-wooedd-upsell-image-small{display:block}.monsterinsights-wooedd-upsell-image-large{display:none}}</style>';
466
-            return;
467
-        }
439
+	if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) {
440
+	    echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
441
+		echo '<div class="monsterinsights-wooedd-upsell-left">';
442
+		    echo '<p><strong>';
443
+		    echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' );
444
+		    echo '</strong></p>';
445
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
446
+		    echo '<p>';
447
+		    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
448
+		    echo '</p>';
449
+		    echo '<p>';
450
+		    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' );
451
+		    echo '</p>';
452
+		    echo '<p>';
453
+		    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
454
+		    echo '</p>';
455
+		    echo '<p>';
456
+		    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
457
+		    echo '</p>';
458
+		    // Translators: Placeholders add a link to the MonsterInsights website.
459
+		    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>' );
460
+		    echo '</p>';
461
+		echo '</div><div class="monsterinsights-wooedd-upsell-right">';
462
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
463
+		echo '</div>';
464
+	    echo '</div>';
465
+	    echo '<style type="text/css">.monsterinsights-wooedd-upsell-left{width:50%;display:table-cell;float:left}.monsterinsights-wooedd-upsell-right{width:50%;display:table-cell;float:left}.monsterinsights-wooedd-upsell-image{width:100%;height:auto;padding:20px}.monsterinsights-wooedd-upsell-image-small{display:none}.monsterinsights-wooedd-upsell-row{display:table}.monsterinsights-wooedd-upsell-left p{margin:1em 0;font-size:16px}@media (max-width:900px){.monsterinsights-wooedd-upsell-left{width:100%}.monsterinsights-wooedd-upsell-right{display:none}.monsterinsights-wooedd-upsell-image-small{display:block}.monsterinsights-wooedd-upsell-image-large{display:none}}</style>';
466
+	    return;
467
+	}
468 468
     }
469 469
 
470 470
     // 9. EDDUpsell
471 471
     if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) {
472
-        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) {
473
-            echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
474
-                echo '<div class="monsterinsights-wooedd-upsell-left">';
475
-                    echo '<p><strong>';
476
-                    echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' );
477
-                    echo '</strong></p>';
478
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
479
-                    echo '<p>';
480
-                    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
481
-                    echo '</p>';
482
-                    echo '<p>';
483
-                    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' );
484
-                    echo '</p>';
485
-                    echo '<p>';
486
-                    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
487
-                    echo '</p>';
488
-                    echo '<p>';
489
-                    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
490
-                    echo '</p>';
491
-                    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>' );
492
-                    echo '</p>';
493
-                echo '</div><div class="monsterinsights-wooedd-upsell-right">';
494
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
495
-                echo '</div>';
496
-            echo '</div>';
497
-            return;
498
-        }
472
+	if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) {
473
+	    echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
474
+		echo '<div class="monsterinsights-wooedd-upsell-left">';
475
+		    echo '<p><strong>';
476
+		    echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' );
477
+		    echo '</strong></p>';
478
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
479
+		    echo '<p>';
480
+		    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
481
+		    echo '</p>';
482
+		    echo '<p>';
483
+		    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' );
484
+		    echo '</p>';
485
+		    echo '<p>';
486
+		    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
487
+		    echo '</p>';
488
+		    echo '<p>';
489
+		    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
490
+		    echo '</p>';
491
+		    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>' );
492
+		    echo '</p>';
493
+		echo '</div><div class="monsterinsights-wooedd-upsell-right">';
494
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
495
+		echo '</div>';
496
+	    echo '</div>';
497
+	    return;
498
+	}
499 499
     }
500 500
 
501 501
     if ( isset( $notices['monsterinsights_cross_domains_extracted'] ) && false === $notices['monsterinsights_cross_domains_extracted'] ) {
502
-        $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
503
-        $page = $page . '#/advanced';
504
-        // Translators: Adds a link to the settings panel.
505
-        $message = sprintf( esc_html__( 'Warning: MonsterInsights found cross-domain settings in the custom code field and converted them to the new settings structure.  %1$sPlease click here to review and remove the code no longer needed.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' );
506
-        echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>'. $message.'</p></div>';
507
-        return;
502
+	$page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
503
+	$page = $page . '#/advanced';
504
+	// Translators: Adds a link to the settings panel.
505
+	$message = sprintf( esc_html__( 'Warning: MonsterInsights found cross-domain settings in the custom code field and converted them to the new settings structure.  %1$sPlease click here to review and remove the code no longer needed.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' );
506
+	echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>'. $message.'</p></div>';
507
+	return;
508 508
     }
509 509
 }
510 510
 add_action( 'admin_notices', 'monsterinsights_admin_setup_notices' );
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 // AM Notices
515 515
 function monsterinsights_am_notice_optout( $super_admin ) {
516 516
     if ( monsterinsights_get_option( 'hide_am_notices', false ) || monsterinsights_get_option( 'network_hide_am_notices', false ) ) {
517
-        return false;
517
+	return false;
518 518
     }
519 519
     return $super_admin;
520 520
 }
Please login to merge, or discard this patch.
includes/admin/notification-event.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -229,9 +229,9 @@
 block discarded – undo
229 229
 		$schedule['minute'] = rand( 0, 59 );
230 230
 		$schedule['second'] = rand( 0, 59 );
231 231
 		$schedule['offset'] = ( $schedule['day'] * DAY_IN_SECONDS ) +
232
-		                      ( $schedule['hour'] * HOUR_IN_SECONDS ) +
233
-		                      ( $schedule['minute'] * MINUTE_IN_SECONDS ) +
234
-		                      $schedule['second'];
232
+				      ( $schedule['hour'] * HOUR_IN_SECONDS ) +
233
+				      ( $schedule['minute'] * MINUTE_IN_SECONDS ) +
234
+				      $schedule['second'];
235 235
 		$date               = strtotime( $this->notification_first_run_time ) + $schedule['offset'];
236 236
 
237 237
 		return $date;
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -126,14 +126,14 @@  discard block
 block discarded – undo
126 126
 			$this->notification_recurrence_name = $this->notification_id . '_' . $this->notification_interval . '_days';
127 127
 			$this->notification_id              = $this->notification_id . '_' . time();
128 128
 			$this->notification_active_for      = date( "m/d/Y", strtotime( "+" . ( $this->notification_interval - 2 ) . " day" ) );
129
-			$this->report_start_from            = "-". $this->notification_interval ." day";
129
+			$this->report_start_from            = "-" . $this->notification_interval . " day";
130 130
 
131
-			if( ! isset( $this->notification_first_run_time ) || empty( $this->notification_first_run_time ) ) {
132
-				$this->notification_first_run_time = "+". $this->notification_interval ." day";
131
+			if ( ! isset( $this->notification_first_run_time ) || empty( $this->notification_first_run_time ) ) {
132
+				$this->notification_first_run_time = "+" . $this->notification_interval . " day";
133 133
 			}
134 134
 
135
-			if( ! isset( $this->notification_icon ) || empty( $this->notification_icon ) ) {
136
-				$this->notification_icon        = '<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
135
+			if ( ! isset( $this->notification_icon ) || empty( $this->notification_icon ) ) {
136
+				$this->notification_icon = '<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
137 137
 <circle cx="16" cy="16" r="16" fill="#D3F8EA"/>
138 138
 <path d="M21.8634 18.6429C21.8634 18.8571 21.7831 19.0268 21.6224 19.1518C21.5688 19.3482 21.542 19.6786 21.542 20.1429C21.542 20.6071 21.5688 20.9375 21.6224 21.1339C21.7831 21.2768 21.8634 21.4464 21.8634 21.6429V22.0714C21.8634 22.25 21.8009 22.4018 21.6759 22.5268C21.5509 22.6518 21.3992 22.7143 21.2206 22.7143H12.4349C11.7206 22.7143 11.1134 22.4643 10.6134 21.9643C10.1134 21.4643 9.86345 20.8571 9.86345 20.1429V11.5714C9.86345 10.8571 10.1134 10.25 10.6134 9.75C11.1134 9.25 11.7206 9 12.4349 9H21.2206C21.3992 9 21.5509 9.0625 21.6759 9.1875C21.8009 9.3125 21.8634 9.46429 21.8634 9.64286V18.6429ZM13.292 12.5893V13.125C13.292 13.2321 13.3456 13.2857 13.4527 13.2857H19.1313C19.2384 13.2857 19.292 13.2321 19.292 13.125V12.5893C19.292 12.4821 19.2384 12.4286 19.1313 12.4286H13.4527C13.3456 12.4286 13.292 12.4821 13.292 12.5893ZM13.292 14.3036V14.8393C13.292 14.9464 13.3456 15 13.4527 15H19.1313C19.2384 15 19.292 14.9464 19.292 14.8393V14.3036C19.292 14.1964 19.2384 14.1429 19.1313 14.1429H13.4527C13.3456 14.1429 13.292 14.1964 13.292 14.3036ZM20.0688 21C20.0152 20.4286 20.0152 19.8571 20.0688 19.2857H12.4349C12.2027 19.2857 11.9974 19.375 11.8188 19.5536C11.6581 19.7143 11.5777 19.9107 11.5777 20.1429C11.5777 20.375 11.6581 20.5804 11.8188 20.7589C11.9974 20.9196 12.2027 21 12.4349 21H20.0688Z" fill="#1EC185"/>
139 139
 </svg>';
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		                      ( $schedule['hour'] * HOUR_IN_SECONDS ) +
233 233
 		                      ( $schedule['minute'] * MINUTE_IN_SECONDS ) +
234 234
 		                      $schedule['second'];
235
-		$date               = strtotime( $this->notification_first_run_time ) + $schedule['offset'];
235
+		$date = strtotime( $this->notification_first_run_time ) + $schedule['offset'];
236 236
 
237 237
 		return $date;
238 238
 	}
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 		$notification['start']   = $this->notification_active_from;
267 267
 		$notification['end']     = $this->notification_active_for;
268 268
 
269
-		$notification_data =  apply_filters( $this->notification_id, $notification );
269
+		$notification_data = apply_filters( $this->notification_id, $notification );
270 270
 
271 271
 		if ( is_array( $notification_data ) && ! empty( $notification_data ) ) {
272 272
 			MonsterInsights()->notifications->add( $notification_data );
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 	 *
285 285
 	 * @since 7.12.3
286 286
 	 */
287
-	public function get_report( $report_name="overview", $report_start_from="-30 day", $report_end_to="-1 day" ) {
287
+	public function get_report( $report_name = "overview", $report_start_from = "-30 day", $report_end_to = "-1 day" ) {
288 288
 		// get overview report data
289 289
 		$data      = array();
290 290
 		$report    = MonsterInsights()->reporting->get_report( $report_name );
Please login to merge, or discard this patch.