Passed
Push — master ( 02fe7f...406f6c )
by
unknown
10:53
created
includes/frontend/events/class-gtag-events.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,17 +63,17 @@  discard block
 block discarded – undo
63 63
 			foreach ( $inbound_paths as $index => $pair ) {
64 64
 				// if empty pair, unset and continue
65 65
 				if ( empty( $pair['path'] ) ) {
66
-					unset( $inbound_paths[ $index ] );
66
+					unset( $inbound_paths[$index] );
67 67
 					continue;
68 68
 				}
69 69
 
70 70
 				// if path does not start with a /, start it with that
71 71
 				$path                            = ! empty( $pair['path'] ) ? $pair['path'] : 'aff';
72
-				$inbound_paths[ $index ]['path'] = trim( $path );
72
+				$inbound_paths[$index]['path'] = trim( $path );
73 73
 
74 74
 				// js escape the link label
75 75
 				$label                            = ! empty( $pair['label'] ) ? $pair['label'] : 'aff';
76
-				$inbound_paths[ $index ]['label'] = esc_js( trim( $label ) );
76
+				$inbound_paths[$index]['label'] = esc_js( trim( $label ) );
77 77
 			}
78 78
 		}
79 79
 
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 		}
88 88
 		$i = 0;
89 89
 		foreach ( $download_extensions as $extension ) {
90
-			$download_extensions[ $i ] = esc_js( trim( $extension ) );
91
-			$i ++;
90
+			$download_extensions[$i] = esc_js( trim( $extension ) );
91
+			$i++;
92 92
 		}
93 93
 
94 94
 		$download_extensions = implode( ",", $download_extensions );
Please login to merge, or discard this patch.
includes/frontend/tracking/class-tracking-gtag.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
 		if ( $encoded ) {
157 157
 			return str_replace(
158
-				[ '"' . $placeholder, $placeholder . '"' ],
158
+				['"' . $placeholder, $placeholder . '"'],
159 159
 				'',
160 160
 				wp_json_encode( $options )
161 161
 			);
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 					var MonsterInsightsLocations = (typeof MonsterInsightsExcludeQuery === 'object') ? MonsterInsightsExcludeQuery : MonsterInsightsDefaultLocations;
219 219
 				}
220 220
 
