Passed
Push — master ( b8d280...edd4c4 )
by Chris
03:53
created
googleanalytics.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 				self::$instance->notices          = new MonsterInsights_Notice_Admin();
228 228
 				self::$instance->license_actions  = new MonsterInsights_License_Actions();
229 229
 				self::$instance->reporting 	      = new MonsterInsights_Reporting();
230
-				self::$instance->api_auth    	  = new MonsterInsights_API_Auth();
230
+				self::$instance->api_auth = new MonsterInsights_API_Auth();
231 231
 				if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
232 232
 					self::$instance->require_updater();
233 233
 				} else {
@@ -351,19 +351,19 @@  discard block
 block discarded – undo
351 351
 		}
352 352
 
353 353
 		if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_DIR' ) ) {
354
-			define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file )  );
354
+			define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) );
355 355
 		}
356 356
 
357 357
 		if ( ! defined( 'GAWP_PATH' ) ) {
358
-			define( 'GAWP_PATH', MONSTERINSIGHTS_PLUGIN_DIR  );
358
+			define( 'GAWP_PATH', MONSTERINSIGHTS_PLUGIN_DIR );
359 359
 		}
360 360
 
361 361
 		if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_URL' ) ) {
362
-			define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file )  );
362
+			define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) );
363 363
 		}
364 364
 
365 365
 		if ( ! defined( 'GAWP_URL' ) ) {
366
-			define( 'GAWP_URL', MONSTERINSIGHTS_PLUGIN_URL  );
366
+			define( 'GAWP_URL', MONSTERINSIGHTS_PLUGIN_URL );
367 367
 		}
368 368
 	}	
369 369
 
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 		}
384 384
 
385 385
 		// Traditional WordPress plugin locale filter.
386
-		$mi_locale  = apply_filters( 'plugin_locale',  $mi_locale, 'google-analytics-for-wordpress' );
386
+		$mi_locale  = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' );
387 387
 		$mi_mofile  = sprintf( '%1$s-%2$s.mo', 'google-analytics-for-wordpress', $mi_locale ); 
388 388
 	
