Passed
Push — master ( 805644...e0709e )
by Chris
06:07
created
includes/admin/routes.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 			return;
43 43
 		}
44 44
 
45
-		$site_license    = array(
45
+		$site_license = array(
46 46
 			'key'         => MonsterInsights()->license->get_site_license_key(),
47 47
 			'type'        => MonsterInsights()->license->get_site_license_type(),
48 48
 			'is_disabled' => MonsterInsights()->license->site_license_disabled(),
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 		// Array fields are needed even if empty.
103 103
 		$array_fields = array( 'view_reports', 'save_settings', 'ignore_users' );
104 104
 		foreach ( $array_fields as $array_field ) {
105
-			if ( ! isset( $options[ $array_field ] ) ) {
106
-				$options[ $array_field ] = array();
105
+			if ( ! isset( $options[$array_field] ) ) {
106
+				$options[$array_field] = array();
107 107
 			}
108 108
 		}
109 109
 		if ( isset( $options['custom_code'] ) ) {
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 						}
178 178
 					}
179 179
 					if ( $empty ) {
180
-						unset( $value[ $key ] );
180
+						unset( $value[$key] );
181 181
 					}
182 182
 				}
183 183
 			}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 				} else {
228 228
 					$addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug );
229 229
 				}
230
-				$parsed_addons[ $addon->slug ] = $addon;
230
+				$parsed_addons[$addon->slug] = $addon;
231 231
 			}
232 232
 		}
233 233
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		$installed       = false;
317 317
 		$plugin_basename = monsterinsights_get_plugin_basename_from_slug( $slug );
318 318
 
319
-		if ( isset( $installed_plugins[ $plugin_basename ] ) ) {
319
+		if ( isset( $installed_plugins[$plugin_basename] ) ) {
320 320
 			$installed = true;
321 321
 
322 322
 			if ( is_multisite() && is_network_admin() ) {
@@ -459,8 +459,8 @@  discard block
 block discarded – undo
459 459
 		);
460 460
 
461 461
 		foreach ( $exclude as $e ) {
462
-			if ( ! empty( $new_settings[ $e ] ) ) {
463
-				unset( $new_settings[ $e ] );
462
+			if ( ! empty( $new_settings[$e] ) ) {
463
+				unset( $new_settings[$e] );
464 464
 			}
465 465
 		}
466 466
 
@@ -471,8 +471,8 @@  discard block
 block discarded – undo
471 471
 		}
472 472
 
473 473
 		foreach ( $exclude as $e ) {
474
-			if ( ! empty( $settings[ $e ] ) ) {
475
-				$new_settings = $settings[ $e ];
474
+			if ( ! empty( $settings[$e] ) ) {
475
+				$new_settings = $settings[$e];
476 476
 			}
477 477
 		}
478 478
 
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 
535 535
 		$isnetwork = ! empty( $_REQUEST['isnetwork'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['isnetwork'] ) ) : '';
536 536
 		$start     = ! empty( $_POST['start'] ) ? sanitize_text_field( wp_unslash( $_POST['start'] ) ) : date( 'Y-m-d', strtotime( '-30 days' ) );
537
-		$end       = ! empty( $_POST['end'] ) ? sanitize_text_field( wp_unslash( $_POST['end'] ) ) : date( 'Y-m-d', strtotime( '-1 day' ) );;
537
+		$end       = ! empty( $_POST['end'] ) ? sanitize_text_field( wp_unslash( $_POST['end'] ) ) : date( 'Y-m-d', strtotime( '-1 day' ) ); ;
538 538
 		$args      = array(
539 539
 			'start' => $start,
540 540
 			'end'   => $end,
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 			),
631 631
 			admin_url( 'admin.php' )
632 632
 		);
633
-		$url    = esc_url( $url );
633
+		$url = esc_url( $url );
634 634
 
635 635
 		ob_start();
636 636
 		if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, null ) ) ) {
Please login to merge, or discard this patch.
includes/install.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		// if new install or Yoast Era instal
64 64
 		if ( ! $version ) {
65 65
 			// See if from Yoast
66
-			$yoast   = get_option( 'yst_ga', false );
66
+			$yoast = get_option( 'yst_ga', false );
67 67
 
68 68
 			// In case from Yoast, start from scratch
69 69
 			delete_option( 'yoast-ga-access_token' );
@@ -313,25 +313,25 @@  discard block
 block discarded – undo
313 313
 	public function v700_upgrades() {
314 314
 		// 1. Default all event tracking and tracking to GA + JS respectively
315 315
 			// 3a Set tracking_mode to use analytics.js
316
-			$this->new_settings['tracking_mode' ] = 'analytics';
316
+			$this->new_settings['tracking_mode'] = 'analytics';
317 317
 
318 318
 
319 319
 			// 3b Set events mode to use JS if the events mode is not set explicitly to none
320
-			if ( empty( $this->new_settings['events_mode' ] ) || $this->new_settings['events_mode' ] !== 'none' ) {
321
-				$this->new_settings['events_mode' ] = 'js';
320
+			if ( empty( $this->new_settings['events_mode'] ) || $this->new_settings['events_mode'] !== 'none' ) {
321
+				$this->new_settings['events_mode'] = 'js';
322 322
 			}
323 323
 
324 324
 		// 2. Migrate manual UA codes
325 325
 			// 2a Manual UA has the lowest priority
326
-			if ( ! empty( $this->new_settings['manual_ua_code' ] ) ) {
326
+			if ( ! empty( $this->new_settings['manual_ua_code'] ) ) {
327 327
 				// Set as manual UA code
328
-				is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['manual_ua_code' ] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['manual_ua_code' ] ) );
328
+				is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['manual_ua_code'] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['manual_ua_code'] ) );
329 329
 			}
330 330
 
331 331
 			// 2b Then try the oAuth UA code
332
-			if ( ! empty( $this->new_settings['analytics_profile_code' ] ) ) {
332
+			if ( ! empty( $this->new_settings['analytics_profile_code'] ) ) {
333 333
 				// Set as manual UA code
334
-				is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['analytics_profile_code' ] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['analytics_profile_code' ] ) );
334
+				is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['analytics_profile_code'] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['analytics_profile_code'] ) );
335 335
 			}
