Passed
Push — master ( 82fe3a...5c0e99 )
by Chris
03:23
created
includes/measurement-protocol.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
 
27 27
 	$defaults = array(
28 28
 		't'  => 'event', // Required: Hit type
29
-		'ec' => '',      // Optional: Event category
30
-		'ea' => '', 	 // Optional: Event Action
31
-		'el' => '', 	 // Optional: Event Label
32
-		'ev' => null, 	 // Optional: Event Value
29
+		'ec' => '', // Optional: Event category
30
+		'ea' => '', // Optional: Event Action
31
+		'el' => '', // Optional: Event Label
32
+		'ev' => null, // Optional: Event Value
33 33
 	);
34 34
 
35
-	$body  = array_merge( $defaults , $args );
35
+	$body = array_merge( $defaults, $args );
36 36
 
37 37
 	// We want to get the user's IP address when possible
38
-	$ip     = '';
38
+	$ip = '';
39 39
 	if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) && ! filter_var( $_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP ) === false ) {
40 40
 		$ip = $_SERVER['HTTP_CLIENT_IP'];
41 41
 	} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && ! filter_var( $_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP ) === false ) {
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		'uip' => $ip,
82 82
 
83 83
 		// Optional: User Agent
84
-		'ua'  => ! empty( $user_agent ) ?  $user_agent : $_SERVER['HTTP_USER_AGENT'],
84
+		'ua'  => ! empty( $user_agent ) ? $user_agent : $_SERVER['HTTP_USER_AGENT'],
85 85
 
86 86
 		// Optional: Time of the event
87 87
 		'z'   => time()
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	// Unset empty values to reduce request size
100 100
 	foreach ( $body as $key => $value ) {
101 101
 		if ( empty( $value ) ) {
102
-			unset( $body[ $key ] );
102
+			unset( $body[$key] );
103 103
 		}
104 104
 	}
105 105
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		// Optional: Event Value
143 143
 		'ev' => null,
144 144
 	);
145
-	$args  = wp_parse_args( $args, $default_args );
145
+	$args = wp_parse_args( $args, $default_args );
146 146
 	//$args = apply_filters( 'monsterinsights_mp_track_event_call', $args );
147 147
 
148 148
 	return monsterinsights_mp_api_call( $args );
Please login to merge, or discard this patch.
includes/admin/settings/settings-api.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( !defined( 'ABSPATH' ) ) exit;
13
+if ( ! defined( 'ABSPATH' ) ) exit;
14 14
 
15 15
 /**
16 16
  * Get the settings for a section
@@ -82,23 +82,23 @@  discard block
 block discarded – undo
82 82
 	// get subtab
83 83
 	$settings = monsterinsights_get_registered_settings();
84 84
 	$tab      = $_POST['monsterinsights_settings_sub_tab'];
85
-	if ( empty( $settings ) || !is_array( $settings ) || empty( $settings[ $tab ] ) || ! is_array( $settings[ $tab ] ) ) {
85
+	if ( empty( $settings ) || ! is_array( $settings ) || empty( $settings[$tab] ) || ! is_array( $settings[$tab] ) ) {
86 86
 		return;
87 87
 	}
88 88
 
89 89
 	// Okay we're good to sanitize, validate, and save this section's settings
90 90
 
91 91
 	// We only care about this sections's settings
92
-	$settings = $settings[ $tab ]; 
92
+	$settings = $settings[$tab]; 
93 93
 
94 94
 	// Run a general sanitization for the tab for special fields
95 95
 	$input    = ! empty( $_POST['monsterinsights_settings'] ) ? $_POST['monsterinsights_settings'] : array();
96 96
 	$input    = apply_filters( 'monsterinsights_settings_' . $tab . '_sanitize', $input );
97 97
 
98
-	foreach( $settings as $id => $setting ) {
98
+	foreach ( $settings as $id => $setting ) {
99 99
 
100 100
 		// If the value wasn't passed in, set to false, which will delete the option
101
-		$value          = isset( $input[ $id ] ) ? $input[ $id ] : false;
101
+		$value          = isset( $input[$id] ) ? $input[$id] : false;
102 102
 		$previous_value = monsterinsights_get_option( $id, false );
103 103
 
104 104
 		// Sanitize/Validate
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
 		) );
139 139
 
140 140
 		// Sanitize settings
141
-		$value = apply_filters( 'monsterinsights_settings_sanitize_' . $id  , $value, $id, $args, $previous_value );
141
+		$value = apply_filters( 'monsterinsights_settings_sanitize_' . $id, $value, $id, $args, $previous_value );
142 142
 		$value = apply_filters( 'monsterinsights_settings_sanitize_' . $type, $value, $id, $args, $previous_value );
143
-		$value = apply_filters( 'monsterinsights_settings_sanitize'         , $value, $id, $args, $previous_value );
143
+		$value = apply_filters( 'monsterinsights_settings_sanitize', $value, $id, $args, $previous_value );
144 144
 
145 145
 		// Save
146 146
 		if ( ! has_action( 'monsterinsights_settings_save_' . $args['type'] ) ) {
@@ -153,13 +153,13 @@  discard block
 block discarded – undo
153 153
 }
154 154
 add_action( 'current_screen', 'monsterinsights_save_settings' );
155 155
 
156
-function monsterinsights_is_settings_tab( $tab = '' ){
156
+function monsterinsights_is_settings_tab( $tab = '' ) {
157 157
 	$tabs = monsterinsights_get_settings_tabs();
158 158
 	if ( empty( $tab ) || empty( $tabs ) || ! is_string( $tab ) || ! is_array( $tabs ) ) {
159 159
 		return false;
160 160
 	}
161 161
 
162
-	return !empty( $tabs[$tab]);
162
+	return ! empty( $tabs[$tab] );
163 163
 }
164 164
 
165 165
 /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 		if ( ! empty( $settings[$section] ) ) {
177 177
 			foreach ( $settings[$section] as $setting ) {
178 178
 				if ( is_array( $setting ) && array_key_exists( 'type', $setting ) ) {
179
-					$setting_types[ $setting['id'] ] = $setting['type'];
179
+					$setting_types[$setting['id']] = $setting['type'];
180 180
 				}
181 181
 			}
182 182
 		}
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		foreach ( $settings as $tab ) {
185 185
 			foreach ( $tab as $setting ) {
186 186
 				if ( is_array( $setting ) && array_key_exists( 'type', $setting ) ) {
187
-					$setting_types[ $setting['id'] ] = $setting['type'];
187
+					$setting_types[$setting['id']] = $setting['type'];
188 188
 				}
189 189
 			}
190 190
 		}
@@ -256,14 +256,14 @@  discard block
 block discarded – undo
256 256
 	function _sanitize_text_fields( $str, $keep_newlines = false ) {
257 257
 		$filtered = wp_check_invalid_utf8( $str );
258 258
 	 
259
-		if ( strpos($filtered, '<') !== false ) {
259
+		if ( strpos( $filtered, '<' ) !== false ) {
260 260
 			$filtered = wp_pre_kses_less_than( $filtered );
261 261
 			// This will strip extra whitespace for us.
262 262
 			$filtered = wp_strip_all_tags( $filtered, false );
263 263
 	 
264 264
 			// Use html entities in a special case to make sure no later
265 265
 			// newline stripping stage could lead to a functional tag
266
-			$filtered = str_replace("<\n", "&lt;\n", $filtered);
266
+			$filtered = str_replace( "<\n", "&lt;\n", $filtered );
267 267
 		}
268 268
 	 
269 269
 		if ( ! $keep_newlines ) {
@@ -272,14 +272,14 @@  discard block
 block discarded – undo
272 272
 		$filtered = trim( $filtered );
273 273
 	 
274 274
 		$found = false;
275
-		while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) {
276
-			$filtered = str_replace($match[0], '', $filtered);
275
+		while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
276
+			$filtered = str_replace( $match[0], '', $filtered );
277 277
 			$found = true;
278 278
 		}
279 279
 	 
280 280
 		if ( $found ) {
281 281
 			// Strip out the whitespace that may now exist after removing the octets.
282
-			$filtered = trim( preg_replace('/ +/', ' ', $filtered) );
282
+			$filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
283 283
 		}
284 284
 	 
285 285
 		return $filtered;
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 function monsterinsights_sanitize_multicheck_field( $value, $id, $setting, $previous_value ) {
318 318
 	$save_value = array();
319 319
 	if ( ! empty( $value ) && is_array( $value ) ) {
320
-		foreach( $setting['options'] as $key => $option ){
320
+		foreach ( $setting['options'] as $key => $option ) {
321 321
 			if ( in_array( $key, $value ) ) {
322 322
 				$save_value[] = $key;
323 323
 			}
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 	if ( ! empty( $value ) && is_array( $value ) ) {
343 343
 		if ( $setting['multiple'] ) {
344 344
 			foreach ( $value as $vid => $vname ) {
345
-				foreach( $setting['options'] as $key => $option ){
345
+				foreach ( $setting['options'] as $key => $option ) {
346 346
 					if ( $key === $vname ) {
347 347
 						$save_value[] = $key;
348 348
 						break;
@@ -350,11 +350,11 @@  discard block
 block discarded – undo
350 350
 				}
351 351
 			}
352 352
 		} else {
353
-			foreach( $setting['options'] as $key => $option ){
353
+			foreach ( $setting['options'] as $key => $option ) {
354 354
 				if ( is_array( $value ) && in_array( $key, $value ) ) {
355 355
 					$save_value = $key;
356 356
 					break;
357
-				} else if ( is_string( $value ) && $key === $value ){
357
+				} else if ( is_string( $value ) && $key === $value ) {
358 358
 					$save_value = $key;
359 359
 					break;
360 360
 				}
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 function monsterinsights_sanitize_radio_field( $value, $id, $setting, $previous_value ) {
376 376
 	$save_value = '';
377 377
 	if ( ! empty( $value ) ) {
378
-		foreach( $setting['options'] as $key => $option ){
378
+		foreach ( $setting['options'] as $key => $option ) {
379 379
 			if ( $key === $value ) {
380 380
 				$save_value = $key;
381 381
 			}
@@ -492,14 +492,14 @@  discard block
 block discarded – undo
492 492
  */