389 389
 		// Look for wp-content/languages/google-analytics-for-wordpress/google-analytics-for-wordpress-{lang}_{country}.mo
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 	public function monsterinsights_wp_notice() {
441 441
 		$url = admin_url( 'plugins.php' );
442 442
 		// Check for MS dashboard
443
-		if( is_network_admin() ) {
443
+		if ( is_network_admin() ) {
444 444
 			$url = network_admin_url( 'plugins.php' );
445 445
 		}
446 446
 		?>
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	public function monsterinsights_pro_notice() {
462 462
 		$url = admin_url( 'plugins.php' );
463 463
 		// Check for MS dashboard
464
-		if( is_network_admin() ) {
464
+		if ( is_network_admin() ) {
465 465
 			$url = network_admin_url( 'plugins.php' );
466 466
 		}
467 467
 		?>
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 		require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/options.php';
488 488
 		require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/helpers.php';
489 489
 		require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/deprecated.php';
490
-		$monsterinsights_settings  = monsterinsights_get_options();
490
+		$monsterinsights_settings = monsterinsights_get_options();
491 491
 	}
492 492
 
493 493
 
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 	 * 
502 502
 	 * @return void
503 503
 	 */
504
-	public function load_licensing(){
504
+	public function load_licensing() {
505 505
 		if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
506 506
 			require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/license.php';
507 507
 			self::$instance->license = new MonsterInsights_License();
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 		$instance->api_auth->delete_auth();
673 673
 
674 674
 		// Delete network data
675
-		$instance->reporting->delete_aggregate_data('network');
675
+		$instance->reporting->delete_aggregate_data( 'network' );
676 676
 
677 677
 		// Delete network license
678 678
 		$instance->license->delete_network_license();
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 			$instance->api_auth->delete_auth();
687 687
 
688 688
 			// Delete data
689
-			$instance->reporting->delete_aggregate_data('site');
689
+			$instance->reporting->delete_aggregate_data( 'site' );
690 690
 
691 691
 			// Delete license
692 692
 			$instance->license->delete_site_license();
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 		$instance->api_auth->delete_auth();
699 699
 
700 700
 		// Delete data
701
-		$instance->reporting->delete_aggregate_data('site');
701
+		$instance->reporting->delete_aggregate_data( 'site' );
702 702
 
703 703
 		// Delete license
704 704
 		$instance->license->delete_site_license();
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
  * 
794 794
  * @return void
795 795
  */
796
-function monsterinsights_lite_call_install_and_upgrade(){
796
+function monsterinsights_lite_call_install_and_upgrade() {
797 797
 	add_action( 'wp_loaded', 'monsterinsights_lite_install_and_upgrade' );
798 798
 }
799 799
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 	 * 
502 502
 	 * @return void
503 503
 	 */
504
-	public function load_licensing(){
504
+	public function load_licensing() {
505 505
 		if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
506 506
 			require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/license.php';
507 507
 			self::$instance->license = new MonsterInsights_License();
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
  * 
794 794
  * @return void
795 795
  */
796
-function monsterinsights_lite_call_install_and_upgrade(){
796
+function monsterinsights_lite_call_install_and_upgrade() {
797 797
 	add_action( 'wp_loaded', 'monsterinsights_lite_install_and_upgrade' );
798 798
 }
799 799
 
Please login to merge, or discard this patch.
lite/includes/admin/reports/report-ecommerce.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/reports/report-publisher.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.
includes/admin/admin.php 3 patches
Indentation   +139 added lines, -139 removed lines patch added patch discarded remove patch
@@ -33,24 +33,24 @@  discard block
 block discarded – undo
33 33
     $hook = 'monsterinsights_settings';
34 34
 
35 35
     if ( $dashboards_disabled || ! $is_authed || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) {
36
-        // If dashboards disabled, first settings page
37
-        add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
38
-        $hook = 'monsterinsights_settings';
36
+	// If dashboards disabled, first settings page
37
+	add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
38
+	$hook = 'monsterinsights_settings';
39 39
 
40
-        add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' );
41
-        add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' );
40
+	add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' );
41
+	add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' );
42 42
     } else {
43
-        // if dashboards enabled, first dashboard
44
-        add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
43
+	// if dashboards enabled, first dashboard
44
+	add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
45 45
 
46
-        $hook = 'monsterinsights_reports';
46
+	$hook = 'monsterinsights_reports';
47 47
 
48
-        add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' );
48
+	add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' );
49 49
 
50
-        // then settings page
51
-        add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' );
50
+	// then settings page
51
+	add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' );
52 52
 
53
-        add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' );
53
+	add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' );
54 54
 
55 55
     }
56 56
     
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     // then addons
61 61
     $network_key = MonsterInsights()->license->get_network_license_key();
62 62
     if ( ! monsterinsights_is_network_active() || ( monsterinsights_is_network_active() && empty( $network_key ) ) ) {
63
-        add_submenu_page( $hook, __( 'Addons:', 'google-analytics-for-wordpress' ), '<span style="color:#7cc048"> ' . __( 'Addons', 'google-analytics-for-wordpress' ) . '</span>', 'monsterinsights_save_settings', 'monsterinsights_addons', 'monsterinsights_addons_page' );
63
+	add_submenu_page( $hook, __( 'Addons:', 'google-analytics-for-wordpress' ), '<span style="color:#7cc048"> ' . __( 'Addons', 'google-analytics-for-wordpress' ) . '</span>', 'monsterinsights_save_settings', 'monsterinsights_addons', 'monsterinsights_addons_page' );
64 64
     }
65 65
 }
66 66
 add_action( 'admin_menu', 'monsterinsights_admin_menu' );
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
     // First, let's see if this is an MS network enabled plugin. If it is, we should load the license 
75 75
     // menu page and the updater on the network panel
76 76
     if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
77
-        require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
77
+	require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
78 78
     }
79 79
 
80 80
     $plugin = plugin_basename( MONSTERINSIGHTS_PLUGIN_FILE );
81 81
     if ( ! is_plugin_active_for_network( $plugin ) ) {
82
-        return;
82
+	return;
83 83
     }
84 84
 
85 85
     $hook = 'monsterinsights_network';
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 function monsterinsights_add_admin_body_class( $classes ) {
104 104
     $screen = get_current_screen(); 
105 105
     if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) {
106
-        return $classes;
106
+	return $classes;
107 107
     }
108 108
        
109 109
     return "$classes monsterinsights_page ";
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
 
124 124
     // If lite, show a link where they can get pro from
125 125
     if ( ! monsterinsights_is_pro_version() ) {
126
-        $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="https://www.monsterinsights.com/lite/">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>';
127
-        array_unshift( $links, $get_pro );
126
+	$get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="https://www.monsterinsights.com/lite/">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>';
127
+	array_unshift( $links, $get_pro );
128 128
     }   
129 129
     
130 130
     // If Lite, support goes to forum. If pro, it goes to our website
131 131
     if ( monsterinsights_is_pro_version() ) {
132
-        $support = '<a title="MonsterInsights Pro Support" href="https://www.monsterinsights.com/my-account/support/">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
133
-        array_unshift( $links, $support );
132
+	$support = '<a title="MonsterInsights Pro Support" href="https://www.monsterinsights.com/my-account/support/">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
133
+	array_unshift( $links, $support );
134 134
     } else {
135
-        $support = '<a title="MonsterInsights Lite Support" href="https://wordpress.org/support/plugin/google-analytics-for-wordpress">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
136
-        array_unshift( $links, $support );      
135
+	$support = '<a title="MonsterInsights Lite Support" href="https://wordpress.org/support/plugin/google-analytics-for-wordpress">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>';
136
+	array_unshift( $links, $support );      
137 137
     }
138 138
 
139 139
     $settings_link = '<a href="' . esc_url( admin_url( 'admin.php?page=monsterinsights_settings' ) ) . '">' . esc_html__( 'Settings', 'google-analytics-for-wordpress' ) . '</a>';
@@ -158,26 +158,26 @@  discard block
 block discarded – undo
158 158
 function monsterinsights_load_admin_partial( $template, $data = array() ) {
159 159
 
160 160
     if ( monsterinsights_is_pro_version() ) {
161
-        $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' );
161
+	$dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' );
162 162
     
163
-        if ( file_exists( $dir . $template . '.php' ) ) {
164
-            require_once(  $dir . $template . '.php' );
165
-            return true;
166
-        }
163
+	if ( file_exists( $dir . $template . '.php' ) ) {
164
+	    require_once(  $dir . $template . '.php' );
165
+	    return true;
166
+	}
167 167
     } else {
168
-        $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' );
168
+	$dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' );
169 169
     
170
-        if ( file_exists( $dir . $template . '.php' ) ) {
171
-            require_once(  $dir . $template . '.php' );
172
-            return true;
173
-        }   
170
+	if ( file_exists( $dir . $template . '.php' ) ) {
171
+	    require_once(  $dir . $template . '.php' );
172
+	    return true;
173
+	}   
174 174
     }
175 175
         
176 176
     $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' );
177 177
 
178 178
     if ( file_exists( $dir . $template . '.php' ) ) {
179
-        require_once(  $dir . $template . '.php' );
180
-        return true;
179
+	require_once(  $dir . $template . '.php' );
180
+	return true;
181 181
     }
182 182
                 
183 183
     return false;
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
     // Get the current screen, and check whether we're viewing a MonsterInsights screen;
194 194
     $screen = get_current_screen(); 
195 195
     if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) {
196
-        return;
196
+	return;
197 197
     }
198 198
 
199 199
     // If here, we're on an MonsterInsights screen, so output the header.
200 200
     monsterinsights_load_admin_partial( 'header', array(
201
-        'mascot'   => plugins_url( 'assets/css/images/mascot.png', MonsterInsights()->file ),
202
-        'logo'     => plugins_url( 'assets/css/images/logo.png', MonsterInsights()->file ),
203
-        '2xmascot' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ),
204
-        '2xlogo'   => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ),
201
+	'mascot'   => plugins_url( 'assets/css/images/mascot.png', MonsterInsights()->file ),
202
+	'logo'     => plugins_url( 'assets/css/images/logo.png', MonsterInsights()->file ),
203
+	'2xmascot' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ),
204
+	'2xlogo'   => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ),
205 205
     ) );
206 206
 }
207 207
 add_action( 'in_admin_header','monsterinsights_admin_header', 100 );
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 function monsterinsights_welcome_redirect() {
210 210
     // Bail if no activation redirect
211 211
     if ( ! get_transient( '_monsterinsights_activation_redirect' ) ) {
212
-        return;
212
+	return;
213 213
     }
214 214
 
215 215
     // Delete the redirect transient
@@ -217,15 +217,15 @@  discard block
 block discarded – undo
217 217
 
218 218
     // Bail if activating from network, or bulk
219 219
     if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
220
-        return;
220
+	return;
221 221
     }
222 222
 
223 223
     $upgrade = get_option( 'monsterinsights_version_upgraded_from' );
224 224
     if( ! $upgrade ) { // First time install
225
-        //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
225
+	//wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
226 226
     } else { // Update
227
-        return;
228
-        //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
227
+	return;
228
+	//wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
229 229
     }
230 230
 }
231 231
 //add_action( 'admin_init', 'monsterinsights_welcome_redirect', 11 ); @todo: Investigate
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 function monsterinsights_admin_footer( $text ) {
242 242
     global $current_screen;
243 243
     if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) {
244
-        $url  = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5';
245
-        $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' .  $url . '" target="_blank" rel="noopener noreferrer">&#9733;&#9733;&#9733;&#9733;&#9733;</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' );
244
+	$url  = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5';
245
+	$text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' .  $url . '" target="_blank" rel="noopener noreferrer">&#9733;&#9733;&#9733;&#9733;&#9733;</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' );
246 246
     }
247 247
     return $text;
248 248
 }
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
     // Don't show on MonsterInsights pages