221
-				<?php if ($this->should_do_optout()) { ?>
221
+				<?php if ( $this->should_do_optout() ) { ?>
222 222
 				var disableStrs = [
223
-					<?php if (! empty( $v4_id )) { ?>
223
+					<?php if ( ! empty( $v4_id ) ) { ?>
224 224
 					'ga-disable-<?php echo esc_js( $v4_id ); ?>',
225 225
 					<?php } ?>
226 226
 				];
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 						}
280 280
 
281 281
 						if (type === 'event') {
282
-							<?php if ($v4_id) { ?>
282
+							<?php if ( $v4_id ) { ?>
283 283
 							parameters.send_to = monsterinsights_frontend.v4_id;
284 284
 							var hookName = name;
285 285
 							if (typeof parameters['event_category'] !== 'undefined') {
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 					if ( MonsterInsightsLocations.page_location ) {
313 313
 						__gtagTracker('set', MonsterInsightsLocations);
314 314
 					}
315
-					<?php if (! empty( $v4_id )) { ?>
315
+					<?php if ( ! empty( $v4_id ) ) { ?>
316 316
 					__gtagTracker('config', '<?php echo esc_js( $v4_id ); ?>', <?php echo $options_v4; // phpcs:ignore ?> );
317 317
 					<?php } ?>
318 318
 					<?php
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 					do_action( 'monsterinsights_frontend_tracking_gtag_after_pageview' );
326 326
 					?>
327 327
 					<?php echo esc_js( $compat ); ?>
328
-					<?php if (apply_filters( 'monsterinsights_tracking_gtag_frontend_gatracker_compatibility', true )) { ?>
328
+					<?php if ( apply_filters( 'monsterinsights_tracking_gtag_frontend_gatracker_compatibility', true ) ) { ?>
329 329
 					(function () {
330 330
 						/* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */
331 331
 						/* ga and __gaTracker compatibility shim. */
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 					})();
439 439
 					<?php } ?>
440 440
 				} else {
441
-					<?php if ($this->should_do_optout()) { ?>
441
+					<?php if ( $this->should_do_optout() ) { ?>
442 442
 					console.log("<?php echo esc_js( $reason ); ?>");
443 443
 					(function () {
444 444
 						function __gtagTracker() {
Please login to merge, or discard this patch.
includes/emails/class-emails.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 
195 195
 			foreach ( $addresses as $key => $address ) {
196 196
 				if ( ! is_email( $address ) ) {
197
-					unset( $addresses[ $key ] );
197
+					unset( $addresses[$key] );
198 198
 				}
199 199
 			}
200 200
 
@@ -295,11 +295,11 @@  discard block
 block discarded – undo
295 295
 				continue;
296 296
 			}
297 297
 
298
-			if ( ! isset( $this->args[ $type ] ) || ! is_array( $this->args[ $type ] ) ) {
299
-				$this->args[ $type ] = array();
298
+			if ( ! isset( $this->args[$type] ) || ! is_array( $this->args[$type] ) ) {
299
+				$this->args[$type] = array();
300 300
 			}
301 301
 
302
-			$this->args[ $type ] = $merge ? array_merge( $this->args[ $type ], $value ) : $value;
302
+			$this->args[$type] = $merge ? array_merge( $this->args[$type], $value ) : $value;
303 303
 		}
304 304
 
305 305
 		return $this;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 	 */
317 317
 	public function get_args( $type ) {
318 318
 		if ( ! empty( $type ) ) {
319
-			return isset( $this->args[ $type ] ) ? apply_filters( 'monsterinsights_emails_templates_get_args_' . $type, $this->args[ $type ], $this ) : array();
319
+			return isset( $this->args[$type] ) ? apply_filters( 'monsterinsights_emails_templates_get_args_' . $type, $this->args[$type], $this ) : array();
320 320
 		}
321 321
 
322 322
 		return apply_filters( 'monsterinsights_emails_templates_get_args', $this->args, $this );
Please login to merge, or discard this patch.
includes/emails/templates/footer-default.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 </tr>
25 25
 <tr>
26 26
 	<td valign="top" id="templateFooter"
27
-		style="mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;background-color: <?php echo esc_attr($background_color); ?>;border-top: 0;border-bottom: 0;padding-top: 12px;padding-bottom: 12px;">
27
+		style="mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;background-color: <?php echo esc_attr( $background_color ); ?>;border-top: 0;border-bottom: 0;padding-top: 12px;padding-bottom: 12px;">
28 28
 		<table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnTextBlock"
29 29
 			   style="min-width: 100%;border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
30 30
 			<tbody class="mcnTextBlockOuter">
Please login to merge, or discard this patch.
includes/emails/templates/header-default.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 
13 13
 $header_image     = monsterinsights_get_option( 'email_header_image', false );
14 14
 $background_color = '#e9eaec';
15
-$text_dir   = is_rtl() ? 'rtl' : 'ltr';
15
+$text_dir = is_rtl() ? 'rtl' : 'ltr';
16 16
 ?>
17 17
 <!doctype html>
18
-<html dir="<?php echo esc_attr($text_dir); ?>" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"
18
+<html dir="<?php echo esc_attr( $text_dir ); ?>" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"
19 19
 	  xmlns:o="urn:schemas-microsoft-com:office:office">
20 20
 <head>
21 21
 	<!--[if gte mso 15]>
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		/***** Make theme edits below if needed *****/
138 138
 		/* Page - Background Style */
139 139
 		body, #bodyTable {
140
-			background-color: <?php echo esc_attr($background_color); ?>;
140
+			background-color: <?php echo esc_attr( $background_color ); ?>;
141 141
 		}
142 142
 
143 143
 		/* Page - Heading 1 */
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
 		/* Footer - Footer Style */
223 223
 		#templateFooter {
224
-			background-color: <?php echo esc_attr($background_color); ?>;
224
+			background-color: <?php echo esc_attr( $background_color ); ?>;
225 225
 			border-top: 0;
226 226
 			border-bottom: 0;
227 227
 			padding-top: 12px;
@@ -280,11 +280,11 @@  discard block
 block discarded – undo
280 280
 	</style>
281 281
 </head>
282 282
 <body
283
-	style="height: 100%;margin: 0;padding: 0;width: 100%;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;background-color: <?php echo esc_attr($background_color); ?>;">
283
+	style="height: 100%;margin: 0;padding: 0;width: 100%;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;background-color: <?php echo esc_attr( $background_color ); ?>;">
284 284
 <!-- Don't forget to run final template through http://templates.mailchimp.com/resources/inline-css/ -->
285 285
 <center>
286 286
 	<table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable"
287
-		   style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;height: 100%;margin: 0;padding: 0;width: 100%;background-color: <?php echo esc_attr($background_color); ?>;">
287
+		   style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;height: 100%;margin: 0;padding: 0;width: 100%;background-color: <?php echo esc_attr( $background_color ); ?>;">
288 288
 		<tr>
289 289
 			<td align="center" valign="top" id="bodyCell"
290 290
 				style="mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;height: 100%;margin: 0;padding: 50px 50px;width: 100%;">
Please login to merge, or discard this patch.
includes/compatibility-check.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 						'<strong>',
265 265
 						$compatible_php_version['required'], // phpcs:ignore
266 266
 						'</strong>',
267
-						'<a target="_blank" href="' . esc_url($url) . '">',
267
+						'<a target="_blank" href="' . esc_url( $url ) . '">',
268 268
 						'</a>'
269 269
 					)
270 270
 				);
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 						'<strong>',
280 280
 						$compatible_wp_version['required'], // phpcs:ignore
281 281
 						'</strong>',
282
-						'<a target="_blank" href="' . esc_url($url) . '">',
282
+						'<a target="_blank" href="' . esc_url( $url ) . '">',
283 283
 						'</a>'
284 284
 					)
285 285
 				);
Please login to merge, or discard this patch.
includes/helpers.php 4 patches
Braces   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@  discard block
 block discarded – undo
16 16
 	exit;
17 17
 }
18 18
 
19
-function monsterinsights_get_url($medium = '', $campaign = '', $url = '', $escape = true)
20
-{
19
+function monsterinsights_get_url($medium = '', $campaign = '', $url = '', $escape = true) {
21 20
     // Setup Campaign variables
22 21
     $source      = monsterinsights_is_pro_version() ? 'proplugin' : 'liteplugin';
23 22
     $medium      = !empty($medium) ? $medium : 'defaultmedium';
@@ -182,7 +181,7 @@  discard block
 block discarded – undo
182 181
 	$cookie = sanitize_text_field( $_COOKIE[ $cookie_name ] );
183 182
 	$parts = explode( '.', $cookie );
184 183
 
185
-	if ( ! isset( $parts[2] ) ){
184
+	if ( ! isset( $parts[2] ) ) {
186 185
 		return null;
187 186
 	}
188 187
 
Please login to merge, or discard this patch.
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -28,19 +28,19 @@  discard block
 block discarded – undo
28 28
 
29 29
     // Put together redirect URL
30 30
     $url = add_query_arg(
31
-        array(
32
-            'utm_source'   => $source,   // Pro/Lite Plugin
33
-            'utm_medium'   => sanitize_key($medium),   // Area of MonsterInsights (example Reports)
34
-            'utm_campaign' => sanitize_key($campaign), // Which link (example eCommerce Report)
35
-            'utm_content'  => $content,  // Version number of MI
36
-        ),
37
-        trailingslashit($url)
31
+	array(
32
+	    'utm_source'   => $source,   // Pro/Lite Plugin
33
+	    'utm_medium'   => sanitize_key($medium),   // Area of MonsterInsights (example Reports)
34
+	    'utm_campaign' => sanitize_key($campaign), // Which link (example eCommerce Report)
35
+	    'utm_content'  => $content,  // Version number of MI
36
+	),
37
+	trailingslashit($url)
38 38
     );
39 39
 
40 40
     if ($escape) {
41
-        return esc_url($url);
41
+	return esc_url($url);
42 42
     } else {
43
-        return $url;
43
+	return $url;
44 44
     }
45 45
 }
46 46
 
@@ -1009,19 +1009,19 @@  discard block
 block discarded – undo
1009 1009
 
1010 1010
     // Build the body of the request.
1011 1011
     $query_params = wp_parse_args(
1012
-        $body,
1013
-        array(
1014
-            'tgm-updater-action'     => $action,
1015
-            'tgm-updater-key'        => $key,
1016
-            'tgm-updater-wp-version' => get_bloginfo( 'version' ),
1017
-            'tgm-updater-referer'    => site_url(),
1018
-            'tgm-updater-mi-version' => MONSTERINSIGHTS_VERSION,
1019
-            'tgm-updater-is-pro'     => monsterinsights_is_pro_version(),
1020
-        )
1012
+	$body,
1013
+	array(
1014
+	    'tgm-updater-action'     => $action,
1015
+	    'tgm-updater-key'        => $key,
1016
+	    'tgm-updater-wp-version' => get_bloginfo( 'version' ),
1017
+	    'tgm-updater-referer'    => site_url(),
1018
+	    'tgm-updater-mi-version' => MONSTERINSIGHTS_VERSION,
1019
+	    'tgm-updater-is-pro'     => monsterinsights_is_pro_version(),
1020
+	)
1021 1021
     );
1022 1022
 
1023 1023
     $args = [
1024
-        'headers' => $headers,
1024
+	'headers' => $headers,
1025 1025
     ];
1026 1026
 
1027 1027
     // Perform the query and retrieve the response.
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 
1032 1032
     // Bail out early if there are any errors.
1033 1033
     if ( 200 != $response_code || is_wp_error( $response_body ) ) {
1034
-        return false;
1034
+	return false;
1035 1035
     }
1036 1036
 
1037 1037
     // Return the json decoded content.
@@ -1250,7 +1250,7 @@  discard block
 block discarded – undo
1250 1250
     $translations_entries = $translations->entries;
1251 1251
 
1252 1252
 	if ( empty( $translations_entries ) ) {
1253
-        return;
1253
+	return;
1254 1254
     }
1255 1255
 
1256 1256
 	$messages = array(
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -16,29 +16,29 @@  discard block
 block discarded – undo
16 16
 	exit;
17 17
 }
18 18
 
19
-function monsterinsights_get_url($medium = '', $campaign = '', $url = '', $escape = true)
19
+function monsterinsights_get_url( $medium = '', $campaign = '', $url = '', $escape = true )
20 20
 {
21 21
     // Setup Campaign variables
22 22
     $source      = monsterinsights_is_pro_version() ? 'proplugin' : 'liteplugin';
23
-    $medium      = !empty($medium) ? $medium : 'defaultmedium';
24
-    $campaign    = !empty($campaign) ? $campaign : 'defaultcampaign';
23
+    $medium      = ! empty( $medium ) ? $medium : 'defaultmedium';
24
+    $campaign    = ! empty( $campaign ) ? $campaign : 'defaultcampaign';
25 25
     $content     = MONSTERINSIGHTS_VERSION;
26 26
     $default_url = monsterinsights_is_pro_version() ? '' : 'lite/';
27
-    $url         = !empty($url) ? $url : 'https://www.monsterinsights.com/' . $default_url;
27
+    $url         = ! empty( $url ) ? $url : 'https://www.monsterinsights.com/' . $default_url;
28 28
 
29 29
     // Put together redirect URL
30 30
     $url = add_query_arg(
31 31
         array(
32
-            'utm_source'   => $source,   // Pro/Lite Plugin
33
-            'utm_medium'   => sanitize_key($medium),   // Area of MonsterInsights (example Reports)
34
-            'utm_campaign' => sanitize_key($campaign), // Which link (example eCommerce Report)
35
-            'utm_content'  => $content,  // Version number of MI
32
+            'utm_source'   => $source, // Pro/Lite Plugin
33
+            'utm_medium'   => sanitize_key( $medium ), // Area of MonsterInsights (example Reports)
34
+            'utm_campaign' => sanitize_key( $campaign ), // Which link (example eCommerce Report)
35
+            'utm_content'  => $content, // Version number of MI
36 36
         ),
37
-        trailingslashit($url)
37
+        trailingslashit( $url )
38 38
     );
39 39
 
40
-    if ($escape) {
41
-        return esc_url($url);
40
+    if ( $escape ) {
41
+        return esc_url( $url );
42 42
     } else {
43 43
         return $url;
44 44
     }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 * if the first page visited is AMP, the cookie may be in the format amp-XXXXXXXXXXXXX-XXXXXXXX
139 139
 	 */
140 140
 
141
-	$ga_cookie    = sanitize_text_field($_COOKIE['_ga']);
141
+	$ga_cookie    = sanitize_text_field( $_COOKIE['_ga'] );
142 142
 	$cookie_parts = explode( '.', $ga_cookie );
143 143
 	if ( is_array( $cookie_parts ) && ! empty( $cookie_parts[2] ) ) {
144 144
 		$cookie_parts = array_slice( $cookie_parts, 2 );
@@ -173,16 +173,16 @@  discard block
 block discarded – undo
173 173
 	// Cookie name example: '_ga_1YS1VWHG3V'.
174 174
 	$cookie_name = '_ga_' . str_replace( 'G-', '', $measurement_id );
175 175
 
176
-	if ( ! isset( $_COOKIE[ $cookie_name ] ) ) {
176
+	if ( ! isset( $_COOKIE[$cookie_name] ) ) {
177 177
 		return null;
178 178
 	}
179 179
 
180 180
 	// Cookie value example: 'GS1.1.1659710029.4.1.1659710504.0'.
181 181
 	// Session Id:                  ^^^^^^^^^^.
182
-	$cookie = sanitize_text_field( $_COOKIE[ $cookie_name ] );
182
+	$cookie = sanitize_text_field( $_COOKIE[$cookie_name] );
183 183
 	$parts = explode( '.', $cookie );
184 184
 
185
-	if ( ! isset( $parts[2] ) ){
185
+	if ( ! isset( $parts[2] ) ) {
186 186
 		return null;
187 187
 	}
188 188
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	$editable_roles = apply_filters( 'editable_roles', $all_roles );
329 329
 
330 330
 	foreach ( $editable_roles as $id => $name ) {
331
-		$roles[ $id ] = translate_user_role( $name['name'] );
331
+		$roles[$id] = translate_user_role( $name['name'] );
332 332
 	}
333 333
 
334 334
 	return $roles;
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 
355 355
 	foreach ( $editable_roles as $id => $role ) {
356 356
 		if ( isset( $role['capabilities']['manage_options'] ) && $role['capabilities']['manage_options'] ) {
357
-			$roles[ $id ] = translate_user_role( $role['name'] );
357
+			$roles[$id] = translate_user_role( $role['name'] );
358 358
 		}
359 359
 	}
360 360
 
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 	function remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) {
1101 1101
 		global $wp_filter;
1102 1102
 		// Check that filter actually exists first
1103
-		if ( ! isset( $wp_filter[ $tag ] ) ) {
1103
+		if ( ! isset( $wp_filter[$tag] ) ) {
1104 1104
 			return false;
1105 1105
 		}
1106 1106
 		/**
@@ -1111,17 +1111,17 @@  discard block
 block discarded – undo
1111 1111
 		 *
1112 1112
 		 * @see https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/
1113 1113
 		 */
1114
-		if ( is_object( $wp_filter[ $tag ] ) && isset( $wp_filter[ $tag ]->callbacks ) ) {
1115
-			$callbacks = &$wp_filter[ $tag ]->callbacks;
1114
+		if ( is_object( $wp_filter[$tag] ) && isset( $wp_filter[$tag]->callbacks ) ) {
1115
+			$callbacks = &$wp_filter[$tag]->callbacks;
1116 1116
 		} else {
1117
-			$callbacks = &$wp_filter[ $tag ];
1117
+			$callbacks = &$wp_filter[$tag];
1118 1118
 		}
1119 1119
 		// Exit if there aren't any callbacks for specified priority
1120
-		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) {
1120
+		if ( ! isset( $callbacks[$priority] ) || empty( $callbacks[$priority] ) ) {
1121 1121
 			return false;
1122 1122
 		}
1123 1123
 		// Loop through each filter for the specified priority, looking for our class & method
1124
-		foreach ( (array) $callbacks[ $priority ] as $filter_id => $filter ) {
1124
+		foreach ( (array) $callbacks[$priority] as $filter_id => $filter ) {
1125 1125
 			// Filter should always be an array - array( $this, 'method' ), if not goto next
1126 1126
 			if ( ! isset( $filter['function'] ) || ! is_array( $filter['function'] ) ) {
1127 1127
 				continue;
@@ -1137,19 +1137,19 @@  discard block
 block discarded – undo
1137 1137
 			// Method matched, now let's check the Class
1138 1138
 			if ( get_class( $filter['function'][0] ) === $class_name ) {
1139 1139
 				// Now let's remove it from the array
1140
-				unset( $callbacks[ $priority ][ $filter_id ] );
1140
+				unset( $callbacks[$priority][$filter_id] );
1141 1141
 				// and if it was the only filter in that priority, unset that priority
1142
-				if ( empty( $callbacks[ $priority ] ) ) {
1143
-					unset( $callbacks[ $priority ] );
1142
+				if ( empty( $callbacks[$priority] ) ) {
1143
+					unset( $callbacks[$priority] );
1144 1144
 				}
1145 1145
 				// and if the only filter for that tag, set the tag to an empty array
1146 1146
 				if ( empty( $callbacks ) ) {
1147 1147
 					$callbacks = array();
1148 1148
 				}
1149 1149
 				// If using WordPress older than 4.7
1150
-				if ( ! is_object( $wp_filter[ $tag ] ) ) {
1150
+				if ( ! is_object( $wp_filter[$tag] ) ) {
1151 1151
 					// Remove this filter from merged_filters, which specifies if filters have been sorted
1152
-					unset( $GLOBALS['merged_filters'][ $tag ] );
1152
+					unset( $GLOBALS['merged_filters'][$tag] );
1153 1153
 				}
1154 1154
 
1155 1155
 				return true;
@@ -1230,7 +1230,7 @@  discard block
 block discarded – undo
1230 1230
 		}
1231 1231
 
1232 1232
 		foreach ( $translations->entries as $msgid => $entry ) {
1233
-			$locale[ $msgid ] = $entry->translations;
1233
+			$locale[$msgid] = $entry->translations;
1234 1234
 		}
1235 1235
 
1236 1236
 		return $locale;
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 	);
1263 1263
 
1264 1264
 	foreach ( $translations_entries as $entry ) {
1265
-		$messages[ $entry->singular ] = $entry->translations;
1265
+		$messages[$entry->singular] = $entry->translations;
1266 1266
 	}
1267 1267
 
1268 1268
 	return array(
@@ -1435,7 +1435,7 @@  discard block
 block discarded – undo
1435 1435
  *
1436 1436
  * @return int
1437 1437
  */
1438
-function monsterinsights_count_third_party_v4_codes($body) {
1438
+function monsterinsights_count_third_party_v4_codes( $body ) {
1439 1439
 	$count = 0;
1440 1440
 	return $count;
1441 1441
 }
@@ -1455,7 +1455,7 @@  discard block
 block discarded – undo
1455 1455
 		$ads_id = esc_attr( monsterinsights_get_option( 'gtag_ads_conversion_id' ) );
1456 1456
 
1457 1457
 		if ( $ads_id === $current_code ) {
1458
-			$count ++;
1458
+			$count++;
1459 1459
 		}
1460 1460
 	}
1461 1461
 
@@ -1523,7 +1523,7 @@  discard block
 block discarded – undo
1523 1523
 	// Main property always has a ?id=(UA|G|GT)-XXXXXXXX script
1524 1524
 	if ( strpos( $body, 'googletagmanager.com/gtag/js?id=' . $current_code ) !== false ) {
1525 1525
 		// In that case, we can safely deduct one from the total count
1526
-		-- $total_count;
1526
+		--$total_count;
1527 1527
 	}
1528 1528
 
1529 1529
 	// Test for Advanced Ads plugin tracking code.
@@ -1570,7 +1570,7 @@  discard block
 block discarded – undo
1570 1570
 			'sslverify' => false,
1571 1571
 		)
1572 1572
 	);
1573
-	$errors  = array();
1573
+	$errors = array();
1574 1574
 
1575 1575
 	$accepted_http_codes = array(
1576 1576
 		200,
@@ -1821,8 +1821,8 @@  discard block
 block discarded – undo
1821 1821
 	$string = explode( ' ', $text );
1822 1822
 	$trimed = '';
1823 1823
 
1824
-	for ( $wordCounter = 0; $wordCounter <= $count; $wordCounter ++ ) {
1825
-		$trimed .= isset( $string[ $wordCounter ] ) ? $string[ $wordCounter ] : '';
1824
+	for ( $wordCounter = 0; $wordCounter <= $count; $wordCounter++ ) {
1825
+		$trimed .= isset( $string[$wordCounter] ) ? $string[$wordCounter] : '';
1826 1826
 
1827 1827
 		if ( $wordCounter < $count ) {
1828 1828
 			$trimed .= ' ';
@@ -2039,7 +2039,7 @@  discard block
 block discarded – undo
2039 2039
 
2040 2040
 	add_filter(
2041 2041
 		'script_loader_tag',
2042
-		function ( $tag, $current_handle ) use ( $handle, $script ) {
2042
+		function( $tag, $current_handle ) use ( $handle, $script ) {
2043 2043
 			if ( $current_handle !== $handle ) {
2044 2044
 				return $tag;
2045 2045
 			}
@@ -2292,8 +2292,8 @@  discard block
 block discarded – undo
2292 2292
 			$month         = $wp_locale->get_month( $datetime->format( 'm' ) );
2293 2293
 			$weekday       = $wp_locale->get_weekday( $datetime->format( 'w' ) );
2294 2294
 
2295
-			for ( $i = 0; $i < $format_length; $i ++ ) {
2296
-				switch ( $format[ $i ] ) {
2295
+			for ( $i = 0; $i < $format_length; $i++ ) {
2296
+				switch ( $format[$i] ) {
2297 2297
 					case 'D':
2298 2298
 						$new_format .= addcslashes( $wp_locale->get_weekday_abbrev( $weekday ), '\\A..Za..z' );
2299 2299
 						break;
@@ -2313,15 +2313,15 @@  discard block
 block discarded – undo
2313 2313
 						$new_format .= addcslashes( $wp_locale->get_meridiem( $datetime->format( 'A' ) ), '\\A..Za..z' );
2314 2314
 						break;
2315 2315
 					case '\\':
2316
-						$new_format .= $format[ $i ];
2316
+						$new_format .= $format[$i];
2317 2317
 
2318 2318
 						// If character follows a slash, we add it without translating.
2319 2319
 						if ( $i < $format_length ) {
2320
-							$new_format .= $format[ ++$i ];
2320
+							$new_format .= $format[ ++$i];
2321 2321
 						}
2322 2322
 						break;
2323 2323
 					default:
2324
-						$new_format .= $format[ $i ];
2324
+						$new_format .= $format[$i];
2325 2325
 						break;
2326 2326
 				}
2327 2327
 			}
@@ -2417,7 +2417,7 @@  discard block
 block discarded – undo
2417 2417
 
2418 2418
 if ( ! function_exists( 'monsterinsights_is_authed' ) ) {
2419 2419
 	function monsterinsights_is_authed() {
2420
-		$site_profile = get_option('monsterinsights_site_profile');
2421
-		return isset($site_profile['key']);
2420
+		$site_profile = get_option( 'monsterinsights_site_profile' );
2421
+		return isset( $site_profile['key'] );
2422 2422
 	}
2423 2423
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1301,7 +1301,7 @@
 block discarded – undo
1301 1301
 	localeData[""].domain = domain;
1302 1302
 	wp.i18n.setLocaleData( localeData, domain );
1303 1303
 } )( "{$domain}", {$json_translations} );
1304
-JS;
1304
+js;
1305 1305
 
1306 1306
 	return wp_get_inline_script_tag( $output );
1307 1307
 }
Please login to merge, or discard this patch.
includes/auth.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	public function is_manual() {
36
-        $manual_code = $this->profile['manual'];
37
-        return monsterinsights_is_valid_v4_id( $manual_code );
36
+	$manual_code = $this->profile['manual'];
37
+	return monsterinsights_is_valid_v4_id( $manual_code );
38 38
 	}
39 39
 
40 40
 	public function is_network_manual( $type = false ) {
41 41
 		$manual_code = $this->network['manual'];
42
-        return monsterinsights_is_valid_v4_id( $manual_code );
42
+	return monsterinsights_is_valid_v4_id( $manual_code );
43 43
 	}
44 44
 
45 45
 	public function is_authed() {
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	}
48 48
 
49 49
 	public function is_network_authed() {
50
-        return ! empty( $this->network['key'] ) && ! empty( $this->network[ 'v4' ] );
50
+	return ! empty( $this->network['key'] ) && ! empty( $this->network[ 'v4' ] );
51 51
 	}
52 52
 
53 53
 	public function get_analytics_profile( $force = false ) {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 			$newdata = array();
107 107
 			if ( isset( $this->profile['v4'] ) ) {
108 108
 				$newdata['manual_v4'] = $this->profile['v4'];
109
-                $newdata['measurement_protocol_secret'] = $this->profile['measurement_protocol_secret'];
109
+		$newdata['measurement_protocol_secret'] = $this->profile['measurement_protocol_secret'];
110 110
 			}
111 111
 			$this->profile = $newdata;
112 112
 			$this->set_analytics_profile( $newdata );
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 			$newdata = array();
122 122
 			if ( isset( $this->network['v4'] ) ) {
123 123
 				$newdata['manual_v4'] = $this->network['v4'];
124
-                $newdata['measurement_protocol_secret'] = $this->profile['measurement_protocol_secret'];
124
+		$newdata['measurement_protocol_secret'] = $this->profile['measurement_protocol_secret'];
125 125
 			}
126 126
 			$this->network = $newdata;
127 127
 			$this->set_network_analytics_profile( $newdata );
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@
 block discarded – undo
43 43
 	}
44 44
 
45 45
 	public function is_authed() {
46
-		return ! empty( $this->profile['key'] ) && ! empty( $this->profile[ 'v4' ] );
46
+		return ! empty( $this->profile['key'] ) && ! empty( $this->profile['v4'] );
47 47
 	}
48 48
 
49 49
 	public function is_network_authed() {
50
-        return ! empty( $this->network['key'] ) && ! empty( $this->network[ 'v4' ] );
50
+        return ! empty( $this->network['key'] ) && ! empty( $this->network['v4'] );
51 51
 	}
52 52
 
53 53
 	public function get_analytics_profile( $force = false ) {
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -266,11 +266,13 @@
 block discarded – undo
266 266
 		return ! empty( $this->network['w'] ) ? $this->network['w'] : '';
267 267
 	}
268 268
 
269
-	public function get_viewid() { // also known as profileID
269
+	public function get_viewid() {
270
+// also known as profileID
270 271
 		return ! empty( $this->profile['p'] ) ? $this->profile['p'] : '';
271 272
 	}
272 273
 
273
-	public function get_network_viewid() { // also known as profileID
274
+	public function get_network_viewid() {
275
+// also known as profileID
274 276
 		return ! empty( $this->network['p'] ) ? $this->network['p'] : '';
275 277
 	}
276 278
 
Please login to merge, or discard this patch.
includes/deprecated.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -316,48 +316,48 @@
 block discarded – undo
316 316
 
317 317
 if (!function_exists('monsterinsights_get_ua')) {
318 318
     function monsterinsights_get_ua() {
319
-        return '';
319
+	return '';
320 320
     }
321 321
 }
322 322
 
323 323
 if (!function_exists('monsterinsights_get_network_ua')) {
324 324
     function monsterinsights_get_network_ua() {
325
-        return '';
325
+	return '';
326 326
     }
327 327
 }
328 328
 
329 329
 if (!function_exists('monsterinsights_mp_track_event_call')) {
330 330
     function monsterinsights_mp_track_event_call() {
331
-        return '';
331
+	return '';
332 332
     }
333 333
 }
334 334
 
335 335
 if (!function_exists('monsterinsights_mp_api_call')) {
336 336
     function monsterinsights_mp_api_call() {
337
-        return '';
337
+	return '';
338 338
     }
339 339
 }
340 340
 
341 341
 if (!function_exists('monsterinsights_get_mp_api_url')) {
342 342
     function monsterinsights_get_mp_api_url() {
343
-        return '';
343
+	return '';
344 344
     }
345 345
 }
346 346
 
347 347
 if (!function_exists('monsterinsights_get_tracking_ids')) {
348 348
     function monsterinsights_get_tracking_ids() {
349
-        return '';
349
+	return '';
350 350
     }
351 351
 }
352 352
 
353 353
 if (!function_exists('monsterinsights_is_valid_ua')) {
354 354
     function monsterinsights_is_valid_ua() {
355
-        return false;
355
+	return false;
356 356
     }
357 357
 }
358 358
 
359 359
 if (!function_exists('monsterinsights_get_ua_to_output')) {
360 360
     function monsterinsights_get_ua_to_output() {
361
-        return '';
361
+	return '';
362 362
     }
363 363
 }
364 364
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -314,49 +314,49 @@
 block discarded – undo
314 314
 	<?php
315 315
 }
316 316
 
317
-if (!function_exists('monsterinsights_get_ua')) {
317
+if ( ! function_exists( 'monsterinsights_get_ua' ) ) {
318 318
     function monsterinsights_get_ua() {
319 319
         return '';
320 320
     }
321 321
 }
322 322
 
323
-if (!function_exists('monsterinsights_get_network_ua')) {
323
+if ( ! function_exists( 'monsterinsights_get_network_ua' ) ) {
324 324
     function monsterinsights_get_network_ua() {
325 325
         return '';
326 326
     }
327 327
 }
328 328
 
329
-if (!function_exists('monsterinsights_mp_track_event_call')) {
329
+if ( ! function_exists( 'monsterinsights_mp_track_event_call' ) ) {
330 330
     function monsterinsights_mp_track_event_call() {
331 331
         return '';
332 332
     }
333 333
 }
334 334
 
335
-if (!function_exists('monsterinsights_mp_api_call')) {
335
+if ( ! function_exists( 'monsterinsights_mp_api_call' ) ) {
336 336
     function monsterinsights_mp_api_call() {
337 337
         return '';
338 338
     }
339 339
 }
340 340
 
341
-if (!function_exists('monsterinsights_get_mp_api_url')) {
341
+if ( ! function_exists( 'monsterinsights_get_mp_api_url' ) ) {
342 342
     function monsterinsights_get_mp_api_url() {
343 343
         return '';
344 344
     }
345 345
 }
346 346
 
347
-if (!function_exists('monsterinsights_get_tracking_ids')) {
347
+if ( ! function_exists( 'monsterinsights_get_tracking_ids' ) ) {
348 348
     function monsterinsights_get_tracking_ids() {
349 349
         return '';
350 350
     }
351 351
 }
352 352
 
353
-if (!function_exists('monsterinsights_is_valid_ua')) {
353
+if ( ! function_exists( 'monsterinsights_is_valid_ua' ) ) {
354 354
     function monsterinsights_is_valid_ua() {
355 355
         return false;
356 356
     }
357 357
 }
358 358
 
359
-if (!function_exists('monsterinsights_get_ua_to_output')) {
359
+if ( ! function_exists( 'monsterinsights_get_ua_to_output' ) ) {
360 360
     function monsterinsights_get_ua_to_output() {
361 361
         return '';
362 362
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -284,8 +284,7 @@  discard block
 block discarded – undo
284 284
  * @since 8.19.0
285 285
  *
286 286
  */
287
-function _monsterinsights_notice_deprecated_facebook_instant_articles()
288
-{
287
+function _monsterinsights_notice_deprecated_facebook_instant_articles() {
289 288
 	?>
290 289
 	<div data-dismissible="deprecated-addon-facebook-instant-articles" class="notice notice-error is-dismissible">
291 290
 		<p>
@@ -303,8 +302,7 @@  discard block
 block discarded – undo
303 302
  * @since 8.20.0
304 303
  *
305 304
  */
306
-function _monsterinsights_notice_deprecated_google_optimize()
307
-{
305
+function _monsterinsights_notice_deprecated_google_optimize() {
308 306
 	?>
309 307
 	<div data-dismissible="deprecated-addon-facebook-instant-articles" class="notice notice-error is-dismissible">
310 308
 		<p>
Please login to merge, or discard this patch.