493 493
 function monsterinsights_get_pages( $force = false ) {
494 494
 	$pages_options = array( '' => '' ); // Blank option
495
-	if( ( ! isset( $_GET['page'] ) || 'monsterinsights_settings' != $_GET['page'] ) && ! $force ) {
495
+	if ( ( ! isset( $_GET['page'] ) || 'monsterinsights_settings' != $_GET['page'] ) && ! $force ) {
496 496
 		return $pages_options;
497 497
 	}
498 498
 
499 499
 	$pages = get_pages();
500 500
 	if ( $pages ) {
501 501
 		foreach ( $pages as $page ) {
502
-			$pages_options[ $page->ID ] = $page->post_title;
502
+			$pages_options[$page->ID] = $page->post_title;
503 503
 		}
504 504
 	}
505 505
 
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 	}
541 541
 
542 542
 	$html     = '<input type="checkbox" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']"' . $name . ' value="1" ' . $checked . ' class="' . $class . '" ' . $disabled . ' />';
543
-	$html    .= '<p class="description">'  . wp_kses_post( $args['desc'] ) . '</p>';
543
+	$html    .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
544 544
 
545 545
 	return apply_filters( 'monsterinsights_after_setting_output', $html, $args );
546 546
 }
@@ -562,9 +562,9 @@  discard block
 block discarded – undo
562 562
 
563 563
 	$html = '';
564 564
 	if ( ! empty( $args['options'] ) ) {
565
-		foreach( $args['options'] as $key => $option ):
566
-			if( isset( $monsterinsights_option[ $key ] ) ) { $enabled = $option; } else { $enabled = NULL; }
567
-			$html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="checkbox" value="' . esc_attr( $option ) . '" ' . checked($option, $enabled, false) . '/>&nbsp;';
565
+		foreach ( $args['options'] as $key => $option ):
566
+			if ( isset( $monsterinsights_option[$key] ) ) { $enabled = $option; } else { $enabled = NULL; }
567
+			$html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="checkbox" value="' . esc_attr( $option ) . '" ' . checked( $option, $enabled, false ) . '/>&nbsp;';
568 568
 			$html .= '<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']">' . wp_kses_post( $option ) . '</label><br/>';
569 569
 		endforeach;
570 570
 		$html .= '<p class="description">' . $args['desc'] . '</p>';
@@ -596,12 +596,12 @@  discard block
 block discarded – undo
596 596
 
597 597
 		if ( $monsterinsights_options && $monsterinsights_options == $key ) {
598 598
 			$checked = true;
599
-		} else if( isset( $args['std'] ) && $args['std'] == $key && ! $monsterinsights_options ) {
599
+		} else if ( isset( $args['std'] ) && $args['std'] == $key && ! $monsterinsights_options ) {
600 600
 			$checked = true;
601 601
 		}
602 602
 
603 603
 		$html .= '<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']">';
604
-		$html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="radio" value="' . monsterinsights_sanitize_key( $key ) . '" ' . checked(true, $checked, false) . '/>&nbsp;';
604
+		$html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="radio" value="' . monsterinsights_sanitize_key( $key ) . '" ' . checked( true, $checked, false ) . '/>&nbsp;';
605 605
 		$html .= esc_html( $option ) . '</label>';
606 606
 	endforeach;
607 607
 
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 
626 626
 	if ( $monsterinsights_option ) {
627 627
 		$value = $monsterinsights_option;
628
-	} elseif( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) {
628
+	} elseif ( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) {
629 629
 		$value = '';
630 630
 	} else {
631 631
 		$value = isset( $args['std'] ) ? $args['std'] : '';
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 	$readonly = $args['readonly'] === true ? ' readonly="readonly"' : '';
646 646
 	$size     = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
647 647
 	$html     = '<input type="text" class="' . $class . ' ' . sanitize_html_class( $size ) . '-text" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" ' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"' . $readonly . $disabled . ' placeholder="' . esc_attr( $args['placeholder'] ) . '"/>';
648
-	$html    .= '<p class="description"> '  . wp_kses_post( $args['desc'] ) . '</p>';
648
+	$html    .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>';
649 649
 
650 650
 	return apply_filters( 'monsterinsights_after_setting_output', $html, $args );
651 651
 }
@@ -679,13 +679,13 @@  discard block
 block discarded – undo
679 679
 
680 680
 	$class = monsterinsights_sanitize_html_class( $args['field_class'] );
681 681
 
682
-	$max  = isset( $args['max'] )  ? $args['max']   : 999999;
683
-	$min  = isset( $args['min'] )  ? $args['min']   : 0;
682
+	$max  = isset( $args['max'] ) ? $args['max'] : 999999;
683
+	$min  = isset( $args['min'] ) ? $args['min'] : 0;
684 684
 	$step = isset( $args['step'] ) ? $args['step'] : 1;
685 685
 
686 686
 	$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
687 687
 	$html = '<input type="number" step="' . esc_attr( $step ) . '" max="' . esc_attr( $max ) . '" min="' . esc_attr( $min ) . '" class="' . $class . ' ' . sanitize_html_class( $size ) . '-text" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" ' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"/>';
688
-	$html .= '<p class="description"> '  . wp_kses_post( $args['desc'] ) . '</p>';
688
+	$html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>';
689 689
 
690 690
 	return apply_filters( 'monsterinsights_after_setting_output', $html, $args );
691 691
 }
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 	$class = monsterinsights_sanitize_html_class( $args['field_class'] );
713 713
 
714 714
 	$html = '<textarea class="' . $class . ' large-text" cols="50" rows="5" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
715
-	$html .= '<p class="description"> '  . wp_kses_post( $args['desc'] ) . '</p>';
715
+	$html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>';
716 716
 
717 717
 	return apply_filters( 'monsterinsights_after_setting_output', $html, $args );
718 718
 }
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 		$class = monsterinsights_sanitize_html_class( $args['field_class'] );
743 743
 
744 744
 		$html = '<textarea class="' . $class . ' large-text" cols="50" rows="5" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']">' . stripslashes( $value ) . '</textarea>';
745
-		$html .= '<p class="description"> '  . wp_kses_post( $args['desc'] ) . '</p>';
745
+		$html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>';
746 746
 	} else {
747 747
 		$html .= sprintf( esc_html__( 'You must have the %s capability to view/edit this setting', 'google-analytics-for-wordpress' ), '"unfiltered_html"' );
748 748
 	}
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
  *
789 789
  * @return void
790 790
  */