254 254
     $screen = get_current_screen(); 
255 255
     if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) {
256
-        return;
256
+	return;
257 257
     }
258 258
 
259 259
     // Make sure they have the permissions to do something
260 260
     if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
261
-        return;
261
+	return;
262 262
     }
263 263
 
264 264
     // Priority:
@@ -271,45 +271,45 @@  discard block
 block discarded – undo
271 271
 
272 272
     // 1. Google Analytics not authenticated
273 273
     if ( ! is_network_admin() && ! monsterinsights_get_ua() ) {
274
-        $page = admin_url( 'admin.php?page=monsterinsights_settings' );
275
-        $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' );
276
-        echo '<div class="error"><p>'. $message.'</p></div>';
277
-        return;
274
+	$page = admin_url( 'admin.php?page=monsterinsights_settings' );
275
+	$message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' );
276
+	echo '<div class="error"><p>'. $message.'</p></div>';
277
+	return;
278 278
     }
279 279
 
280 280
     // 2. License key not entered for pro
281 281
     $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : '';
282 282
     if ( monsterinsights_is_pro_version() && empty( $key ) ) {
283
-        $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
284
-        $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' );
285
-        echo '<div class="error"><p>'. $message.'</p></div>';
286
-        return;
283
+	$page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
284
+	$message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' );
285
+	echo '<div class="error"><p>'. $message.'</p></div>';
286
+	return;
287 287
     }
