Passed
Push — master ( b8d280...edd4c4 )
by Chris
03:53
created
includes/admin/tracking.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
 		$data['usagetracking'] = get_option( 'monsterinsights_usage_tracking_config', false );
94 94
 		$data['usercount']     = function_exists( 'get_user_count' ) ? get_user_count() : 'Not Set';
95 95
 		$data['usesauth']      = $usesauth;
96
-		$data['timezoneoffset']= date('P');
96
+		$data['timezoneoffset'] = date( 'P' );
97 97
 
98 98
 
99 99
 
100 100
 		// Retrieve current plugin information
101
-		if( ! function_exists( 'get_plugins' ) ) {
101
+		if ( ! function_exists( 'get_plugins' ) ) {
102 102
 			include ABSPATH . '/wp-admin/includes/plugin.php';
103 103
 		}
104 104
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 		foreach ( $plugins as $key => $plugin ) {
109 109
 			if ( in_array( $plugin, $active_plugins ) ) {
110 110
 				// Remove active plugins from list so we can show active and inactive separately
111
-				unset( $plugins[ $key ] );
111
+				unset( $plugins[$key] );
112 112
 			}
113 113
 		}
114 114
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 			return false;
127 127
 		}
128 128
 
129
-		if( ! $this->tracking_allowed() && ! $override ) {
129
+		if ( ! $this->tracking_allowed() && ! $override ) {
130 130
 			return false;
131 131
 		}
132 132
 
@@ -158,15 +158,15 @@  discard block
 block discarded – undo
158 158
 	public function schedule_send() {
159 159
 		if ( ! wp_next_scheduled( 'monsterinsights_usage_tracking_cron' ) ) {
160 160
 			$tracking             = array();
161
-			$tracking['day']      = rand( 0, 6  );
161
+			$tracking['day']      = rand( 0, 6 );
162 162
 			$tracking['hour']     = rand( 0, 23 );
163 163
 			$tracking['minute']   = rand( 0, 59 );
164 164
 			$tracking['second']   = rand( 0, 59 );
165
-			$tracking['offset']   = ( $tracking['day']    * DAY_IN_SECONDS    ) +
166
-									( $tracking['hour']   * HOUR_IN_SECONDS   ) +
165
+			$tracking['offset']   = ( $tracking['day'] * DAY_IN_SECONDS ) +
166
+									( $tracking['hour'] * HOUR_IN_SECONDS ) +
167 167
 									( $tracking['minute'] * MINUTE_IN_SECONDS ) +
168 168
 									 $tracking['second'];
169
-			$tracking['initsend'] = strtotime("next sunday") + $tracking['offset'];
169
+			$tracking['initsend'] = strtotime( "next sunday" ) + $tracking['offset'];
170 170
 
171 171
 			wp_schedule_event( $tracking['initsend'], 'weekly', 'monsterinsights_usage_tracking_cron' );
172 172
 			update_option( 'monsterinsights_usage_tracking_config', $tracking );
Please login to merge, or discard this patch.
includes/admin/reports/overview.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	}
37 37
 
38 38
 	// Outputs the report.
39
-	protected function get_report_html( $data = array() ){
39
+	protected function get_report_html( $data = array() ) {
40 40
 		ob_start();
41 41
 		if ( ! empty( $data['overviewgraph']['count'] ) && $data['overviewgraph']['count'] > 0 ) {
42 42
 			?>
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 					<img src="<?php echo $up; ?>" srcset="<?php echo $up2x; ?> 2x" alt="<?php echo $uplabel; ?>"/>
98 98
 					<?php echo esc_html( $data['infobox']['sessions']['prev'] ) . '%'; ?>
99 99
 				</div>
100
-				<?php } else  { ?>
100
+				<?php } else { ?>
101 101
 				<div class="monsterinsights-reports-infobox-prev">
102 102
 					<img src="<?php echo $down; ?>" srcset="<?php echo $down2x; ?> 2x" alt="<?php echo $downlabel; ?>"/>
103 103
 					<?php echo esc_html( absint( $data['infobox']['sessions']['prev'] ) ) . '%'; ?>
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 					<img src="<?php echo $up; ?>" srcset="<?php echo $up2x; ?> 2x" alt="<?php echo $uplabel; ?>"/>
125 125
 					<?php echo esc_html( $data['infobox']['pageviews']['prev'] ) . '%'; ?>
126 126
 				</div>
127
-				<?php } else  { ?>
127
+				<?php } else { ?>
128 128
 				<div class="monsterinsights-reports-infobox-prev">
129 129
 					<img src="<?php echo $down; ?>" srcset="<?php echo $down2x; ?> 2x" alt="<?php echo $downlabel; ?>"/>
130 130
 					<?php echo esc_html( absint( $data['infobox']['pageviews']['prev'] ) ) . '%'; ?>
@@ -151,10 +151,10 @@  discard block
 block discarded – undo
151 151
 					<img src="<?php echo $up; ?>" srcset="<?php echo $up2x; ?> 2x" alt="<?php echo $uplabel; ?>"/>
152 152
 					<?php echo esc_html( $data['infobox']['duration']['prev'] ) . '%'; ?>
153 153
 				</div>
154
-				<?php } else  { ?>
154
+				<?php } else { ?>
155 155
 				<div class="monsterinsights-reports-infobox-prev">
156 156
 					<img src="<?php echo $down; ?>" srcset="<?php echo $down2x; ?> 2x" alt="<?php echo $downlabel; ?>"/>
157
-					<?php echo esc_html( absint(  $data['infobox']['duration']['prev'] ) ) . '%'; ?>
157
+					<?php echo esc_html( absint( $data['infobox']['duration']['prev'] ) ) . '%'; ?>
158 158
 				</div>
159 159
 				<?php } ?>
160 160
 				<div class="monsterinsights-reports-infobox-compare">
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 					<img src="<?php echo $upred; ?>" srcset="<?php echo $upred2x; ?> 2x" alt="<?php echo $uplabel; ?>"/>
179 179
 					<?php echo esc_html( $data['infobox']['bounce']['prev'] ) . '%'; ?>
180 180
 				</div>
181
-				<?php } else  { ?>
181
+				<?php } else { ?>
182 182
 				<div class="monsterinsights-reports-infobox-prev">
183 183
 					<img src="<?php echo $downgrn; ?>" srcset="<?php echo $downgrn2x; ?> 2x" alt="<?php echo $downlabel; ?>"/>
184 184
 					<?php echo esc_html( absint( $data['infobox']['bounce']['prev'] ) ) . '%'; ?>
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
 			  </div>
191 191
 			</div>
192 192
 		<?php } ?>
193
-		<?php if ( ! empty( $data['newvsreturn'] ) &&  ! empty( $data['devices'] ) ) { ?>
193
+		<?php if ( ! empty( $data['newvsreturn'] ) && ! empty( $data['devices'] ) ) { ?>
194 194
 			<div class="monsterinsights-reports-2-column-container row">
195 195
 			  <div class="monsterinsights-reports-2-column-item col-md-6">
196 196
 				<div class="monsterinsights-reports-2-column-panel panel monsterinsights-pie-chart-panel chart-panel">
197 197
 					<div class="monsterinsights-reports-panel-title">
198
-						<?php echo esc_html__( 'New vs. Returning Visitors', 'google-analytics-for-wordpress' );?>
198
+						<?php echo esc_html__( 'New vs. Returning Visitors', 'google-analytics-for-wordpress' ); ?>
199 199
 					</div>
200 200
 					<div class="monsterinsights-reports-uright-tooltip" data-tooltip-title="<?php echo esc_attr( __( 'New vs. Returning Visitors', 'google-analytics-for-wordpress' ) ); ?>" data-tooltip-description="<?php echo esc_attr( __( 'This graph shows what percent of your user sessions come from new versus repeat visitors.', 'google-analytics-for-wordpress' ) ); ?>"></div>
201 201
 					<div class="monsterinsights-reports-pie-graph monsterinsights-clear">
@@ -285,8 +285,8 @@  discard block
 block discarded – undo
285 285
 										}],
286 286
 										values: [<?php echo esc_js( $data['newvsreturn']['new'] ); ?>,<?php echo esc_js( $data['newvsreturn']['returning'] ); ?> ],
287 287
 										labels: [
288
-											"<?php echo esc_js( __('New', 'google-analytics-for-wordpress' ) ); ?>",
289
-											"<?php echo esc_js( __('Returning', 'google-analytics-for-wordpress' ) ); ?>",
288
+											"<?php echo esc_js( __( 'New', 'google-analytics-for-wordpress' ) ); ?>",
289
+											"<?php echo esc_js( __( 'Returning', 'google-analytics-for-wordpress' ) ); ?>",
290 290
 										]
291 291
 									},
292 292
 									options: {
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 			<div class="monsterinsights-reports-2-column-item col-md-6">
345 345
 				<div class="monsterinsights-reports-2-column-panel panel monsterinsights-pie-chart-panel chart-panel">
346 346
 					<div class="monsterinsights-reports-panel-title">
347
-						<?php echo esc_html__( 'Device Breakdown', 'google-analytics-for-wordpress' );?>
347
+						<?php echo esc_html__( 'Device Breakdown', 'google-analytics-for-wordpress' ); ?>
348 348
 					</div>
349 349
 					<div class="monsterinsights-reports-uright-tooltip" data-tooltip-title="<?php echo esc_attr( __( 'Device Breakdown', 'google-analytics-for-wordpress' ) ); ?>" data-tooltip-description="<?php echo esc_attr( __( 'This graph shows what percent of your visitor sessions are done using a traditional computer or laptop, tablet or mobile device to view your site.', 'google-analytics-for-wordpress' ) ); ?>"></div>
350 350
 					<div class="monsterinsights-reports-pie-graph monsterinsights-clear">
@@ -436,9 +436,9 @@  discard block
 block discarded – undo
436 436
 										}],
437 437
 										values: [<?php echo esc_js( $data['devices']['desktop'] ); ?>,<?php echo esc_js( $data['devices']['tablet'] ); ?>,<?php echo esc_js( $data['devices']['mobile'] ); ?>  ],
438 438
 										labels: [
439
-											"<?php echo esc_js( __('Desktop', 'google-analytics-for-wordpress' ) ); ?>",
440
-											"<?php echo esc_js( __('Tablet', 'google-analytics-for-wordpress' ) ); ?>",
441
-											"<?php echo esc_js( __('Mobile', 'google-analytics-for-wordpress' ) ); ?>",
439
+											"<?php echo esc_js( __( 'Desktop', 'google-analytics-for-wordpress' ) ); ?>",
440
+											"<?php echo esc_js( __( 'Tablet', 'google-analytics-for-wordpress' ) ); ?>",
441
+											"<?php echo esc_js( __( 'Mobile', 'google-analytics-for-wordpress' ) ); ?>",
442 442
 										]
443 443
 									},