791
-function monsterinsights_select_callback($args) {
791
+function monsterinsights_select_callback( $args ) {
792 792
 	$monsterinsights_option = monsterinsights_get_option( $args['id'] );
793 793
 
794 794
 	if ( $monsterinsights_option ) {
@@ -810,14 +810,14 @@  discard block
 block discarded – undo
810 810
 	}
811 811
 
812 812
 	$allowclear   = isset( $args['allowclear'] ) ? (bool) $args['allowclear'] : false;
813
-	$multiple     = isset( $args['multiple'] )   ? (bool) $args['multiple'] : false;
813
+	$multiple     = isset( $args['multiple'] ) ? (bool) $args['multiple'] : false;
814 814
 	$multiple     = $multiple ? 'multiple="multiple"' : '';
815 815
 	$multiple_arg = $multiple ? '[]' : '';
816 816
 
817
-	$html = '<select id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']' . $multiple_arg .'" class="' . $class . '" data-placeholder="' . esc_html( $placeholder ) . '" data-allow-clear="' . $allowclear . '" ' . $multiple . ' />';
817
+	$html = '<select id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']' . $multiple_arg . '" class="' . $class . '" data-placeholder="' . esc_html( $placeholder ) . '" data-allow-clear="' . $allowclear . '" ' . $multiple . ' />';
818 818
 
