Passed
Push — master ( 3b714f...562556 )
by Chris
03:05
created
includes/admin/tracking.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		$data['usercount']     = function_exists( 'get_user_count' ) ? get_user_count() : 'Not Set';
84 84
 
85 85
 		// Retrieve current plugin information
86
-		if( ! function_exists( 'get_plugins' ) ) {
86
+		if ( ! function_exists( 'get_plugins' ) ) {
87 87
 			include ABSPATH . '/wp-admin/includes/plugin.php';
88 88
 		}
89 89
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		foreach ( $plugins as $key => $plugin ) {
94 94
 			if ( in_array( $plugin, $active_plugins ) ) {
95 95
 				// Remove active plugins from list so we can show active and inactive separately
96
-				unset( $plugins[ $key ] );
96
+				unset( $plugins[$key] );
97 97
 			}
98 98
 		}
99 99
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			return false;
112 112
 		}
113 113
 
114
-		if( ! $this->tracking_allowed() && ! $override ) {
114
+		if ( ! $this->tracking_allowed() && ! $override ) {
115 115
 			return false;
116 116
 		}
117 117
 
@@ -143,15 +143,15 @@  discard block
 block discarded – undo
143 143
 	public function schedule_send() {
144 144
 		if ( ! wp_next_scheduled( 'monsterinsights_usage_tracking_cron' ) ) {
145 145
 			$tracking             = array();
146
-			$tracking['day']      = rand( 0, 6  );
146
+			$tracking['day']      = rand( 0, 6 );
147 147
 			$tracking['hour']     = rand( 0, 23 );
148 148
 			$tracking['minute']   = rand( 0, 59 );
149 149
 			$tracking['second']   = rand( 0, 59 );
150
-			$tracking['offset']   = ( $tracking['day']    * DAY_IN_SECONDS    ) +
151
-									( $tracking['hour']   * HOUR_IN_SECONDS   ) +
150
+			$tracking['offset']   = ( $tracking['day'] * DAY_IN_SECONDS ) +
151
+									( $tracking['hour'] * HOUR_IN_SECONDS ) +
152 152
 									( $tracking['minute'] * MINUTE_IN_SECONDS ) +
153 153
 									 $tracking['second'];
154
-			$tracking['initsend'] = strtotime("next sunday") + $tracking['offset'];
154
+			$tracking['initsend'] = strtotime( "next sunday" ) + $tracking['offset'];
155 155
 
156 156
 			wp_schedule_event( $tracking['initsend'], 'weekly', 'monsterinsights_usage_tracking_cron' );
157 157
 			update_option( 'monsterinsights_usage_tracking_config', $tracking );
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
 		}
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
 	 */
176 176
 	public function frontend_output( ) {
177 177
 		$options        = $this->frontend_tracking_options();
178
-		$is_debug_mode  =  monsterinsights_is_debug_mode();
179
-		$src     	    = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics.js' );
178
+		$is_debug_mode  = monsterinsights_is_debug_mode();
179
+		$src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics.js' );
180 180
 		if ( current_user_can( 'manage_options' ) && $is_debug_mode ) {
181 181
 			$src       = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics_debug.js' );
182 182
 		}
@@ -192,13 +192,13 @@  discard block
 block discarded – undo
192 192
 <?php if ( ! $track_user ) {
193 193
 	if ( empty( $ua ) ) {
194 194
 		$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' );
195
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
195
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
196 196
 	} else if ( current_user_can( 'monsterinsights_save_settings' ) ) {
197
-		$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' );
198
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
197
+		$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' );
198
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
199 199
 	} else {
200 200
 		$reason = __( 'Note: The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' );
201
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
201
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
202 202
 	}
203 203
 	echo $output;
204 204
 } ?>
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 	?>
251 251
 	} else {
252 252
 <?php if ( $this->should_do_optout() ) { ?>
253
-		console.log( "<?php echo esc_js( $reason );?>" );
253
+		console.log( "<?php echo esc_js( $reason ); ?>" );
254 254
 		(function() {
255 255
 			/* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */
256 256
 			var noopfn = function() {
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 				}
274 274
 				var f = arguments[len-1];
275 275
 				if ( typeof f !== 'object' || f === null || typeof f.hitCallback !== 'function' ) {
276
-					console.log( '<?php echo esc_js( __('Not running function', 'google-analytics-for-wordpress' ) );?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( sprintf( __( "because you're not being tracked. %s", 'google-analytics-for-wordpress' ), $reason ) );?>");
276
+					console.log( '<?php echo esc_js( __( 'Not running function', 'google-analytics-for-wordpress' ) ); ?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( sprintf( __( "because you're not being tracked. %s", 'google-analytics-for-wordpress' ), $reason ) ); ?>");
277 277
 					return;
278 278
 				}
279 279
 				try {
Please login to merge, or discard this patch.