444 444
 									options: {
@@ -496,12 +496,12 @@  discard block
 block discarded – undo
496 496
 			</div>
497 497
 		<?php } ?>
498 498
 
499
-		<?php if ( ! empty( $data['countries'] ) &&  ! empty( $data['referrals'] ) ) { ?>
499
+		<?php if ( ! empty( $data['countries'] ) && ! empty( $data['referrals'] ) ) { ?>
500 500
 			<div class="monsterinsights-reports-2-column-container row">
501 501
 			  <div class="monsterinsights-reports-2-column-item col-md-6 list-has-icons">
502 502
 				<div class="monsterinsights-reports-2-column-panel panel nopadding">
503 503
 					<div class="monsterinsights-reports-panel-title">
504
-						<?php echo esc_html__( 'Top 10 Countries', 'google-analytics-for-wordpress' );?>
504
+						<?php echo esc_html__( 'Top 10 Countries', 'google-analytics-for-wordpress' ); ?>
505 505
 					</div>
506 506
 					<div class="monsterinsights-reports-uright-tooltip" data-tooltip-title="<?php echo esc_attr( __( 'Top 10 Countries', 'google-analytics-for-wordpress' ) ); ?>" data-tooltip-description="<?php echo esc_attr( __( 'This list shows the top countries your website visitors are from.', 'google-analytics-for-wordpress' ) ); ?>"></div>
507 507
 					<div class="monsterinsights-reports-list">
@@ -509,11 +509,11 @@  discard block
 block discarded – undo
509 509
 						<?php 
510 510
 						$countries = monsterinsights_get_country_list( true );
511 511
 						$i = 1;
512
-						foreach( $data['countries'] as $icountry => $countrydata ) {
513
-							if ( ! empty( $countries[ $countrydata['iso'] ] ) ) {
514
-								echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">'. $i .'.</span><span class="monsterinsights-reports-country-flag monsterinsights-flag-icon monsterinsights-flag-icon-' . strtolower( $countrydata['iso'] ) . ' "></span><span class="monsterinsights-reports-list-text">' . $countries[ $countrydata['iso'] ] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $countrydata['sessions'] ) . '</span></li>';
512
+						foreach ( $data['countries'] as $icountry => $countrydata ) {
513
+							if ( ! empty( $countries[$countrydata['iso']] ) ) {
514
+								echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">' . $i . '.</span><span class="monsterinsights-reports-country-flag monsterinsights-flag-icon monsterinsights-flag-icon-' . strtolower( $countrydata['iso'] ) . ' "></span><span class="monsterinsights-reports-list-text">' . $countries[$countrydata['iso']] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $countrydata['sessions'] ) . '</span></li>';
515 515
 							} else { 
516
-								echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">'. $i .'</span><span class="monsterinsights-flag-icon monsterinsights-flag-icon-' . strtolower( $countrydata['iso'] ) . ' "></span><span class="monsterinsights-reports-list-text">' . $countrydata['iso'] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $countrydata['sessions'] ) . '</span></li>';
516
+								echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">' . $i . '</span><span class="monsterinsights-flag-icon monsterinsights-flag-icon-' . strtolower( $countrydata['iso'] ) . ' "></span><span class="monsterinsights-reports-list-text">' . $countrydata['iso'] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $countrydata['sessions'] ) . '</span></li>';
517 517
 							}
518 518
 							$i++;
519 519
 						}
@@ -521,35 +521,35 @@  discard block
 block discarded – undo
521 521
 						</ul>
522 522
 					</div>
523 523
 					<?php 
524
-					$referral_url = 'https://analytics.google.com/analytics/web/#report/visitors-geo/'. MonsterInsights()->auth->get_referral_url() . $this->get_ga_report_range( $data );
524
+					$referral_url = 'https://analytics.google.com/analytics/web/#report/visitors-geo/' . MonsterInsights()->auth->get_referral_url() . $this->get_ga_report_range( $data );
525 525
 					?>
526 526
 					<div class="monsterinsights-reports-panel-footer">
527
-						<a href="<?php echo $referral_url; ?>" target="_blank"  title="<?php echo esc_html__( 'View Full Countries Report', 'google-analytics-for-wordpress' );?>" class="monsterinsights-reports-panel-footer-button"><?php echo esc_html__( 'View All Countries Report', 'google-analytics-for-wordpress' );?></a>
527
+						<a href="<?php echo $referral_url; ?>" target="_blank"  title="<?php echo esc_html__( 'View Full Countries Report', 'google-analytics-for-wordpress' ); ?>" class="monsterinsights-reports-panel-footer-button"><?php echo esc_html__( 'View All Countries Report', 'google-analytics-for-wordpress' ); ?></a>
528 528
 					</div>
529 529
 				</div>
530 530
 			  </div>
531 531
 			  <div class="monsterinsights-reports-2-column-item col-md-6 list-has-icons">
532 532
 				<div class="monsterinsights-reports-2-column-panel panel nopadding">
533 533
 					<div class="monsterinsights-reports-panel-title">
534
-						<?php echo esc_html__( 'Referrals', 'google-analytics-for-wordpress' );?>
534
+						<?php echo esc_html__( 'Referrals', 'google-analytics-for-wordpress' ); ?>
535 535
 					</div>
536 536
 					<div class="monsterinsights-reports-uright-tooltip" data-tooltip-title="<?php echo esc_attr( __( 'Referrals', 'google-analytics-for-wordpress' ) ); ?>" data-tooltip-description="<?php echo esc_attr( __( 'This list shows the top websites that send your website traffic, known as "referral traffic".', 'google-analytics-for-wordpress' ) ); ?>"></div>
537 537
 					<div class="monsterinsights-reports-list">
538 538
 						<ul class="monsterinsights-reports-referral-list list-group">
539 539
 						<?php
540 540
 						$i = 1;
541
-						foreach( $data['referrals'] as $ireferrals => $referralsdata ) {
542
-								echo '<li class="list-group-item">'.
541
+						foreach ( $data['referrals'] as $ireferrals => $referralsdata ) {
542
+								echo '<li class="list-group-item">' .
543 543
 										'<span class="monsterinsights-reports-list-count">'
544 544
 											. $i .
545
-										'</span>'.
546
-										'<img class="monsterinsights-reports-referral-icon"  src="https://www.google.com/s2/favicons?domain=' . $referralsdata['url'] . '" width="16px" height="16px" />'.
545
+										'</span>' .
546
+										'<img class="monsterinsights-reports-referral-icon"  src="https://www.google.com/s2/favicons?domain=' . $referralsdata['url'] . '" width="16px" height="16px" />' .
547 547
 										'<span class="monsterinsights-reports-list-text">' 
548 548
 											. $referralsdata['url'] . 
549 549
 										'</span>
550 550
 										<span class="monsterinsights-reports-list-number">'
551 551
 											. number_format_i18n( $referralsdata['sessions'] ) . 
552
-										'</span>'.
552
+										'</span>' .
553 553
 									'</li>';
554 554
 							$i++;
555 555
 						}
@@ -557,10 +557,10 @@  discard block
 block discarded – undo
557 557
 						</ul>
558 558
 					</div>
559 559
 					<?php 
560
-					$referral_url = 'https://analytics.google.com/analytics/web/#report/trafficsources-referrals/'. MonsterInsights()->auth->get_referral_url() . $this->get_ga_report_range( $data );
560
+					$referral_url = 'https://analytics.google.com/analytics/web/#report/trafficsources-referrals/' . MonsterInsights()->auth->get_referral_url() . $this->get_ga_report_range( $data );
561 561
 					?>
562 562
 					<div class="monsterinsights-reports-panel-footer">
563
-						<a href="<?php echo $referral_url; ?>" target="_blank" title="<?php echo esc_html__( 'View All Referral Sources', 'google-analytics-for-wordpress' );?>" class="monsterinsights-reports-panel-footer-button"><?php echo esc_html__( 'View All Referral Sources', 'google-analytics-for-wordpress' );?></a>
563
+						<a href="<?php echo $referral_url; ?>" target="_blank" title="<?php echo esc_html__( 'View All Referral Sources', 'google-analytics-for-wordpress' ); ?>" class="monsterinsights-reports-panel-footer-button"><?php echo esc_html__( 'View All Referral Sources', 'google-analytics-for-wordpress' ); ?></a>
564 564
 					</div>
565 565
 				</div>
566 566
 			  </div>
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 		<?php if ( ! empty( $data['toppages'] ) ) { ?>
571 571
 			<div class="monsterinsights-reports-1-column-row panel row container-fluid nopadding list-no-icons" style="position: relative;">
572 572
 				<div class="monsterinsights-reports-panel-title">
573
-					<?php echo esc_html__( 'Top Posts / Pages', 'google-analytics-for-wordpress' );?>
573
+					<?php echo esc_html__( 'Top Posts / Pages', 'google-analytics-for-wordpress' ); ?>
574 574
 				</div>
575 575
 				
576 576
 				<div class="monsterinsights-reports-uright-tooltip" data-tooltip-title="<?php echo esc_attr( __( 'Top Posts / Pages', 'google-analytics-for-wordpress' ) ); ?>" data-tooltip-description="<?php echo esc_attr( __( 'This list shows the most viewed posts and pages on your website.', 'google-analytics-for-wordpress' ) ); ?>"></div>
@@ -578,23 +578,23 @@  discard block
 block discarded – undo
578 578
 					<ul class="monsterinsights-reports-pages-list list-group">
579 579
 						<?php
580 580
 						$i = 1;
581
-						foreach( $data['toppages'] as $itoppages => $toppagesdata ) {
582
-								$hide     = $i > 10 ? ' style="display: none;" ': '';
581
+						foreach ( $data['toppages'] as $itoppages => $toppagesdata ) {
582
+								$hide     = $i > 10 ? ' style="display: none;" ' : '';
583 583
 								$protocol = is_ssl() ? 'https://' : 'http://';
584
-								$opening  = ! empty( $toppagesdata['url'] ) && ! empty( $toppagesdata['hostname'] ) ? '<a href="' . $protocol . esc_attr( $toppagesdata['hostname'] . $toppagesdata['url'] ) .'" target="_blank">' : '';
584
+								$opening  = ! empty( $toppagesdata['url'] ) && ! empty( $toppagesdata['hostname'] ) ? '<a href="' . $protocol . esc_attr( $toppagesdata['hostname'] . $toppagesdata['url'] ) . '" target="_blank">' : '';
585 585
 								$closing = ! empty( $opening ) ? '</a>' : '';
586
-								echo '<li class="list-group-item  monsterinsights-listing-table-row"'. $hide . '>'.
586
+								echo '<li class="list-group-item  monsterinsights-listing-table-row"' . $hide . '>' .
587 587
 										'<span class="monsterinsights-reports-list-count">'
588 588
 											. $i .
589
-										'. </span>&nbsp;'.
589
+										'. </span>&nbsp;' .
590 590
 										'<span class="monsterinsights-reports-list-text">' 
591 591
 											. $opening
592 592
 											. $toppagesdata['title']
593 593
 											. $closing .
594
-										'</span>'.
594
+										'</span>' .
595 595
 										'<span class="monsterinsights-reports-list-number">' . 
596 596
 											number_format_i18n( $toppagesdata['sessions'] ) . 
597
-										'</span>'.
597
+										'</span>' .
598 598
 									'</li>';
599 599
 							$i++;
600 600
 						}
@@ -602,16 +602,16 @@  discard block
 block discarded – undo
602 602
 					</ul>
603 603
 				</div>
604 604
 				<?php 
605
-				$referral_url = 'https://analytics.google.com/analytics/web/#report/content-pages/'. MonsterInsights()->auth->get_referral_url() . $this->get_ga_report_range( $data );
605
+				$referral_url = 'https://analytics.google.com/analytics/web/#report/content-pages/' . MonsterInsights()->auth->get_referral_url() . $this->get_ga_report_range( $data );
606 606
 				?>
607 607
 				<div class="monsterinsights-reports-panel-footer monsterinsights-reports-panel-footer-large">
608
-					<?php echo esc_html__( 'Show', 'google-analytics-for-wordpress' );?>&nbsp;
609
-					<div class="monsterinsights-reports-show-selector-group btn-group" role="group" aria-label="<?php echo esc_html__( 'How many to show', 'google-analytics-for-wordpress' );?>">
608
+					<?php echo esc_html__( 'Show', 'google-analytics-for-wordpress' ); ?>&nbsp;
609
+					<div class="monsterinsights-reports-show-selector-group btn-group" role="group" aria-label="<?php echo esc_html__( 'How many to show', 'google-analytics-for-wordpress' ); ?>">
610 610
 						 <button type="button" data-tid="monsterinsights-report-top-page-list" class="monsterinsights-reports-show-selector-button ten btn btn-default active" disabled="disabled">10</button>
611 611
 						 <button type="button" data-tid="monsterinsights-report-top-page-list" class="monsterinsights-reports-show-selector-button twentyfive btn btn-default">25</button>
612 612
 						 <button type="button" data-tid="monsterinsights-report-top-page-list" class="monsterinsights-reports-show-selector-button fifty btn btn-default">50</button>
613 613
 					</div>
614
-					<a href="<?php echo $referral_url; ?>" target="_blank" title="<?php echo esc_html__( 'View Full Post/Page Report', 'google-analytics-for-wordpress' );?>" class="monsterinsights-reports-panel-footer-button alignright" style="margin-right: 20px;"><?php echo esc_html__( 'View Full Post/Page Report', 'google-analytics-for-wordpress' );?></a>
614
+					<a href="<?php echo $referral_url; ?>" target="_blank" title="<?php echo esc_html__( 'View Full Post/Page Report', 'google-analytics-for-wordpress' ); ?>" class="monsterinsights-reports-panel-footer-button alignright" style="margin-right: 20px;"><?php echo esc_html__( 'View Full Post/Page Report', 'google-analytics-for-wordpress' ); ?></a>
615 615
 				</div>
616 616
 			</div>
617 617
 		<?php } ?>
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 
649 649
 		ob_start(); ?>
650 650
 		<div class="monsterinsights-reports-box-datagraph" style="position:relative;">
651
-			<canvas id="monsterinsights-overview-<?php echo $class;?>" width="400px" height="400px"></canvas>
651
+			<canvas id="monsterinsights-overview-<?php echo $class; ?>" width="400px" height="400px"></canvas>
652 652
 			<script>
653 653
 				jQuery(document).ready(function() {
654 654
 					if ( window.uorigindetected != null){
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 						   }
680 680
 						});
681 681
 						
682
-						var ctx = document.getElementById("monsterinsights-overview-<?php echo $class;?>");
682
+						var ctx = document.getElementById("monsterinsights-overview-<?php echo $class; ?>");
683 683
 						var data = {
684 684
 							labels: [<?php echo implode( ', ', $labels ); ?>],
685 685
 							datasets: [
@@ -704,8 +704,8 @@  discard block
 block discarded – undo
704 704
 									pointHoverRadius: 6,//The radius of the point when hovered.
705 705
 
706 706
 
707
-									labels: [<?php echo implode( ', ', $labels );   ?>],
708
-									data: [<?php echo implode( ', ', $datapoints );   ?>],
707
+									labels: [<?php echo implode( ', ', $labels ); ?>],
708
+									data: [<?php echo implode( ', ', $datapoints ); ?>],
709 709
 									trend: [<?php echo implode( ', ', $trendpoints ); ?>],
710 710
 								},
711 711
 							]
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 						  });
788 788
 						};
789 789
 
790
-						var MonsterInsightsOverview<?php echo time();?> = new Chart(ctx, {
790
+						var MonsterInsightsOverview<?php echo time(); ?> = new Chart(ctx, {
791 791
 							type: 'LineWithLine',
792 792
 							data: data,
793 793
 							plugins: [{
Please login to merge, or discard this patch.
includes/admin/reports/abstract-report.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @since 6.0.0
31 31
 	 */
32 32
 	public function __construct() {
33
-		add_filter( 'monsterinsights_reports_abstract_get_data_pre_cache', array( $this, 'requirements' ), 10 , 3 );
33
+		add_filter( 'monsterinsights_reports_abstract_get_data_pre_cache', array( $this, 'requirements' ), 10, 3 );
34 34
 	}
35 35
 
36 36
 	// Let's get the HTML to output for a particular report. This is not the AJAX endpoint. Args can hold things (generally start/end date range)
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		return ''; 
41 41
 	}
42 42
 
43
-	public function additional_data(){
43
+	public function additional_data() {
44 44
 		return array();
45 45
 	}
46 46
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	public function show_report( $args = array() ) {
52 52
 
53 53
 		if ( ! current_user_can( 'monsterinsights_view_dashboard' ) ) {
54
-			return monsterinsights_get_message( 'error', esc_html__( 'Access denied' , 'google-analytics-for-wordpress' ) );
54
+			return monsterinsights_get_message( 'error', esc_html__( 'Access denied', 'google-analytics-for-wordpress' ) );
55 55
 		}
56 56
 
57 57
 		if ( monsterinsights_get_option( 'dashboard_disabled', false ) ) { 
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 			}
70 70
 		}
71 71
 
72
-		if ( monsterinsights_is_pro_version() ){
72
+		if ( monsterinsights_is_pro_version() ) {
73 73
 			if ( ! MonsterInsights()->license->has_license() ) {
74 74
 				$url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_settings' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
75
-				return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ),'<a href="' . $url . '">','</a>' );
75
+				return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' );
76 76
 			} else if ( MonsterInsights()->license->license_has_error() ) {
77 77
 				return monsterinsights_get_message( 'error', $this->get_license_error() );
78 78
 			}
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
 			return monsterinsights_get_message( 'error', $args['error'] );
108 108
 		}
109 109
 
110
-		if ( empty( $args['data' ] ) || ! is_array( $args['data' ] ) ) {
110
+		if ( empty( $args['data'] ) || ! is_array( $args['data'] ) ) {
111 111
 			if ( monsterinsights_is_pro_version() ) {
112 112
 				return '';
113 113
 			} else {
114 114
 				// Try to get default data.
115 115
 				$args = $this->get_data( array( 'default' => true ) );
116
-				if ( empty( $args['data'] ) || is_array( $args['data' ] ) ) {
116
+				if ( empty( $args['data'] ) || is_array( $args['data'] ) ) {
117 117
 					return monsterinsights_get_message( 'error', __( 'No data found', 'google-analytics-for-wordpress' ) );
118 118
 				}
119 119
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		}
148 148
 		
149 149
 		$start = ! empty( $args['start'] ) && $this->is_valid_date( $args['start'] ) ? $args['start'] : '';
150
-		$end   = ! empty( $args['end'] )   && $this->is_valid_date( $args['end'] )   ? $args['end']   : '';
150
+		$end   = ! empty( $args['end'] ) && $this->is_valid_date( $args['end'] ) ? $args['end'] : '';
151 151
 
152 152
 		if ( ! MonsterInsights()->license->license_can( $this->level ) ) {
153 153
 			return array(
@@ -202,11 +202,11 @@  discard block
 block discarded – undo
202 202
 				$data = ! $site_auth && $ms_auth ? get_site_transient( $transient ) : get_transient( $transient );
203 203
 			}
204 204
 
205
-			if ( ! empty( $data )             &&
206
-				 ! empty( $data['expires'] )  &&
205
+			if ( ! empty( $data ) &&
206
+				 ! empty( $data['expires'] ) &&
207 207
 				   $data['expires'] >= time() &&
208
-				 ! empty( $data['data'] )     && 
209
-				 ! empty( $data['p'] )        && 
208
+				 ! empty( $data['data'] ) && 
209
+				 ! empty( $data['p'] ) && 
210 210
 				   $data['p'] === $p
211 211
 			) {
212 212
 				return array(
@@ -216,12 +216,12 @@  discard block
 block discarded – undo
216 216
 			}
217 217
 
218 218
 			// Nothing in cache, either not saved before, expired or mismatch. Let's grab from API
219
-			$api_options = array( 'start' => $start, 'end' => $end);
219
+			$api_options = array( 'start' => $start, 'end' => $end );
220 220
 			if ( ! $site_auth && $ms_auth ) {
221 221
 				$api_options['network'] = true;
222 222
 			}
223 223
 			
224
-			$api   = new MonsterInsights_API_Request( 'analytics/reports/' . $this->name . '/', $api_options, 'GET' );
224
+			$api = new MonsterInsights_API_Request( 'analytics/reports/' . $this->name . '/', $api_options, 'GET' );
225 225
 
226 226
 			$additional_data = $this->additional_data();
227 227
 			
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 				$api->set_additional_data( $additional_data );
230 230
 			}
231 231
 			
232
-			$ret   = $api->request();
232
+			$ret = $api->request();
233 233
 			//echo print_r( $ret['data']);wp_die();
234 234
 			
235 235
 			if ( is_wp_error( $ret ) ) {
@@ -290,44 +290,44 @@  discard block
 block discarded – undo
290 290
 	// Is a valid date value
291 291
 	public function is_valid_date( $date = '' ) {
292 292
 		$d = MonsterInsightsDateTime::createFromFormat( 'Y-m-d', $date );
293
-		return $d && $d->format('Y-m-d') === $date;
293
+		return $d && $d->format( 'Y-m-d' ) === $date;
294 294
 	}
295 295
 
296 296
 	/**
297 297
 	 * Do not use the functions below this. They are unused and are just here so people
298 298
 	 * with out of date MonsterInsights addons won't get fatal errors.
299 299
 	 */
300
-	protected function get_api_max_limit() {return 300;}
301
-	protected function get_date_range() {return array();}
300
+	protected function get_api_max_limit() {return 300; }
301
+	protected function get_date_range() {return array(); }
302 302
 
303 303
 	public function get_upsell_notice() {
304 304
 		$has_level = MonsterInsights()->license->get_license_type();
305 305
 		$has_level = $has_level ? $has_level : 'lite';
306 306
 		$message = sprintf( __( 'You currently have a %s level license, but this report requires at least a %s level license to view the %s. Please upgrade to view this report.', 'google-analytics-for-wordpress' ), $has_level, $this->level, $this->title );
307
-		ob_start();?>
308
-		<div class="monsterinsights-upsell-report-container monsterinsights-upsell-report-<?php echo $this->name;?>-bg">
307
+		ob_start(); ?>
308
+		<div class="monsterinsights-upsell-report-container monsterinsights-upsell-report-<?php echo $this->name; ?>-bg">
309 309
 			<div class="monsterinsights-upsell-container">
310 310
 		  		<div class="row justify-content-center">
311 311
 					<div class="col-lg-10 col-lg-offset-1 align-self-center">
312 312
 						<div class="monsterinsights-upsell-card">
313
-							  <img class="monsterinsights-upgrade-mascot" src="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL );?>assets/css/images/mascot.png" srcset="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL );?>assets/css/images/[email protected] 2x" alt="">
313
+							  <img class="monsterinsights-upgrade-mascot" src="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ); ?>assets/css/images/mascot.png" srcset="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ); ?>assets/css/images/[email protected] 2x" alt="">
314 314
 								<div class="monsterinsights-upsell-card-card-content">
315
-								  <span class="monsterinsights-upsell-card-title"><?php esc_html_e( 'Ready to Get Analytics Super-Powers?', 'google-analytics-for-wordpress' );?></span>
316
-								  <p class="monsterinsights-upsell-card-subtitle"><strong><?php esc_html_e( '(And Crush Your Competition?)', 'google-analytics-for-wordpress' );?></strong></p> &nbsp;
315
+								  <span class="monsterinsights-upsell-card-title"><?php esc_html_e( 'Ready to Get Analytics Super-Powers?', 'google-analytics-for-wordpress' ); ?></span>
316
+								  <p class="monsterinsights-upsell-card-subtitle"><strong><?php esc_html_e( '(And Crush Your Competition?)', 'google-analytics-for-wordpress' ); ?></strong></p> &nbsp;
317 317
 								  <?php if ( monsterinsights_is_pro_version() ) { ?>
318 318
 									  <p ><?php echo sprintf( esc_html__( "Hey there! It looks like you've got the %s license installed on your site.
319
-									  That's awesome! %s",'google-analytics-for-wordpress'), $has_level, '<span class="dashicons dashicons-smiley"></span>' ); ?></p>
319
+									  That's awesome! %s",'google-analytics-for-wordpress' ), $has_level, '<span class="dashicons dashicons-smiley"></span>' ); ?></p>
320 320
 									   &nbsp;
321
-									  <p><?php echo sprintf( esc_html__( "Do you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with the <strong>%s level%s</strong> of our paid packages. You'll need to upgrade your license to get instant access.",'google-analytics-for-wordpress'), '<strong>' . $this->title, '</strong>','<a href="https://monsterinsights.com/my-account/">' . $this->level,'</a>' ); ?></p>
322
-									   &nbsp;<p><?php echo sprintf( esc_html__( "It's easy! To upgrade, navigate to %sMy Account%s on MonsterInsights.com, go to the licenses tab, and click upgrade. We also have a %sstep by step guide%s with pictures of this process.",'google-analytics-for-wordpress'), '<a href="https://monsterinsights.com/my-account/?utm_source=wpdashboard&utm_campaign=reportupsellpro"><strong>','</strong></a>', '<a href="https://www.monsterinsights.com/docs/upgrade-monsterinsights-license/" style="text-decoration:underline !important">', '</a>' ); ?></p>
323
-									   &nbsp;<p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress');?></p>
321
+									  <p><?php echo sprintf( esc_html__( "Do you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with the <strong>%s level%s</strong> of our paid packages. You'll need to upgrade your license to get instant access.", 'google-analytics-for-wordpress' ), '<strong>' . $this->title, '</strong>', '<a href="https://monsterinsights.com/my-account/">' . $this->level, '</a>' ); ?></p>
322
+									   &nbsp;<p><?php echo sprintf( esc_html__( "It's easy! To upgrade, navigate to %sMy Account%s on MonsterInsights.com, go to the licenses tab, and click upgrade. We also have a %sstep by step guide%s with pictures of this process.", 'google-analytics-for-wordpress' ), '<a href="https://monsterinsights.com/my-account/?utm_source=wpdashboard&utm_campaign=reportupsellpro"><strong>', '</strong></a>', '<a href="https://www.monsterinsights.com/docs/upgrade-monsterinsights-license/" style="text-decoration:underline !important">', '</a>' ); ?></p>
323
+									   &nbsp;<p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress' ); ?></p>
324 324
 									<?php } else { ?>
325 325
 									   <p><?php echo sprintf( esc_html__( "Hey there! %s It looks like you've got the free version of MonsterInsights installed on your site.
326
-									  That's awesome!",'google-analytics-for-wordpress'), '<span class="dashicons dashicons-smiley"></span>' ); ?></p>
326
+									  That's awesome!",'google-analytics-for-wordpress' ), '<span class="dashicons dashicons-smiley"></span>' ); ?></p>
327 327
 									   &nbsp;
328
-									  <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. To get instant access, you'll want to buy a MonsterInsights license, which also gives you access to powerful addons, expanded reporting (including the ability to use custom date ranges), comprehensive tracking features (like UserID tracking) and access to our world-class support team.",'google-analytics-for-wordpress'), '<strong>' . $this->title, '</strong>','<a href="https://monsterinsights.com/lite/">' . $this->level,'</a>' ); ?></p>
329
-									   &nbsp;<p><?php echo sprintf( esc_html__( "Upgrading is easy! To upgrade, navigate to %sour pricing page%s, purchase the required license, and then follow the %sinstructions in the email receipt%s to upgrade. It only takes a few minutes to unlock the most powerful, yet easy to use analytics tracking system for WordPress.",'google-analytics-for-wordpress'), '<a href="https://monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=reportupselllite"><strong>', '</strong></a>','<a style="text-decoration:underline !important" href="https://www.monsterinsights.com/docs/go-lite-pro/">', '</a>' ); ?></p>
330
-									   &nbsp;<p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress');?></p>
328
+									  <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. To get instant access, you'll want to buy a MonsterInsights license, which also gives you access to powerful addons, expanded reporting (including the ability to use custom date ranges), comprehensive tracking features (like UserID tracking) and access to our world-class support team.", 'google-analytics-for-wordpress' ), '<strong>' . $this->title, '</strong>', '<a href="https://monsterinsights.com/lite/">' . $this->level, '</a>' ); ?></p>
329
+									   &nbsp;<p><?php echo sprintf( esc_html__( "Upgrading is easy! To upgrade, navigate to %sour pricing page%s, purchase the required license, and then follow the %sinstructions in the email receipt%s to upgrade. It only takes a few minutes to unlock the most powerful, yet easy to use analytics tracking system for WordPress.", 'google-analytics-for-wordpress' ), '<a href="https://monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=reportupselllite"><strong>', '</strong></a>', '<a style="text-decoration:underline !important" href="https://www.monsterinsights.com/docs/go-lite-pro/">', '</a>' ); ?></p>
330
+									   &nbsp;<p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress' ); ?></p>
331 331
 									<?php } ?>
332 332
 								</div>
333 333
 								<div class="monsterinsights-upsell-card-action">
@@ -352,9 +352,9 @@  discard block
 block discarded – undo
352 352
     		return '';
353 353
     	} else {
354 354
     		if ( ! empty( $data['reportprevrange'] ) && ! empty( $data['reportprevrange']['startDate'] ) && ! empty( $data['reportprevrange']['endDate'] ) ) {
355
-    			return '%3F_u.date00%3D' . str_replace( '-', '', $data['reportcurrentrange']['startDate'] ) .'%26_u.date01%3D' . str_replace( '-', '', $data['reportcurrentrange']['endDate'] ) . '%26_u.date10%3D' . str_replace( '-', '', $data['reportprevrange']['startDate'] ) .'%26_u.date11%3D' . str_replace( '-', '', $data['reportprevrange']['endDate'] ) . '/';
355
+    			return '%3F_u.date00%3D' . str_replace( '-', '', $data['reportcurrentrange']['startDate'] ) . '%26_u.date01%3D' . str_replace( '-', '', $data['reportcurrentrange']['endDate'] ) . '%26_u.date10%3D' . str_replace( '-', '', $data['reportprevrange']['startDate'] ) . '%26_u.date11%3D' . str_replace( '-', '', $data['reportprevrange']['endDate'] ) . '/';
356 356
     		} else {
357
-    			return '%3F_u.date00%3D' . str_replace( '-', '', $data['reportcurrentrange']['startDate'] ) .'%26_u.date01%3D' . str_replace( '-', '', $data['reportcurrentrange']['endDate'] ) . '/';
357
+    			return '%3F_u.date00%3D' . str_replace( '-', '', $data['reportcurrentrange']['startDate'] ) . '%26_u.date01%3D' . str_replace( '-', '', $data['reportcurrentrange']['endDate'] ) . '/';
358 358
     		}
359 359
     	}
360 360
     }
Please login to merge, or discard this patch.
includes/admin/common.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -150,32 +150,32 @@  discard block
 block discarded – undo
150 150
 				'copytoclip'       				=> esc_html__( 'Copy to Clipboard', 'google-analytics-for-wordpress' ),
151 151
 				'failed'           				=> esc_html__( 'Failed!', 'google-analytics-for-wordpress' ),
152 152
 				'admin_nonce'      				=> wp_create_nonce( 'mi-admin-nonce' ),
153
-				'shorten'         				=> esc_html__( 'Shorten URL' ,'google-analytics-for-wordpress'),
154
-				'shortened'        				=> esc_html__( 'Shortened!' ,'google-analytics-for-wordpress'),
155
-				'working'          				=> esc_html__( 'Working...' ,'google-analytics-for-wordpress'),
156
-				'importtext'       				=> esc_html__( 'Import' ,'google-analytics-for-wordpress'),
157
-				'imported'         				=> esc_html__( 'Imported!' ,'google-analytics-for-wordpress'),
158
-				'redirect_loading_title_text'   => esc_html__( 'Preparing to redirect:' ,'google-analytics-for-wordpress'),
159
-				'redirect_loading_text_text'    => esc_html__( "You'll be redirected momentarily to complete authentication. This may take a couple seconds." ,'google-analytics-for-wordpress'),
160
-				'redirect_loading_error_title'  => esc_html__( "Authentication Error:" ,'google-analytics-for-wordpress'),
161
-				'deauth_loading_title_text'  	=> esc_html__( 'Deauthenticating....' ,'google-analytics-for-wordpress'),
162
-				'deauth_loading_text_text'   	=> esc_html__( "We're deactivating your site. This may take a couple seconds." ,'google-analytics-for-wordpress'),
163
-				'deauth_loading_error_title' 	=> esc_html__( "Deactivation Error:" ,'google-analytics-for-wordpress'),
164
-				'deauth_success_title_text'  	=> esc_html__( 'Deactivated Successfully!' ,'google-analytics-for-wordpress'),
165
-				'deauth_success_text_text'   	=> esc_html__( "You've disconnected your site from MonsterInsights. Your site is no longer being tracked by Google Analytics and you won't see reports anymore." ,'google-analytics-for-wordpress'),
166
-				'verify_loading_title_text'  	=> esc_html__( 'Verifying....' ,'google-analytics-for-wordpress'),
167
-				'verify_loading_text_text'   	=> esc_html__( "We're verifying your site. This may take a couple seconds." ,'google-analytics-for-wordpress'),
168
-				'verify_loading_error_title' 	=> esc_html__( "Verification Error:" ,'google-analytics-for-wordpress'),
169
-				'verify_success_title_text' 	=> esc_html__( 'Verified Successfully!' ,'google-analytics-for-wordpress'),
170
-				'verify_success_text_text'  	=> esc_html__( "Your site is connected to MonsterInsights!" ,'google-analytics-for-wordpress'),
171
-				'ok_text' 						=> esc_html__( "OK" ,'google-analytics-for-wordpress'),
172
-				'force_deauth_button_text'  	=> esc_html__( "Force Deauthenticate" ,'google-analytics-for-wordpress'),
153
+				'shorten'         				=> esc_html__( 'Shorten URL', 'google-analytics-for-wordpress' ),
154
+				'shortened'        				=> esc_html__( 'Shortened!', 'google-analytics-for-wordpress' ),
155
+				'working'          				=> esc_html__( 'Working...', 'google-analytics-for-wordpress' ),
156
+				'importtext'       				=> esc_html__( 'Import', 'google-analytics-for-wordpress' ),
157
+				'imported'         				=> esc_html__( 'Imported!', 'google-analytics-for-wordpress' ),
158
+				'redirect_loading_title_text'   => esc_html__( 'Preparing to redirect:', 'google-analytics-for-wordpress' ),
159
+				'redirect_loading_text_text'    => esc_html__( "You'll be redirected momentarily to complete authentication. This may take a couple seconds.", 'google-analytics-for-wordpress' ),
160
+				'redirect_loading_error_title'  => esc_html__( "Authentication Error:", 'google-analytics-for-wordpress' ),
161
+				'deauth_loading_title_text'  	=> esc_html__( 'Deauthenticating....', 'google-analytics-for-wordpress' ),
162
+				'deauth_loading_text_text'   	=> esc_html__( "We're deactivating your site. This may take a couple seconds.", 'google-analytics-for-wordpress' ),
163
+				'deauth_loading_error_title' 	=> esc_html__( "Deactivation Error:", 'google-analytics-for-wordpress' ),
164
+				'deauth_success_title_text'  	=> esc_html__( 'Deactivated Successfully!', 'google-analytics-for-wordpress' ),
165
+				'deauth_success_text_text'   	=> esc_html__( "You've disconnected your site from MonsterInsights. Your site is no longer being tracked by Google Analytics and you won't see reports anymore.", 'google-analytics-for-wordpress' ),
166
+				'verify_loading_title_text'  	=> esc_html__( 'Verifying....', 'google-analytics-for-wordpress' ),
167
+				'verify_loading_text_text'   	=> esc_html__( "We're verifying your site. This may take a couple seconds.", 'google-analytics-for-wordpress' ),
168
+				'verify_loading_error_title' 	=> esc_html__( "Verification Error:", 'google-analytics-for-wordpress' ),
169
+				'verify_success_title_text' 	=> esc_html__( 'Verified Successfully!', 'google-analytics-for-wordpress' ),
170
+				'verify_success_text_text'  	=> esc_html__( "Your site is connected to MonsterInsights!", 'google-analytics-for-wordpress' ),
171
+				'ok_text' 						=> esc_html__( "OK", 'google-analytics-for-wordpress' ),
172
+				'force_deauth_button_text'  	=> esc_html__( "Force Deauthenticate", 'google-analytics-for-wordpress' ),
173 173
 				'refresh_report_title'          => esc_html__( 'Refreshing Report', 'google-analytics-for-wordpress' ),
174 174
 				'refresh_report_text'           => esc_html__( 'Loading new report data...', 'google-analytics-for-wordpress' ),
175 175
 				'refresh_report_success_text'   => esc_html__( 'Success', 'google-analytics-for-wordpress' ),
176 176
 				'refresh_report_success_text'   => esc_html__( 'Retrieved the new report data successfully', 'google-analytics-for-wordpress' ),
177 177
 				'refresh_report_failure_title'  => esc_html__( 'Error', 'google-analytics-for-wordpress' ),
178
-				'timezone'						=> date('e'),
178
+				'timezone'						=> date( 'e' ),
179 179
 			)
180 180
 		);
181 181
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 		'kad_admin_js', // Pinnacle theme
231 231
 		'dt-chart', // DesignThemes core features plugin
232 232
 		'tweeetshare_font_script', // TweetShare - Click To Tweet
233
-		'tweeetshare_jquery_script',  // TweetShare - Click To Tweet
233
+		'tweeetshare_jquery_script', // TweetShare - Click To Tweet
234 234
 		'tweeetshare_jqueryui_script', // TweetShare - Click To Tweet
235 235
 		'tweeetshare_custom_script', // TweetShare - Click To Tweet
236 236
 		'imagify-promise-polyfill', // Imagify 
@@ -249,16 +249,16 @@  discard block
 block discarded – undo
249 249
 		'rml-modal', // WP Real Media Library
250 250
 		'rml-order', // WP Real Media Library
251 251
 		'rml-meta', // WP Real Media Library
252
-		'rml-uploader',  // WP Real Media Library
253
-		'rml-options',  // WP Real Media Library
254
-		'rml-usersettings',  // WP Real Media Library
252
+		'rml-uploader', // WP Real Media Library
253
+		'rml-options', // WP Real Media Library
254
+		'rml-usersettings', // WP Real Media Library
255 255
 		'rml-main', // WP Real Media Library
256 256
 		'control-panel-sweet-alert', // Ken Theme
257 257
 		'sweet-alert-js', // Vitrine Theme
258 258
 		'theme-admin-script', // Vitrine Theme
259 259
 		'sweetalert', //  Church Suite Theme by Webnus
260 260
 		'be_alerts_charts', //  WooCommerce bolder product alerts
261
- 		'magayo-lottery-results',  //  Magayo Lottery Results
261
+ 		'magayo-lottery-results', //  Magayo Lottery Results
262 262
 		'control-panel-sweet-alert', // Ken Theme
263 263
 		'cpm_chart', // WP Project Manager
264 264
 		'adminscripts', //  Artisan Nayma Theme
@@ -305,15 +305,15 @@  discard block
 block discarded – undo
305 305
 
306 306
 	global $wp_styles;
307 307
 	foreach ( $wp_styles->queue as $handle ) {
308
-		if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content') === false ) {
308
+		if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content' ) === false ) {
309 309
 			return;
310 310
 		}
311 311
 		
312
-		if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights') !== false ) {
312
+		if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights' ) !== false ) {
313 313
 			return;
314 314
 		}
315 315
 
316
-		foreach( $third_party as $partial ) {
316
+		foreach ( $third_party as $partial ) {
317 317
 			if ( strpos( $wp_styles->registered[$handle]->handle, $partial ) !== false ) {
318 318
 				wp_dequeue_style( $handle ); // Remove css file from MI screen
319 319
 				wp_deregister_style( $handle );
@@ -328,15 +328,15 @@  discard block
 block discarded – undo
328 328
 
329 329
 	global $wp_scripts;
330 330
 	foreach ( $wp_scripts->queue as $handle ) {
331
-		if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content') === false ) {
331
+		if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content' ) === false ) {
332 332
 			return;
333 333
 		}
334 334
 		
335
-		if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights') !== false ) {
335
+		if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights' ) !== false ) {
336 336
 			return;
337 337
 		}
338 338
 
339
-		foreach( $third_party as $partial ) {
339
+		foreach ( $third_party as $partial ) {
340 340
 			if ( strpos( $wp_scripts->registered[$handle]->handle, $partial ) !== false ) {
341 341
 				wp_dequeue_script( $handle ); // Remove JS file from MI screen
342 342
 				wp_deregister_script( $handle );
@@ -359,65 +359,65 @@  discard block
 block discarded – undo
359 359
  *
360 360
  * @return null Return early if not on the proper screen.
361 361
  */
362
-function hide_non_monsterinsights_warnings () {
362
+function hide_non_monsterinsights_warnings() {
363 363
 	// Bail if we're not on a MonsterInsights screen.
364 364
 	if ( empty( $_REQUEST['page'] ) || strpos( $_REQUEST['page'], 'monsterinsights' ) === false ) {
365 365
 		return;
366 366
 	}
367 367
 
368 368
 	global $wp_filter;
369
-	if ( !empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) {
370
-		foreach( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) {
369
+	if ( ! empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) {
370
+		foreach ( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) {
371 371
 			foreach ( $hooks as $name => $arr ) {
372 372
 				if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
373
-					unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] );
373
+					unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] );
374 374
 					continue;
375 375
 				}
376 376
 				if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
377 377
 					continue;
378 378
 				}
379
-				if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
379
+				if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
380 380
 					unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] );
381 381
 				}
382 382
 			}
383 383
 		}
384 384
 	}
385 385
 
386
-	if ( !empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) {
387
-		foreach( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) {
386
+	if ( ! empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) {
387
+		foreach ( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) {
388 388
 			foreach ( $hooks as $name => $arr ) {
389 389
 				if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
390
-					unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] );
390
+					unset( $wp_filter['admin_notices']->callbacks[$priority][$name] );
391 391
 					continue;
392 392
 				}
393 393
 				if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
394 394
 					continue;
395 395
 				}
396
-				if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
396
+				if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
397 397
 					unset( $wp_filter['admin_notices']->callbacks[$priority][$name] );
398 398
 				}
399 399
 			}
400 400
 		}
401 401
 	}
402 402
 
403
-	if ( !empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) {
404
-		foreach( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) {
403
+	if ( ! empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) {
404
+		foreach ( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) {
405 405
 			foreach ( $hooks as $name => $arr ) {
406 406
 				if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
407
-					unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] );
407
+					unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] );
408 408
 					continue;
409 409
 				}
410 410
 				if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) {
411 411
 					continue;
412 412
 				}
413
-				if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
413
+				if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) {
414 414
 					unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] );
415 415
 				}
416 416
 			}
417 417
 		}
418 418
 	}
419 419
 }
420
-add_action('admin_print_scripts', 'hide_non_monsterinsights_warnings');  
420
+add_action( 'admin_print_scripts', 'hide_non_monsterinsights_warnings' );  
421 421
 
422 422
 /**
423 423
  * Called whenever an upgrade button / link is displayed in Lite, this function will
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 	return $shareasale_id;
479 479
 }
480 480
 
481
-function monsterinsights_settings_ublock_error_js(){
481
+function monsterinsights_settings_ublock_error_js() {
482 482
 	echo "<script type='text/javascript'>\n";
483 483
 	echo "jQuery( document ).ready( function( $ ) {
484 484
 			if ( window.uorigindetected == null){
@@ -494,9 +494,9 @@  discard block
 block discarded – undo
494 494
 }
495 495
 
496 496
 function monsterinsights_ublock_notice() {
497
-	ob_start();?>
497
+	ob_start(); ?>
498 498
 	<div id="monsterinsights-ublock-origin-error" class="error inline" style="display:none;">
499
-		<?php echo sprintf( esc_html__( 'MonsterInsights has detected that it\'s files are being blocked. This is usually caused by a adblock browser plugin (particularly uBlock Origin), or a conflicting WordPress theme or plugin. This issue only affects the admin side of MonsterInsights. To solve this, ensure MonsterInsights is whitelisted for your website URL in any adblock browser plugin you use. For step by step directions on how to do this, %1$sclick here%2$s. If this doesn\'t solve the issue (rare), send us a ticket %3$shere%2$s and we\'ll be happy to help diagnose the issue.', 'google-analytics-for-wordpress'), '<a href="https://monsterinsights.com/docs/monsterinsights-asset-files-blocked/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>', '<a href="https://monsterinsights.com/contact/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">');
499
+		<?php echo sprintf( esc_html__( 'MonsterInsights has detected that it\'s files are being blocked. This is usually caused by a adblock browser plugin (particularly uBlock Origin), or a conflicting WordPress theme or plugin. This issue only affects the admin side of MonsterInsights. To solve this, ensure MonsterInsights is whitelisted for your website URL in any adblock browser plugin you use. For step by step directions on how to do this, %1$sclick here%2$s. If this doesn\'t solve the issue (rare), send us a ticket %3$shere%2$s and we\'ll be happy to help diagnose the issue.', 'google-analytics-for-wordpress' ), '<a href="https://monsterinsights.com/docs/monsterinsights-asset-files-blocked/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>', '<a href="https://monsterinsights.com/contact/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">' );
500 500
 		?>
501 501
 	</div>
502 502
 	<?php
Please login to merge, or discard this patch.
includes/admin/settings/register-settings.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -176,13 +176,13 @@  discard block
 block discarded – undo
176 176
 			)
177 177
 		),
178 178
 		/** Demographics Settings */
179
-		'demographics' => apply_filters('monsterinsights_settings_demographics',
179
+		'demographics' => apply_filters( 'monsterinsights_settings_demographics',
180 180
 			array(
181 181
 				'demographics' => array(
182 182
 					'id'          => 'demographics',
183 183
 					'name'        => __( 'Enable Demographics and Interests Reports for Remarketing and Advertising', 'google-analytics-for-wordpress' ),
184 184
 					'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 Analytics 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. 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.', 'google-analytics-for-wordpress' ), '<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">',
185
-									'</a>','<a href="https://support.google.com/analytics/answer/2444872?hl=' . get_locale() . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">'
185
+									'</a>', '<a href="https://support.google.com/analytics/answer/2444872?hl=' . get_locale() . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">'
186 186
 					),
187 187
 					'type' 		  => 'checkbox',
188 188
 				),
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 			)
196 196
 		),
197 197
 		/** Enhanced Link Attribution Settings */
198
-		'links' => apply_filters('monsterinsights_settings_links',
198
+		'links' => apply_filters( 'monsterinsights_settings_links',
199 199
 			array(
200 200
 				'enhanced_link_attribution' => array(
201 201
 					'id'          => 'enhanced_link_attribution',
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 			)
231 231
 		),
232 232
 		/** File Download Settings */
233
-		'files' => apply_filters('monsterinsights_settings_files',
233
+		'files' => apply_filters( 'monsterinsights_settings_files',
234 234
 			array(
235 235
 				'track_download_as' => array(
236 236
 					'id'          => 'track_download_as',
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 			)
253 253
 		),
254 254
 		/** Affiliate Tracking Settings */
255
-		'affiliates' => apply_filters('monsterinsights_settings_affiliates',
255
+		'affiliates' => apply_filters( 'monsterinsights_settings_affiliates',
256 256
 			array(
257 257
 				'track_internal_as_outbound' => array(
258 258
 					'id'          => 'track_internal_as_outbound',
@@ -269,68 +269,68 @@  discard block
 block discarded – undo
269 269
 			)
270 270
 		),
271 271
 		/** Social Tracking Settings */
272
-		'social' => apply_filters('monsterinsights_settings_social',
272
+		'social' => apply_filters( 'monsterinsights_settings_social',
273 273
 			array()
274 274
 		),
275 275
 		/** Ad Tracking Settings */
276
-		'ads' => apply_filters('monsterinsights_settings_ads',
276
+		'ads' => apply_filters( 'monsterinsights_settings_ads',
277 277
 			array()
278 278
 		),
279 279
 		/** Forms Tracking Settings */
280
-		'forms' => apply_filters('monsterinsights_settings_forms',
280
+		'forms' => apply_filters( 'monsterinsights_settings_forms',
281 281
 			array()
282 282
 		),
283 283
 		/** eCommerce Tracking Settings */
284
-		'ecommerce' => apply_filters('monsterinsights_settings_ecommerce',
284
+		'ecommerce' => apply_filters( 'monsterinsights_settings_ecommerce',
285 285
 			array()
286 286
 		),
287 287
 		/** Media Tracking Settings */
288
-		'media' => apply_filters('monsterinsights_settings_media',
288
+		'media' => apply_filters( 'monsterinsights_settings_media',
289 289
 			array()
290 290
 		),
291 291
 		/** Members Tracking Settings */
292
-		'memberships' => apply_filters('monsterinsights_settings_memberships',
292
+		'memberships' => apply_filters( 'monsterinsights_settings_memberships',
293 293
 			array()
294 294
 		),
295 295
 		/** Dimensions Tracking Settings */
296
-		'dimensions' => apply_filters('monsterinsights_settings_dimensions',
296
+		'dimensions' => apply_filters( 'monsterinsights_settings_dimensions',
297 297
 			array()
298 298
 		),
299 299
 		/** Performance Tracking Settings */
300
-		'performance' => apply_filters('monsterinsights_settings_performance',
300
+		'performance' => apply_filters( 'monsterinsights_settings_performance',
301 301
 			array()
302 302
 		),
303 303
 		/** AMP Tracking Settings */
304
-		'amp' => apply_filters('monsterinsights_settings_amp',
304
+		'amp' => apply_filters( 'monsterinsights_settings_amp',
305 305
 			array()
306 306
 		),
307 307
 		/** Google Optimize Tracking Settings */
308
-		'goptimize' => apply_filters('monsterinsights_settings_goptimize',
308
+		'goptimize' => apply_filters( 'monsterinsights_settings_goptimize',
309 309
 			array()
310 310
 		),
311 311
 		/** Facebook Instant Articles Tracking Settings */
312
-		'fbia' => apply_filters('monsterinsights_settings_fbia',
312
+		'fbia' => apply_filters( 'monsterinsights_settings_fbia',
313 313
 			array()
314 314
 		),
315 315
 		/** Bounce Reduction Settings */
316
-		'bounce' => apply_filters('monsterinsights_settings_bounce',
316
+		'bounce' => apply_filters( 'monsterinsights_settings_bounce',
317 317
 			array()
318 318
 		),
319 319
 		/** Reporting Tracking Settings */
320
-		'reporting' => apply_filters('monsterinsights_settings_reporting',
320
+		'reporting' => apply_filters( 'monsterinsights_settings_reporting',
321 321
 			array()
322 322
 		),
323 323
 		/** Notifications Tracking Settings */
324
-		'notifications' => apply_filters('monsterinsights_settings_notifications',
324
+		'notifications' => apply_filters( 'monsterinsights_settings_notifications',
325 325
 			array()
326 326
 		),
327 327
 		/** Compatibility Tracking Settings */
328
-		'compatibility' => apply_filters('monsterinsights_settings_compatibility',
328
+		'compatibility' => apply_filters( 'monsterinsights_settings_compatibility',
329 329
 			array(
330 330
 				'subdomain_tracking' => array(
331 331
 					'id'          => 'subdomain_tracking',
332 332
 					'name'        => __( 'Domain to track as:', 'google-analytics-for-wordpress' ),
333
-					'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>' ),
333
+					'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>' ),
334 334
 					'type' 		  => 'text',
335 335
 				),
336 336
 				'custom_code' => array(
@@ -342,22 +342,22 @@  discard block
 block discarded – undo
342 342
 				'debug_mode' => array(
343 343
 					'id'          => 'debug_mode',
344 344
 					'name'        => __( 'Enable Debug Mode', 'google-analytics-for-wordpress' ),
345
-					'desc'        => __( 'Turns on debugging in JS events tracking, logging of eCommerce requests and enables debug settings.', 'google-analytics-for-wordpress'),
345
+					'desc'        => __( 'Turns on debugging in JS events tracking, logging of eCommerce requests and enables debug settings.', 'google-analytics-for-wordpress' ),
346 346
 					'type' 		  => 'checkbox',
347 347
 				),
348 348
 			)
349 349
 		),
350 350
 		/** EU Compliance Tracking Settings */
351
-		'eucompliance' => apply_filters('monsterinsights_settings_eucompliance',
351
+		'eucompliance' => apply_filters( 'monsterinsights_settings_eucompliance',
352 352
 			array()
353 353
 		),
354 354
 		/** Permissions Tracking Settings */
355
-		'permissions' => apply_filters('monsterinsights_settings_permissions',
355
+		'permissions' => apply_filters( 'monsterinsights_settings_permissions',
356 356
 			array(
357 357
 				'view_reports' => array(
358 358
 					'id'          => 'view_reports',
359 359
 					'name'        => __( 'Let these user roles see reports:', 'google-analytics-for-wordpress' ),
360
-					'desc'        => sprintf( esc_html( 'Users that have at least one of these roles will be able to view the reports, along with any user with the %s capability.', 'google-analytics-for-wordpress' ), '<code>manage_options</code>'),
360
+					'desc'        => sprintf( esc_html( 'Users that have at least one of these roles will be able to view the reports, along with any user with the %s capability.', 'google-analytics-for-wordpress' ), '<code>manage_options</code>' ),
361 361
 					'type'        => 'select',
362 362
 					'options'     => monsterinsights_get_roles(),
363 363
 					'select2'     => true,
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 				'save_settings' => array(
368 368
 					'id'          => 'save_settings',
369 369
 					'name'        => __( 'Let these user roles save settings:', 'google-analytics-for-wordpress' ),
370
-					'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>' ),
370
+					'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>' ),
371 371
 					'type'        => 'select',
372 372
 					'options'     => monsterinsights_get_roles(),
373 373
 					'select2'     => true,
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
 
@@ -1029,9 +1029,9 @@  discard block
 block discarded – undo
1029 1029
 	$notices = get_transient( 'monsterinsights_settings_notices' );
1030 1030
 	if ( empty( $notices ) ) {
1031 1031
 		$notices          = array();
1032
-		$notices[ $name ] = array( "type" => $type, "message" => $message );
1032
+		$notices[$name] = array( "type" => $type, "message" => $message );
1033 1033
 	} else {
1034
-		$notices[ $name ] = array( "type" => $type, "message" => $message );
1034
+		$notices[$name] = array( "type" => $type, "message" => $message );
1035 1035
 	}
1036 1036
 	set_transient( 'monsterinsights_settings_notices', $notices );
1037 1037
 }
@@ -1043,8 +1043,8 @@  discard block
 block discarded – undo
1043 1043
 	$notices = get_transient( 'monsterinsights_settings_notices' );
1044 1044
 	$found   = false;
1045 1045
 	if ( ! empty( $notices ) ) {
1046
-		if ( isset( $notices[ $name] ) ) {
1047
-			unset( $notices[ $name] );
1046
+		if ( isset( $notices[$name] ) ) {
1047
+			unset( $notices[$name] );
1048 1048
 			set_transient( 'monsterinsights_settings_notices', $notices );
1049 1049
 			$found = true;
1050 1050
 		} else {
@@ -1057,6 +1057,6 @@  discard block
 block discarded – undo
1057 1057
 /** 
1058 1058
  * @todo  docbloc
1059 1059
  */
1060
-function monsterinsights_get_non_setting_types(){
1061
-	return apply_filters( 'monsterinsights_non_setting_types', array(  'descriptive_text', 'hook', 'upgrade_notice', 'install_notice', 'notice' ) );
1060
+function monsterinsights_get_non_setting_types() {
1061
+	return apply_filters( 'monsterinsights_non_setting_types', array( 'descriptive_text', 'hook', 'upgrade_notice', 'install_notice', 'notice' ) );
1062 1062
 }
1063 1063
\ No newline at end of file
Please login to merge, or discard this patch.
includes/frontend/tracking/class-tracking-analytics.php 1 patch
Spacing   +16 added lines, -16 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,22 +175,22 @@  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
-			$src       = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics_debug.js' );
181
+			$src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics_debug.js' );
182 182
 		}
183 183
 		$compat     	= monsterinsights_get_option( 'gatracker_compatibility_mode', false );
184
-		$compat    	 	= $compat ? 'window.ga = __gaTracker;' : '';
184
+		$compat = $compat ? 'window.ga = __gaTracker;' : '';
185 185
 		$track_user 	= monsterinsights_track_user();
186 186
 		$ua         	= monsterinsights_get_ua();
187 187
 		$output     	= '';
188 188
 		$reason     	= '';
189 189
 		$cookie_notice  = class_exists( 'Cookie_Notice' );
190
-		$attributes     = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false'  ) );
190
+		$attributes     = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) );
191 191
 		$attr_string    = '';
192 192
 		if ( ! empty( $attributes ) ) {
193
-			foreach( $attributes as $attr_name => $attr_value ) {
193
+			foreach ( $attributes as $attr_name => $attr_value ) {
194 194
 	 			if ( ! empty( $attr_name ) ) {
195 195
 	 				$attr_string .= ' ' . sanitize_key( $attr_name ) . '="' . esc_attr( $attr_value ) . '"';
196 196
 	 			} else {
@@ -204,20 +204,20 @@  discard block
 block discarded – undo
204 204
 <?php if ( ! $track_user ) {
205 205
 	if ( empty( $ua ) ) {
206 206
 		$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' );
207
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
207
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
208 208
 	} else if ( current_user_can( 'monsterinsights_save_settings' ) ) {
209
-		$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' );
210
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
209
+		$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' );
210
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
211 211
 	} else {
212 212
 		$reason = __( 'Note: The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' );
213
-	    $output .=  '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
213
+	    $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
214 214
 	}
215 215
 	echo $output;
216 216
 } ?>
217 217
 <?php if ( $ua ) { ?>
218
-<script<?php echo $attr_string;?>>
218
+<script<?php echo $attr_string; ?>>
219 219
 	var mi_track_user      = <?php echo ( $track_user ? 'true' : 'false' ); ?>;
220
-	var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason)  . "'": "''" ); ?>;
220
+	var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason ) . "'" : "''" ); ?>;
221 221
 	<?php do_action( 'monsterinsights_tracking_analytics_frontend_output_after_mi_track_user' ); ?>
222 222
 
223 223
 <?php if ( $this->should_do_optout() ) { ?>
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	?>
266 266
 	} else {
267 267
 <?php if ( $this->should_do_optout() ) { ?>
268
-		console.log( "<?php echo esc_js( $reason );?>" );
268
+		console.log( "<?php echo esc_js( $reason ); ?>" );
269 269
 		(function() {
270 270
 			/* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */
271 271
 			var noopfn = function() {
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 				}
289 289
 				var f = arguments[len-1];
290 290
 				if ( typeof f !== 'object' || f === null || typeof f.hitCallback !== 'function' ) {
291
-					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 );
291
+					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 );
292 292
 					return;
293 293
 				}
294 294
 				try {
Please login to merge, or discard this patch.
lite/includes/admin/reports/report-forms.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 		parent::__construct();
24 24
 	}
25 25
 
26
-	protected function get_report_html( $data = array() ){
26
+	protected function get_report_html( $data = array() ) {
27 27
 		return $this->get_upsell_notice();
28 28
 	}
29 29
 }
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 		parent::__construct();
24 24
 	}
25 25
 
26
-	protected function get_report_html( $data = array() ){
26
+	protected function get_report_html( $data = array() ) {
27 27
 		return $this->get_upsell_notice();
28 28
 	}
29 29
 }
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
lite/includes/admin/settings.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 			$settings['social']['social_notice'] = array( 
12 12
 				'id' => 'social_notice',
13 13
 				'no_label' => true,
14
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
14
+				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ),
15 15
 				'type' => 'upgrade_notice',
16 16
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Social tracking to see who's clicking on your social share links, so you can track and maximize your social sharing exposure.", 'google-analytics-for-wordpress' )
17 17
 			);
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 			$settings['eucompliance']['eucompliance_notice'] = array( 
21 21
 				'id' => 'eucompliance_notice',
22 22
 				'no_label' => true,
23
-				'name' => __( 'Google Analytics EU Compliance', 'google-analytics-for-wordpress'),
23
+				'name' => __( 'Google Analytics EU Compliance', 'google-analytics-for-wordpress' ),
24 24
 				'type' => 'upgrade_notice',
25 25
 				'desc' => esc_html__( "The MonsterInsights EU Compliance addon allows you to improve compliance with GDPR and other privacy regulations.", 'google-analytics-for-wordpress' )
26 26
 			);
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 			$settings['ads']['ads_notice'] = array( 
30 30
 				'id' => 'ads_notice',
31 31
 				'no_label' => true,
32
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
32
+				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ),
33 33
 				'type' => 'upgrade_notice',
34 34
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Ads tracking to see who's clicking on your Google Ads, so you can increase your revenue.", 'google-analytics-for-wordpress' )
35 35
 			);
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 			$settings['forms']['forms_notice'] = array( 
39 39
 				'id' => 'forms_notice',
40 40
 				'no_label' => true,
41
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
41
+				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ),
42 42
 				'type' => 'upgrade_notice',
43 43
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Forms tracking to see who's seeing and submitting your forms, so you can increase your conversion rate.", 'google-analytics-for-wordpress' )
44 44
 			);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 			$settings['media']['media_notice'] = array( 
48 48
 				'id' => 'media_notice',
49 49
 				'no_label' => true,
50
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
50
+				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ),
51 51
 				'type' => 'upgrade_notice',
52 52
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Media tracking to see who's interacting with the media on your site, so you know what your users are most interested in on your site. You can use this to tailor future content to meet your audience's interest to promote repeat visitors and expand your average user's time spent visiting your website on each visit.", 'google-analytics-for-wordpress' )
53 53
 			);
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 			$settings['membership']['membership_notice'] = array( 
57 57
 				'id' => 'membership_notice',
58 58
 				'no_label' => true,
59
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
59
+				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ),
60 60
 				'type' => 'upgrade_notice',
61 61
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Membership tracking.", 'google-analytics-for-wordpress' )
62 62
 			);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			$settings['dimensions']['dimensions_notice'] = array( 
66 66
 				'id' => 'dimensions_notice',
67 67
 				'no_label' => true,
68
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
68
+				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ),
69 69
 				'type' => 'upgrade_notice',
70 70
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Custom Dimensions and track who's the most popular author on your site, which post types get the most traffic, and more. Why not check it out?", 'google-analytics-for-wordpress' )
71 71
 			);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 			$settings['performance']['performance_notice'] = array( 
75 75
 				'id' => 'performance_notice',
76 76
 				'no_label' => true,
77
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
77
+				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ),
78 78
 				'type' => 'upgrade_notice',
79 79
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can adjust the sample rate so you don't exceed Google Analytics' processing limit. You can also use it to enable Google Optimize for A/B testing and personalization.", 'google-analytics-for-wordpress' )
80 80
 			);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 			$settings['reporting']['reporting_notice'] = array( 
84 84
 				'id' => 'reporting_notice',
85 85
 				'no_label' => true,
86
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
86
+				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ),
87 87
 				'type' => 'upgrade_notice',
88 88
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable enhanced reporting.", 'google-analytics-for-wordpress' )
89 89
 			);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 			$settings['amp']['amp_notice'] = array( 
93 93
 				'id' => 'amp_notice',
94 94
 				'no_label' => true,
95
-				'name' => __( 'Want to use track users visiting your AMP pages?', 'google-analytics-for-wordpress'),
95
+				'name' => __( 'Want to use track users visiting your AMP pages?', 'google-analytics-for-wordpress' ),
96 96
 				'type' => 'upgrade_notice',
97 97
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable AMP page tracking.", 'google-analytics-for-wordpress' )
98 98
 			);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 			$settings['goptimize']['goptimize_notice'] = array( 
102 102
 				'id' => 'goptimize_notice',
103 103
 				'no_label' => true,
104
-				'name' => __( 'Want to use Google Optimize to retarget your website visitors and perform A/B split tests with ease?', 'google-analytics-for-wordpress'),
104
+				'name' => __( 'Want to use Google Optimize to retarget your website visitors and perform A/B split tests with ease?', 'google-analytics-for-wordpress' ),
105 105
 				'type' => 'upgrade_notice',
106 106
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable Google Optimize.", 'google-analytics-for-wordpress' )
107 107
 			);
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 			$settings['fbia']['fbia_notice'] = array( 
111 111
 				'id' => 'fbia_notice',
112 112
 				'no_label' => true,
113
-				'name' => __( 'Want to expand your website audience beyond your website with Facebook Instant Articles?', 'google-analytics-for-wordpress'),
113
+				'name' => __( 'Want to expand your website audience beyond your website with Facebook Instant Articles?', 'google-analytics-for-wordpress' ),
114 114
 				'type' => 'upgrade_notice',
115 115
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can track your Facebook Instant Article visitors with MonsterInsights.", 'google-analytics-for-wordpress' )
116 116
 			);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 			$settings['bounce']['bounce_notice'] = array( 
120 120
 				'id' => 'bounce_notice',
121 121
 				'no_label' => true,
122
-				'name' => __( 'Want to adjust your website bounce rate?', 'google-analytics-for-wordpress'),
122
+				'name' => __( 'Want to adjust your website bounce rate?', 'google-analytics-for-wordpress' ),
123 123
 				'type' => 'upgrade_notice',
124 124
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can adjust your Google Analytics bounce rate with MonsterInsights.", 'google-analytics-for-wordpress' )
125 125
 			);
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 			$settings['notifications']['notifications_notice'] = array( 
129 129
 				'id' => 'notifications_notice',
130 130
 				'no_label' => true,
131
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
131
+				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ),
132 132
 				'type' => 'upgrade_notice',
133 133
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable notifications.", 'google-analytics-for-wordpress' )
134 134
 			);
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 			$settings['ecommerce']['ecommerce_notice'] = array( 
138 138
 				'id' => 'ecommerce_notice',
139 139
 				'no_label' => true,
140
-				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'),
140
+				'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ),
141 141
 				'type' => 'upgrade_notice',
142 142
 				'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Ecommerce tracking to see who's buying your product, what's the most popular item on your store, the average order value, and tons more.", 'google-analytics-for-wordpress' )
143 143
 			);
Please login to merge, or discard this patch.