288 288
 
289 289
     // 3. License key not valid/okay for pro
290 290
     if ( monsterinsights_is_pro_version() ) {
291
-        $message = '';
292
-        if ( MonsterInsights()->license->get_site_license_key() ){
293
-            if ( MonsterInsights()->license->site_license_expired() ) {
294
-                $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
295
-            } else if ( MonsterInsights()->license->site_license_disabled() ) {
296
-                $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
297
-            } else if ( MonsterInsights()->license->site_license_invalid() ) {
298
-                $message = esc_html__( 'Your license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' );
299
-            }
300
-        } else if ( MonsterInsights()->license->get_network_license_key() ) {
301
-            if ( MonsterInsights()->license->network_license_expired() ) {
302
-                $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
303
-            } else if ( MonsterInsights()->license->network_license_disabled() ) {
304
-                $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
305
-            } else if ( MonsterInsights()->license->network_license_invalid() ) {
306
-                $message = esc_html__( 'Your network license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' );
307
-            }
308
-        }
309
-        if ( ! empty( $message ) ) {
310
-            echo '<div class="error"><p>'. $message.'</p></div>';
311
-            return;
312
-        }
291
+	$message = '';
292
+	if ( MonsterInsights()->license->get_site_license_key() ){
293
+	    if ( MonsterInsights()->license->site_license_expired() ) {
294
+		$message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
295
+	    } else if ( MonsterInsights()->license->site_license_disabled() ) {
296
+		$message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
297
+	    } else if ( MonsterInsights()->license->site_license_invalid() ) {
298
+		$message = esc_html__( 'Your license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' );
299
+	    }
300
+	} else if ( MonsterInsights()->license->get_network_license_key() ) {
301
+	    if ( MonsterInsights()->license->network_license_expired() ) {
302
+		$message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
303
+	    } else if ( MonsterInsights()->license->network_license_disabled() ) {
304
+		$message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' );
305
+	    } else if ( MonsterInsights()->license->network_license_invalid() ) {
306
+		$message = esc_html__( 'Your network license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' );
307
+	    }
308
+	}
309
+	if ( ! empty( $message ) ) {
310
+	    echo '<div class="error"><p>'. $message.'</p></div>';
311
+	    return;
312
+	}
313 313
     }
