Passed
Push — master ( 59650c...0b7aa3 )
by Chris
11:04 queued 06:15
created
assets/lib/pandora/class-am-deactivation-survey.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 				return;
55 55
 			}
56 56
 
57
-			add_action( 'admin_print_scripts', array( $this, 'js'    ), 20 );
58
-			add_action( 'admin_print_scripts', array( $this, 'css'   )     );
59
-			add_action( 'admin_footer',        array( $this, 'modal' )     );
57
+			add_action( 'admin_print_scripts', array( $this, 'js' ), 20 );
58
+			add_action( 'admin_print_scripts', array( $this, 'css' ) );
59
+			add_action( 'admin_footer', array( $this, 'modal' ) );
60 60
 		}
61 61
 
62 62
 		/**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		 */
68 68
 		public function is_dev_url() {
69 69
 			// If it is an AM dev site, return false, so we can see them on our dev sites.
70
-			if ( defined ('AWESOMEMOTIVE_DEV_MODE' ) && AWESOMEMOTIVE_DEV_MODE ) {
70
+			if ( defined( 'AWESOMEMOTIVE_DEV_MODE' ) && AWESOMEMOTIVE_DEV_MODE ) {
71 71
 				return false;
72 72
 			}
73 73
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
 				}
103 103
 				if ( substr_count( $host, '.' ) > 1 ) {
104
-					$subdomains_to_check =  array( 'dev.', '*.staging.', 'beta.', 'test.' );
104
+					$subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' );
105 105
 					foreach ( $subdomains_to_check as $subdomain ) {
106 106
 						$subdomain = str_replace( '.', '(.)', $subdomain );
107 107
 						$subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain );
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 						<span class="am-deactivate-survey-desc">
320 320
 							<?php
321 321
 							// Translators: Placeholder for the plugin name.
322
-							echo sprintf( esc_html__('If you have a moment, please share why you are deactivating %s:', 'google-analytics-for-wordpress' ), $this->name );
322
+							echo sprintf( esc_html__( 'If you have a moment, please share why you are deactivating %s:', 'google-analytics-for-wordpress' ), $this->name );
323 323
 							?>
324 324
 						</span>
325 325
 						<div class="am-deactivate-survey-options">
@@ -339,13 +339,13 @@  discard block
 block discarded – undo
339 339
 							<button type="submit" class="am-deactivate-survey-submit button button-primary button-large">
340 340
 								<?php
341 341
 								// Translators: Adds an ampersand.
342
-								echo sprintf( esc_html__('Submit %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' );
342
+								echo sprintf( esc_html__( 'Submit %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' );
343 343
 								?>
344 344
 							</button>
345 345
 							<a href="#" class="am-deactivate-survey-deactivate">
346 346
 								<?php
347 347
 								// Translators: Adds an ampersand.
348
-								echo sprintf( esc_html__('Skip %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' );
348
+								echo sprintf( esc_html__( 'Skip %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' );
349 349
 								?>
350 350
 							</a>
351 351
 						</div>
Please login to merge, or discard this patch.
googleanalytics.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -336,11 +336,11 @@  discard block
 block discarded – undo
336 336
 		}
337 337
 
338 338
 		if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_DIR' ) ) {
339
-			define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file )  );
339
+			define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) );
340 340
 		}
341 341
 
342 342
 		if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_URL' ) ) {
343
-			define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file )  );
343
+			define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) );
344 344
 		}
345 345
 	}
346 346
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 		}
361 361
 
362 362
 		// Traditional WordPress plugin locale filter.
363
-		$mi_locale  = apply_filters( 'plugin_locale',  $mi_locale, 'google-analytics-for-wordpress' );
363
+		$mi_locale  = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' );
364 364
 		$mi_mofile  = sprintf( '%1$s-%2$s.mo', 'google-analytics-for-wordpress', $mi_locale );
365 365
 
