Passed
Push — master ( a9a27c...5b63cb )
by Chris
08:45
created
includes/admin/routes.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 			return;
68 68
 		}
69 69
 
70
-		$site_license    = array(
70
+		$site_license = array(
71 71
 			'key'         => MonsterInsights()->license->get_site_license_key(),
72 72
 			'type'        => MonsterInsights()->license->get_site_license_type(),
73 73
 			'is_disabled' => MonsterInsights()->license->site_license_disabled(),
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 		// Array fields are needed even if empty.
135 135
 		$array_fields = array( 'view_reports', 'save_settings', 'ignore_users' );
136 136
 		foreach ( $array_fields as $array_field ) {
137
-			if ( ! isset( $options[ $array_field ] ) ) {
138
-				$options[ $array_field ] = array();
137
+			if ( ! isset( $options[$array_field] ) ) {
138
+				$options[$array_field] = array();
139 139
 			}
140 140
 		}
141 141
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 						}
266 266
 					}
267 267
 					if ( $empty ) {
268
-						unset( $value[ $key ] );
268
+						unset( $value[$key] );
269 269
 					}
270 270
 				}
271 271
 			}
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 				} else {
316 316
 					$addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug );
317 317
 				}
318
-				$parsed_addons[ $addon->slug ] = $addon;
318
+				$parsed_addons[$addon->slug] = $addon;
319 319
 			}
320 320
 		}
321 321
 
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 			'slug'      => 'wp-mail-smtp',
424 424
 		);
425 425
 		// SeedProd.