314 314
 
315 315
     // 4. Optin setting not configured
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
     $notices   = get_option( 'monsterinsights_notices' );
341 341
     if ( ! is_array( $notices ) ) {
342
-        $notices = array();
342
+	$notices = array();
343 343
     }
344 344
 
345 345
     // 5. Authenticate, not manual
@@ -347,12 +347,12 @@  discard block
 block discarded – undo
347 347
     $url      = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
348 348
 
349 349
     if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { 
350
-        echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">';
351
-            echo '<p>';
352
-            echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); 
353
-            echo '</p>';
354
-        echo '</div>';
355
-        return;
350
+	echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">';
351
+	    echo '<p>';
352
+	    echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); 
353
+	    echo '</p>';
354
+	echo '</div>';
355
+	return;
356 356
     }
357 357
 
358 358
     // 6. Automatic updates not configured
@@ -372,64 +372,64 @@  discard block
 block discarded – undo
372 372
 
373 373
     // 7. WooUpsell
374 374
     if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
375
-        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { 
376
-            echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
377
-                echo '<div class="monsterinsights-wooedd-upsell-left">';
378
-                    echo '<p><strong>';
379
-                    echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' );
380
-                    echo '</strong></p>';
381
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
382
-                    echo '<p>';
383
-                    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
384
-                    echo '</p>';
385
-                    echo '<p>';
386
-                    echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' );
387
-                    echo '</p>';
388
-                    echo '<p>';
389
-                    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
390
-                    echo '</p>';
391
-                    echo '<p>';
392
-                    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
393
-                    echo '</p>';
394
-                    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="https://www.monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=woocommercelite">', ' &raquo;</a>' ); 
395
-                    echo '</p>';
396
-                echo '</div><div class="monsterinsights-wooedd-upsell-right">';
397
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
398
-                echo '</div>';
399
-            echo '</div>';
400
-            return;
401
-        }
375
+	if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { 
376
+	    echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
377
+		echo '<div class="monsterinsights-wooedd-upsell-left">';
378
+		    echo '<p><strong>';
379
+		    echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' );
380
+		    echo '</strong></p>';
381
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
382
+		    echo '<p>';
383
+		    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
384
+		    echo '</p>';
385
+		    echo '<p>';
386
+		    echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' );
387
+		    echo '</p>';
388
+		    echo '<p>';
389
+		    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
390
+		    echo '</p>';
391
+		    echo '<p>';
392
+		    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
393
+		    echo '</p>';
394
+		    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="https://www.monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=woocommercelite">', ' &raquo;</a>' ); 
395
+		    echo '</p>';
396
+		echo '</div><div class="monsterinsights-wooedd-upsell-right">';
397
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
398
+		echo '</div>';
399
+	    echo '</div>';
400
+	    return;
401
+	}
402 402
     }
403 403
 
404 404
     // 8. EDDUpsell
405 405
     if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) {
406
-        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { 
407
-            echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
408
-                echo '<div class="monsterinsights-wooedd-upsell-left">';
409
-                    echo '<p><strong>';
410
-                    echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' );
411
-                    echo '</strong></p>';
412
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
413
-                    echo '<p>';
414
-                    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
415
-                    echo '</p>';
416
-                    echo '<p>';
417
-                    echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' );
418
-                    echo '</p>';
419
-                    echo '<p>';
420
-                    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
421
-                    echo '</p>';
422
-                    echo '<p>';
423
-                    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
424
-                    echo '</p>';
425
-                    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="https://www.monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=eddlite">', ' &raquo;</a>' ); 
426
-                    echo '</p>';
427
-                echo '</div><div class="monsterinsights-wooedd-upsell-right">';
428
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
429
-                echo '</div>';
430
-            echo '</div>';
431
-            return;
432
-        }
406
+	if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { 
407
+	    echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
408
+		echo '<div class="monsterinsights-wooedd-upsell-left">';
409
+		    echo '<p><strong>';
410
+		    echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' );
411
+		    echo '</strong></p>';
412
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
413
+		    echo '<p>';
414
+		    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
415
+		    echo '</p>';
416
+		    echo '<p>';
417
+		    echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' );
418
+		    echo '</p>';
419
+		    echo '<p>';
420
+		    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
421
+		    echo '</p>';
422
+		    echo '<p>';
423
+		    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
424
+		    echo '</p>';
425
+		    echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="https://www.monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=eddlite">', ' &raquo;</a>' ); 
426
+		    echo '</p>';
427
+		echo '</div><div class="monsterinsights-wooedd-upsell-right">';
428
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
429
+		echo '</div>';
430
+	    echo '</div>';
431
+	    return;
432
+	}
433 433
     }