819 819
 	foreach ( $args['options'] as $option => $name ) {
820
-		$selected = ! empty( $value ) && is_array( $value ) ? in_array( $option, $value ) :  $value === $option;
820
+		$selected = ! empty( $value ) && is_array( $value ) ? in_array( $option, $value ) : $value === $option;
821 821
 		$selected = selected( true, $selected, false );
822 822
 		$html .= '<option value="' . esc_attr( $option ) . '" ' . $selected . '>' . esc_html( $name ) . '</option>';
823 823
 	}
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 	if ( $monsterinsights_option ) {
843 843
 		$value = $monsterinsights_option;
844 844
 	} else {
845
-		if( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) {
845
+		if ( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) {
846 846
 			$value = '';
847 847
 		} else {
848 848
 			$value = isset( $args['std'] ) ? $args['std'] : '';
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
  * @return void
903 903
  */
904 904
 function monsterinsights_upgrade_notice_callback( $args ) {
905
-	$html =   '<div class="monsterinsights-upsell-box"><h2>' . esc_html( $args['name' ] ) . '</h2>'
905
+	$html = '<div class="monsterinsights-upsell-box"><h2>' . esc_html( $args['name'] ) . '</h2>'
906 906
 			. '<p class="monsterinsights-upsell-lite-text">' . $args['desc'] . '</p>'
907 907
 			. '<p class="monsterinsights-upsell-button-par"><a href="https://www.monsterinsights.com/lite/" class="monsterinsights-upsell-box-button button button-primary">' . __( 'Click here to Upgrade', 'google-analytics-for-wordpress' ) . '</a></p>'
908 908
 			. '</div>';
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
  * @param array $args Arguments passed by the setting
933 933
  * @return void
934 934
  */
935
-function monsterinsights_missing_callback($args) {
935
+function monsterinsights_missing_callback( $args ) {
936 936
 	return sprintf(
937 937
 		__( 'The callback function used for the %s setting is missing.', 'google-analytics-for-wordpress' ),
938 938
 		'<strong>' . $args['id'] . '</strong>'
@@ -963,12 +963,12 @@  discard block
 block discarded – undo
963 963
 			}
964 964
 		}
965 965
 		if ( $submit_button ) {
966
-			$html .= '<input type="hidden" name="monsterinsights_settings_tab" value="' . esc_attr( $page ). '"/>';
967
-			$html .= '<input type="hidden" name="monsterinsights_settings_sub_tab" value="' .  esc_attr( $section ) . '"/>';
966
+			$html .= '<input type="hidden" name="monsterinsights_settings_tab" value="' . esc_attr( $page ) . '"/>';
967
+			$html .= '<input type="hidden" name="monsterinsights_settings_sub_tab" value="' . esc_attr( $section ) . '"/>';
968 968
 			$html .= wp_nonce_field( 'monsterinsights-settings-nonce', 'monsterinsights-settings-nonce', true, false );
969 969
 			$html .= get_submit_button( esc_html__( 'Save Changes', 'google-analytics-for-wordpress' ), 'primary', 'monsterinsights-settings-submit', false );
970 970
 		}
971
-		$html      = apply_filters( 'monsterinsights_html_after_submit_field', $html, $page, $section );
971
+		$html = apply_filters( 'monsterinsights_html_after_submit_field', $html, $page, $section );
972 972
 	}
973 973
 	return $html;
974 974
 }
@@ -978,10 +978,10 @@  discard block
 block discarded – undo
978 978
  */
979 979
 function monsterinsights_render_field( $args ) {
980 980
 	$output = '';
981
-	$output .='<tr id="monsterinsights-input-' . monsterinsights_sanitize_key( $args['id'] ) .'">';
981
+	$output .= '<tr id="monsterinsights-input-' . monsterinsights_sanitize_key( $args['id'] ) . '">';
982 982
 		if ( ! empty( $args['name'] ) && empty( $args['no_label'] ) ) {
983 983
 			$output .= '<th scope="row">';
984
-				$output .='<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']">' . esc_html( $args["name"] ) . '</label>';
984
+				$output .= '<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']">' . esc_html( $args["name"] ) . '</label>';
985 985
 			$output .= '</th>';
986 986
 		}
987 987
 		$output .= '<td>';
@@ -1024,9 +1024,9 @@  discard block
 block discarded – undo
1024 1024
 	$notices = get_transient( 'monsterinsights_settings_notices' );
1025 1025
 	if ( empty( $notices ) ) {
1026 1026
 		$notices          = array();
1027
-		$notices[ $name ] = array( "type" => $type, "message" => $message );
1027
+		$notices[$name] = array( "type" => $type, "message" => $message );
1028 1028
 	} else {
1029
-		$notices[ $name ] = array( "type" => $type, "message" => $message );
1029
+		$notices[$name] = array( "type" => $type, "message" => $message );
1030 1030
 	}
1031 1031
 	set_transient( 'monsterinsights_settings_notices', $notices );
1032 1032
 }
@@ -1038,8 +1038,8 @@  discard block
 block discarded – undo
1038 1038
 	$notices = get_transient( 'monsterinsights_settings_notices' );
1039 1039
 	$found   = false;
1040 1040
 	if ( ! empty( $notices ) ) {
1041
-		if ( isset( $notices[ $name] ) ) {
1042
-			unset( $notices[ $name] );
1041
+		if ( isset( $notices[$name] ) ) {
1042
+			unset( $notices[$name] );
1043 1043
 			set_transient( 'monsterinsights_settings_notices', $notices );
1044 1044
 			$found = true;
1045 1045
 		} else {
@@ -1052,6 +1052,6 @@  discard block
 block discarded – undo
1052 1052
 /** 
1053 1053
  * @todo  docbloc
1054 1054
  */
1055
-function monsterinsights_get_non_setting_types(){
1056
-	return apply_filters( 'monsterinsights_non_setting_types', array(  'descriptive_text', 'hook', 'upgrade_notice', 'install_notice', 'notice' ) );
1055
+function monsterinsights_get_non_setting_types() {
1056
+	return apply_filters( 'monsterinsights_non_setting_types', array( 'descriptive_text', 'hook', 'upgrade_notice', 'install_notice', 'notice' ) );
1057 1057
 }
1058 1058
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/settings/register-settings.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -173,13 +173,13 @@  discard block
 block discarded – undo
173 173
 			)
174 174
 		),
175 175
 		/** Demographics Settings */
176
-		'demographics' => apply_filters('monsterinsights_settings_demographics',
176
+		'demographics' => apply_filters( 'monsterinsights_settings_demographics',
177 177
 			array(
178 178
 				'demographics' => array(
179 179
 					'id'          => 'demographics',
180 180
 					'name'        => __( 'Enable Demographics and Interests Reports for Remarketing and Advertising', 'google-analytics-for-wordpress' ),
181 181
 					'desc'        => sprintf( esc_html__( 'Check this setting to add the Demographics and Remarketing features to your Google Analytics tracking code. Make sure to enable Demographics and Remarketing in your Google Analaytics account. We have a guide for how to do that in our %1$sknowledge base%2$s. For more information about Remarketing, we refer you to %3$sGoogle\'s documentation%2$s.', 'google-analytics-for-wordpress. Note that usage of this function is affected by privacy and cookie laws around the world. Be sure to follow the laws that affect your target audience.' ), '<a href="https://www.monsterinsights.com/docs/enable-demographics-and-interests-report-in-google-analytics/#utm_medium=kb-link&amp;utm_source=gawp-config&amp;utm_campaign=wpgaplugin" target="_blank" rel="noopener noreferrer" referrer="no-referrer">',
182
-									'</a>','<a href="https://support.google.com/analytics/answer/2444872?hl=' . get_locale() . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">'
182
+									'</a>', '<a href="https://support.google.com/analytics/answer/2444872?hl=' . get_locale() . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">'
183 183
 					),
184 184
 					'type' 		  => 'checkbox',
185 185
 				),
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 			)
193 193
 		),
194 194
 		/** Enhanced Link Attribution Settings */
195
-		'links' => apply_filters('monsterinsights_settings_links',
195
+		'links' => apply_filters( 'monsterinsights_settings_links',
196 196
 			array(
197 197
 				'enhanced_link_attribution' => array(
198 198
 					'id'          => 'enhanced_link_attribution',
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 			)
228 228
 		),
229 229
 		/** File Download Settings */
230
-		'files' => apply_filters('monsterinsights_settings_files',
230
+		'files' => apply_filters( 'monsterinsights_settings_files',
231 231
 			array(
232 232
 				'track_download_as' => array(
233 233
 					'id'          => 'track_download_as',
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 			)
250 250
 		),
251 251
 		/** Affiliate Tracking Settings */
252
-		'affiliates' => apply_filters('monsterinsights_settings_affiliates',
252
+		'affiliates' => apply_filters( 'monsterinsights_settings_affiliates',
253 253
 			array(
254 254
 				'track_internal_as_outbound' => array(
255 255
 					'id'          => 'track_internal_as_outbound',
@@ -266,68 +266,68 @@  discard block
 block discarded – undo
266 266
 			)
267 267
 		),
268 268
 		/** Social Tracking Settings */
269
-		'social' => apply_filters('monsterinsights_settings_social',
269
+		'social' => apply_filters( 'monsterinsights_settings_social',
270 270
 			array()
271 271
 		),
272 272
 		/** Ad Tracking Settings */
273
-		'ads' => apply_filters('monsterinsights_settings_ads',
273
+		'ads' => apply_filters( 'monsterinsights_settings_ads',
274 274
 			array()
275 275
 		),
276 276
 		/** Forms Tracking Settings */
277
-		'forms' => apply_filters('monsterinsights_settings_forms',
277
+		'forms' => apply_filters( 'monsterinsights_settings_forms',
278 278
 			array()
279 279
 		),
280 280
 		/** eCommerce Tracking Settings */
281
-		'ecommerce' => apply_filters('monsterinsights_settings_ecommerce',
281
+		'ecommerce' => apply_filters( 'monsterinsights_settings_ecommerce',
282 282
 			array()
283 283
 		),
284 284
 		/** Media Tracking Settings */
285
-		'media' => apply_filters('monsterinsights_settings_media',
285
+		'media' => apply_filters( 'monsterinsights_settings_media',
286 286
 			array()
287 287
 		),
288 288
 		/** Members Tracking Settings */
289
-		'memberships' => apply_filters('monsterinsights_settings_memberships',
289
+		'memberships' => apply_filters( 'monsterinsights_settings_memberships',
290 290
 			array()
291 291
 		),
292 292
 		/** Dimensions Tracking Settings */
293
-		'dimensions' => apply_filters('monsterinsights_settings_dimensions',
293
+		'dimensions' => apply_filters( 'monsterinsights_settings_dimensions',
294 294
 			array()
295 295
 		),
296 296
 		/** Performance Tracking Settings */
297
-		'performance' => apply_filters('monsterinsights_settings_performance',
297
+		'performance' => apply_filters( 'monsterinsights_settings_performance',
298 298
 			array()
299 299
 		),
300 300
 		/** AMP Tracking Settings */
301
-		'amp' => apply_filters('monsterinsights_settings_amp',
301
+		'amp' => apply_filters( 'monsterinsights_settings_amp',
302 302
 			array()
303 303
 		),
304 304
 		/** Google Optimize Tracking Settings */
305
-		'goptimize' => apply_filters('monsterinsights_settings_goptimize',
305
+		'goptimize' => apply_filters( 'monsterinsights_settings_goptimize',
306 306
 			array()
307 307
 		),
308 308
 		/** Facebook Instant Articles Tracking Settings */
309
-		'fbia' => apply_filters('monsterinsights_settings_fbia',
309
+		'fbia' => apply_filters( 'monsterinsights_settings_fbia',
310 310
 			array()
311 311
 		),
312 312
 		/** Bounce Reduction Settings */
313
-		'bounce' => apply_filters('monsterinsights_settings_bounce',
313
+		'bounce' => apply_filters( 'monsterinsights_settings_bounce',
314 314
 			array()
315 315
 		),
316 316
 		/** Reporting Tracking Settings */
317
-		'reporting' => apply_filters('monsterinsights_settings_reporting',
317
+		'reporting' => apply_filters( 'monsterinsights_settings_reporting',
318 318
 			array()
319 319
 		),
320 320
 		/** Notifications Tracking Settings */
321
-		'notifications' => apply_filters('monsterinsights_settings_notifications',
321
+		'notifications' => apply_filters( 'monsterinsights_settings_notifications',
322 322
 			array()
323 323
 		),
324 324
 		/** Compatibility Tracking Settings */
325
-		'compatibility' => apply_filters('monsterinsights_settings_compatibility',
325
+		'compatibility' => apply_filters( 'monsterinsights_settings_compatibility',
326 326
 			array(
327 327
 				'subdomain_tracking' => array(
328 328
 					'id'          => 'subdomain_tracking',
329 329
 					'name'        => __( 'Domain to track as:', 'google-analytics-for-wordpress' ),
330
-					'desc'        => sprintf( esc_html__( 'This allows you to %1$sset the domain%2$s that\'s used for tracking. Only is used if set to a value, else defaults to automatic determination. It is very rare that you would need to use this setting.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/tracking-snippet-reference" target="_blank" rel="noopener noreferrer" referrer="no-referrer">' ,'</a>' ),
330
+					'desc'        => sprintf( esc_html__( 'This allows you to %1$sset the domain%2$s that\'s used for tracking. Only is used if set to a value, else defaults to automatic determination. It is very rare that you would need to use this setting.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/tracking-snippet-reference" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ),
331 331
 					'type' 		  => 'text',
332 332
 				),
333 333
 				'custom_code' => array(
@@ -339,18 +339,18 @@  discard block
 block discarded – undo
339 339
 				'debug_mode' => array(
340 340
 					'id'          => 'debug_mode',
341 341
 					'name'        => __( 'Enable Debug Mode', 'google-analytics-for-wordpress' ),
342
-					'desc'        => __( 'Turns on debugging in JS events tracking, logging of eCommerce requests and enables debug settings.', 'google-analytics-for-wordpress'),
342
+					'desc'        => __( 'Turns on debugging in JS events tracking, logging of eCommerce requests and enables debug settings.', 'google-analytics-for-wordpress' ),
343 343
 					'type' 		  => 'checkbox',
344 344
 				),
345 345
 			)
346 346
 		),
347 347
 		/** Permissions Tracking Settings */
348
-		'permissions' => apply_filters('monsterinsights_settings_permissions',
348
+		'permissions' => apply_filters( 'monsterinsights_settings_permissions',
349 349
 			array(
350 350
 				'view_reports' => array(
351 351
 					'id'          => 'view_reports',
352 352
 					'name'        => __( 'Let these user roles see reports (and the dashboard):', 'google-analytics-for-wordpress' ),
353
-					'desc'        => sprintf( esc_html( 'Users that have at least one of these roles will be able to view the reports and dashboard, along with any user with the %s capability.', 'google-analytics-for-wordpress' ), '<code>manage_options</code>'),
353
+					'desc'        => sprintf( esc_html( 'Users that have at least one of these roles will be able to view the reports and dashboard, along with any user with the %s capability.', 'google-analytics-for-wordpress' ), '<code>manage_options</code>' ),
354 354
 					'type'        => 'select',
355 355
 					'options'     => monsterinsights_get_roles(),
356 356
 					'select2'     => true,
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 				'save_settings' => array(
361 361
 					'id'          => 'save_settings',
362 362
 					'name'        => __( 'Let these user roles save settings:', 'google-analytics-for-wordpress' ),
363
-					'desc'        => sprintf( esc_html__( 'Users that have at least one of these roles will be able to view and save the settings panel, along with any user with the %s capability.', 'google-analytics-for-wordpress'), '<code>manage_options</code>' ),
363
+					'desc'        => sprintf( esc_html__( 'Users that have at least one of these roles will be able to view and save the settings panel, along with any user with the %s capability.', 'google-analytics-for-wordpress' ), '<code>manage_options</code>' ),
364 364
 					'type'        => 'select',
365 365
 					'options'     => monsterinsights_get_roles(),
366 366
 					'select2'     => true,
Please login to merge, or discard this patch.
includes/admin/settings/tab-tracking.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                 $class = ( 0 === $i ? ' monsterinsights-active' : '' ); 
73 73
                 ?>
74 74
                  <div id="monsterinsights-sub-tab-<?php echo esc_attr( $id ); ?>" class="monsterinsights-sub-nav-tab monsterinsights-nav-tab<?php echo esc_attr( $class ); ?>">
75
-                    <?php if ( $item['level'] === 'lite' ||  $is_pro ) { ?>
75
+                    <?php if ( $item['level'] === 'lite' || $is_pro ) { ?>
76 76
                     <?php echo '<h2 class="monsterinsights-sub-tab-header">' . esc_html( $item['title'] ) . '</h2>'; ?>
77 77
                     <?php } ?>
78 78
                      <div class="monsterinsights-subtab-settings-notices">
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                     </div>
91 91
                     <!-- Settings Form -->
92 92
                     <?php $class = ( $item['level'] !== 'lite' && ! $is_pro ) ? 'monsterinsights-no-settings-shown' : ''; ?>
93
-                    <form id="monsterinsights-tracking-<?php echo esc_attr( $id );?>-tab" class="<?php echo $class; ?>" method="post">
93
+                    <form id="monsterinsights-tracking-<?php echo esc_attr( $id ); ?>-tab" class="<?php echo $class; ?>" method="post">
94 94
                         <table class="form-table">
95 95
                             <tbody>
96 96
                                 <?php
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                             </tbody>
102 102
                         </table>
103 103
                         <?php echo monsterinsights_render_submit_field( $id, 'tracking' ); ?>
104
-                        <?php if ( $item['level'] === 'lite' && !$is_pro ) { ?>
104
+                        <?php if ( $item['level'] === 'lite' && ! $is_pro ) { ?>
105 105
                             <div class="monsterinsights-upsell-under-box">
106 106
                                 <h2><?php esc_html_e( "Want even more fine tuned control over your website analytics?", 'google-analytics-for-wordpress' ); ?></h2>
107 107
                                 <p class="monsterinsights-upsell-lite-text"><?php esc_html_e( "By upgrading to MonsterInsights Pro, you get access to numerous addons and tools that help you better understand what people are doing on your website, so you can keep doing more of what's working. Some of the features include: Ecommerce tracking, Author tracking, Post Type tracking, Ads tracking, Google AMP tracking, Performance optimization, and so much more!", 'google-analytics-for-wordpress' ); ?></p>
Please login to merge, or discard this patch.
includes/admin/settings/tab-general.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                 <tbody>
128 128
                     <?php if ( ! $profile_name ) { ?>
129 129
                     <!-- Manual UA -->
130
-                    <tr id="monsterinsights-google-ua-box" <?php echo ( ! $ua_code ? 'class="monsterinsights-hideme"' : ''); ?> >
130
+                    <tr id="monsterinsights-google-ua-box" <?php echo ( ! $ua_code ? 'class="monsterinsights-hideme"' : '' ); ?> >
131 131
                         <th scope="row">
132 132
                             <label for="monsterinsights-google-ua"><?php esc_html_e( 'Manually enter your UA code', 'google-analytics-for-wordpress' ); ?></label>
133 133
                         </th>
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                     echo monsterinsights_make_checkbox( 'dashboards_disabled', $title, $description );
146 146
                     ?>
147 147
 
148
-                    <?php if ( $tracking_mode === 'ga' || monsterinsights_is_debug_mode() ){  ?>
148
+                    <?php if ( $tracking_mode === 'ga' || monsterinsights_is_debug_mode() ) {  ?>
149 149
                     <tr id="monsterinsights-tracking-mode">
150 150
                         <th scope="row">
151 151
                             <label for="monsterinsights-tracking-mode"><?php esc_html_e( 'Pick Tracking Mode', 'google-analytics-for-wordpress' ); ?></label>
@@ -154,17 +154,17 @@  discard block
 block discarded – undo
154 154
                             <?php
155 155
                             $url = esc_url( wp_nonce_url( add_query_arg( array( 'monsterinsights-action' => 'switch_to_analyticsjs', 'return' => 'general' ) ), 'monsterinsights-switch-to-analyticsjs-nonce' ) );
156 156
                             ?>
157
-                            <label><input type="radio" name="tracking_mode" value="ga" <?php checked( $tracking_mode, 'ga' ); ?> ><?php esc_html_e('GA.js (Deprecated)', 'google-analytics-for-wordpress'); ?> </label>
158
-                            <label><input type="radio" name="tracking_mode" value="analytics" <?php checked( $tracking_mode, 'analytics' ); ?> ><?php esc_html_e( 'Analytics.js (Universal Analytics)', 'google-analytics-for-wordpress'); ?> </label>
159
-                            <?php if ($tracking_mode === 'ga' ) { ?>
160
-                            <?php echo monsterinsights_get_message( 'error', sprintf( esc_html__( 'Warning: You\'re currently using deprecated ga.js tracking. We recommend switching to analytics.js, as it is significantly more accurate than ga.js, and allows for functionality (like the more accurate Javascript based events tracking we offer). Further Google Analytics has deprecated support for ga.js, and it may stop working at any time when Google decides to disable it from their server. To switch to using the newer Universal Analytics (analytics.js) %1$sclick here%2$s.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ) );
157
+                            <label><input type="radio" name="tracking_mode" value="ga" <?php checked( $tracking_mode, 'ga' ); ?> ><?php esc_html_e( 'GA.js (Deprecated)', 'google-analytics-for-wordpress' ); ?> </label>
158
+                            <label><input type="radio" name="tracking_mode" value="analytics" <?php checked( $tracking_mode, 'analytics' ); ?> ><?php esc_html_e( 'Analytics.js (Universal Analytics)', 'google-analytics-for-wordpress' ); ?> </label>
159
+                            <?php if ( $tracking_mode === 'ga' ) { ?>
160
+                            <?php echo monsterinsights_get_message( 'error', sprintf( esc_html__( 'Warning: You\'re currently using deprecated ga.js tracking. We recommend switching to analytics.js, as it is significantly more accurate than ga.js, and allows for functionality (like the more accurate Javascript based events tracking we offer). Further Google Analytics has deprecated support for ga.js, and it may stop working at any time when Google decides to disable it from their server. To switch to using the newer Universal Analytics (analytics.js) %1$sclick here%2$s.', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' ) );
161 161
                             ?>
162 162
                             <?php } ?>
163 163
                         </td>
164 164
                     </tr>
165 165
                     <?php } ?>
166 166
 
167
-                    <?php if ( $tracking_mode !== 'ga' && $events_mode === 'php' ){  ?>
167
+                    <?php if ( $tracking_mode !== 'ga' && $events_mode === 'php' ) {  ?>
168 168
                     <tr id="monsterinsights-tracking-mode">
169 169
                         <th scope="row">
170 170
                             <label for="monsterinsights-tracking-mode"><?php esc_html_e( 'Switch to JS events tracking', 'google-analytics-for-wordpress' ); ?></label>
@@ -173,22 +173,22 @@  discard block
 block discarded – undo
173 173
                             <?php
174 174
                             $url = esc_url( wp_nonce_url( add_query_arg( array( 'monsterinsights-action' => 'switch_to_jsevents', 'return' => 'general' ) ), 'monsterinsights-switch-to-jsevents-nonce' ) );
175 175
                             ?>
176
-                            <?php echo monsterinsights_get_message( 'error', sprintf( esc_html__( 'Warning: You\'re currently using deprecated PHP based events tracking. We recommend switching to JS events tracking, as it is significantly more accurate than PHP based events tracking and we will eventually discontinue PHP based events tracking. To switch %1$sclick here%2$s.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ) );
176
+                            <?php echo monsterinsights_get_message( 'error', sprintf( esc_html__( 'Warning: You\'re currently using deprecated PHP based events tracking. We recommend switching to JS events tracking, as it is significantly more accurate than PHP based events tracking and we will eventually discontinue PHP based events tracking. To switch %1$sclick here%2$s.', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' ) );
177 177
                          ?>
178 178
                         </td>
179 179
                     </tr>
180 180
                     <?php } ?>
181 181
 
182
-                    <?php if ( $automatic_updates !== 'all' && $automatic_updates !== 'minor' ){  ?>
182
+                    <?php if ( $automatic_updates !== 'all' && $automatic_updates !== 'minor' ) {  ?>
183 183
                     <?php $automatic_updates = $automatic_updates ? $automatic_updates : 'none'; ?>
184 184
                     <tr id="monsterinsights-automatic-updates-mode">
185 185
                         <th scope="row">
186 186
                             <label for="monsterinsights-tracking-mode"><?php esc_html_e( 'Automatic Updates', 'google-analytics-for-wordpress' ); ?></label>
187 187
                         </th>
188 188
                         <td>
189
-                            <label><input type="radio" name="automatic_updates" value="all" <?php checked( $automatic_updates, 'all' ); ?> ><?php esc_html_e('Yes (Recommended) - Get the latest features, bugfixes, and security updates as they are released.', 'google-analytics-for-wordpress'); ?> </label>
190
-                            <label><input type="radio" name="automatic_updates" value="minor" <?php checked( $automatic_updates, 'minor' ); ?> ><?php esc_html_e( 'Minor Only - Only get bugfixes and security updates, but not major features.', 'google-analytics-for-wordpress'); ?> </label>
191
-                            <label><input type="radio" name="automatic_updates" value="none" <?php checked( $automatic_updates, 'none' ); ?> ><?php esc_html_e( 'None - Manually update everything.', 'google-analytics-for-wordpress'); ?> </label>
189
+                            <label><input type="radio" name="automatic_updates" value="all" <?php checked( $automatic_updates, 'all' ); ?> ><?php esc_html_e( 'Yes (Recommended) - Get the latest features, bugfixes, and security updates as they are released.', 'google-analytics-for-wordpress' ); ?> </label>
190
+                            <label><input type="radio" name="automatic_updates" value="minor" <?php checked( $automatic_updates, 'minor' ); ?> ><?php esc_html_e( 'Minor Only - Only get bugfixes and security updates, but not major features.', 'google-analytics-for-wordpress' ); ?> </label>
191
+                            <label><input type="radio" name="automatic_updates" value="none" <?php checked( $automatic_updates, 'none' ); ?> ><?php esc_html_e( 'None - Manually update everything.', 'google-analytics-for-wordpress' ); ?> </label>
192 192
                         </td>
193 193
                     </tr>
194 194
                     <?php } ?>
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                     <?php
198 198
                     $title       = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' );
199 199
                     $description = esc_html__( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' );
200
-                    if ( ! $anon_tracking || monsterinsights_is_debug_mode() ){
200
+                    if ( ! $anon_tracking || monsterinsights_is_debug_mode() ) {
201 201
                         echo monsterinsights_make_checkbox( 'anonymous_data', $title, $description );
202 202
                     }
203 203
                     ?>
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
  * @return void
233 233
  */
234 234
 function monsterinsights_settings_save_general() {
235
-    $throw_notice    = false;
235
+    $throw_notice = false;
236 236
     $manual_ua_code = isset( $_POST['manual_ua_code'] ) ? $_POST['manual_ua_code'] : '';
237 237
     $manual_ua_code = monsterinsights_is_valid_ua( $manual_ua_code ); // also sanitizes the string
238 238
     
Please login to merge, or discard this patch.
includes/admin/capabilities.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
  * @return array Array of caps needed to have this meta cap. If returned array is empty, user has the capability.
34 34
  */
35 35
 function monsterinsights_add_capabilities( $caps, $cap, $user_id, $args ) {
36
-    switch( $cap ) {
36
+    switch ( $cap ) {
37 37
         case 'monsterinsights_view_dashboard' :
38 38
             $roles = monsterinsights_get_option( 'view_reports', array() );
39 39
 
@@ -85,4 +85,4 @@  discard block
 block discarded – undo
85 85
     }
86 86
     return $caps;
87 87
 }
88
-add_filter( 'map_meta_cap','monsterinsights_add_capabilities', 10, 4 );
89 88
\ No newline at end of file
89
+add_filter( 'map_meta_cap', 'monsterinsights_add_capabilities', 10, 4 );
90 90
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/reports/overview.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	}
37 37
 
38 38
 	// Adds/Refreshes the data
39
-	public function add_report_data( $client, $id ){
39
+	public function add_report_data( $client, $id ) {
40 40
 		if ( ! current_user_can( 'monsterinsights_view_dashboard' ) ) {
41 41
 			return false;
42 42
 		}
@@ -44,22 +44,22 @@  discard block
 block discarded – undo
44 44
 		$dates = $this->get_date_range();
45 45
 
46 46
 		// Pageviews
47
-		$pageviews = $client->do_request( 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A' . $id . '&start-date=' . $dates['start']  . '&end-date=' . $dates['end']  . '&metrics=ga%3Apageviews&dimensions=ga%3Adate&max-results=' . $this->get_api_max_limit() );
47
+		$pageviews = $client->do_request( 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A' . $id . '&start-date=' . $dates['start'] . '&end-date=' . $dates['end'] . '&metrics=ga%3Apageviews&dimensions=ga%3Adate&max-results=' . $this->get_api_max_limit() );
48 48
 		$pageviews = $this->parse_request( $pageviews );
49 49
 		update_option( 'monsterinsights_report_overview_pageviews', $pageviews );
50 50
 		
51 51
 		// Top posts and pages
52
-		$top_content = $client->do_request( 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A' . $id . '&start-date=' . $dates['start']  . '&end-date=' . $dates['end']  . '&metrics=ga%3Apageviews&dimensions=ga%3ApagePath&sort=-ga%3Apageviews&max-results=' . $this->get_api_max_limit() );
52
+		$top_content = $client->do_request( 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A' . $id . '&start-date=' . $dates['start'] . '&end-date=' . $dates['end'] . '&metrics=ga%3Apageviews&dimensions=ga%3ApagePath&sort=-ga%3Apageviews&max-results=' . $this->get_api_max_limit() );
53 53
 		$top_content = $this->parse_request( $top_content );
54 54
 		update_option( 'monsterinsights_report_overview_top_content', $top_content );
55 55
 
56 56
 		// Top sources
57
-		$top_sources = $client->do_request( 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A' . $id . '&start-date=' . $dates['start']  . '&end-date=' . $dates['end']  . '&metrics=ga%3Apageviews&dimensions=ga%3Asource&sort=-ga%3Apageviews&max-results=' . $this->get_api_max_limit() );
57
+		$top_sources = $client->do_request( 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A' . $id . '&start-date=' . $dates['start'] . '&end-date=' . $dates['end'] . '&metrics=ga%3Apageviews&dimensions=ga%3Asource&sort=-ga%3Apageviews&max-results=' . $this->get_api_max_limit() );
58 58
 		$top_sources = $this->parse_request( $top_sources );
59 59
 		update_option( 'monsterinsights_report_overview_top_sources', $top_sources );
60 60
 
61 61
 		// Top countries
62
-		$countries = $client->do_request( 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A' . $id . '&start-date=' . $dates['start']  . '&end-date=' . $dates['end']  . '&metrics=ga%3Apageviews&dimensions=ga%3AcountryIsoCode&sort=-ga%3Apageviews&max-results=' . $this->get_api_max_limit() );
62
+		$countries = $client->do_request( 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A' . $id . '&start-date=' . $dates['start'] . '&end-date=' . $dates['end'] . '&metrics=ga%3Apageviews&dimensions=ga%3AcountryIsoCode&sort=-ga%3Apageviews&max-results=' . $this->get_api_max_limit() );
63 63
 		$countries = $this->parse_request( $countries );
64 64
 		update_option( 'monsterinsights_report_overview_countries', $countries );
65 65
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	}
68 68
 
69 69
 	// Gets the data
70
-	public function get_report_data( ){
70
+	public function get_report_data( ) {
71 71
 		$data = array();
72 72
 		$data['pageviews'] = get_option( 'monsterinsights_report_overview_pageviews', array() );
73 73
 		$data['top-content'] = get_option( 'monsterinsights_report_overview_top_content', array() );
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	}
78 78
 
79 79
 	// Removes report data
80
-	public function delete_report_data(){
80
+	public function delete_report_data() {
81 81
 		if ( ! current_user_can( 'monsterinsights_view_dashboard' ) ) {
82 82
 			return false;
83 83
 		}
@@ -90,20 +90,20 @@  discard block
 block discarded – undo
90 90
 	}
91 91
 
92 92
 	// Outputs the report.
93
-	public function show_report( ){
93
+	public function show_report( ) {
94 94
 		if ( ! current_user_can( 'monsterinsights_view_dashboard' ) ) {
95 95
 			return false;
96 96
 		}
97 97
 		$data = $this->get_report_data();
98 98
 
99 99
 		$pageviews = ! empty( $data['pageviews'] ) ? $data['pageviews'] : false;
100
-		$top 	   = ! empty( $data['top-content'] ) ? $data['top-content'] : false;
100
+		$top = ! empty( $data['top-content'] ) ? $data['top-content'] : false;
101 101
 		$sources   = ! empty( $data['top-sources'] ) ? $data['top-sources'] : false;
102 102
 		$countries = ! empty( $data['countries'] ) ? $data['countries'] : false;
103 103
 		?>
104 104
 		<?php
105 105
 		if ( ( empty( $pageviews ) && empty( $top ) && empty( $sources ) && empty( $countries ) ) || ( empty( $top['total']['ga:pageviews'] ) ) || ( empty( $top['data'] ) ) ) {
106
-			echo MonsterInsights()->notices->display_inline_notice( 'monsterinsights_standard_notice', '', __( 'If you\'ve just installed MonsterInsights, data may take up to 24 hours to populate here. Check back soon!','google-analytics-for-wordpress'), 'info', false, array() );
106
+			echo MonsterInsights()->notices->display_inline_notice( 'monsterinsights_standard_notice', '', __( 'If you\'ve just installed MonsterInsights, data may take up to 24 hours to populate here. Check back soon!', 'google-analytics-for-wordpress' ), 'info', false, array() );
107 107
 			return;
108 108
 		}
109 109
 
@@ -456,9 +456,9 @@  discard block
 block discarded – undo
456 456
 									$i++;
457 457
 								}
458 458
 								$title   = isset( $countries_values[0] ) ? esc_html( $countries_values[0] ) : __( 'Country not set', 'google-analytics-for-wordpress' );
459
-								$title   = isset( $list_of_countries[ $title ] ) ? esc_html( $list_of_countries[ $title ] )  : $title;
459
+								$title   = isset( $list_of_countries[$title] ) ? esc_html( $list_of_countries[$title] ) : $title;
460 460
 								$views   = isset( $countries_values[1] ) ? absint( $countries_values[1] ) : 0;
461
-								$percent = ! empty( $countries['total']['ga:pageviews'] ) &&  absint( $countries['total']['ga:pageviews'] ) > 0 ? $views / absint( $countries['total']['ga:pageviews'] ) : 0;
461
+								$percent = ! empty( $countries['total']['ga:pageviews'] ) && absint( $countries['total']['ga:pageviews'] ) > 0 ? $views / absint( $countries['total']['ga:pageviews'] ) : 0;
462 462
 								$percent = number_format( $percent * 100, 2 ) . '%';
463 463
 							?>
464 464
 							<div class="monsterinsights-data-row">
@@ -477,12 +477,12 @@  discard block
 block discarded – undo
477 477
 
478 478
 	public function parse_request( $request ) {
479 479
 		$to_save = array();
480
-		if ( ! empty( $request['response'] ) && ! empty( $request['response']['code'] ) && 200 == $request['response']['code'] ){
480
+		if ( ! empty( $request['response'] ) && ! empty( $request['response']['code'] ) && 200 == $request['response']['code'] ) {
481 481
 			$dates = $this->get_date_range();
482 482
 			$to_save['start-date'] = $dates['start'];
483 483
 			$to_save['end-date']   = $dates['end'];
484
-			$to_save['total'] 	   = isset( $request['body']['totalsForAllResults'] ) ? $request['body']['totalsForAllResults'] : 0 ;
485
-			$to_save['data'] 	   = isset( $request['body']['rows'] ) ? $request['body']['rows'] : array();
484
+			$to_save['total'] = isset( $request['body']['totalsForAllResults'] ) ? $request['body']['totalsForAllResults'] : 0;
485
+			$to_save['data'] = isset( $request['body']['rows'] ) ? $request['body']['rows'] : array();
486 486
 		} else {
487 487
 			monsterinsights_update_option( 'cron_failed', true );
488 488
 		}
@@ -692,17 +692,17 @@  discard block
 block discarded – undo
692 692
 		} else {
693 693
 			$list_of_countries = array_flip( monsterinsights_get_country_list() );
694 694
 			foreach ( $countries['data'] as $countries_index => $countries_values ) {
695
-				$title   = isset( $countries_values[0] ) ? esc_html( $countries_values[0] ) : false;
695
+				$title = isset( $countries_values[0] ) ? esc_html( $countries_values[0] ) : false;
696 696
 				if ( ! $title ) {
697 697
 					continue;
698 698
 				}
699 699
 
700
-				if ( isset( $js_countries[ $title ] ) ) {
700
+				if ( isset( $js_countries[$title] ) ) {
701 701
 					$views   = isset( $countries_values[1] ) ? absint( $countries_values[1] ) : 0;
702
-					$js_countries[ $title ] = $views;
703
-				} else if ( isset( $list_of_countries[ $title ] ) ) {
702
+					$js_countries[$title] = $views;
703
+				} else if ( isset( $list_of_countries[$title] ) ) {
704 704
 					$views   = isset( $countries_values[1] ) ? absint( $countries_values[1] ) : 0;
705
-					$js_countries[ $list_of_countries[ $title ] ] = $views;				
705
+					$js_countries[$list_of_countries[$title]] = $views;				
706 706
 				} else {
707 707
 					continue;
708 708
 				}
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 
712 712
 		$to_return = "{" . PHP_EOL;
713 713
 		foreach ( $js_countries as $country => $value ) {
714
-			$to_return .= '"' . esc_js( $country ) . '": ' . esc_js(  $value ) . "," . PHP_EOL;
714
+			$to_return .= '"' . esc_js( $country ) . '": ' . esc_js( $value ) . "," . PHP_EOL;
715 715
 		}
716 716
 		$to_return .= "}" . PHP_EOL;
717 717
 		return $to_return;
Please login to merge, or discard this patch.
includes/admin/reporting.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 				// Clear data + last run + failed
99 99
 				$this->delete_aggregate_data();
100 100
 
101
-		} else if ( ! $dashboards_disabled && $dashboards_disabled_old ){
101
+		} else if ( ! $dashboards_disabled && $dashboards_disabled_old ) {
102 102
 			// The dashboards are now being enabled
103 103
 				// Refresh data + schedule cron
104 104
 				$this->refresh_aggregate_data();
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 		$last_run = monsterinsights_get_option( 'cron_last_run', false );
122 122
 
123 123
 		// See if issue connecting or expired
124
-		if ( $last_run === false || monsterinsights_hours_between( $last_run ) >= 24 || date( 'Ymd', $last_run ) !== date('Ymd', time() ) ) { 
124
+		if ( $last_run === false || monsterinsights_hours_between( $last_run ) >= 24 || date( 'Ymd', $last_run ) !== date( 'Ymd', time() ) ) { 
125 125
 			$this->run_cron();
126 126
 		}
127 127
 	}
Please login to merge, or discard this patch.
includes/admin/googleauth.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 }
16 16
 
17 17
 function monsterinsights_google_auth_start_view( $reauth = false ) {
18
-    $class = ( $reauth ) ? 'monsterinsights_google_auth_reauth_start_view' : 'monsterinsights_google_auth_start_view' ;
18
+    $class = ( $reauth ) ? 'monsterinsights_google_auth_reauth_start_view' : 'monsterinsights_google_auth_start_view';
19 19
     ob_start(); 
20 20
     ?>
21 21
     <div class="<?php echo $class; ?>">
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
                 <div class="monsterinsights_google_auth_view_title monsterinsights_google_auth_view_title monsterinsights_google_auth_start_view_title"><?php esc_html_e( 'AUTHENTICATION', 'google-analytics-for-wordpress' ); ?> </div>
38 38
                 <div class="monsterinsights_google_auth_view_description monsterinsights_google_auth_start_view_description"><?php esc_html_e( 'Authenticate your Google Analytics account with MonsterInsights', 'google-analytics-for-wordpress' ); ?> </div>
39 39
             <?php } ?>
40
-            <input type="hidden" id="monsterinsightsreauth" name="monsterinsightsreauth" value="<?php echo ( $reauth ) ? 'true' : 'false';?>">
41
-            <input type="hidden" id="monsterinsightsview" name="monsterinsightsview" value="<?php echo 'start';?>">
40
+            <input type="hidden" id="monsterinsightsreauth" name="monsterinsightsreauth" value="<?php echo ( $reauth ) ? 'true' : 'false'; ?>">
41
+            <input type="hidden" id="monsterinsightsview" name="monsterinsightsview" value="<?php echo 'start'; ?>">
42 42
         </div>
43 43
         <div id="monsterinsights_google_auth_box_footer">
44 44
             <div id="monsterinsights_google_auth_box_footer_left">
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     return $contents;
63 63
 }
64 64
 function monsterinsights_google_auth_enterkey_view( $reauth = false, $auth_url = '', $error = '' ) {
65
-    $class    = ( $reauth ) ? 'monsterinsights_google_auth_reauth_enterkey_view' : 'monsterinsights_google_auth_enterkey_view' ;
65
+    $class    = ( $reauth ) ? 'monsterinsights_google_auth_reauth_enterkey_view' : 'monsterinsights_google_auth_enterkey_view';
66 66
     $auth_url = esc_js( esc_url( $auth_url ) );
67 67
     ob_start(); 
68 68
     ?>
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
          <?php } ?>
80 80
          <div id="monsterinsights_google_auth_box_contents" <?php if ( $reauth ) { echo 'class="monsterinsights_google_auth_reauth"'; } ?> >
81 81
             <div class="monsterinsights_google_auth_view_title monsterinsights_google_auth_enterkey_view_title"><?php esc_html_e( 'ENTER GOOGLE CODE', 'google-analytics-for-wordpress' ); ?> </div>
82
-            <a id="monsterinsights-google-oauth-window" class="button" onclick="monsterinsights_popupwindow('<?php echo esc_js( esc_attr( esc_url( $auth_url ) ) );  ?>',500,500);"><?php esc_html_e( 'Click To Get Google Code', 'google-analytics-for-wordpress' ); ?> </a>
82
+            <a id="monsterinsights-google-oauth-window" class="button" onclick="monsterinsights_popupwindow('<?php echo esc_js( esc_attr( esc_url( $auth_url ) ) ); ?>',500,500);"><?php esc_html_e( 'Click To Get Google Code', 'google-analytics-for-wordpress' ); ?> </a>
83 83
             <label for="monsterinsights_step_data" class="monsterinsights_google_auth_step_data_label_enterkey_view"><?php esc_html_e( 'Copy the Google code into the box below and click next', 'google-analytics-for-wordpress' ); ?> </label>
84
-            <input type="text"   id="monsterinsights_step_data" class="monsterinsights_google_auth_step_data_enterkey_view" name="monsterinsights_step_data" placeholder="<?php esc_html_e( 'Paste Google Code here', 'google-analytics-for-wordpress'); ?>">
85
-            <input type="hidden" id="monsterinsightsreauth" name="monsterinsightsreauth" value="<?php echo ($reauth) ? 'true' : 'false';?>">
86
-            <input type="hidden" id="monsterinsightsview" name="monsterinsightsview" value="<?php echo 'enterkey';?>">
84
+            <input type="text"   id="monsterinsights_step_data" class="monsterinsights_google_auth_step_data_enterkey_view" name="monsterinsights_step_data" placeholder="<?php esc_html_e( 'Paste Google Code here', 'google-analytics-for-wordpress' ); ?>">
85
+            <input type="hidden" id="monsterinsightsreauth" name="monsterinsightsreauth" value="<?php echo ( $reauth ) ? 'true' : 'false'; ?>">
86
+            <input type="hidden" id="monsterinsightsview" name="monsterinsightsview" value="<?php echo 'enterkey'; ?>">
87 87
             <?php if ( ! empty( $error ) ) { ?>
88 88
                 <div class="monsterinsights_google_auth_enterkey_error notice notice-warning" style="margin:0px;padding:0px;"><p><?php esc_html_e( $error ); ?><p></div>
89 89
             <?php } ?>
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     return $contents;    
111 111
 }
112 112
 function monsterinsights_google_auth_selectprofile_view( $reauth = false, $selectprofile = '', $error = '' ) {
113
-    $class = ( $reauth ) ? 'monsterinsights_google_auth_reauth_selectprofile_view' : 'monsterinsights_google_auth_selectprofile_view' ;
113
+    $class = ( $reauth ) ? 'monsterinsights_google_auth_reauth_selectprofile_view' : 'monsterinsights_google_auth_selectprofile_view';
114 114
     ob_start(); 
115 115
     ?>
116 116
     <div class="<?php echo $class; ?>">
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
             <div class="monsterinsights_google_auth_view_title monsterinsights_google_auth_start_view_title"><?php esc_html_e( 'SELECT PROFILE', 'google-analytics-for-wordpress' ); ?> </div>
130 130
             <div class="monsterinsights_google_auth_view_description monsterinsights_google_auth_start_view_description"><?php esc_html_e( 'Select the Google Analytics Profile to Use', 'google-analytics-for-wordpress' ); ?> </div>
131 131
             <?php echo $selectprofile; ?>
132
-            <input type="hidden" id="monsterinsightsreauth" name="monsterinsightsreauth" value="<?php echo ( $reauth) ? 'true' : 'false';?>">
133
-            <input type="hidden" id="monsterinsightsview" name="monsterinsightsview" value="<?php echo 'selectprofile';?>">
132
+            <input type="hidden" id="monsterinsightsreauth" name="monsterinsightsreauth" value="<?php echo ( $reauth ) ? 'true' : 'false'; ?>">
133
+            <input type="hidden" id="monsterinsightsview" name="monsterinsightsview" value="<?php echo 'selectprofile'; ?>">
134 134
             <?php if ( ! empty( $error ) ) { ?>
135 135
                 <div class="monsterinsights_google_auth_selectprofile_error notice notice-warning" style="margin:0px;padding:0px;"><p><?php esc_html_e( $error ); ?><p></div>
136 136
             <?php } ?>
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     return $contents;  
158 158
 }
159 159
 function monsterinsights_google_auth_done_view( $reauth = false ) {
160
-    $class = ( $reauth ) ? 'monsterinsights_google_auth_reauth_done_view' : 'monsterinsights_google_auth_done_view' ;
160
+    $class = ( $reauth ) ? 'monsterinsights_google_auth_reauth_done_view' : 'monsterinsights_google_auth_done_view';
161 161
     ob_start(); 
162 162
     ?>
163 163
     <div class="<?php echo $class; ?>">
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
          <div id="monsterinsights_google_auth_box_contents" <?php if ( $reauth ) { echo 'class="monsterinsights_google_auth_reauth"'; } ?> >
172 172
             <div class="monsterinsights_google_auth_view_title monsterinsights_google_auth_start_view_title"><?php esc_html_e( 'DONE', 'google-analytics-for-wordpress' ); ?> </div>
173 173
             <div class="monsterinsights_google_auth_view_description monsterinsights_google_auth_start_view_description"><?php esc_html_e( 'You\'re all set!', 'google-analytics-for-wordpress' ); ?> </div>
174
-            <input type="hidden" id="monsterinsightsreauth" name="monsterinsightsreauth" value="<?php echo ( $reauth) ? 'true' : 'false';?>">
175
-            <input type="hidden" id="monsterinsightsview" name="monsterinsightsview" value="<?php echo 'done';?>">
174
+            <input type="hidden" id="monsterinsightsreauth" name="monsterinsightsreauth" value="<?php echo ( $reauth ) ? 'true' : 'false'; ?>">
175
+            <input type="hidden" id="monsterinsightsview" name="monsterinsightsview" value="<?php echo 'done'; ?>">
176 176
         </div>
177 177
         <div id="monsterinsights_google_auth_box_footer">
178 178
             <div id="monsterinsights_google_auth_box_footer_left">
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 }
198 198
 
199 199
 function monsterinsights_google_auth_error_view( $reauth = false, $error = '' ) {
200
-    $class = ( $reauth ) ? 'monsterinsights_google_auth_reauth_exit_view' : 'monsterinsights_google_auth_exit_view' ;
200
+    $class = ( $reauth ) ? 'monsterinsights_google_auth_reauth_exit_view' : 'monsterinsights_google_auth_exit_view';
201 201
     ob_start(); 
202 202
     ?>
203 203
     <div class="<?php echo $class; ?>">
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
          <div id="monsterinsights_google_auth_box_contents" <?php if ( $reauth ) { echo 'class="monsterinsights_google_auth_reauth"'; } ?> >
215 215
             <div class="monsterinsights_google_auth_view_title monsterinsights_google_auth_exit_view_title"><?php esc_html_e( 'ERROR', 'google-analytics-for-wordpress' ); ?> </div>
216 216
             <div class="monsterinsights_google_auth_view_description monsterinsights_google_auth_exit_view_description"><?php echo $error; ?> </div>
217
-            <input type="hidden" id="monsterinsightsreauth" name="monsterinsightsreauth" value="<?php echo ( $reauth) ? 'true' : 'false';?>">
218
-            <input type="hidden" id="monsterinsightsview" name="monsterinsightsview" value="<?php echo 'done';?>">
217
+            <input type="hidden" id="monsterinsightsreauth" name="monsterinsightsreauth" value="<?php echo ( $reauth ) ? 'true' : 'false'; ?>">
218
+            <input type="hidden" id="monsterinsightsview" name="monsterinsightsview" value="<?php echo 'done'; ?>">
219 219
         </div>
220 220
         <div id="monsterinsights_google_auth_box_footer">
221 221
             <div id="monsterinsights_google_auth_box_footer_left">
Please login to merge, or discard this patch.