336 336
 
337 337
 		// 3. Migrate License keys
@@ -373,8 +373,8 @@  discard block
 block discarded – undo
373 373
 					'track_internal_as_label',
374 374
 				);
375 375
 				foreach ( $settings as $setting ) {
376
-					if ( ! empty( $this->new_settings[ $setting ] ) ) {
377
-						unset( $this->new_settings[ $setting ] );
376
+					if ( ! empty( $this->new_settings[$setting] ) ) {
377
+						unset( $this->new_settings[$setting] );
378 378
 					}
379 379
 				}
380 380
 			}
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
 			);
419 419
 
420 420
 			foreach ( $settings as $setting ) {
421
-				if ( ! empty( $this->new_settings[ $setting ] ) ) {
422
-					unset( $this->new_settings[ $setting ] );
421
+				if ( ! empty( $this->new_settings[$setting] ) ) {
422
+					unset( $this->new_settings[$setting] );
423 423
 				}
424 424
 			}
425 425
 
@@ -458,8 +458,8 @@  discard block
 block discarded – undo
458 458
 			);
459 459
 
460 460
 			foreach ( $settings as $setting ) {
461
-				if ( ! empty( $this->new_settings[ $setting ] ) ) {
462
-					unset( $this->new_settings[ $setting ] );
461
+				if ( ! empty( $this->new_settings[$setting] ) ) {
462
+					unset( $this->new_settings[$setting] );
463 463
 				}
464 464
 			}
465 465
 
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 					}
551 551
 					preg_match( $regex, $cross_domain['domain'], $matches );
552 552
 					if ( count( $matches ) > 0 ) {
553
-						unset( $this->new_settings['cross_domains'][ $key ] );
553
+						unset( $this->new_settings['cross_domains'][$key] );
554 554
 					}
555 555
 				}
556 556
 			}
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 				'js',
631 631
 				'tgz'
632 632
 			);
633
-			$extensions_to_add    = array(
633
+			$extensions_to_add = array(
634 634
 				'docx',
635 635
 				'pptx',
636 636
 				'xlsx',
Please login to merge, or discard this patch.