434 434
 }
435 435
 add_action( 'admin_notices', 'monsterinsights_admin_setup_notices' );
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
 
35 35
     if ( $dashboards_disabled || ! $is_authed || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) {
36 36
         // If dashboards disabled, first settings page
37
-        add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
37
+        add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
38 38
         $hook = 'monsterinsights_settings';
39 39
 
40 40
         add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' );
41 41
         add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' );
42 42
     } else {
43 43
         // if dashboards enabled, first dashboard
44
-        add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
44
+        add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
45 45
 
46 46
         $hook = 'monsterinsights_reports';
47 47
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     }
84 84
 
85 85
     $hook = 'monsterinsights_network';
86
-    add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page',  plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
86
+    add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' );
87 87
 
88 88
     add_submenu_page( $hook, __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Network Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page' );
89 89
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
     // If lite, show a link where they can get pro from
125 125
     if ( ! monsterinsights_is_pro_version() ) {
126
-        $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="https://www.monsterinsights.com/lite/">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>';
126
+        $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '" href="https://www.monsterinsights.com/lite/">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>';
127 127
         array_unshift( $links, $get_pro );
128 128
     }   
129 129
     
@@ -161,14 +161,14 @@  discard block
 block discarded – undo
161 161
         $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' );
162 162
     
163 163
         if ( file_exists( $dir . $template . '.php' ) ) {
164
-            require_once(  $dir . $template . '.php' );
164
+            require_once( $dir . $template . '.php' );
165 165
             return true;
166 166
         }
167 167
     } else {
168 168
         $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' );
169 169
     
170 170
         if ( file_exists( $dir . $template . '.php' ) ) {
171
-            require_once(  $dir . $template . '.php' );
171
+            require_once( $dir . $template . '.php' );
172 172
             return true;
173 173
         }   
174 174
     }
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' );
177 177
 
178 178
     if ( file_exists( $dir . $template . '.php' ) ) {
179
-        require_once(  $dir . $template . '.php' );
179
+        require_once( $dir . $template . '.php' );
180 180
         return true;
181 181
     }
182 182
                 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         '2xlogo'   => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ),
205 205
     ) );
206 206
 }
207
-add_action( 'in_admin_header','monsterinsights_admin_header', 100 );
207
+add_action( 'in_admin_header', 'monsterinsights_admin_header', 100 );
208 208
 
209 209
 function monsterinsights_welcome_redirect() {
210 210
     // Bail if no activation redirect
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
     }
222 222
 
223 223
     $upgrade = get_option( 'monsterinsights_version_upgraded_from' );
224
-    if( ! $upgrade ) { // First time install
224
+    if ( ! $upgrade ) { // First time install
225 225
         //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
226 226
     } else { // Update
227 227
         return;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     global $current_screen;
243 243
     if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) {
244 244
         $url  = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5';
245
-        $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' .  $url . '" target="_blank" rel="noopener noreferrer">&#9733;&#9733;&#9733;&#9733;&#9733;</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' );
245
+        $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer">&#9733;&#9733;&#9733;&#9733;&#9733;</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' );
246 246
     }
247 247
     return $text;
248 248
 }
@@ -272,8 +272,8 @@  discard block
 block discarded – undo
272 272
     // 1. Google Analytics not authenticated
273 273
     if ( ! is_network_admin() && ! monsterinsights_get_ua() ) {
274 274
         $page = admin_url( 'admin.php?page=monsterinsights_settings' );
275
-        $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' );
276
-        echo '<div class="error"><p>'. $message.'</p></div>';
275
+        $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ), '<a href="' . $page . '">', '</a>' );
276
+        echo '<div class="error"><p>' . $message . '</p></div>';
277 277
         return;
278 278
     }
279 279
 
@@ -281,15 +281,15 @@  discard block
 block discarded – undo
281 281
     $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : '';