426
-		$parsed_addons['coming-soon']    = array(
426
+		$parsed_addons['coming-soon'] = array(
427 427
 			'active'    => defined( 'SEEDPROD_VERSION' ),
428 428
 			'icon'      => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugin-seedprod.png',
429 429
 			'title'     => 'SeedProd',
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 			'settings'  => admin_url( 'admin.php?page=seedprod_lite' ),
435 435
 		);
436 436
 		// RafflePress
437
-		$parsed_addons['rafflepress']    = array(
437
+		$parsed_addons['rafflepress'] = array(
438 438
 			'active'    => function_exists( 'rafflepress_lite_activation' ),
439 439
 			'icon'      => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/pluign-rafflepress.png',
440 440
 			'title'     => 'RafflePress',
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 		$installed       = false;
545 545
 		$plugin_basename = monsterinsights_get_plugin_basename_from_slug( $slug );
546 546
 
547
-		if ( isset( $installed_plugins[ $plugin_basename ] ) ) {
547
+		if ( isset( $installed_plugins[$plugin_basename] ) ) {
548 548
 			$installed = true;
549 549
 
550 550
 			if ( is_multisite() && is_network_admin() ) {
@@ -559,8 +559,8 @@  discard block
 block discarded – undo
559 559
 
560 560
 		$active_version = false;
561 561
 		if ( $active ) {
562
-			if ( ! empty( $installed_plugins[ $plugin_basename ]['Version'] ) ) {
563
-				$active_version = $installed_plugins[ $plugin_basename ]['Version'];
562
+			if ( ! empty( $installed_plugins[$plugin_basename]['Version'] ) ) {
563
+				$active_version = $installed_plugins[$plugin_basename]['Version'];
564 564
 			}
565 565
 		}
566 566
 
@@ -828,14 +828,14 @@  discard block
 block discarded – undo
828 828
 		);
829 829
 
830 830
 		foreach ( $exclude as $e ) {
831
-			if ( ! empty( $new_settings[ $e ] ) ) {
832
-				unset( $new_settings[ $e ] );
831
+			if ( ! empty( $new_settings[$e] ) ) {
832
+				unset( $new_settings[$e] );
833 833
 			}
834 834
 		}
835 835
 
836 836
 		foreach ( $exclude as $e ) {
837
-			if ( ! empty( $settings[ $e ] ) ) {
838
-				$new_settings = $settings[ $e ];
837
+			if ( ! empty( $settings[$e] ) ) {
838
+				$new_settings = $settings[$e];
839 839
 			}
840 840
 		}
841 841
 
@@ -995,7 +995,7 @@  discard block
 block discarded – undo
995 995
 			),
996 996
 			admin_url( 'admin.php' )
997 997
 		);
998
-		$url    = esc_url( $url );
998
+		$url = esc_url( $url );
999 999
 
1000 1000
 		ob_start();
1001 1001
 		if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, null ) ) ) {
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
 			$homepage = get_option( 'page_on_front' );
1102 1102
 			if ( ! $homepage ) {
1103 1103
 				$array[] = array(
1104
-					'id'    => - 1,
1104
+					'id'    => -1,
1105 1105
 					'title' => __( 'Homepage', 'google-analytics-for-wordpress' ),
1106 1106
 				);
1107 1107
 			}
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
 			if ( ! post_type_supports( $post_type->name, 'editor' ) || 'product' === $post_type->name ) {
1176 1176
 				continue;
1177 1177
 			}
1178
-			$post_types_parsed[ $post_type->name ] = $post_type->labels->singular_name;
1178
+			$post_types_parsed[$post_type->name] = $post_type->labels->singular_name;
1179 1179
 		}
1180 1180
 
1181 1181
 		$post_types_parsed = apply_filters( 'monsterinsights_vue_post_types_editor', $post_types_parsed );
@@ -1297,18 +1297,18 @@  discard block
 block discarded – undo
1297 1297
 			$value        = sanitize_text_field( wp_unslash( $_POST['value'] ) ); // Value of custom style like 12px or #fff.
1298 1298
 			$settings     = get_option( $settings_key, array() );
1299 1299
 
1300
-			if ( ! isset( $settings[ $type ] ) ) {
1301
-				$settings[ $type ] = array();
1300
+			if ( ! isset( $settings[$type] ) ) {
1301
+				$settings[$type] = array();
1302 1302
 			}
1303
-			if ( ! isset( $settings[ $type ][ $theme ] ) ) {
1304
-				$settings[ $type ][ $theme ] = array();
1303
+			if ( ! isset( $settings[$type][$theme] ) ) {
1304
+				$settings[$type][$theme] = array();
1305 1305
 			}
1306 1306
 
1307
-			if ( ! isset( $settings[ $type ][ $theme ][ $object ] ) ) {
1308
-				$settings[ $type ][ $theme ][ $object ] = array();
1307
+			if ( ! isset( $settings[$type][$theme][$object] ) ) {
1308
+				$settings[$type][$theme][$object] = array();
1309 1309
 			}
1310 1310
 
1311
-			$settings[ $type ][ $theme ][ $object ][ $key ] = $value;
1311
+			$settings[$type][$theme][$object][$key] = $value;
1312 1312
 
1313 1313
 			update_option( $settings_key, $settings );
1314 1314
 
Please login to merge, or discard this patch.
includes/frontend/tracking/class-tracking-analytics.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 
99 99
 		if ( $create && ! empty( $create ) && is_array( $create ) ) {
100 100
 			$create = json_encode( $create );
101
-			$create = str_replace( '"', "'",  $create );
102
-			$options['create'] = "'create', '" . esc_js( $ua_code ). "', '" . esc_js( $domain ) . "', " . $create;
101
+			$create = str_replace( '"', "'", $create );
102
+			$options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "', " . $create;
103 103
 		} else {
104 104
 			$options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "'";
105 105
 		}
@@ -206,22 +206,22 @@  discard block
 block discarded – undo
206 206
 <?php if ( ! $track_user ) {
207 207
 	if ( empty( $ua ) ) {
208 208
 		$reason = __( 'Note: MonsterInsights is not currently configured on this site. The site owner needs to authenticate with Google Analytics in the MonsterInsights settings panel.', 'google-analytics-for-wordpress' );
209
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
209
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
210 210
 	} else if ( current_user_can( 'monsterinsights_save_settings' ) ) {
211
-		$reason = __( 'Note: MonsterInsights does not track you as a logged-in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.'. PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' );
212
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
211
+		$reason = __( 'Note: MonsterInsights does not track you as a logged-in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.' . PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' );
212
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
213 213
 	} else {
214 214
 		$reason = __( 'Note: The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' );
215
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
215
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
216 216
 	}
217 217
 	echo $output;
218 218
 } ?>
219 219
 <?php if ( $ua ) { ?>
220
-<script<?php echo $attr_string;?>>
220
+<script<?php echo $attr_string; ?>>
221 221
     (window.gaDevIds=window.gaDevIds||[]).push("dZGIzZG");
222 222
 	var mi_version         = '<?php echo MONSTERINSIGHTS_VERSION; ?>';
223 223
 	var mi_track_user      = <?php echo ( $track_user ? 'true' : 'false' ); ?>;
224
-	var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason)  . "'": "''" ); ?>;
224
+	var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason ) . "'" : "''" ); ?>;
225 225
 	<?php do_action( 'monsterinsights_tracking_analytics_frontend_output_after_mi_track_user' ); ?>
226 226
 
227 227
 <?php if ( $this->should_do_optout() ) { ?>
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 	?>
276 276
 	} else {
277 277
 <?php if ( $this->should_do_optout() ) { ?>
278
-		console.log( "<?php echo esc_js( $reason );?>" );
278
+		console.log( "<?php echo esc_js( $reason ); ?>" );
279 279
 		(function() {
280 280
 			/* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */
281 281
 			var noopfn = function() {
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 				}
299 299
 				var f = arguments[len-1];
300 300
 				if ( typeof f !== 'object' || f === null || typeof f.hitCallback !== 'function' ) {
301
-					console.log( '<?php echo esc_js( __("Not running function", "google-analytics-for-wordpress" ) );?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) );?> " + mi_no_track_reason );
301
+					console.log( '<?php echo esc_js( __( "Not running function", "google-analytics-for-wordpress" ) ); ?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) ); ?> " + mi_no_track_reason );
302 302
 					return;
303 303
 				}
304 304
 				try {
Please login to merge, or discard this patch.