366 366
 		// Look for wp-content/languages/google-analytics-for-wordpress/google-analytics-for-wordpress-{lang}_{country}.mo
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 	public function monsterinsights_wp_notice() {
400 400
 		$url = admin_url( 'plugins.php' );
401 401
 		// Check for MS dashboard
402
-		if( is_network_admin() ) {
402
+		if ( is_network_admin() ) {
403 403
 			$url = network_admin_url( 'plugins.php' );
404 404
 		}
405 405
 		?>
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 	public function monsterinsights_pro_notice() {
421 421
 		$url = admin_url( 'plugins.php' );
422 422
 		// Check for MS dashboard
423
-		if( is_network_admin() ) {
423
+		if ( is_network_admin() ) {
424 424
 			$url = network_admin_url( 'plugins.php' );
425 425
 		}
426 426
 		?>
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 		require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/options.php';
447 447
 		require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/helpers.php';
448 448
 		require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/deprecated.php';
449
-		$monsterinsights_settings  = monsterinsights_get_options();
449
+		$monsterinsights_settings = monsterinsights_get_options();
450 450
 	}
451 451
 
452 452
 
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	 *
461 461
 	 * @return void
462 462
 	 */
463
-	public function load_licensing(){
463
+	public function load_licensing() {
464 464
 		if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
465 465
 			require_once MONSTERINSIGHTS_PLUGIN_DIR . 'lite/includes/license-compat.php';
466 466
 			self::$instance->license = new MonsterInsights_License_Compat();
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 			$instance->api_auth->delete_auth();
624 624
 
625 625
 			// Delete data
626
-			$instance->reporting->delete_aggregate_data('site');
626
+			$instance->reporting->delete_aggregate_data( 'site' );
627 627
 
628 628
 			restore_current_blog();
629 629
 		}
@@ -631,13 +631,13 @@  discard block
 block discarded – undo
631 631
 		$instance->api_auth->uninstall_network_auth();
632 632
 
633 633
 		// Delete network data
634
-		$instance->reporting->delete_aggregate_data('network');
634
+		$instance->reporting->delete_aggregate_data( 'network' );
635 635
 	} else {
636 636
 		// Delete auth
637 637
 		$instance->api_auth->delete_auth();
638 638
 
639 639
 		// Delete data
640
-		$instance->reporting->delete_aggregate_data('site');
640
+		$instance->reporting->delete_aggregate_data( 'site' );
641 641
 	}
642 642
 
643 643
 }
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
  *
726 726
  * @return void
727 727
  */
728
-function monsterinsights_lite_call_install_and_upgrade(){
728
+function monsterinsights_lite_call_install_and_upgrade() {
729 729
 	add_action( 'wp_loaded', 'monsterinsights_lite_install_and_upgrade' );
730 730
 }
731 731
 
Please login to merge, or discard this patch.
includes/helpers.php 2 patches
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 ) {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 
101 101
 	$ga_cookie    = $_COOKIE['_ga'];
102
-	$cookie_parts = explode('.', $ga_cookie );
102
+	$cookie_parts = explode( '.', $ga_cookie );
103 103
 	if ( is_array( $cookie_parts ) && ! empty( $cookie_parts[2] ) && ! empty( $cookie_parts[3] ) ) {
104 104
 		$uuid = (string) $cookie_parts[2] . '.' . (string) $cookie_parts[3];
105 105
 		if ( is_string( $uuid ) ) {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	}
159 159
 
160 160
 	$ga_cookie    = $_COOKIE['_ga'];
161
-	$cookie_parts = explode('.', $ga_cookie );
161
+	$cookie_parts = explode( '.', $ga_cookie );
162 162
 	if ( is_array( $cookie_parts ) && ! empty( $cookie_parts[2] ) && ! empty( $cookie_parts[3] ) ) {
163 163
 		$uuid = (string) $cookie_parts[2] . '.' . (string) $cookie_parts[3];
164 164
 		if ( is_string( $uuid ) ) {
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
 
175 175
 function monsterinsights_generate_ga_client_id() {
176
-	return rand(100000000,999999999) . '.' . time();
176
+	return rand( 100000000, 999999999 ) . '.' . time();
177 177
 }
178 178
 
179 179
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		$stop = time();
194 194
 	}
195 195
 
196
-	$diff = (int) abs( $stop -  $start );
196
+	$diff = (int) abs( $stop - $start );
197 197
 	$hours = round( $diff / HOUR_IN_SECONDS );
198 198
 	return $hours;
199 199
 }
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	$editable_roles = apply_filters( 'editable_roles', $all_roles );
252 252
 
253 253
 	foreach ( $editable_roles as $id => $name ) {
254
-		$roles[ $id ] = translate_user_role( $name['name'] );
254
+		$roles[$id] = translate_user_role( $name['name'] );
255 255
 	}
256 256
 
257 257
 	return $roles;
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 
278 278
 	foreach ( $editable_roles as $id => $role ) {
279 279
 		if ( isset( $role['capabilities']['manage_options'] ) && $role['capabilities']['manage_options'] ) {
280
-			$roles[ $id ] = translate_user_role( $role['name'] );
280
+			$roles[$id] = translate_user_role( $role['name'] );
281 281
 		}
282 282
 	}
283 283
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 
324 324
 		}
325 325
 		if ( substr_count( $host, '.' ) > 1 ) {
326
-			$subdomains_to_check =  array( 'dev.', '*.staging.', 'beta.', 'test.' );
326
+			$subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' );
327 327
 			foreach ( $subdomains_to_check as $subdomain ) {
328 328
 				$subdomain = str_replace( '.', '(.)', $subdomain );
329 329
 				$subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain );
@@ -339,16 +339,16 @@  discard block
 block discarded – undo
339 339
 
340 340
 // Set cookie to expire in 2 years
341 341
 function monsterinsights_get_cookie_expiration_date( $time ) {
342
-	return date('D, j F Y H:i:s', time() + $time );
342
+	return date( 'D, j F Y H:i:s', time() + $time );
343 343
 }
344 344
 
345 345
 function monsterinsights_string_ends_with( $string, $ending ) {
346
-	$strlen = strlen($string);
347
-	$endinglen = strlen($ending);
346
+	$strlen = strlen( $string );
347
+	$endinglen = strlen( $ending );
348 348
 	if ( $endinglen > $strlen ) {
349 349
 		return false;
350 350
 	}
351
-	return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen) === 0;
351
+	return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen ) === 0;
352 352
 }
353 353
 
354 354
 function monsterinsights_string_starts_with( $string, $start ) {
@@ -878,11 +878,11 @@  discard block
 block discarded – undo
878 878
 	return $countries;
879 879
 }
880 880
 
881
-function monsterinsights_get_api_url(){
881
+function monsterinsights_get_api_url() {
882 882
 	return apply_filters( 'monsterinsights_get_api_url', 'api.monsterinsights.com/v2/' );
883 883
 }
884 884
 
885
-function monsterinsights_get_licensing_url(){
885
+function monsterinsights_get_licensing_url() {
886 886
 	return apply_filters( 'monsterinsights_get_licensing_url', 'https://www.monsterinsights.com' );
887 887
 }
888 888
 
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
 	}
927 927
 }
928 928
 
929
-if ( ! function_exists ( 'remove_class_filter' ) ) {
929
+if ( ! function_exists( 'remove_class_filter' ) ) {
930 930
 	/**
931 931
 	 * Remove Class Filter Without Access to Class Object
932 932
 	 *
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
 	function remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) {
948 948
 		global $wp_filter;
949 949
 		// Check that filter actually exists first
950
-		if ( ! isset( $wp_filter[ $tag ] ) ) return FALSE;
950
+		if ( ! isset( $wp_filter[$tag] ) ) return FALSE;
951 951
 		/**
952 952
 		 * If filter config is an object, means we're using WordPress 4.7+ and the config is no longer
953 953
 		 * a simple array, rather it is an object that implements the ArrayAccess interface.
@@ -956,33 +956,33 @@  discard block
 block discarded – undo
956 956
 		 *
957 957
 		 * @see https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/
958 958
 		 */
959
-		if ( is_object( $wp_filter[ $tag ] ) && isset( $wp_filter[ $tag ]->callbacks ) ) {
960
-			$callbacks = &$wp_filter[ $tag ]->callbacks;
959
+		if ( is_object( $wp_filter[$tag] ) && isset( $wp_filter[$tag]->callbacks ) ) {
960
+			$callbacks = &$wp_filter[$tag]->callbacks;
961 961
 		} else {
962
-			$callbacks = &$wp_filter[ $tag ];
962
+			$callbacks = &$wp_filter[$tag];
963 963
 		}
964 964
 		// Exit if there aren't any callbacks for specified priority
965
-		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) return FALSE;
965
+		if ( ! isset( $callbacks[$priority] ) || empty( $callbacks[$priority] ) ) return FALSE;
966 966
 		// Loop through each filter for the specified priority, looking for our class & method
967
-		foreach( (array) $callbacks[ $priority ] as $filter_id => $filter ) {
967
+		foreach ( (array) $callbacks[$priority] as $filter_id => $filter ) {
968 968
 			// Filter should always be an array - array( $this, 'method' ), if not goto next
969
-			if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) continue;
969
+			if ( ! isset( $filter['function'] ) || ! is_array( $filter['function'] ) ) continue;
970 970
 			// If first value in array is not an object, it can't be a class
971
-			if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) continue;
971
+			if ( ! is_object( $filter['function'][0] ) ) continue;
972 972
 			// Method doesn't match the one we're looking for, goto next
973
-			if ( $filter[ 'function' ][ 1 ] !== $method_name ) continue;
973
+			if ( $filter['function'][1] !== $method_name ) continue;
974 974
 			// Method matched, now let's check the Class
975
-			if ( get_class( $filter[ 'function' ][ 0 ] ) === $class_name ) {
975
+			if ( get_class( $filter['function'][0] ) === $class_name ) {
976 976
 				// Now let's remove it from the array
977
-				unset( $callbacks[ $priority ][ $filter_id ] );
977
+				unset( $callbacks[$priority][$filter_id] );
978 978
 				// and if it was the only filter in that priority, unset that priority
979
-				if ( empty( $callbacks[ $priority ] ) ) unset( $callbacks[ $priority ] );
979
+				if ( empty( $callbacks[$priority] ) ) unset( $callbacks[$priority] );
980 980
 				// and if the only filter for that tag, set the tag to an empty array
981 981
 				if ( empty( $callbacks ) ) $callbacks = array();
982 982
 				// If using WordPress older than 4.7
983
-				if ( ! is_object( $wp_filter[ $tag ] ) ) {
983
+				if ( ! is_object( $wp_filter[$tag] ) ) {
984 984
 					// Remove this filter from merged_filters, which specifies if filters have been sorted
985
-					unset( $GLOBALS[ 'merged_filters' ][ $tag ] );
985
+					unset( $GLOBALS['merged_filters'][$tag] );
986 986
 				}
987 987
 				return TRUE;
988 988
 			}
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
 	}
992 992
 } // End function exists
993 993
 
994
-if ( ! function_exists ( 'remove_class_action' ) ) {
994
+if ( ! function_exists( 'remove_class_action' ) ) {
995 995
 	/**
996 996
 	 * Remove Class Action Without Access to Class Object
997 997
 	 *
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
 		}
1062 1062
 
1063 1063
 		foreach ( $translations->entries as $msgid => $entry ) {
1064
-			$locale[ $msgid ] = $entry->translations;
1064
+			$locale[$msgid] = $entry->translations;
1065 1065
 		}
1066 1066
 
1067 1067
 		return $locale;
@@ -1378,22 +1378,22 @@  discard block
 block discarded – undo
1378 1378
  *
1379 1379
  * @return trimed sentence
1380 1380
  */
1381
-function monsterinsights_trim_text( $text, $count ){
1382
-	$text 	= str_replace("  ", " ", $text);
1383
-	$string = explode(" ", $text);
1381
+function monsterinsights_trim_text( $text, $count ) {
1382
+	$text = str_replace( "  ", " ", $text );
1383
+	$string = explode( " ", $text );
1384 1384
 	$trimed = "";
1385 1385
 
1386 1386
 	for ( $wordCounter = 0; $wordCounter <= $count; $wordCounter++ ) {
1387 1387
 		$trimed .= isset( $string[$wordCounter] ) ? $string[$wordCounter] : '';
1388 1388
 
1389
-		if ( $wordCounter < $count ){
1389
+		if ( $wordCounter < $count ) {
1390 1390
 			$trimed .= " "; 
1391 1391
 		} else {
1392 1392
 			$trimed .= "..."; 
1393 1393
 		}
1394 1394
 	}
1395 1395
 
1396
-	$trimed = trim($trimed);
1396
+	$trimed = trim( $trimed );
1397 1397
 
1398 1398
 	return $trimed;
1399 1399
 }
@@ -1469,7 +1469,7 @@  discard block
 block discarded – undo
1469 1469
 	$monsterinsights_reference = isset( $_GET['monsterinsights_reference'] ) ? $_GET['monsterinsights_reference'] : '';
1470 1470
 
1471 1471
 	if ( 'post-new.php' === $pagenow && 'pretty-link' === $post_type && 'url_builder' === $monsterinsights_reference ) {
1472
-	    $onboard  = get_option( 'prli_onboard' );
1472
+	    $onboard = get_option( 'prli_onboard' );
1473 1473
 
1474 1474
 		if ( $onboard == 'welcome' || $onboard == 'update' ) {
1475 1475
 			update_option( 'monsterinsights_backup_prli_onboard_value', $onboard );
@@ -1489,7 +1489,7 @@  discard block
 block discarded – undo
1489 1489
 	$post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : '';
1490 1490
 
1491 1491
 	if ( 'edit.php' === $pagenow && 'pretty-link' === $post_type ) {
1492
-		$onboard   = get_option( 'monsterinsights_backup_prli_onboard_value' );
1492
+		$onboard = get_option( 'monsterinsights_backup_prli_onboard_value' );
1493 1493
 
1494 1494
 		if ( class_exists( 'PrliBaseController' ) && ( $onboard == 'welcome' || $onboard == 'update' ) ) {
1495 1495
 			update_option( 'prli_onboard', $onboard );
Please login to merge, or discard this patch.
Braces   +25 added lines, -11 removed lines patch added patch discarded remove patch
@@ -878,11 +878,11 @@  discard block
 block discarded – undo
878 878
 	return $countries;
879 879
 }
880 880
 
881
-function monsterinsights_get_api_url(){
881
+function monsterinsights_get_api_url() {
882 882
 	return apply_filters( 'monsterinsights_get_api_url', 'api.monsterinsights.com/v2/' );
883 883
 }
884 884
 
885
-function monsterinsights_get_licensing_url(){
885
+function monsterinsights_get_licensing_url() {
886 886
 	return apply_filters( 'monsterinsights_get_licensing_url', 'https://www.monsterinsights.com' );
887 887
 }
888 888
 
@@ -947,7 +947,9 @@  discard block
 block discarded – undo
947 947
 	function remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) {
948 948
 		global $wp_filter;
949 949
 		// Check that filter actually exists first
950
-		if ( ! isset( $wp_filter[ $tag ] ) ) return FALSE;
950
+		if ( ! isset( $wp_filter[ $tag ] ) ) {
951
+			return FALSE;
952
+		}
951 953
 		/**
952 954
 		 * If filter config is an object, means we're using WordPress 4.7+ and the config is no longer
953 955
 		 * a simple array, rather it is an object that implements the ArrayAccess interface.
@@ -962,23 +964,35 @@  discard block
 block discarded – undo
962 964
 			$callbacks = &$wp_filter[ $tag ];
963 965
 		}
964 966
 		// Exit if there aren't any callbacks for specified priority
965
-		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) return FALSE;
967
+		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) {
968
+			return FALSE;
969
+		}
966 970
 		// Loop through each filter for the specified priority, looking for our class & method
967 971
 		foreach( (array) $callbacks[ $priority ] as $filter_id => $filter ) {
968 972
 			// Filter should always be an array - array( $this, 'method' ), if not goto next
969
-			if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) continue;
973
+			if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) {
974
+				continue;
975
+			}
970 976
 			// If first value in array is not an object, it can't be a class
971
-			if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) continue;
977
+			if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) {
978
+				continue;
979
+			}
972 980
 			// Method doesn't match the one we're looking for, goto next
973
-			if ( $filter[ 'function' ][ 1 ] !== $method_name ) continue;
981
+			if ( $filter[ 'function' ][ 1 ] !== $method_name ) {
982
+				continue;
983
+			}
974 984
 			// Method matched, now let's check the Class
975 985
 			if ( get_class( $filter[ 'function' ][ 0 ] ) === $class_name ) {
976 986
 				// Now let's remove it from the array
977 987
 				unset( $callbacks[ $priority ][ $filter_id ] );
978 988
 				// and if it was the only filter in that priority, unset that priority
979
-				if ( empty( $callbacks[ $priority ] ) ) unset( $callbacks[ $priority ] );
989
+				if ( empty( $callbacks[ $priority ] ) ) {
990
+					unset( $callbacks[ $priority ] );
991
+				}
980 992
 				// and if the only filter for that tag, set the tag to an empty array
981
-				if ( empty( $callbacks ) ) $callbacks = array();
993
+				if ( empty( $callbacks ) ) {
994
+					$callbacks = array();
995
+				}
982 996
 				// If using WordPress older than 4.7
983 997
 				if ( ! is_object( $wp_filter[ $tag ] ) ) {
984 998
 					// Remove this filter from merged_filters, which specifies if filters have been sorted
@@ -1378,7 +1392,7 @@  discard block
 block discarded – undo
1378 1392
  *
1379 1393
  * @return trimed sentence
1380 1394
  */
1381
-function monsterinsights_trim_text( $text, $count ){
1395
+function monsterinsights_trim_text( $text, $count ) {
1382 1396
 	$text 	= str_replace("  ", " ", $text);
1383 1397
 	$string = explode(" ", $text);
1384 1398
 	$trimed = "";
@@ -1386,7 +1400,7 @@  discard block
 block discarded – undo
1386 1400
 	for ( $wordCounter = 0; $wordCounter <= $count; $wordCounter++ ) {
1387 1401
 		$trimed .= isset( $string[$wordCounter] ) ? $string[$wordCounter] : '';
1388 1402
 
1389
-		if ( $wordCounter < $count ){
1403
+		if ( $wordCounter < $count ) {
1390 1404
 			$trimed .= " "; 
1391 1405
 		} else {
1392 1406
 			$trimed .= "..."; 
Please login to merge, or discard this patch.
includes/emails/class-emails.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 
194 194
 			foreach ( $addresses as $key => $address ) {
195 195
 				if ( ! is_email( $address ) ) {
196
-					unset( $addresses[ $key ] );
196
+					unset( $addresses[$key] );
197 197
 				}
198 198
 			}
199 199
 
@@ -294,11 +294,11 @@  discard block
 block discarded – undo
294 294
 				continue;
295 295
 			}
296 296
 
297
-			if ( ! isset( $this->args[ $type ] ) || ! is_array( $this->args[ $type ] ) ) {
298
-				$this->args[ $type ] = array();
297
+			if ( ! isset( $this->args[$type] ) || ! is_array( $this->args[$type] ) ) {
298
+				$this->args[$type] = array();
299 299
 			}
300 300
 
301
-			$this->args[ $type ] = $merge ? array_merge( $this->args[ $type ], $value ) : $value;
301
+			$this->args[$type] = $merge ? array_merge( $this->args[$type], $value ) : $value;
302 302
 		}
303 303
 
304 304
 		return $this;
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 */
316 316
 	public function get_args( $type ) {
317 317
 		if ( ! empty( $type ) ) {
318
-			return isset( $this->args[ $type ] ) ? apply_filters( 'monsterinsights_emails_templates_get_args_' . $type, $this->args[ $type ], $this ) : array();
318
+			return isset( $this->args[$type] ) ? apply_filters( 'monsterinsights_emails_templates_get_args_' . $type, $this->args[$type], $this ) : array();
319 319
 		}
320 320
 
321 321
 		return apply_filters( 'monsterinsights_emails_templates_get_args', $this->args, $this );
@@ -330,12 +330,12 @@  discard block
 block discarded – undo
330 330
 	 *
331 331
 	 * @return string
332 332
 	 */
333
-	public function build_email( $message=null ) {
333
+	public function build_email( $message = null ) {
334 334
 		// process plain text email
335 335
 		if ( false === $this->html ) {
336
-			$body 		= $this->get_template_part( 'body', $this->get_template(), true );
337
-			$body 	 	= wp_strip_all_tags( $body );
338
-			$message 	= str_replace( '{email}', $message, $body );
336
+			$body = $this->get_template_part( 'body', $this->get_template(), true );
337
+			$body = wp_strip_all_tags( $body );
338
+			$message = str_replace( '{email}', $message, $body );
339 339
 
340 340
 			return apply_filters( 'monsterinsights_email_message', $message, $this );
341 341
 		}
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 		do_action( 'monsterinsights_email_footer', $email_parts['footer'] );
359 359
 
360 360
 
361
-		$body 	 = implode( $email_parts );
361
+		$body = implode( $email_parts );
362 362
 		$message = $this->process_tag( $message, false );
363 363
 		$message = nl2br( $message );
364 364
 		$message = str_replace( '{email}', $message, $body );
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 	 *
380 380
 	 * @return bool
381 381
 	 */
382
-	public function send( $to, $subject, $message=null, $attachments = array() ) {
382
+	public function send( $to, $subject, $message = null, $attachments = array() ) {
383 383
 
384 384
 		if ( ! did_action( 'init' ) && ! did_action( 'admin_init' ) ) {
385 385
 			_doing_it_wrong( __FUNCTION__, esc_html__( 'You cannot send emails with MI_WP_Emails() until init/admin_init has been reached.', 'google-analytics-for-wordpress' ), null );
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 			$this->template = 'default';
511 511
 		}
512 512
 
513
-		return apply_filters( 'monsterinsights_email_template', $this->template);
513
+		return apply_filters( 'monsterinsights_email_template', $this->template );
514 514
 	}
515 515
 
516 516
 	/**
Please login to merge, or discard this patch.
includes/api-request.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -155,25 +155,25 @@  discard block
 block discarded – undo
155 155
 		$this->network   = is_network_admin() || ! empty( $args['network'] );
156 156
 
157 157
 		$default_token   = $this->network ? MonsterInsights()->auth->get_network_token() : MonsterInsights()->auth->get_token();
158
-		$default_key     = $this->network ? MonsterInsights()->auth->get_network_key()   : MonsterInsights()->auth->get_key();
158
+		$default_key     = $this->network ? MonsterInsights()->auth->get_network_key() : MonsterInsights()->auth->get_key();
159 159
 
160
-		$this->token     = ! empty( $args['token'] )     ? $args['token']  : $default_token;
161
-		$this->key       = ! empty( $args['key'] ) 	     ? $args['key']    : $default_key;
162
-		$this->tt        = ! empty( $args['tt'] ) 		 ? $args['tt']     : '';
163
-		$this->return    = ! empty( $args['return'] )    ? $args['return'] : '';
164
-		$this->start     = ! empty( $args['start'] )	 ? $args['start']  : '';
165
-		$this->end       = ! empty( $args['end'] )  	 ? $args['end']    : '';
160
+		$this->token     = ! empty( $args['token'] ) ? $args['token'] : $default_token;
161
+		$this->key       = ! empty( $args['key'] ) ? $args['key'] : $default_key;
162
+		$this->tt        = ! empty( $args['tt'] ) ? $args['tt'] : '';
163
+		$this->return    = ! empty( $args['return'] ) ? $args['return'] : '';
164
+		$this->start     = ! empty( $args['start'] ) ? $args['start'] : '';
165
+		$this->end       = ! empty( $args['end'] ) ? $args['end'] : '';
166 166
 
167 167
 		// We need to do this hack so that the network panel + the site_url of the main site are distinct
168 168
 		$this->site_url  = is_network_admin() ? network_admin_url() : site_url();
169 169
 
170 170
 		if ( monsterinsights_is_pro_version() ) {
171
-			$this->license   = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key();
171
+			$this->license = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key();
172 172
 		}
173 173
 		$this->plugin    = MonsterInsights()->plugin_slug;
174 174
 		$this->miversion = MONSTERINSIGHTS_VERSION;
175
-		$this->sitei     = ! empty( $args['sitei'] )   ? $args['sitei'] : '';
176
-		$this->testurl   = ! empty( $args['testurl'] ) ? $args['testurl']    : '';
175
+		$this->sitei     = ! empty( $args['sitei'] ) ? $args['sitei'] : '';
176
+		$this->testurl   = ! empty( $args['testurl'] ) ? $args['testurl'] : '';
177 177
 	}
178 178
 
179 179
 	/**
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	public function request() {
187 187
 		// Make sure we're not blocked
188 188
 		$blocked = $this->is_blocked( $this->url );
189
-		if ( $blocked || is_wp_error( $blocked )  ) {
189
+		if ( $blocked || is_wp_error( $blocked ) ) {
190 190
 			if ( is_wp_error( $blocked ) ) {
191 191
 				// Translators: Placeholder gets replaced with the error message.
192 192
 				return new WP_Error( 'api-error', sprintf( __( 'The firewall of your server is blocking outbound calls. Please contact your hosting provider to fix this issue. %s', 'google-analytics-for-wordpress' ), $blocked->get_error_message() ) );
@@ -244,14 +244,14 @@  discard block
 block discarded – undo
244 244
 		}
245 245
 
246 246
 		if ( 'GET' == $this->method ) {
247
-			$body['time']   = time(); // just to avoid caching
247
+			$body['time'] = time(); // just to avoid caching
248 248
 		}
249 249
 
250
-		$body['timezone'] = date('e');
250
+		$body['timezone'] = date( 'e' );
251 251
 
252 252
 		$body['network']  = $this->network ? 'network' : 'site';
253 253
 
254
-		$body['ip']   = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : '';
254
+		$body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : '';
255 255
 
256 256
 		// This filter will be removed in the future.
257 257
 		$body   = apply_filters( 'monsterinsights_api_request_body', $body );
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 		);
283 283
 
284 284
 		// Perform the query and retrieve the response.
285
-		$response      = 'GET' == $this->method ? wp_remote_get( esc_url_raw( $this->url ) . '?' . $string, $data ) : wp_remote_post( esc_url_raw( $this->url ), $data );
285
+		$response = 'GET' == $this->method ? wp_remote_get( esc_url_raw( $this->url ) . '?' . $string, $data ) : wp_remote_post( esc_url_raw( $this->url ), $data );
286 286
 
287 287
 		//return new WP_Error( 'debug', '<pre>' . var_export( $response, true ) . '</pre>' );
288 288
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
 		// If not a 200 status header, send back error.
303 303
 		if ( 200 != $response_code ) {
304
-			$type  = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error';
304
+			$type = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error';
305 305
 
306 306
 			if ( empty( $response_code ) ) {
307 307
 				return new WP_Error( $type, __( 'The API was unreachable.', 'google-analytics-for-wordpress' ) );
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 		// and for image linking purposes in Google Images. We use it to test outbound connections since it is run on google.com
393 393
 		// and is only a few bytes large. Plus on Google's main CDN so it loads in most places in 0.07 seconds or less. Perfect for our
394 394
 		// use case of quickly testing outbound connections.
395
-		$testurl = ! empty( $this->testurl ) ? $this->testurl :'http://www.google.com/blank.html';
395
+		$testurl = ! empty( $this->testurl ) ? $this->testurl : 'http://www.google.com/blank.html';
396 396
 		if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) {
397 397
 			if ( defined( 'WP_ACCESSIBLE_HOSTS' ) ) {
398 398
 				$wp_http      = new WP_Http();
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 						'body'          => ''
408 408
 					);
409 409
 					$response = wp_remote_get( $testurl, $params );
410
-					if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
410
+					if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
411 411
 						return false;
412 412
 					} else {
413 413
 						if ( is_wp_error( $response ) ) {
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 			);
430 430
 			$response = wp_remote_get( $testurl, $params );
431 431
 
432
-			if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
432
+			if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
433 433
 				return false;
434 434
 			} else {
435 435
 				if ( is_wp_error( $response ) ) {
Please login to merge, or discard this patch.
includes/admin/admin.php 3 patches
Indentation   +175 added lines, -175 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' ) );
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     // then addons
54 54
     $network_key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_network_license_key() : '';
55 55
     if ( ! monsterinsights_is_network_active() || ( monsterinsights_is_network_active() && empty( $network_key ) ) ) {
56
-        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' );
56
+	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' );
57 57
     }
58 58
 
59 59
     // Add About us page.
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 function monsterinsights_get_menu_hook() {
65 65
     $dashboards_disabled = monsterinsights_get_option( 'dashboards_disabled', false );
66 66
     if ( $dashboards_disabled || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) {
67
-        return 'monsterinsights_settings';
67
+	return 'monsterinsights_settings';
68 68
     } else {
69
-        return 'monsterinsights_reports';
69
+	return 'monsterinsights_reports';
70 70
     }
71 71
 }
72 72
 
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
     // First, let's see if this is an MS network enabled plugin. If it is, we should load the license
78 78
     // menu page and the updater on the network panel
79 79
     if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
80
-        require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
80
+	require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
81 81
     }
82 82
 
83 83
     $plugin = plugin_basename( MONSTERINSIGHTS_PLUGIN_FILE );
84 84
     if ( ! is_plugin_active_for_network( $plugin ) ) {
85
-        return;
85
+	return;
86 86
     }
87 87
 
88 88
     $menu_icon_inline = monsterinsights_get_inline_menu_icon();
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 function monsterinsights_add_admin_body_class( $classes ) {
114 114
     $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
115 115
     if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) {
116
-        return $classes;
116
+	return $classes;
117 117
     }
118 118
 
119 119
     return "$classes monsterinsights_page ";
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
131 131
 
132 132
     if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id  ) {
133
-        return $classes;
133
+	return $classes;
134 134
     }
135 135
 
136 136
     return "$classes insights_page_monsterinsights_tools ";
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 function monsterinsights_add_admin_body_class_addons_page( $classes ) {
147 147
     $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
148 148
     if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id  ) {
149
-        return $classes;
149
+	return $classes;
150 150
     }
151 151
 
152 152
     return "$classes insights_page_monsterinsights_addons ";
@@ -166,17 +166,17 @@  discard block
 block discarded – undo
166 166
 
167 167
     // If lite, show a link where they can get pro from
168 168
     if ( ! monsterinsights_is_pro_version() ) {
169
-        $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>';
170
-        array_unshift( $links, $get_pro );
169
+	$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>';
170
+	array_unshift( $links, $get_pro );
171 171
     }
172 172
 
173 173
     // If Lite, support goes to forum. If pro, it goes to our website
174 174
     if ( monsterinsights_is_pro_version() ) {
175
-        $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>';
176
-        array_unshift( $links, $support );
175
+	$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>';
176
+	array_unshift( $links, $support );
177 177
     } else {
178
-        $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>';
179
-        array_unshift( $links, $support );
178
+	$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>';
179
+	array_unshift( $links, $support );
180 180
     }
181 181
 
182 182
 	if ( is_network_admin() ) {
@@ -207,26 +207,26 @@  discard block
 block discarded – undo
207 207
 function monsterinsights_load_admin_partial( $template, $data = array() ) {
208 208
 
209 209
     if ( monsterinsights_is_pro_version() ) {
210
-        $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' );
210
+	$dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' );
211 211
 
212
-        if ( file_exists( $dir . $template . '.php' ) ) {
213
-            require_once(  $dir . $template . '.php' );
214
-            return true;
215
-        }
212
+	if ( file_exists( $dir . $template . '.php' ) ) {
213
+	    require_once(  $dir . $template . '.php' );
214
+	    return true;
215
+	}
216 216
     } else {
217
-        $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' );
217
+	$dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' );
218 218
 
219
-        if ( file_exists( $dir . $template . '.php' ) ) {
220
-            require_once(  $dir . $template . '.php' );
221
-            return true;
222
-        }
219
+	if ( file_exists( $dir . $template . '.php' ) ) {
220
+	    require_once(  $dir . $template . '.php' );
221
+	    return true;
222
+	}
223 223
     }
224 224
 
225 225
     $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' );
226 226
 
227 227
     if ( file_exists( $dir . $template . '.php' ) ) {
228
-        require_once(  $dir . $template . '.php' );
229
-        return true;
228
+	require_once(  $dir . $template . '.php' );
229
+	return true;
230 230
     }
231 231
 
232 232
     return false;
@@ -243,9 +243,9 @@  discard block
 block discarded – undo
243 243
 function monsterinsights_admin_footer( $text ) {
244 244
     global $current_screen;
245 245
     if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) {
246
-        $url  = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5';
247
-        // Translators: Placeholders add a link to the wordpress.org repository.
248
-        $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>' );
246
+	$url  = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5';
247
+	// Translators: Placeholders add a link to the wordpress.org repository.
248
+	$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>' );
249 249
     }
250 250
     return $text;
251 251
 }
@@ -256,12 +256,12 @@  discard block
 block discarded – undo
256 256
     // Don't show on MonsterInsights pages
257 257
     $screen = get_current_screen();
258 258
     if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) {
259
-        return;
259
+	return;
260 260
     }
261 261
 
262 262
     // Make sure they have the permissions to do something
263 263
     if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
264
-        return;
264
+	return;
265 265
     }
266 266
 
267 267
     // Priority:
@@ -279,89 +279,89 @@  discard block
 block discarded – undo
279 279
     // 1. Google Analytics not authenticated
280 280
 	if ( ! is_network_admin() && ! monsterinsights_get_ua() && ! defined( 'MONSTERINSIGHTS_DISABLE_TRACKING' ) ) {
281 281
 
282
-        $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' ) );
283
-        $title     = esc_html__( 'Please Setup Website Analytics to See Audience Insights', 'google-analytics-for-wordpress' );
284
-        $primary   = esc_html__( 'Connect MonsterInsights and Setup Website Analytics', 'google-analytics-for-wordpress' );
285
-        $urlone    = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights-onboarding' ) : admin_url( 'admin.php?page=monsterinsights-onboarding' );
286
-        $secondary = esc_html__( 'Learn More', 'google-analytics-for-wordpress' );
287
-        $urltwo    = $submenu_base . '#/about/getting-started';
288
-        $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' );
289
-        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>';
290
-        return;
282
+	$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' ) );
283
+	$title     = esc_html__( 'Please Setup Website Analytics to See Audience Insights', 'google-analytics-for-wordpress' );
284
+	$primary   = esc_html__( 'Connect MonsterInsights and Setup Website Analytics', 'google-analytics-for-wordpress' );
285
+	$urlone    = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights-onboarding' ) : admin_url( 'admin.php?page=monsterinsights-onboarding' );
286
+	$secondary = esc_html__( 'Learn More', 'google-analytics-for-wordpress' );
287
+	$urltwo    = $submenu_base . '#/about/getting-started';
288
+	$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' );
289
+	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>';
290
+	return;
291 291
     }
292 292
 
293 293
     // 2. License key not entered for pro
294 294
     $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : '';
295 295
     if ( monsterinsights_is_pro_version() && empty( $key ) ) {
296
-        $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
297
-        // Translators: Adds a link to retrieve the license.
298
-        $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>' );
299
-        echo '<div class="error"><p>'. $message.'</p></div>';
300
-        return;
296
+	$page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
297
+	// Translators: Adds a link to retrieve the license.
298
+	$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>' );
299
+	echo '<div class="error"><p>'. $message.'</p></div>';
300
+	return;
301 301
     }
302 302
 
303 303
     // 3. License key not valid/okay for pro
304 304
     if ( monsterinsights_is_pro_version() ) {
305
-        $message = '';
306
-        if ( MonsterInsights()->license->get_site_license_key() ){
307
-            if ( MonsterInsights()->license->site_license_expired() ) {
308
-	            // Translators: Adds a link to the license renewal.
309
-                $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>' );
310
-            } else if ( MonsterInsights()->license->site_license_disabled() ) {
311
-                $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
312
-            } else if ( MonsterInsights()->license->site_license_invalid() ) {
313
-                $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' );
314
-            }
315
-        } else if ( MonsterInsights()->license->get_network_license_key() ) {
316
-            if ( MonsterInsights()->license->network_license_expired() ) {
317
-            	// Translators: Adds a link to renew license.
318
-                $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>' );
319
-            } else if ( MonsterInsights()->license->network_license_disabled() ) {
320
-                $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
321
-            } else if ( MonsterInsights()->license->network_license_invalid() ) {
322
-                $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' );
323
-            }
324
-        }
325
-        if ( ! empty( $message ) ) {
326
-            echo '<div class="error"><p>'. $message.'</p></div>';
327
-            return;
328
-        }
305
+	$message = '';
306
+	if ( MonsterInsights()->license->get_site_license_key() ){
307
+	    if ( MonsterInsights()->license->site_license_expired() ) {
308
+		    // Translators: Adds a link to the license renewal.
309
+		$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>' );
310
+	    } else if ( MonsterInsights()->license->site_license_disabled() ) {
311
+		$message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
312
+	    } else if ( MonsterInsights()->license->site_license_invalid() ) {
313
+		$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' );
314
+	    }
315
+	} else if ( MonsterInsights()->license->get_network_license_key() ) {
316
+	    if ( MonsterInsights()->license->network_license_expired() ) {
317
+	    	// Translators: Adds a link to renew license.
318
+		$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>' );
319
+	    } else if ( MonsterInsights()->license->network_license_disabled() ) {
320
+		$message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
321
+	    } else if ( MonsterInsights()->license->network_license_invalid() ) {
322
+		$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' );
323
+	    }
324
+	}
325
+	if ( ! empty( $message ) ) {
326
+	    echo '<div class="error"><p>'. $message.'</p></div>';
327
+	    return;
328
+	}
329 329
     }
330 330
 
331 331
     // 4. Notices for PHP/WP version deprecations
332 332
     if ( current_user_can( 'update_core' ) ) {
333
-        global $wp_version;
334
-
335
-        // PHP 5.2/5.3
336
-        if ( version_compare( phpversion(), '5.4', '<' ) ) {
337
-            $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' );
338
-            // Translators: Placeholders add the PHP version, a link to the MonsterInsights blog and a line break.
339
-            $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>' );
340
-            echo '<div class="error"><p>'. $message.'</p></div>';
341
-            return;
342
-        }
343
-        // WordPress 3.0 - 4.5
344
-        else if ( version_compare( $wp_version, '4.6', '<' ) ) {
345
-            $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' );
346
-            // Translators: Placeholders add the current WordPress version and links to the MonsterInsights blog
347
-            $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.6 in April, 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>' );
348
-            echo '<div class="error"><p>'. $message.'</p></div>';
349
-            return;
350
-        }
351
-        // PHP 5.4/5.5
352
-        // else if ( version_compare( phpversion(), '5.6', '<' ) ) {
353
-        //  $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' );
354
-        //  $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>' );
355
-        //  echo '<div class="error"><p>'. $message.'</p></div>';
356
-        //  return;
357
-        // }
358
-        // // WordPress 4.6 - 4.8
359
-        // else if ( version_compare( $wp_version, '4.9', '<' ) ) {
360
-        //  $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' );
361
-        //  $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>' );
362
-        //  echo '<div class="error"><p>'. $message.'</p></div>';
363
-        //  return;
364
-        // }
333
+	global $wp_version;
334
+
335
+	// PHP 5.2/5.3
336
+	if ( version_compare( phpversion(), '5.4', '<' ) ) {
337
+	    $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' );
338
+	    // Translators: Placeholders add the PHP version, a link to the MonsterInsights blog and a line break.
339
+	    $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>' );
340
+	    echo '<div class="error"><p>'. $message.'</p></div>';
341
+	    return;
342
+	}
343
+	// WordPress 3.0 - 4.5
344
+	else if ( version_compare( $wp_version, '4.6', '<' ) ) {
345
+	    $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' );
346
+	    // Translators: Placeholders add the current WordPress version and links to the MonsterInsights blog
347
+	    $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.6 in April, 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>' );
348
+	    echo '<div class="error"><p>'. $message.'</p></div>';
349
+	    return;
350
+	}
351
+	// PHP 5.4/5.5
352
+	// else if ( version_compare( phpversion(), '5.6', '<' ) ) {
353
+	//  $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' );
354
+	//  $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>' );
355
+	//  echo '<div class="error"><p>'. $message.'</p></div>';
356
+	//  return;
357
+	// }
358
+	// // WordPress 4.6 - 4.8
359
+	// else if ( version_compare( $wp_version, '4.9', '<' ) ) {
360
+	//  $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' );
361
+	//  $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>' );
362
+	//  echo '<div class="error"><p>'. $message.'</p></div>';
363
+	//  return;
364
+	// }
365 365
     }
366 366
 
367 367
     // 5. Optin setting not configured
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 
392 392
     $notices   = get_option( 'monsterinsights_notices' );
393 393
     if ( ! is_array( $notices ) ) {
394
-        $notices = array();
394
+	$notices = array();
395 395
     }
396 396
 
397 397
     // 6. Authenticate, not manual
@@ -435,74 +435,74 @@  discard block
 block discarded – undo
435 435
 
436 436
     // 8. WooUpsell
437 437
     if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
438
-        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) {
439
-            echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
440
-                echo '<div class="monsterinsights-wooedd-upsell-left">';
441
-                    echo '<p><strong>';
442
-                    echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' );
443
-                    echo '</strong></p>';
444
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
445
-                    echo '<p>';
446
-                    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
447
-                    echo '</p>';
448
-                    echo '<p>';
449
-                    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' );
450
-                    echo '</p>';
451
-                    echo '<p>';
452
-                    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
453
-                    echo '</p>';
454
-                    echo '<p>';
455
-                    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
456
-                    echo '</p>';
457
-                    // Translators: Placeholders add a link to the MonsterInsights website.
458
-                    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>' );
459
-                    echo '</p>';
460
-                echo '</div><div class="monsterinsights-wooedd-upsell-right">';
461
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
462
-                echo '</div>';
463
-            echo '</div>';
464
-            return;
465
-        }
438
+	if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) {
439
+	    echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
440
+		echo '<div class="monsterinsights-wooedd-upsell-left">';
441
+		    echo '<p><strong>';
442
+		    echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' );
443
+		    echo '</strong></p>';
444
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
445
+		    echo '<p>';
446
+		    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
447
+		    echo '</p>';
448
+		    echo '<p>';
449
+		    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' );
450
+		    echo '</p>';
451
+		    echo '<p>';
452
+		    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
453
+		    echo '</p>';
454
+		    echo '<p>';
455
+		    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
456
+		    echo '</p>';
457
+		    // Translators: Placeholders add a link to the MonsterInsights website.
458
+		    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>' );
459
+		    echo '</p>';
460
+		echo '</div><div class="monsterinsights-wooedd-upsell-right">';
461
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
462
+		echo '</div>';
463
+	    echo '</div>';
464
+	    return;
465
+	}
466 466
     }
467 467
 
468 468
     // 9. EDDUpsell
469 469
     if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) {
470
-        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) {
471
-            echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
472
-                echo '<div class="monsterinsights-wooedd-upsell-left">';
473
-                    echo '<p><strong>';
474
-                    echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' );
475
-                    echo '</strong></p>';
476
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
477
-                    echo '<p>';
478
-                    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
479
-                    echo '</p>';
480
-                    echo '<p>';
481
-                    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' );
482
-                    echo '</p>';
483
-                    echo '<p>';
484
-                    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
485
-                    echo '</p>';
486
-                    echo '<p>';
487
-                    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
488
-                    echo '</p>';
489
-                    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>' );
490
-                    echo '</p>';
491
-                echo '</div><div class="monsterinsights-wooedd-upsell-right">';
492
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
493
-                echo '</div>';
494
-            echo '</div>';
495
-            return;
496
-        }
470
+	if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) {
471
+	    echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
472
+		echo '<div class="monsterinsights-wooedd-upsell-left">';
473
+		    echo '<p><strong>';
474
+		    echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' );
475
+		    echo '</strong></p>';
476
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
477
+		    echo '<p>';
478
+		    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
479
+		    echo '</p>';
480
+		    echo '<p>';
481
+		    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' );
482
+		    echo '</p>';
483
+		    echo '<p>';
484
+		    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
485
+		    echo '</p>';
486
+		    echo '<p>';
487
+		    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
488
+		    echo '</p>';
489
+		    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>' );
490
+		    echo '</p>';
491
+		echo '</div><div class="monsterinsights-wooedd-upsell-right">';
492
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
493
+		echo '</div>';
494
+	    echo '</div>';
495
+	    return;
496
+	}
497 497
     }
498 498
 
499 499
     if ( isset( $notices['monsterinsights_cross_domains_extracted'] ) && false === $notices['monsterinsights_cross_domains_extracted'] ) {
500
-        $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
501
-        $page = $page . '#/advanced';
502
-        // Translators: Adds a link to the settings panel.
503
-        $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>' );
504
-        echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>'. $message.'</p></div>';
505
-        return;
500
+	$page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
501
+	$page = $page . '#/advanced';
502
+	// Translators: Adds a link to the settings panel.
503
+	$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>' );
504
+	echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>'. $message.'</p></div>';
505
+	return;
506 506
     }
507 507
 }
508 508
 add_action( 'admin_notices', 'monsterinsights_admin_setup_notices' );
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 // AM Notices
513 513
 function monsterinsights_am_notice_optout( $super_admin ) {
514 514
     if ( monsterinsights_get_option( 'hide_am_notices', false ) || monsterinsights_get_option( 'network_hide_am_notices', false ) ) {
515
-        return false;
515
+	return false;
516 516
     }
517 517
     return $super_admin;
518 518
 }
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
 
29 29
     if ( $hook === 'monsterinsights_settings' ) {
30 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' );
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 32
         $hook = 'monsterinsights_settings';
33 33
 
34 34
         add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' );
35 35
     } else {
36 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' );
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 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
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     $menu_icon_inline = monsterinsights_get_inline_menu_icon();
89 89
     $hook = 'monsterinsights_network';
90 90
     $submenu_base = add_query_arg( 'page', 'monsterinsights_network', network_admin_url( 'admin.php' ) );
91
-    add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page',  $menu_icon_inline, '100.00013467543' );
91
+    add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', $menu_icon_inline, '100.00013467543' );
92 92
 
93 93
     add_submenu_page( $hook, __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Network Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page' );
94 94
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 function monsterinsights_add_admin_body_class_tools_page( $classes ) {
130 130
     $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
131 131
 
132
-    if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id  ) {
132
+    if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id ) {
133 133
         return $classes;
134 134
     }
135 135
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function monsterinsights_add_admin_body_class_addons_page( $classes ) {
147 147
     $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
148
-    if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id  ) {
148
+    if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id ) {
149 149
         return $classes;
150 150
     }
151 151
 
@@ -161,21 +161,21 @@  discard block
 block discarded – undo
161 161
  * @return array $links
162 162
  */
163 163
 function monsterinsights_add_action_links( $links ) {
164
-    $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="'. monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>';
164
+    $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="' . monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) . '">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>';
165 165
     array_unshift( $links, $docs );
166 166
 
167 167
     // If lite, show a link where they can get pro from
168 168
     if ( ! monsterinsights_is_pro_version() ) {
169
-        $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>';
169
+        $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>';
170 170
         array_unshift( $links, $get_pro );
171 171
     }
172 172
 
173 173
     // If Lite, support goes to forum. If pro, it goes to our website
174 174
     if ( monsterinsights_is_pro_version() ) {
175
-        $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>';
175
+        $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>';
176 176
         array_unshift( $links, $support );
177 177
     } else {
178
-        $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>';
178
+        $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>';
179 179
         array_unshift( $links, $support );
180 180
     }
181 181
 
@@ -210,14 +210,14 @@  discard block
 block discarded – undo
210 210
         $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' );
211 211
 
212 212
         if ( file_exists( $dir . $template . '.php' ) ) {
213
-            require_once(  $dir . $template . '.php' );
213
+            require_once( $dir . $template . '.php' );
214 214
             return true;
215 215
         }
216 216
     } else {
217 217
         $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' );
218 218
 
219 219
         if ( file_exists( $dir . $template . '.php' ) ) {
220
-            require_once(  $dir . $template . '.php' );
220
+            require_once( $dir . $template . '.php' );
221 221
             return true;
222 222
         }
223 223
     }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
     $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' );
226 226
 
227 227
     if ( file_exists( $dir . $template . '.php' ) ) {
228
-        require_once(  $dir . $template . '.php' );
228
+        require_once( $dir . $template . '.php' );
229 229
         return true;
230 230
     }
231 231
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) {
246 246
         $url  = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5';
247 247
         // Translators: Placeholders add a link to the wordpress.org repository.
248
-        $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>' );
248
+        $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>' );
249 249
     }
250 250
     return $text;
251 251
 }
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         $secondary = esc_html__( 'Learn More', 'google-analytics-for-wordpress' );
287 287
         $urltwo    = $submenu_base . '#/about/getting-started';
288 288
         $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' );
289
-        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>';
289
+        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>';
290 290
         return;
291 291
     }
292 292
 
@@ -295,18 +295,18 @@  discard block
 block discarded – undo
295 295
     if ( monsterinsights_is_pro_version() && empty( $key ) ) {
296 296
         $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
297 297
         // Translators: Adds a link to retrieve the license.
298
-        $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>' );
299
-        echo '<div class="error"><p>'. $message.'</p></div>';
298
+        $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>' );
299
+        echo '<div class="error"><p>' . $message . '</p></div>';
300 300
         return;
301 301
     }
302 302
 
303 303
     // 3. License key not valid/okay for pro
304 304
     if ( monsterinsights_is_pro_version() ) {
305 305
         $message = '';
306
-        if ( MonsterInsights()->license->get_site_license_key() ){
306
+        if ( MonsterInsights()->license->get_site_license_key() ) {
307 307
             if ( MonsterInsights()->license->site_license_expired() ) {
308 308
 	            // Translators: Adds a link to the license renewal.
309
-                $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>' );
309
+                $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>' );
310 310
             } else if ( MonsterInsights()->license->site_license_disabled() ) {
311 311
                 $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
312 312
             } else if ( MonsterInsights()->license->site_license_invalid() ) {
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         } else if ( MonsterInsights()->license->get_network_license_key() ) {
316 316
             if ( MonsterInsights()->license->network_license_expired() ) {
317 317
             	// Translators: Adds a link to renew license.
318
-                $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>' );
318
+                $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>' );
319 319
             } else if ( MonsterInsights()->license->network_license_disabled() ) {
320 320
                 $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
321 321
             } else if ( MonsterInsights()->license->network_license_invalid() ) {
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             }
324 324
         }
325 325
         if ( ! empty( $message ) ) {
326
-            echo '<div class="error"><p>'. $message.'</p></div>';
326
+            echo '<div class="error"><p>' . $message . '</p></div>';
327 327
             return;
328 328
         }
329 329
     }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
             $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' );
338 338
             // Translators: Placeholders add the PHP version, a link to the MonsterInsights blog and a line break.
339 339
             $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>' );
340
-            echo '<div class="error"><p>'. $message.'</p></div>';
340
+            echo '<div class="error"><p>' . $message . '</p></div>';
341 341
             return;
342 342
         }
343 343
         // WordPress 3.0 - 4.5
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
             $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' );
346 346
             // Translators: Placeholders add the current WordPress version and links to the MonsterInsights blog
347 347
             $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.6 in April, 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>' );
348
-            echo '<div class="error"><p>'. $message.'</p></div>';
348
+            echo '<div class="error"><p>' . $message . '</p></div>';
349 349
             return;
350 350
         }
351 351
         // PHP 5.4/5.5
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
     //     }
390 390
     // }
391 391
 
392
-    $notices   = get_option( 'monsterinsights_notices' );
392
+    $notices = get_option( 'monsterinsights_notices' );
393 393
     if ( ! is_array( $notices ) ) {
394 394
         $notices = array();
395 395
     }
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 
436 436
     // 8. WooUpsell
437 437
     if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
438
-        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) {
438
+        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available'] ) ) {
439 439
             echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
440 440
                 echo '<div class="monsterinsights-wooedd-upsell-left">';
441 441
                     echo '<p><strong>';
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
                     echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
456 456
                     echo '</p>';
457 457
                     // Translators: Placeholders add a link to the MonsterInsights website.
458
-                    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>' );
458
+                    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>' );
459 459
                     echo '</p>';
460 460
                 echo '</div><div class="monsterinsights-wooedd-upsell-right">';
461 461
                     echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 
468 468
     // 9. EDDUpsell
469 469
     if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) {
470
-        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) {
470
+        if ( ! isset( $notices['monsterinsights_edd_tracking_available'] ) ) {
471 471
             echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
472 472
                 echo '<div class="monsterinsights-wooedd-upsell-left">';
473 473
                     echo '<p><strong>';
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
                     echo '<p>';
487 487
                     echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
488 488
                     echo '</p>';
489
-                    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>' );
489
+                    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>' );
490 490
                     echo '</p>';
491 491
                 echo '</div><div class="monsterinsights-wooedd-upsell-right">';
492 492
                     echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
@@ -500,8 +500,8 @@  discard block
 block discarded – undo
500 500
         $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
501 501
         $page = $page . '#/advanced';
502 502
         // Translators: Adds a link to the settings panel.
503
-        $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>' );
504
-        echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>'. $message.'</p></div>';
503
+        $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>' );
504
+        echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>' . $message . '</p></div>';
505 505
         return;
506 506
     }
507 507
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -303,7 +303,7 @@
 block discarded – undo
303 303
     // 3. License key not valid/okay for pro
304 304
     if ( monsterinsights_is_pro_version() ) {
305 305
         $message = '';
306
-        if ( MonsterInsights()->license->get_site_license_key() ){
306
+        if ( MonsterInsights()->license->get_site_license_key() ) {
307 307
             if ( MonsterInsights()->license->site_license_expired() ) {
308 308
 	            // Translators: Adds a link to the license renewal.
309 309
                 $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>' );
Please login to merge, or discard this patch.
includes/admin/licensing/plugin-upgrader.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -97,7 +97,8 @@  discard block
 block discarded – undo
97 97
 		 */
98 98
 		$options = apply_filters( 'upgrader_package_options', $options );
99 99
 
100
-		if ( ! $options['is_multi'] ) { // call $this->header separately if running multiple times
100
+		if ( ! $options['is_multi'] ) {
101
+// call $this->header separately if running multiple times
101 102
 			$this->skin->header();
102 103
 		}
103 104
 
@@ -288,7 +289,8 @@  discard block
 block discarded – undo
288 289
 			return $reply;
289 290
 		}
290 291
 
291
-		if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) { //Local file or remote?
292
+		if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) {
293
+//Local file or remote?
292 294
 			return $package; //must be a local file..
293 295
 		}
294 296
 
@@ -443,11 +445,13 @@  discard block
 block discarded – undo
443 445
 		$remote_destination = $wp_filesystem->find_folder( $local_destination );
444 446
 
445 447
 		//Locate which directory to copy to the new folder, This is based on the actual folder holding the files.
446
-		if ( 1 == count( $source_files ) && $wp_filesystem->is_dir( trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) { //Only one folder? Then we want its contents.
448
+		if ( 1 == count( $source_files ) && $wp_filesystem->is_dir( trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) {
449
+//Only one folder? Then we want its contents.
447 450
 			$source = trailingslashit( $args['source'] ) . trailingslashit( $source_files[0] );
448 451
 		} elseif ( count( $source_files ) == 0 ) {
449 452
 			return new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] ); // There are no files?
450
-		} else { // It's only a single file, the upgrader will use the folder name of this file as the destination folder. Folder name is based on zip filename.
453
+		} else {
454
+// It's only a single file, the upgrader will use the folder name of this file as the destination folder. Folder name is based on zip filename.
451 455
 			$source = trailingslashit( $args['source'] );
452 456
 		}
453 457
 
Please login to merge, or discard this patch.
includes/admin/notifications.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 				( ! empty( $notification['start'] ) && time() < strtotime( $notification['start'] ) ) ||
213 213
 				( ! empty( $notification['end'] ) && time() > strtotime( $notification['end'] ) )
214 214
 			) {
215
-				unset( $notifications[ $key ] );
215
+				unset( $notifications[$key] );
216 216
 			}
217 217
 		}
218 218
 
@@ -342,10 +342,10 @@  discard block
 block discarded – undo
342 342
 		$option['dismissed']   = array_unique( $option['dismissed'] );
343 343
 
344 344
 		// Remove notification.
345
-		if ( is_array( $option[ $type ] ) && ! empty( $option[ $type ] ) ) {
346
-			foreach ( $option[ $type ] as $key => $notification ) {
345
+		if ( is_array( $option[$type] ) && ! empty( $option[$type] ) ) {
346
+			foreach ( $option[$type] as $key => $notification ) {
347 347
 				if ( $notification['id'] == $id ) { // phpcs:ignore WordPress.PHP.StrictComparisons
348
-					unset( $option[ $type ][ $key ] );
348
+					unset( $option[$type][$key] );
349 349
 					break;
350 350
 				}
351 351
 			}
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -141,7 +141,8 @@  discard block
 block discarded – undo
141 141
 	 * @since {VERSION}
142 142
 	 *
143 143
 	 */
144
-	public function verify( $notifications ) { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh
144
+	public function verify( $notifications ) {
145
+// phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh
145 146
 
146 147
 		$data = array();
147 148
 
@@ -169,7 +170,8 @@  discard block
 block discarded – undo
169 170
 			}
170 171
 
171 172
 			// Ignore if notification has already been dismissed.
172
-			if ( ! empty( $option['dismissed'] ) && in_array( $notification['id'], $option['dismissed'] ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
173
+			if ( ! empty( $option['dismissed'] ) && in_array( $notification['id'], $option['dismissed'] ) ) {
174
+// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
173 175
 				continue;
174 176
 			}
175 177
 
@@ -275,7 +277,8 @@  discard block
 block discarded – undo
275 277
 
276 278
 		$option = $this->get_option();
277 279
 
278
-		if ( in_array( $notification['id'], $option['dismissed'] ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
280
+		if ( in_array( $notification['id'], $option['dismissed'] ) ) {
281
+// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
279 282
 			return;
280 283
 		}
281 284
 
@@ -344,7 +347,8 @@  discard block
 block discarded – undo
344 347
 		// Remove notification.
345 348
 		if ( is_array( $option[ $type ] ) && ! empty( $option[ $type ] ) ) {
346 349
 			foreach ( $option[ $type ] as $key => $notification ) {
347
-				if ( $notification['id'] == $id ) { // phpcs:ignore WordPress.PHP.StrictComparisons
350
+				if ( $notification['id'] == $id ) {
351
+// phpcs:ignore WordPress.PHP.StrictComparisons
348 352
 					unset( $option[ $type ][ $key ] );
349 353
 					break;
350 354
 				}
Please login to merge, or discard this patch.
includes/deprecated.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	if ( ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) || monsterinsights_is_debug_mode() ) {
125 125
 		$message = empty( $message ) ? '' : ' ' . $message;
126 126
 		// Translators: Placeholders add the hook name, plugin version and bold text.
127
-		trigger_error( sprintf( esc_html__( '%1$s is %3$sdeprecated%4$s since MonsterInsights version %2$s!', 'google-analytics-for-wordpress' ), $hook, $version, '<strong>', '</strong>' ) . esc_html ( $message ) );
127
+		trigger_error( sprintf( esc_html__( '%1$s is %3$sdeprecated%4$s since MonsterInsights version %2$s!', 'google-analytics-for-wordpress' ), $hook, $version, '<strong>', '</strong>' ) . esc_html( $message ) );
128 128
 	}
129 129
 }
130 130
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	if ( ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) || monsterinsights_is_debug_mode() ) {
180 180
 		// Translators: Placeholders add the hook name, plugin version and bold text.
181 181
 		trigger_error( sprintf( esc_html__( '%1$s is %3$sdeprecated%4$s since MonsterInsights version %2$s.', 'google-analytics-for-wordpress' ), $function, $version, '<strong>', '</strong>' ) );
182
-		trigger_error( print_r( $backtrace, 1 ) );// Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
182
+		trigger_error( print_r( $backtrace, 1 ) ); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
183 183
 		// Alternatively we could dump this to a file.
184 184
 	}
185 185
 }
Please login to merge, or discard this patch.