282 282
     if ( monsterinsights_is_pro_version() && empty( $key ) ) {
283 283
         $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
284
-        $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' );
285
-        echo '<div class="error"><p>'. $message.'</p></div>';
284
+        $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . esc_url( $page ) . '">', '</a>' );
285
+        echo '<div class="error"><p>' . $message . '</p></div>';
286 286
         return;
287 287
     }
288 288
 
289 289
     // 3. License key not valid/okay for pro
290 290
     if ( monsterinsights_is_pro_version() ) {
291 291
         $message = '';
292
-        if ( MonsterInsights()->license->get_site_license_key() ){
292
+        if ( MonsterInsights()->license->get_site_license_key() ) {
293 293
             if ( MonsterInsights()->license->site_license_expired() ) {
294 294
                 $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
295 295
             } else if ( MonsterInsights()->license->site_license_disabled() ) {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
             }
308 308
         }
309 309
         if ( ! empty( $message ) ) {
310
-            echo '<div class="error"><p>'. $message.'</p></div>';
310
+            echo '<div class="error"><p>' . $message . '</p></div>';
311 311
             return;
312 312
         }
313 313
     }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
     //     }
338 338
     // }
339 339
 
340
-    $notices   = get_option( 'monsterinsights_notices' );
340
+    $notices = get_option( 'monsterinsights_notices' );
341 341
     if ( ! is_array( $notices ) ) {
342 342
         $notices = array();
343 343
     }
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
     $authed   = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed();
347 347
     $url      = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
348 348
 
349
-    if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { 
349
+    if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual'] ) ) { 
350 350
         echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">';
351 351
             echo '<p>';
352
-            echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); 
352
+            echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' ); 
353 353
             echo '</p>';
354 354
         echo '</div>';
355 355
         return;
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 
373 373
     // 7. WooUpsell
374 374
     if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
375
-        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { 
375
+        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available'] ) ) { 
376 376
             echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
377 377
                 echo '<div class="monsterinsights-wooedd-upsell-left">';
378 378
                     echo '<p><strong>';
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
     // 8. EDDUpsell
405 405
     if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) {
406
-        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { 
406
+        if ( ! isset( $notices['monsterinsights_edd_tracking_available'] ) ) { 
407 407
             echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
408 408
                 echo '<div class="monsterinsights-wooedd-upsell-left">';
409 409
                     echo '<p><strong>';
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -221,9 +221,11 @@  discard block
 block discarded – undo
221 221
     }
222 222
 
223 223
     $upgrade = get_option( 'monsterinsights_version_upgraded_from' );
224
-    if( ! $upgrade ) { // First time install
224
+    if( ! $upgrade ) {
225
+// First time install
225 226
         //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
226
-    } else { // Update
227
+    } else {
228
+// Update
227 229
         return;
228 230
         //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit;
229 231
     }
@@ -289,7 +291,7 @@  discard block
 block discarded – undo
289 291
     // 3. License key not valid/okay for pro
290 292
     if ( monsterinsights_is_pro_version() ) {
291 293
         $message = '';
292
-        if ( MonsterInsights()->license->get_site_license_key() ){
294
+        if ( MonsterInsights()->license->get_site_license_key() ) {
293 295
             if ( MonsterInsights()->license->site_license_expired() ) {
294 296
                 $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' );
295 297
             } else if ( MonsterInsights()->license->site_license_disabled() ) {
@@ -346,7 +348,7 @@  discard block
 block discarded – undo
346 348
     $authed   = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed();
347 349
     $url      = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
348 350
 
349
-    if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { 
351
+    if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) {
350 352
         echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">';
351 353
             echo '<p>';
352 354
             echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); 
@@ -372,7 +374,7 @@  discard block
 block discarded – undo
372 374
 
373 375
     // 7. WooUpsell
374 376
     if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
375
-        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { 
377
+        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) {
376 378
             echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
377 379
                 echo '<div class="monsterinsights-wooedd-upsell-left">';
378 380
                     echo '<p><strong>';
@@ -403,7 +405,7 @@  discard block
 block discarded – undo
403 405
 
404 406
     // 8. EDDUpsell
405 407
     if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) {
406
-        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { 
408
+        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) {
407 409
             echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
408 410
                 echo '<div class="monsterinsights-wooedd-upsell-left">';
409 411
                     echo '<p><strong>';
Please login to merge, or discard this patch.
includes/api-request.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -136,21 +136,21 @@  discard block
 block discarded – undo
136 136
 		$this->method    = $method;
137 137
 
138 138
 		$default_token   = ! empty( $args['network'] ) && $args['network'] ? MonsterInsights()->auth->get_network_token() : MonsterInsights()->auth->get_token();
139
-		$default_key     = ! empty( $args['network'] ) && $args['network'] ? MonsterInsights()->auth->get_network_key()   : MonsterInsights()->auth->get_key();
139
+		$default_key     = ! empty( $args['network'] ) && $args['network'] ? MonsterInsights()->auth->get_network_key() : MonsterInsights()->auth->get_key();
140 140
 		
141 141
 		
142
-		$this->token     = ! empty( $args['token'] )     ? $args['token']  : $default_token;
143
-		$this->key       = ! empty( $args['key'] ) 	     ? $args['key']    : $default_key;
144
-		$this->tt        = ! empty( $args['tt'] ) 		 ? $args['tt']     : '';
145
-		$this->return    = ! empty( $args['return'] )    ? $args['return'] : '';
146
-		$this->start     = ! empty( $args['start'] )	 ? $args['start']  : '';
147
-		$this->end       = ! empty( $args['end'] )  	 ? $args['end']    : '';
142
+		$this->token     = ! empty( $args['token'] ) ? $args['token'] : $default_token;
143
+		$this->key       = ! empty( $args['key'] ) ? $args['key'] : $default_key;
144
+		$this->tt        = ! empty( $args['tt'] ) ? $args['tt'] : '';
145
+		$this->return    = ! empty( $args['return'] ) ? $args['return'] : '';
146
+		$this->start     = ! empty( $args['start'] ) ? $args['start'] : '';
147
+		$this->end       = ! empty( $args['end'] ) ? $args['end'] : '';
148 148
 
149 149
 		// We need to do this hack so that the network panel + the site_url of the main site are distinct
150 150
 		$this->site_url  = is_network_admin() ? network_admin_url() : site_url();
151 151
 
152 152
 		if ( monsterinsights_is_pro_version() ) {
153
-			$this->license   = is_network_admin() || ( ! empty( $args['network'] ) && $args['network'] ) ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key();
153
+			$this->license = is_network_admin() || ( ! empty( $args['network'] ) && $args['network'] ) ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key();
154 154
 		}
155 155
 		$this->plugin    = MonsterInsights()->plugin_slug;
156 156
 		$this->miversion = MONSTERINSIGHTS_VERSION;
@@ -220,12 +220,12 @@  discard block
 block discarded – undo
220 220
 		}
221 221
 
222 222
 		if ( 'GET' == $this->method ) {
223
-			$body['time']   = time(); // just to avoid caching
223
+			$body['time'] = time(); // just to avoid caching
224 224
 		}
225 225
 
226
-		$body['timezone'] = date('e');
226
+		$body['timezone'] = date( 'e' );
227 227
 
228
-		$body['ip']   = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : '';
228
+		$body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : '';
229 229
 
230 230
 		// This filter will be removed in the future.
231 231
 		$body   = apply_filters( 'monsterinsights_api_request_body', $body );
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 
270 270
 		// If not a 200 status header, send back error.
271 271
 		if ( 200 != $response_code ) {
272
-			$type  = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error';
272
+			$type = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error';
273 273
 			
274 274
 			if ( empty( $response_code ) ) {
275 275
 				return new WP_Error( $type, __( 'The API was unreachable.', 'google-analytics-for-wordpress' ) );
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 						'body'          => ''
375 375
 					);
376 376
 					$response = wp_remote_get( $testurl, $params );
377
-					if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
377
+					if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
378 378
 						return false;
379 379
 					} else {
380 380
 						return true;
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 			);
393 393
 			$response = wp_remote_get( $testurl, $params );
394 394
 			
395
-			if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
395
+			if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
396 396
 				return false;
397 397
 			} else {
398 398
 				return true;
Please login to merge, or discard this patch.
includes/admin/reports/overview.php 2 patches
Braces   +2 added lines, -2 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
 			?>
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 						foreach( $data['countries'] as $icountry => $countrydata ) {
509 509
 							if ( ! empty( $countries[ $countrydata['iso'] ] ) ) {
510 510
 								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>';
511
-							} else { 
511
+							} else {
512 512
 								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>';
513 513
 							}
514 514
 							$i++;
Please login to merge, or discard this 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/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/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/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.