Passed
Push — master ( e64af5...ad1bda )
by Chris
03:25
created
includes/frontend/class-tracking-abstract.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      * @return array Array of the options to use.
59 59
      */
60 60
     public function frontend_tracking_options( ) {
61
-        return array();
61
+	return array();
62 62
     }
63 63
 
64 64
     /**
@@ -74,6 +74,6 @@  discard block
 block discarded – undo
74 74
      * @return string Javascript to output.
75 75
      */
76 76
     public function frontend_output( ) {
77
-         return "<!-- MonsterInsights Abstract Tracking class -->";
77
+	 return "<!-- MonsterInsights Abstract Tracking class -->";
78 78
     }
79 79
 }
80 80
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/pages/settings.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -19,32 +19,32 @@  discard block
 block discarded – undo
19 19
     global $admin_page_hooks;
20 20
    
21 21
     if ( ! is_object( $current_screen ) || empty( $current_screen->id ) || empty( $admin_page_hooks ) ) {
22
-        return false;
22
+	return false;
23 23
     }
24 24
 
25 25
     $settings_page = false;
26 26
     if ( ! empty( $admin_page_hooks['monsterinsights_settings'] ) && $current_screen->id === $admin_page_hooks['monsterinsights_settings'] ) {
27
-        $settings_page = true;
27
+	$settings_page = true;
28 28
     }
29 29
 
30 30
     if ( ! empty( $admin_page_hooks['monsterinsights_reports'] ) && $current_screen->id === $admin_page_hooks['monsterinsights_reports'] ) {
31
-        $settings_page = true;
31
+	$settings_page = true;
32 32
     }
33 33
 
34 34
     if ( $current_screen->id === 'toplevel_page_monsterinsights_settings' ) {
35
-        $settings_page = true;
35
+	$settings_page = true;
36 36
     }
37 37
 
38 38
     if ( $current_screen->id === 'insights_page_monsterinsights_settings' ) {
39
-        $settings_page = true;
39
+	$settings_page = true;
40 40
     }
41 41
 
42 42
     if ( $current_screen->id === 'insights_page_monsterinsights_tracking' ) {
43
-        $settings_page = true;
43
+	$settings_page = true;
44 44
     }
45 45
 
46 46
     if ( ! empty( $current_screen->base ) && strpos( $current_screen->base, 'monsterinsights_network' ) !== false ) {
47
-        $settings_page = true;
47
+	$settings_page = true;
48 48
     }
49 49
    
50 50
     return $settings_page;
@@ -106,31 +106,31 @@  discard block
 block discarded – undo
106 106
 function monsterinsights_save_general_settings_page() {
107 107
 
108 108
     if ( ! monsterinsights_is_settings_page() ) {
109
-        return;
109
+	return;
110 110
     }
111 111
 
112 112
     // Check if user pressed the 'Update' button and nonce is valid
113 113
     if ( ! isset( $_POST['monsterinsights-settings-submit'] ) ) {
114
-        return;
114
+	return;
115 115
     }
116 116
 
117 117
     if ( ! wp_verify_nonce( $_POST['monsterinsights-settings-nonce'], 'monsterinsights-settings-nonce' ) ) {
118
-        return;
118
+	return;
119 119
     }
120 120
 
121 121
     if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
122
-        return;
122
+	return;
123 123
     }
124 124
 
125 125
     if ( ! empty( $_POST['monsterinsights_settings_tab'] ) && $_POST['monsterinsights_settings_tab'] === 'general' ) {
126
-        /** 
127
-         * Developer Alert:
128
-         *
129
-         * Per the README, this is considered an internal hook and should
130
-         * not be used by other developers. This hook's behavior may be modified
131
-         * or the hook may be removed at any time, without warning.
132
-         */
133
-        do_action( 'monsterinsights_settings_save_general' );
126
+	/** 
127
+	 * Developer Alert:
128
+	 *
129
+	 * Per the README, this is considered an internal hook and should
130
+	 * not be used by other developers. This hook's behavior may be modified
131
+	 * or the hook may be removed at any time, without warning.
132
+	 */
133
+	do_action( 'monsterinsights_settings_save_general' );
134 134
     }
135 135
 }
136 136
 add_action( 'current_screen', 'monsterinsights_save_general_settings_page' );
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             <?php echo esc_html__( 'General', 'google-analytics-for-wordpress' ); ?>
80 80
         </a>
81 81
 
82
-        <a class="monsterinsights-main-nav-item monsterinsights-nav-item" href="<?php echo admin_url('admin.php?page=monsterinsights_tracking#monsterinsights-main-tab-tracking?monsterinsights-sub-tab-engagement');?>" title="<?php echo esc_attr( __( 'Tracking', 'google-analytics-for-wordpress' ) ); ?>">
82
+        <a class="monsterinsights-main-nav-item monsterinsights-nav-item" href="<?php echo admin_url( 'admin.php?page=monsterinsights_tracking#monsterinsights-main-tab-tracking?monsterinsights-sub-tab-engagement' ); ?>" title="<?php echo esc_attr( __( 'Tracking', 'google-analytics-for-wordpress' ) ); ?>">
83 83
             <?php echo esc_html__( 'Tracking', 'google-analytics-for-wordpress' ); ?>
84 84
         </a>
85 85
     </h1>
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
     ob_start();
179 179
     ?>
180 180
     <tr id="monsterinsights-input-<?php echo esc_attr( $option_class ); ?>">
181
-        <?php if ( !empty ( $title ) ) { ?>
181
+        <?php if ( ! empty ( $title ) ) { ?>
182 182
         <th scope="row">
183 183
             <label for="monsterinsights-<?php echo esc_attr( $option_class ); ?>"><?php echo $title; ?></label>
184 184
         </th>
Please login to merge, or discard this patch.
includes/admin/pages/tracking.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     <h1 id="monsterinsights-settings-page-main-nav" class="monsterinsights-main-nav-container monsterinsights-nav-container" data-container="#monsterinsights-settings-pages">
39 39
         <a class="monsterinsights-main-nav-item monsterinsights-nav-item monsterinsights-spacing-item" href="#">&nbsp;</a>
40 40
 
41
-        <a class="monsterinsights-main-nav-item monsterinsights-nav-item" href="<?php echo admin_url('admin.php?page=monsterinsights_settings');?>" title="<?php echo esc_attr( __( 'General', 'google-analytics-for-wordpress' ) ); ?>">
41
+        <a class="monsterinsights-main-nav-item monsterinsights-nav-item" href="<?php echo admin_url( 'admin.php?page=monsterinsights_settings' ); ?>" title="<?php echo esc_attr( __( 'General', 'google-analytics-for-wordpress' ) ); ?>">
42 42
             <?php echo esc_html__( 'General', 'google-analytics-for-wordpress' ); ?>
43 43
         </a>
44 44
 
Please login to merge, or discard this patch.
includes/admin/capabilities.php 2 patches
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -35,54 +35,54 @@
 block discarded – undo
35 35
 function monsterinsights_add_capabilities( $caps, $cap, $user_id, $args ) {
36 36
  
37 37
     switch( $cap ) {
38
-        case 'monsterinsights_view_dashboard' :
39
-            $roles = monsterinsights_get_option( 'view_reports', array() );
38
+	case 'monsterinsights_view_dashboard' :
39
+	    $roles = monsterinsights_get_option( 'view_reports', array() );
40 40
 
41
-            $user_can_via_settings = false;
42
-            if ( ! empty( $roles ) && is_array( $roles ) ) {
43
-                foreach ( $roles as $role ) {
44
-                    if ( is_string( $role ) ) {
45
-                        if ( user_can( $user_id, $role ) ) {
46
-                            $user_can_via_settings = true;
47
-                            break;
48
-                        }
49
-                    }
50
-                }
51
-            } else if ( ! empty( $roles ) && is_string( $roles ) ) {
52
-                if ( user_can( $user_id, $roles ) ) {
53
-                    $user_can_via_settings = true;
54
-                }
55
-            }
41
+	    $user_can_via_settings = false;
42
+	    if ( ! empty( $roles ) && is_array( $roles ) ) {
43
+		foreach ( $roles as $role ) {
44
+		    if ( is_string( $role ) ) {
45
+			if ( user_can( $user_id, $role ) ) {
46
+			    $user_can_via_settings = true;
47
+			    break;
48
+			}
49
+		    }
50
+		}
51
+	    } else if ( ! empty( $roles ) && is_string( $roles ) ) {
52
+		if ( user_can( $user_id, $roles ) ) {
53
+		    $user_can_via_settings = true;
54
+		}
55
+	    }
56 56
 
57
-            if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) {
58
-                $caps = array();
59
-            }
57
+	    if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) {
58
+		$caps = array();
59
+	    }
60 60
             
61
-            break;
62
-         case 'monsterinsights_save_settings' :
63
-            $roles = monsterinsights_get_option( 'save_settings', array() );
61
+	    break;
62
+	 case 'monsterinsights_save_settings' :
63
+	    $roles = monsterinsights_get_option( 'save_settings', array() );
64 64
 
65
-            $user_can_via_settings = false;
66
-            if ( ! empty( $roles ) && is_array( $roles ) ) {
67
-                foreach ( $roles as $role ) {
68
-                    if ( is_string( $role ) ) {
69
-                        if ( user_can( $user_id, $role ) ) {
70
-                            $user_can_via_settings = true;
71
-                            break;
72
-                        }
73
-                    }
74
-                }
75
-            } else if ( ! empty( $roles ) && is_string( $roles ) ) {
76
-                 if ( user_can( $user_id, $roles ) ) {
77
-                    $user_can_via_settings = true;
78
-                }
79
-            }
65
+	    $user_can_via_settings = false;
66
+	    if ( ! empty( $roles ) && is_array( $roles ) ) {
67
+		foreach ( $roles as $role ) {
68
+		    if ( is_string( $role ) ) {
69
+			if ( user_can( $user_id, $role ) ) {
70
+			    $user_can_via_settings = true;
71
+			    break;
72
+			}
73
+		    }
74
+		}
75
+	    } else if ( ! empty( $roles ) && is_string( $roles ) ) {
76
+		 if ( user_can( $user_id, $roles ) ) {
77
+		    $user_can_via_settings = true;
78
+		}
79
+	    }
80 80
 
81
-            if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) {
82
-                $caps = array();
83
-            }
81
+	    if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) {
82
+		$caps = array();
83
+	    }
84 84
 
85
-            break;
85
+	    break;
86 86
     }
87 87
     return $caps;
88 88
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
  */
35 35
 function monsterinsights_add_capabilities( $caps, $cap, $user_id, $args ) {
36 36
  
37
-    switch( $cap ) {
37
+    switch ( $cap ) {
38 38
         case 'monsterinsights_view_dashboard' :
39 39
             $roles = monsterinsights_get_option( 'view_reports', array() );
40 40
 
@@ -86,4 +86,4 @@  discard block
 block discarded – undo
86 86
     }
87 87
     return $caps;
88 88
 }
89
-add_filter( 'map_meta_cap','monsterinsights_add_capabilities', 10, 4 );
90 89
\ No newline at end of file
90
+add_filter( 'map_meta_cap', 'monsterinsights_add_capabilities', 10, 4 );
91 91
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/reporting.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
 	}
26 26
 
27
-	public function add_report( $report = false ){
27
+	public function add_report( $report = false ) {
28 28
 		if ( empty( $report ) || ! is_object( $report ) ) {
29 29
 			return;
30 30
 		}
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
 	}
26 26
 
27
-	public function add_report( $report = false ){
27
+	public function add_report( $report = false ) {
28 28
 		if ( empty( $report ) || ! is_object( $report ) ) {
29 29
 			return;
30 30
 		}
Please login to merge, or discard this patch.
includes/admin/reports/abstract-report.php 2 patches
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 	}
35 35
 
36 36
 	// Let's get the HTML to output for a particular report. This is not the AJAX endpoint. Args can hold things (generally start/end date range)
37
-	protected function get_report_html( $args = array() ) { 
37
+	protected function get_report_html( $args = array() ) {
38 38
 		/* Defined in the report class */ 
39 39
 		// For ajax, args start, end, and data will be set with the data to use. Else call $this->get_data( array( 'default' => true ) )
40 40
 		return ''; 
41 41
 	}
42 42
 
43
-	public function additional_data(){
43
+	public function additional_data() {
44 44
 		return array();
45 45
 	}
46 46
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 			return monsterinsights_get_message( 'error', esc_html__( 'Access denied' , 'google-analytics-for-wordpress' ) );
55 55
 		}
56 56
 
57
-		if ( monsterinsights_get_option( 'dashboard_disabled', false ) ) { 
57
+		if ( monsterinsights_get_option( 'dashboard_disabled', false ) ) {
58 58
 			if ( current_user_can( 'monsterinsights_save_settings' ) ) {
59 59
 				$url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_settings' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
60 60
 				return monsterinsights_get_message( 'error',
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 			}
70 70
 		}
71 71
 
72
-		if ( monsterinsights_is_pro_version() ){
72
+		if ( monsterinsights_is_pro_version() ) {
73 73
 			if ( ! MonsterInsights()->license->has_license() ) {
74 74
 				$url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_settings' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
75 75
 				return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ),'<a href="' . $url . '">','</a>' );
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 if ( ! class_exists( 'MonsterInsightsDateTime' ) ) {
352 352
 	class MonsterInsightsDateTime extends DateTime {
353 353
 		public static function createFromFormat( $format, $time, $timezone = null ) {
354
-			if ( ! $timezone ) { 
354
+			if ( ! $timezone ) {
355 355
 				$timezone = new DateTimeZone( date_default_timezone_get() );
356 356
 			}
357 357
 			if ( version_compare( PHP_VERSION, '5.3', '>=' ) ) {
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @since 6.0.0
31 31
 	 */
32 32
 	public function __construct() {
33
-		add_filter( 'monsterinsights_reports_abstract_get_data_pre_cache', array( $this, 'requirements' ), 10 , 3 );
33
+		add_filter( 'monsterinsights_reports_abstract_get_data_pre_cache', array( $this, 'requirements' ), 10, 3 );
34 34
 	}
35 35
 
36 36
 	// Let's get the HTML to output for a particular report. This is not the AJAX endpoint. Args can hold things (generally start/end date range)
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		return ''; 
41 41
 	}
42 42
 
43
-	public function additional_data(){
43
+	public function additional_data() {
44 44
 		return array();
45 45
 	}
46 46
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	public function show_report( $args = array() ) {
52 52
 
53 53
 		if ( ! current_user_can( 'monsterinsights_view_dashboard' ) ) {
54
-			return monsterinsights_get_message( 'error', esc_html__( 'Access denied' , 'google-analytics-for-wordpress' ) );
54
+			return monsterinsights_get_message( 'error', esc_html__( 'Access denied', 'google-analytics-for-wordpress' ) );
55 55
 		}
56 56
 
57 57
 		if ( monsterinsights_get_option( 'dashboard_disabled', false ) ) { 
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 			}
70 70
 		}
71 71
 
72
-		if ( monsterinsights_is_pro_version() ){
72
+		if ( monsterinsights_is_pro_version() ) {
73 73
 			if ( ! MonsterInsights()->license->has_license() ) {
74 74
 				$url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_settings' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
75
-				return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ),'<a href="' . $url . '">','</a>' );
75
+				return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' );
76 76
 			} else if ( MonsterInsights()->license->license_has_error() ) {
77 77
 				return monsterinsights_get_message( 'error', $this->get_license_error() );
78 78
 			}
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
 			return monsterinsights_get_message( 'error', $args['error'] );
108 108
 		}
109 109
 
110
-		if ( empty( $args['data' ] ) || ! is_array( $args['data' ] ) ) {
110
+		if ( empty( $args['data'] ) || ! is_array( $args['data'] ) ) {
111 111
 			if ( monsterinsights_is_pro_version() ) {
112 112
 				return '';
113 113
 			} else {
114 114
 				// Try to get default data.
115 115
 				$args = $this->get_data( array( 'default' => true ) );
116
-				if ( empty( $args['data'] ) || is_array( $args['data' ] ) ) {
116
+				if ( empty( $args['data'] ) || is_array( $args['data'] ) ) {
117 117
 					return monsterinsights_get_message( 'error', __( 'No data found', 'google-analytics-for-wordpress' ) );
118 118
 				}
119 119
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		}
148 148
 		
149 149
 		$start = ! empty( $args['start'] ) && $this->is_valid_date( $args['start'] ) ? $args['start'] : '';
150
-		$end   = ! empty( $args['end'] )   && $this->is_valid_date( $args['end'] )   ? $args['end']   : '';
150
+		$end   = ! empty( $args['end'] ) && $this->is_valid_date( $args['end'] ) ? $args['end'] : '';
151 151
 
152 152
 		if ( ! MonsterInsights()->license->license_can( $this->level ) ) {
153 153
 			return array(
@@ -202,11 +202,11 @@  discard block
 block discarded – undo
202 202
 				$data = ! $site_auth && $ms_auth ? get_site_transient( $transient ) : get_transient( $transient );
203 203
 			}
204 204
 
205
-			if ( ! empty( $data )             &&
206
-				 ! empty( $data['expires'] )  &&
205
+			if ( ! empty( $data ) &&
206
+				 ! empty( $data['expires'] ) &&
207 207
 				   $data['expires'] >= time() &&
208
-				 ! empty( $data['data'] )     && 
209
-				 ! empty( $data['p'] )        && 
208
+				 ! empty( $data['data'] ) && 
209
+				 ! empty( $data['p'] ) && 
210 210
 				   $data['p'] === $p
211 211
 			) {
212 212
 				return array(
@@ -216,12 +216,12 @@  discard block
 block discarded – undo
216 216
 			}
217 217
 
218 218
 			// Nothing in cache, either not saved before, expired or mismatch. Let's grab from API
219
-			$api_options = array( 'start' => $start, 'end' => $end);
219
+			$api_options = array( 'start' => $start, 'end' => $end );
220 220
 			if ( ! $site_auth && $ms_auth ) {
221 221
 				$api_options['network'] = true;
222 222
 			}
223 223
 			
224
-			$api   = new MonsterInsights_API_Request( 'analytics/reports/' . $this->name . '/', $api_options, 'GET' );
224
+			$api = new MonsterInsights_API_Request( 'analytics/reports/' . $this->name . '/', $api_options, 'GET' );
225 225
 
226 226
 			$additional_data = $this->additional_data();
227 227
 			
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 				$api->set_additional_data( $additional_data );
230 230
 			}
231 231
 			
232
-			$ret   = $api->request();
232
+			$ret = $api->request();
233 233
 			//echo print_r( $ret['data']);wp_die();
234 234
 			
235 235
 			if ( is_wp_error( $ret ) ) {
@@ -290,44 +290,44 @@  discard block
 block discarded – undo
290 290
 	// Is a valid date value
291 291
 	public function is_valid_date( $date = '' ) {
292 292
 		$d = MonsterInsightsDateTime::createFromFormat( 'Y-m-d', $date );
293
-		return $d && $d->format('Y-m-d') === $date;
293
+		return $d && $d->format( 'Y-m-d' ) === $date;
294 294
 	}
295 295
 
296 296
 	/**
297 297
 	 * Do not use the functions below this. They are unused and are just here so people
298 298
 	 * with out of date MonsterInsights addons won't get fatal errors.
299 299
 	 */
300
-	protected function get_api_max_limit() {return 300;}
301
-	protected function get_date_range() {return array();}
300
+	protected function get_api_max_limit() {return 300; }
301
+	protected function get_date_range() {return array(); }
302 302
 
303 303
 	public function get_upsell_notice() {
304 304
 		$has_level = MonsterInsights()->license->get_license_type();
305 305
 		$has_level = $has_level ? $has_level : 'lite';
306 306
 		$message = sprintf( __( 'You currently have a %s level license, but this report requires at least a %s level license to view the %s. Please upgrade to view this report.', 'google-analytics-for-wordpress' ), $has_level, $this->level, $this->title );
307
-		ob_start();?>
308
-		<div class="monsterinsights-upsell-report-container monsterinsights-upsell-report-<?php echo $this->name;?>-bg">
307
+		ob_start(); ?>
308
+		<div class="monsterinsights-upsell-report-container monsterinsights-upsell-report-<?php echo $this->name; ?>-bg">
309 309
 			<div class="monsterinsights-upsell-container">
310 310
 		  		<div class="row justify-content-center">
311 311
 					<div class="col-lg-10 col-lg-offset-1 align-self-center">
312 312
 						<div class="monsterinsights-upsell-card">
313
-							  <img class="monsterinsights-upgrade-mascot" src="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL );?>assets/css/images/mascot.png" srcset="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL );?>assets/css/images/[email protected] 2x" alt="">
313
+							  <img class="monsterinsights-upgrade-mascot" src="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ); ?>assets/css/images/mascot.png" srcset="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ); ?>assets/css/images/[email protected] 2x" alt="">
314 314
 								<div class="monsterinsights-upsell-card-card-content">
315
-								  <span class="monsterinsights-upsell-card-title"><?php esc_html_e( 'Ready to Get Analytics Super-Powers?', 'google-analytics-for-wordpress' );?></span>
316
-								  <p class="monsterinsights-upsell-card-subtitle"><strong><?php esc_html_e( '(And Crush Your Competition?)', 'google-analytics-for-wordpress' );?></strong></p> &nbsp;
315
+								  <span class="monsterinsights-upsell-card-title"><?php esc_html_e( 'Ready to Get Analytics Super-Powers?', 'google-analytics-for-wordpress' ); ?></span>
316
+								  <p class="monsterinsights-upsell-card-subtitle"><strong><?php esc_html_e( '(And Crush Your Competition?)', 'google-analytics-for-wordpress' ); ?></strong></p> &nbsp;
317 317
 								  <?php if ( monsterinsights_is_pro_version() ) { ?>
318 318
 									  <p ><?php echo sprintf( esc_html__( "Hey there! It looks like you've got the %s license installed on your site.
319
-									  That's awesome! %s",'google-analytics-for-wordpress'), $has_level, '<span class="dashicons dashicons-smiley"></span>' ); ?></p>
319
+									  That's awesome! %s",'google-analytics-for-wordpress' ), $has_level, '<span class="dashicons dashicons-smiley"></span>' ); ?></p>
320 320
 									   &nbsp;
321
-									  <p><?php echo sprintf( esc_html__( "Do you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with the %s level%s of our paid packages. You'll need to upgrade your license to get instant access.",'google-analytics-for-wordpress'), '<strong>' . $this->title, '</strong>','<strong><a href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) .'">' . $this->level,'</a></strong>' ); ?></p>
322
-									   &nbsp;<p><?php echo sprintf( esc_html__( "It's easy! To upgrade, navigate to %sMy Account%s on MonsterInsights.com, go to the licenses tab, and click upgrade. We also have a %sstep by step guide%s with pictures of this process.",'google-analytics-for-wordpress'), '<a href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) .'"><strong>','</strong></a>', '<a href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://www.monsterinsights.com/docs/upgrade-monsterinsights-license/' ) .'" style="text-decoration:underline !important">', '</a>' ); ?></p>
323
-									   &nbsp;<p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress');?></p>
321
+									  <p><?php echo sprintf( esc_html__( "Do you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with the %s level%s of our paid packages. You'll need to upgrade your license to get instant access.", 'google-analytics-for-wordpress' ), '<strong>' . $this->title, '</strong>', '<strong><a href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) . '">' . $this->level, '</a></strong>' ); ?></p>
322
+									   &nbsp;<p><?php echo sprintf( esc_html__( "It's easy! To upgrade, navigate to %sMy Account%s on MonsterInsights.com, go to the licenses tab, and click upgrade. We also have a %sstep by step guide%s with pictures of this process.", 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) . '"><strong>', '</strong></a>', '<a href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://www.monsterinsights.com/docs/upgrade-monsterinsights-license/' ) . '" style="text-decoration:underline !important">', '</a>' ); ?></p>
323
+									   &nbsp;<p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress' ); ?></p>
324 324
 									<?php } else { ?>
325 325
 									   <p><?php echo sprintf( esc_html__( "Hey there! %s It looks like you've got the free version of MonsterInsights installed on your site.
326
-									  That's awesome!",'google-analytics-for-wordpress'), '<span class="dashicons dashicons-smiley"></span>' ); ?></p>
326
+									  That's awesome!",'google-analytics-for-wordpress' ), '<span class="dashicons dashicons-smiley"></span>' ); ?></p>
327 327
 									   &nbsp;
328
-									  <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. To get instant access, you'll want to buy a MonsterInsights license, which also gives you access to powerful addons, expanded reporting (including the ability to use custom date ranges), comprehensive tracking features (like UserID tracking) and access to our world-class support team.",'google-analytics-for-wordpress'), '<strong>' . $this->title, '</strong>','<a href="'. monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) .'">' . $this->level,'</a>' ); ?></p>
329
-									   &nbsp;<p><?php echo sprintf( esc_html__( "Upgrading is easy! To upgrade, navigate to %sour pricing page%s, purchase the required license, and then follow the %sinstructions in the email receipt%s to upgrade. It only takes a few minutes to unlock the most powerful, yet easy to use analytics tracking system for WordPress.",'google-analytics-for-wordpress'), '<a href="'. monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) .'"><strong>', '</strong></a>','<a style="text-decoration:underline !important" href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-go-lite-pro-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) .'">', '</a>' ); ?></p>
330
-									   &nbsp;<p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress');?></p>
328
+									  <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. To get instant access, you'll want to buy a MonsterInsights license, which also gives you access to powerful addons, expanded reporting (including the ability to use custom date ranges), comprehensive tracking features (like UserID tracking) and access to our world-class support team.", 'google-analytics-for-wordpress' ), '<strong>' . $this->title, '</strong>', '<a href="' . monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) . '">' . $this->level, '</a>' ); ?></p>
329
+									   &nbsp;<p><?php echo sprintf( esc_html__( "Upgrading is easy! To upgrade, navigate to %sour pricing page%s, purchase the required license, and then follow the %sinstructions in the email receipt%s to upgrade. It only takes a few minutes to unlock the most powerful, yet easy to use analytics tracking system for WordPress.", 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) . '"><strong>', '</strong></a>', '<a style="text-decoration:underline !important" href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-go-lite-pro-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) . '">', '</a>' ); ?></p>
330
+									   &nbsp;<p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress' ); ?></p>
331 331
 									<?php } ?>
332 332
 								</div>
333 333
 								<div class="monsterinsights-upsell-card-action">
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 	 * @return string
366 366
 	 */
367 367
 	public function get_addons_page_link() {
368
-		$addons_url    = add_query_arg( 'page', 'monsterinsights_addons', admin_url( 'admin.php' ) );
368
+		$addons_url = add_query_arg( 'page', 'monsterinsights_addons', admin_url( 'admin.php' ) );
369 369
 		return sprintf( '<a href="%1$s">%2$s</a>', $addons_url, esc_html__( 'Visit addons page', 'google-analytics-for-wordpress' ) );
370 370
 	}
371 371
 
Please login to merge, or discard this patch.
includes/admin/licensing/license-actions.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -171,14 +171,14 @@
 block discarded – undo
171 171
 
172 172
         // If a key or author error is returned, the license no longer exists or the user has been deleted, so reset license.
173 173
         if ( isset( $validate->key ) || isset( $validate->author ) ) {
174
-            $option['is_invalid']  = true;
174
+            $option['is_invalid'] = true;
175 175
             is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
176 176
             return;
177 177
         }
178 178
 
179 179
         // If the license has expired, set the transient and expired flag and return.
180 180
         if ( isset( $validate->expired ) ) {
181
-            $option['is_expired']  = true;
181
+            $option['is_expired'] = true;
182 182
             is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
183 183
             return;
184 184
         }
Please login to merge, or discard this patch.
Indentation   +196 added lines, -196 removed lines patch added patch discarded remove patch
@@ -47,27 +47,27 @@  discard block
 block discarded – undo
47 47
      * @since 6.0.0
48 48
      */
49 49
     public function __construct() {
50
-        add_action( 'admin_init', array( $this, 'admin_init' ) );
50
+	add_action( 'admin_init', array( $this, 'admin_init' ) );
51 51
     }
52 52
     
53 53
     public function admin_init() {
54
-        // Possibly verify the key.
55
-        $this->maybe_verify_key();
56
-
57
-        // Add potential admin notices for actions around the admin.
58
-        add_action( 'admin_notices', array( $this, 'monsterinsights_notices' ), 11 );
59
-        add_action( 'network_admin_notices', array( $this, 'monsterinsights_notices' ), 11 );
60
-
61
-        // Grab the license key. If it is not set (even after verification), return early.
62
-        $this->key = is_network_admin() ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key();
63
-        if ( ! $this->key ) {
64
-            return;
65
-        }
66
-
67
-        // Possibly handle validating, deactivating and refreshing license keys.
68
-        $this->maybe_validate_key();
69
-        $this->maybe_deactivate_key();
70
-        $this->maybe_refresh_key();
54
+	// Possibly verify the key.
55
+	$this->maybe_verify_key();
56
+
57
+	// Add potential admin notices for actions around the admin.
58
+	add_action( 'admin_notices', array( $this, 'monsterinsights_notices' ), 11 );
59
+	add_action( 'network_admin_notices', array( $this, 'monsterinsights_notices' ), 11 );
60
+
61
+	// Grab the license key. If it is not set (even after verification), return early.
62
+	$this->key = is_network_admin() ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key();
63
+	if ( ! $this->key ) {
64
+	    return;
65
+	}
66
+
67
+	// Possibly handle validating, deactivating and refreshing license keys.
68
+	$this->maybe_validate_key();
69
+	$this->maybe_deactivate_key();
70
+	$this->maybe_refresh_key();
71 71
     }
72 72
 
73 73
     /**
@@ -79,19 +79,19 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function maybe_verify_key() {
81 81
 
82
-        if ( empty( $_POST['monsterinsights-license-key'] ) || strlen( $_POST['monsterinsights-license-key'] ) < 10 || empty( $_POST['monsterinsights-verify-submit'] ) ) {
83
-            return;
84
-        }
82
+	if ( empty( $_POST['monsterinsights-license-key'] ) || strlen( $_POST['monsterinsights-license-key'] ) < 10 || empty( $_POST['monsterinsights-verify-submit'] ) ) {
83
+	    return;
84
+	}
85 85
 
86
-        if ( ! wp_verify_nonce( $_POST['monsterinsights-key-nonce'], 'monsterinsights-key-nonce' ) ) {
87
-            return;
88
-        }
86
+	if ( ! wp_verify_nonce( $_POST['monsterinsights-key-nonce'], 'monsterinsights-key-nonce' ) ) {
87
+	    return;
88
+	}
89 89
 
90
-        if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
91
-            return;
92
-        }
90
+	if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
91
+	    return;
92
+	}
93 93
 
94
-        $this->verify_key();
94
+	$this->verify_key();
95 95
 
96 96
     }
97 97
 
@@ -102,33 +102,33 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public function verify_key() {
104 104
 
105
-        // Perform a request to verify the key.
106
-        $verify = $this->perform_remote_request( 'verify-key', array( 'tgm-updater-key' => trim( $_POST['monsterinsights-license-key'] ) ) );
107
-
108
-        // If it returns false, send back a generic error message and return.
109
-        if ( ! $verify ) {
110
-            $this->errors[] = esc_html__( 'There was an error connecting to the remote key API. Please try again later.', 'google-analytics-for-wordpress' );
111
-            return;
112
-        }
113
-
114
-        // If an error is returned, set the error and return.
115
-        if ( ! empty( $verify->error ) ) {
116
-            $this->errors[] = $verify->error;
117
-            return;
118
-        }
119
-
120
-        // Otherwise, our request has been done successfully. Update the option and set the success message.
121
-        $option                = is_network_admin() ? MonsterInsights()->license->get_network_license() : MonsterInsights()->license->get_site_license();
122
-        $option['key']         = trim( $_POST['monsterinsights-license-key'] );
123
-        $option['type']        = isset( $verify->type ) ? $verify->type : $option['type'];
124
-        $option['is_expired']  = false;
125
-        $option['is_disabled'] = false;
126
-        $option['is_invalid']  = false;
127
-        $this->success[]       = isset( $verify->success ) ? $verify->success : esc_html__( 'Congratulations! This site is now receiving automatic updates.', 'google-analytics-for-wordpress' );
128
-        is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
129
-        delete_transient( '_monsterinsights_addons' );
130
-        monsterinsights_get_addons_data( $option['key'] );
131
-        // Make sure users can now update their plugins if they previously an expired key.
105
+	// Perform a request to verify the key.
106
+	$verify = $this->perform_remote_request( 'verify-key', array( 'tgm-updater-key' => trim( $_POST['monsterinsights-license-key'] ) ) );
107
+
108
+	// If it returns false, send back a generic error message and return.
109
+	if ( ! $verify ) {
110
+	    $this->errors[] = esc_html__( 'There was an error connecting to the remote key API. Please try again later.', 'google-analytics-for-wordpress' );
111
+	    return;
112
+	}
113
+
114
+	// If an error is returned, set the error and return.
115
+	if ( ! empty( $verify->error ) ) {
116
+	    $this->errors[] = $verify->error;
117
+	    return;
118
+	}
119
+
120
+	// Otherwise, our request has been done successfully. Update the option and set the success message.
121
+	$option                = is_network_admin() ? MonsterInsights()->license->get_network_license() : MonsterInsights()->license->get_site_license();
122
+	$option['key']         = trim( $_POST['monsterinsights-license-key'] );
123
+	$option['type']        = isset( $verify->type ) ? $verify->type : $option['type'];
124
+	$option['is_expired']  = false;
125
+	$option['is_disabled'] = false;
126
+	$option['is_invalid']  = false;
127
+	$this->success[]       = isset( $verify->success ) ? $verify->success : esc_html__( 'Congratulations! This site is now receiving automatic updates.', 'google-analytics-for-wordpress' );
128
+	is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
129
+	delete_transient( '_monsterinsights_addons' );
130
+	monsterinsights_get_addons_data( $option['key'] );
131
+	// Make sure users can now update their plugins if they previously an expired key.
132 132
 	    wp_clean_plugins_cache( true );
133 133
     }
134 134
 
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
      * @return null Return early if the transient has not expired yet.
141 141
      */
142 142
     public function maybe_validate_key() {
143
-        $check = is_network_admin() ? MonsterInsights()->license->time_to_check_network_license() : MonsterInsights()->license->time_to_check_site_license();
144
-        if ( $check ) {
145
-            $this->validate_key();
146
-        }
143
+	$check = is_network_admin() ? MonsterInsights()->license->time_to_check_network_license() : MonsterInsights()->license->time_to_check_site_license();
144
+	if ( $check ) {
145
+	    $this->validate_key();
146
+	}
147 147
     }
148 148
 
149 149
     /**
@@ -155,58 +155,58 @@  discard block
 block discarded – undo
155 155
      */
156 156
     public function validate_key( $forced = false ) {
157 157
 
158
-        $validate = $this->perform_remote_request( 'validate-key', array( 'tgm-updater-key' => $this->key ) );
159
-
160
-        // If there was a basic API error in validation, only set the transient for 10 minutes before retrying.
161
-        if ( ! $validate ) {
162
-            // If forced, set contextual success message.
163
-            if ( $forced ) {
164
-                $this->errors[] = esc_html__( 'There was an error connecting to the remote key API. Please try again later.', 'google-analytics-for-wordpress' );
165
-            }
166
-            return;
167
-        }
168
-
169
-        $option = is_network_admin() ? MonsterInsights()->license->get_network_license() : MonsterInsights()->license->get_site_license();
170
-        $option['is_expired']  = false;
171
-        $option['is_disabled'] = false;
172
-        $option['is_invalid']  = false;
173
-
174
-        // If a key or author error is returned, the license no longer exists or the user has been deleted, so reset license.
175
-        if ( isset( $validate->key ) || isset( $validate->author ) ) {
176
-            $option['is_invalid']  = true;
177
-            is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
178
-            return;
179
-        }
180
-
181
-        // If the license has expired, set the transient and expired flag and return.
182
-        if ( isset( $validate->expired ) ) {
183
-            $option['is_expired']  = true;
184
-            is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
185
-            return;
186
-        }
187
-
188
-        // If the license is disabled, set the transient and disabled flag and return.
189
-        if ( isset( $validate->disabled ) ) {
190
-            $option['is_disabled'] = true;
191
-            is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
192
-            return;
193
-        }
194
-
195
-        // If forced, set contextual success message.
196
-        if ( ( ! empty( $validate->key ) || ! empty( $this->key ) ) && $forced ) {
197
-            $key = ! empty( $validate->key ) ? $validate->key : $this->key;
198
-            delete_transient( '_monsterinsights_addons' );
199
-            monsterinsights_get_addons_data( $key );
200
-            $this->success[] = esc_html__( 'Congratulations! Your key has been refreshed successfully.', 'google-analytics-for-wordpress' );
201
-        }
202
-
203
-        $option = array();
204
-        $option = is_network_admin() ? MonsterInsights()->license->get_network_license() : MonsterInsights()->license->get_site_license();
205
-        $option['type']        = isset( $validate->type ) ? $validate->type : $option['type'];
206
-        $option['is_expired']  = false;
207
-        $option['is_disabled'] = false;
208
-        $option['is_invalid']  = false;
209
-        is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
158
+	$validate = $this->perform_remote_request( 'validate-key', array( 'tgm-updater-key' => $this->key ) );
159
+
160
+	// If there was a basic API error in validation, only set the transient for 10 minutes before retrying.
161
+	if ( ! $validate ) {
162
+	    // If forced, set contextual success message.
163
+	    if ( $forced ) {
164
+		$this->errors[] = esc_html__( 'There was an error connecting to the remote key API. Please try again later.', 'google-analytics-for-wordpress' );
165
+	    }
166
+	    return;
167
+	}
168
+
169
+	$option = is_network_admin() ? MonsterInsights()->license->get_network_license() : MonsterInsights()->license->get_site_license();
170
+	$option['is_expired']  = false;
171
+	$option['is_disabled'] = false;
172
+	$option['is_invalid']  = false;
173
+
174
+	// If a key or author error is returned, the license no longer exists or the user has been deleted, so reset license.
175
+	if ( isset( $validate->key ) || isset( $validate->author ) ) {
176
+	    $option['is_invalid']  = true;
177
+	    is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
178
+	    return;
179
+	}
180
+
181
+	// If the license has expired, set the transient and expired flag and return.
182
+	if ( isset( $validate->expired ) ) {
183
+	    $option['is_expired']  = true;
184
+	    is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
185
+	    return;
186
+	}
187
+
188
+	// If the license is disabled, set the transient and disabled flag and return.
189
+	if ( isset( $validate->disabled ) ) {
190
+	    $option['is_disabled'] = true;
191
+	    is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
192
+	    return;
193
+	}
194
+
195
+	// If forced, set contextual success message.
196
+	if ( ( ! empty( $validate->key ) || ! empty( $this->key ) ) && $forced ) {
197
+	    $key = ! empty( $validate->key ) ? $validate->key : $this->key;
198
+	    delete_transient( '_monsterinsights_addons' );
199
+	    monsterinsights_get_addons_data( $key );
200
+	    $this->success[] = esc_html__( 'Congratulations! Your key has been refreshed successfully.', 'google-analytics-for-wordpress' );
201
+	}
202
+
203
+	$option = array();
204
+	$option = is_network_admin() ? MonsterInsights()->license->get_network_license() : MonsterInsights()->license->get_site_license();
205
+	$option['type']        = isset( $validate->type ) ? $validate->type : $option['type'];
206
+	$option['is_expired']  = false;
207
+	$option['is_disabled'] = false;
208
+	$option['is_invalid']  = false;
209
+	is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option );
210 210
 
211 211
     }
212 212
 
@@ -219,19 +219,19 @@  discard block
 block discarded – undo
219 219
      */
220 220
     public function maybe_deactivate_key() {
221 221
 
222
-        if ( empty( $_POST['monsterinsights-license-key'] ) || empty( $_POST['monsterinsights-deactivate-submit'] ) ) {
223
-            return;
224
-        }
222
+	if ( empty( $_POST['monsterinsights-license-key'] ) || empty( $_POST['monsterinsights-deactivate-submit'] ) ) {
223
+	    return;
224
+	}
225 225
 
226
-        if ( ! wp_verify_nonce( $_POST['monsterinsights-key-nonce'], 'monsterinsights-key-nonce' ) ) {
227
-            return;
228
-        }
226
+	if ( ! wp_verify_nonce( $_POST['monsterinsights-key-nonce'], 'monsterinsights-key-nonce' ) ) {
227
+	    return;
228
+	}
229 229
 
230
-        if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
231
-            return;
232
-        }
230
+	if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
231
+	    return;
232
+	}
233 233
 
234
-        $this->deactivate_key();
234
+	$this->deactivate_key();
235 235
 
236 236
     }
237 237
 
@@ -242,24 +242,24 @@  discard block
 block discarded – undo
242 242
      */
243 243
     public function deactivate_key() {
244 244
 
245
-        // Perform a request to deactivate the key.
246
-        $deactivate = $this->perform_remote_request( 'deactivate-key', array( 'tgm-updater-key' => $_POST['monsterinsights-license-key'] ) );
245
+	// Perform a request to deactivate the key.
246
+	$deactivate = $this->perform_remote_request( 'deactivate-key', array( 'tgm-updater-key' => $_POST['monsterinsights-license-key'] ) );
247 247
 
248
-        // If it returns false, send back a generic error message and return.
249
-        if ( ! $deactivate ) {
250
-            $this->errors[] = esc_html__( 'There was an error connecting to the remote key API. Please try again later.', 'google-analytics-for-wordpress' );
251
-            return;
252
-        }
248
+	// If it returns false, send back a generic error message and return.
249
+	if ( ! $deactivate ) {
250
+	    $this->errors[] = esc_html__( 'There was an error connecting to the remote key API. Please try again later.', 'google-analytics-for-wordpress' );
251
+	    return;
252
+	}
253 253
 
254
-        // If an error is returned, set the error and return.
255
-        if ( ! empty( $deactivate->error ) && ! monsterinsights_is_debug_mode() ) {
256
-            $this->errors[] = $deactivate->error;
257
-            return;
258
-        }
254
+	// If an error is returned, set the error and return.
255
+	if ( ! empty( $deactivate->error ) && ! monsterinsights_is_debug_mode() ) {
256
+	    $this->errors[] = $deactivate->error;
257
+	    return;
258
+	}
259 259
 
260
-        // Otherwise, our request has been done successfully. Reset the option and set the success message.
261
-        $this->success[] = isset( $deactivate->success ) ? $deactivate->success : esc_html__( 'Congratulations! You have deactivated the key from this site successfully.', 'google-analytics-for-wordpress' );
262
-        is_network_admin() ? MonsterInsights()->license->delete_network_license() : MonsterInsights()->license->delete_site_license();
260
+	// Otherwise, our request has been done successfully. Reset the option and set the success message.
261
+	$this->success[] = isset( $deactivate->success ) ? $deactivate->success : esc_html__( 'Congratulations! You have deactivated the key from this site successfully.', 'google-analytics-for-wordpress' );
262
+	is_network_admin() ? MonsterInsights()->license->delete_network_license() : MonsterInsights()->license->delete_site_license();
263 263
 
264 264
     }
265 265
 
@@ -272,20 +272,20 @@  discard block
 block discarded – undo
272 272
      */
273 273
     public function maybe_refresh_key() {
274 274
 
275
-        if ( empty( $_POST['monsterinsights-license-key'] ) || empty( $_POST['monsterinsights-refresh-submit'] ) ) {
276
-            return;
277
-        }
275
+	if ( empty( $_POST['monsterinsights-license-key'] ) || empty( $_POST['monsterinsights-refresh-submit'] ) ) {
276
+	    return;
277
+	}
278 278
 
279
-        if ( ! wp_verify_nonce( $_POST['monsterinsights-key-nonce'], 'monsterinsights-key-nonce' ) ) {
280
-            return;
281
-        }
279
+	if ( ! wp_verify_nonce( $_POST['monsterinsights-key-nonce'], 'monsterinsights-key-nonce' ) ) {
280
+	    return;
281
+	}
282 282
 
283
-        if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
284
-            return;
285
-        }
283
+	if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
284
+	    return;
285
+	}
286 286
 
287
-        // Refreshing is simply a word alias for validating a key. Force true to set contextual messages.
288
-        $this->validate_key( true );
287
+	// Refreshing is simply a word alias for validating a key. Force true to set contextual messages.
288
+	$this->validate_key( true );
289 289
 
290 290
     }
291 291
 
@@ -295,16 +295,16 @@  discard block
 block discarded – undo
295 295
      * @since 7.0.0
296 296
      */
297 297
     public function monsterinsights_notices() {
298
-        if ( ! monsterinsights_is_pro_version() ) {
299
-            return;
300
-        }
298
+	if ( ! monsterinsights_is_pro_version() ) {
299
+	    return;
300
+	}
301 301
 
302
-        $screen = get_current_screen();
303
-        if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) {
304
-            return;
305
-        }
302
+	$screen = get_current_screen();
303
+	if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) {
304
+	    return;
305
+	}
306 306
 
307
-        if ( ! empty( $this->errors ) ) { ?>
307
+	if ( ! empty( $this->errors ) ) { ?>
308 308
             <div class="error">
309 309
                 <p><?php echo implode( '<br>', $this->errors ); ?></p>
310 310
             </div>
@@ -328,46 +328,46 @@  discard block
 block discarded – undo
328 328
      */
329 329
     public function perform_remote_request( $action, $body = array(), $headers = array(), $return_format = 'json' ) {
330 330
 
331
-        // Build the body of the request.
332
-        $body = wp_parse_args(
333
-            $body,
334
-            array(
335
-                'tgm-updater-action'     => $action,
336
-                'tgm-updater-key'        => $this->key,
337
-                'tgm-updater-wp-version' => get_bloginfo( 'version' ),
338
-                'tgm-updater-referer'    => site_url(),
339
-                'tgm-updater-mi-version' => MONSTERINSIGHTS_VERSION,
340
-                'tgm-updater-is-pro'     => monsterinsights_is_pro_version(),
341
-            )
342
-        );
343
-        $body = http_build_query( $body, '', '&' );
344
-
345
-        // Build the headers of the request.
346
-        $headers = wp_parse_args(
347
-            $headers,
348
-            array(
349
-                'Content-Type'   => 'application/x-www-form-urlencoded',
350
-                'Content-Length' => strlen( $body )
351
-            )
352
-        );
353
-
354
-        // Setup variable for wp_remote_post.
355
-        $post = array(
356
-            'headers' => $headers,
357
-            'body'    => $body
358
-        );
359
-
360
-        // Perform the query and retrieve the response.
361
-        $response      = wp_remote_post( monsterinsights_get_licensing_url(), $post );
362
-        $response_code = wp_remote_retrieve_response_code( $response );
363
-        $response_body = wp_remote_retrieve_body( $response );
364
-
365
-        // Bail out early if there are any errors.
366
-        if ( 200 != $response_code || is_wp_error( $response_body ) ) {
367
-            return false;
368
-        }
369
-
370
-        // Return the json decoded content.
371
-        return json_decode( $response_body );
331
+	// Build the body of the request.
332
+	$body = wp_parse_args(
333
+	    $body,
334
+	    array(
335
+		'tgm-updater-action'     => $action,
336
+		'tgm-updater-key'        => $this->key,
337
+		'tgm-updater-wp-version' => get_bloginfo( 'version' ),
338
+		'tgm-updater-referer'    => site_url(),
339
+		'tgm-updater-mi-version' => MONSTERINSIGHTS_VERSION,
340
+		'tgm-updater-is-pro'     => monsterinsights_is_pro_version(),
341
+	    )
342
+	);
343
+	$body = http_build_query( $body, '', '&' );
344
+
345
+	// Build the headers of the request.
346
+	$headers = wp_parse_args(
347
+	    $headers,
348
+	    array(
349
+		'Content-Type'   => 'application/x-www-form-urlencoded',
350
+		'Content-Length' => strlen( $body )
351
+	    )
352
+	);
353
+
354
+	// Setup variable for wp_remote_post.
355
+	$post = array(
356
+	    'headers' => $headers,
357
+	    'body'    => $body
358
+	);
359
+
360
+	// Perform the query and retrieve the response.
361
+	$response      = wp_remote_post( monsterinsights_get_licensing_url(), $post );
362
+	$response_code = wp_remote_retrieve_response_code( $response );
363
+	$response_body = wp_remote_retrieve_body( $response );
364
+
365
+	// Bail out early if there are any errors.
366
+	if ( 200 != $response_code || is_wp_error( $response_body ) ) {
367
+	    return false;
368
+	}
369
+
370
+	// Return the json decoded content.
371
+	return json_decode( $response_body );
372 372
     }
373 373
 }
374 374
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/settings/tab-tracking.php 2 patches
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -29,65 +29,65 @@  discard block
 block discarded – undo
29 29
         <!-- Tabs -->
30 30
         <h1 id="monsterinsights-settings-page-sub-nav" class="monsterinsights-sub-nav-container monsterinsights-nav-container" data-container="#monsterinsights-settings-sub-pages">
31 31
             <?php 
32
-            $i      = 0;
33
-            $class  = '';
34
-            $is_pro = monsterinsights_is_pro_version();
35
-            foreach ( (array) monsterinsights_get_settings_tabs() as $id => $item ) {
36
-                if ( isset( $item['comingsoon'] ) && $item['comingsoon'] || empty( $item['title'] ) ) {
37
-                    continue;
38
-                }
39
-                $class = ( 0 === $i ? 'monsterinsights-active' : '' );
40
-                ?>
32
+	    $i      = 0;
33
+	    $class  = '';
34
+	    $is_pro = monsterinsights_is_pro_version();
35
+	    foreach ( (array) monsterinsights_get_settings_tabs() as $id => $item ) {
36
+		if ( isset( $item['comingsoon'] ) && $item['comingsoon'] || empty( $item['title'] ) ) {
37
+		    continue;
38
+		}
39
+		$class = ( 0 === $i ? 'monsterinsights-active' : '' );
40
+		?>
41 41
                 <a class="monsterinsights-sub-nav-item monsterinsights-nav-item monstericon-<?php echo esc_attr( $id ); ?> <?php echo esc_attr( $class ); ?>" href="#monsterinsights-main-tab-tracking?monsterinsights-sub-tab-<?php echo esc_attr( $id ); ?>" title="<?php echo esc_attr( $item['title'] ); ?>">
42 42
                     <?php echo esc_html( $item['title'] ); ?>
43 43
                 </a>
44 44
                 <?php 
45
-                $i++; 
46
-            }
47
-            ?>
45
+		$i++; 
46
+	    }
47
+	    ?>
48 48
         </h1>
49 49
 
50 50
         <h1 class="monsterinsights-hideme"></h1><!-- so wp notices are below the nav bar -->
51 51
 
52 52
         <?php 
53
-        // Output any notices now
54
-        /** 
55
-         * Developer Alert:
56
-         *
57
-         * Per the README, this is considered an internal hook and should
58
-         * not be used by other developers. This hook's behavior may be modified
59
-         * or the hook may be removed at any time, without warning.
60
-         */
61
-        do_action( 'monsterinsights_settings_tracking_tab_notice' );
62
-        ?>
53
+	// Output any notices now
54
+	/** 
55
+	 * Developer Alert:
56
+	 *
57
+	 * Per the README, this is considered an internal hook and should
58
+	 * not be used by other developers. This hook's behavior may be modified
59
+	 * or the hook may be removed at any time, without warning.
60
+	 */
61
+	do_action( 'monsterinsights_settings_tracking_tab_notice' );
62
+	?>
63 63
 
64 64
         <!-- Tab Panels -->
65 65
         <div id="monsterinsights-settings-sub-pages" class="monsterinsights-sub-nav-tabs monsterinsights-nav-tabs" data-navigation="#monsterinsights-settings-page-sub-nav">
66 66
             <?php 
67
-            $i = 0; 
68
-            foreach ( (array) monsterinsights_get_settings_tabs() as $id => $item ) {
69
-                if ( isset( $item['comingsoon'] ) && $item['comingsoon'] || empty( $item['title'] ) ) {
70
-                    continue;
71
-                }
72
-                $class = ( 0 === $i ? ' monsterinsights-active' : '' ); 
73
-                $i++;
74
-                ?>
67
+	    $i = 0; 
68
+	    foreach ( (array) monsterinsights_get_settings_tabs() as $id => $item ) {
69
+		if ( isset( $item['comingsoon'] ) && $item['comingsoon'] || empty( $item['title'] ) ) {
70
+		    continue;
71
+		}
72
+		$class = ( 0 === $i ? ' monsterinsights-active' : '' ); 
73
+		$i++;
74
+		?>
75 75
                  <div id="monsterinsights-sub-tab-<?php echo esc_attr( $id ); ?>" class="monsterinsights-sub-nav-tab monsterinsights-nav-tab<?php echo esc_attr( $class ); ?>">
76 76
                     <?php if ( $item['level'] === 'lite' ||  $is_pro ) { ?>
77 77
                     <?php echo '<h2 class="monsterinsights-sub-tab-header">' . esc_html( $item['title'] ) . '</h2>'; ?>
78 78
                     <?php } ?>
79 79
                      <div class="monsterinsights-subtab-settings-notices">
80 80
                         <?php 
81
-                        // Output any notices now
82
-                        /** 
83
-                         * Developer Alert:
84
-                         *
85
-                         * Per the README, this is considered an internal hook and should
86
-                         * not be used by other developers. This hook's behavior may be modified
87
-                         * or the hook may be removed at any time, without warning.
88
-                         */
89
-                        do_action( 'monsterinsights_tracking_' . $id . '_tab_notice' );
90
-                        ?>
81
+			// Output any notices now
82
+			/** 
83
+			 * Developer Alert:
84
+			 *
85
+			 * Per the README, this is considered an internal hook and should
86
+			 * not be used by other developers. This hook's behavior may be modified
87
+			 * or the hook may be removed at any time, without warning.
88
+			 */
89
+			do_action( 'monsterinsights_tracking_' . $id . '_tab_notice' );
90
+			?>
91 91
                     </div>
92 92
                     <!-- Settings Form -->
93 93
                     <?php $class = ( $item['level'] !== 'lite' && ! $is_pro ) ? 'monsterinsights-no-settings-shown' : ''; ?>
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
                         <table class="form-table">
96 96
                             <tbody>
97 97
                                 <?php
98
-                                //do_action( 'monsterinsights_settings_tab_top_' . $id  );
99
-                                echo monsterinsights_get_section_settings( $id, 'tracking' );
100
-                                //do_action( 'monsterinsights_settings_tab_bottom_' . $id  );
101
-                                ?>
98
+				//do_action( 'monsterinsights_settings_tab_top_' . $id  );
99
+				echo monsterinsights_get_section_settings( $id, 'tracking' );
100
+				//do_action( 'monsterinsights_settings_tab_bottom_' . $id  );
101
+				?>
102 102
                             </tbody>
103 103
                         </table>
104 104
                         <?php echo monsterinsights_render_submit_field( $id, 'tracking' ); ?>
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
                     </form>
112 112
                 </div>
113 113
                 <?php
114
-            }
115
-            ?>
114
+	    }
115
+	    ?>
116 116
         </div>
117 117
     </div>
118 118
     <?php
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                 $i++;
74 74
                 ?>
75 75
                  <div id="monsterinsights-sub-tab-<?php echo esc_attr( $id ); ?>" class="monsterinsights-sub-nav-tab monsterinsights-nav-tab<?php echo esc_attr( $class ); ?>">
76
-                    <?php if ( $item['level'] === 'lite' ||  $is_pro ) { ?>
76
+                    <?php if ( $item['level'] === 'lite' || $is_pro ) { ?>
77 77
                     <?php echo '<h2 class="monsterinsights-sub-tab-header">' . esc_html( $item['title'] ) . '</h2>'; ?>
78 78
                     <?php } ?>
79 79
                      <div class="monsterinsights-subtab-settings-notices">
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                     </div>
92 92
                     <!-- Settings Form -->
93 93
                     <?php $class = ( $item['level'] !== 'lite' && ! $is_pro ) ? 'monsterinsights-no-settings-shown' : ''; ?>
94
-                    <form id="monsterinsights-tracking-<?php echo esc_attr( $id );?>-tab" class="<?php echo $class; ?>" method="post">
94
+                    <form id="monsterinsights-tracking-<?php echo esc_attr( $id ); ?>-tab" class="<?php echo $class; ?>" method="post">
95 95
                         <table class="form-table">
96 96
                             <tbody>
97 97
                                 <?php
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
                             </tbody>
103 103
                         </table>
104 104
                         <?php echo monsterinsights_render_submit_field( $id, 'tracking' ); ?>
105
-                        <?php if ( $item['level'] === 'lite' && !$is_pro ) { ?>
105
+                        <?php if ( $item['level'] === 'lite' && ! $is_pro ) { ?>
106 106
                             <div class="monsterinsights-upsell-under-box">
107 107
                                 <h2><?php esc_html_e( "Want even more fine tuned control over your website analytics?", 'google-analytics-for-wordpress' ); ?></h2>
108 108
                                 <p class="monsterinsights-upsell-lite-text"><?php esc_html_e( "By upgrading to MonsterInsights Pro, you get access to numerous addons and tools that help you better understand what people are doing on your website, so you can keep doing more of what's working. Some of the features include: Ecommerce tracking, Author tracking, Post Type tracking, Ads tracking, Google AMP tracking, Performance optimization, and so much more!", 'google-analytics-for-wordpress' ); ?></p>
109
-                                <p class="monsterinsights-upsell-button-par"><a href="<?php echo monsterinsights_get_upgrade_link( 'settings-page', 'settings-page-bottom-cta' );?>" class="button button-primary"><?php esc_html_e( "Click here to Upgrade", 'google-analytics-for-wordpress' ); ?></a></p></div>
109
+                                <p class="monsterinsights-upsell-button-par"><a href="<?php echo monsterinsights_get_upgrade_link( 'settings-page', 'settings-page-bottom-cta' ); ?>" class="button button-primary"><?php esc_html_e( "Click here to Upgrade", 'google-analytics-for-wordpress' ); ?></a></p></div>
110 110
                         <?php } ?>
111 111
                     </form>
112 112
                 </div>
Please login to merge, or discard this patch.
includes/admin/settings/tab-general.php 3 patches
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -29,26 +29,26 @@  discard block
 block discarded – undo
29 29
     <div id="monsterinsights-settings-general">
30 30
         <div class="monsterinsights-tab-settings-notices">
31 31
         <?php 
32
-        // Output any notices now
33
-        /** 
34
-         * Developer Alert:
35
-         *
36
-         * Per the README, this is considered an internal hook and should
37
-         * not be used by other developers. This hook's behavior may be modified
38
-         * or the hook may be removed at any time, without warning.
39
-         */
40
-        do_action( 'monsterinsights_settings_general_tab_notice' );
41
-        ?>
32
+	// Output any notices now
33
+	/** 
34
+	 * Developer Alert:
35
+	 *
36
+	 * Per the README, this is considered an internal hook and should
37
+	 * not be used by other developers. This hook's behavior may be modified
38
+	 * or the hook may be removed at any time, without warning.
39
+	 */
40
+	do_action( 'monsterinsights_settings_general_tab_notice' );
41
+	?>
42 42
         </div>
43 43
         <table class="form-table">
44 44
             <tbody>
45 45
                 <?php if ( monsterinsights_is_pro_version() ) {
46
-                    $license_key  = MonsterInsights()->license->get_site_license_key();
47
-                    $license_key  = $license_key ? $license_key : MonsterInsights()->license->get_network_license_key();
48
-                    $license_key  = $license_key ? $license_key : MonsterInsights()->license->get_default_license_key();
46
+		    $license_key  = MonsterInsights()->license->get_site_license_key();
47
+		    $license_key  = $license_key ? $license_key : MonsterInsights()->license->get_network_license_key();
48
+		    $license_key  = $license_key ? $license_key : MonsterInsights()->license->get_default_license_key();
49 49
 
50
-                    $license_type = MonsterInsights()->license->get_site_license_type();
51
-                    ?>
50
+		    $license_type = MonsterInsights()->license->get_site_license_type();
51
+		    ?>
52 52
                     <tr id="monsterinsights-settings-key-box">
53 53
                         <th scope="row">
54 54
                             <label for="monsterinsights-settings-key"><?php esc_html_e( 'License Key', 'google-analytics-for-wordpress' ); ?></label>
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
                     <?php } ?>
155 155
 
156 156
                     <?php 
157
-                    $manual_ua = MonsterInsights()->auth->get_manual_ua();
158
-                    $auth_ua   = MonsterInsights()->auth->get_ua();
157
+		    $manual_ua = MonsterInsights()->auth->get_manual_ua();
158
+		    $auth_ua   = MonsterInsights()->auth->get_ua();
159 159
 
160
-                    if ( empty( $manual_ua ) && empty( $auth_ua ) && monsterinsights_get_network_ua() ) { ?>
160
+		    if ( empty( $manual_ua ) && empty( $auth_ua ) && monsterinsights_get_network_ua() ) { ?>
161 161
                         <!-- If we don't have a manual or auth UA but we have a valid default set (from network), explain that -->
162 162
                         <tr id="monsterinsights-default-google-authenticate-box">
163 163
                             <th scope="row">
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
 
172 172
                     <!-- Disable Dashboard -->
173 173
                     <?php
174
-                    $title       = esc_html__( 'Disable Reports', 'google-analytics-for-wordpress' );
175
-                    $description = esc_html__( 'Hide the reports page.', 'google-analytics-for-wordpress' );
176
-                    echo monsterinsights_make_checkbox( 'dashboards_disabled', $title, $description );
177
-                    ?>
174
+		    $title       = esc_html__( 'Disable Reports', 'google-analytics-for-wordpress' );
175
+		    $description = esc_html__( 'Hide the reports page.', 'google-analytics-for-wordpress' );
176
+		    echo monsterinsights_make_checkbox( 'dashboards_disabled', $title, $description );
177
+		    ?>
178 178
 
179 179
                     <?php if ( $automatic_updates !== 'all' && $automatic_updates !== 'minor' ){  ?>
180 180
                     <?php $automatic_updates = $automatic_updates ? $automatic_updates : 'none'; ?>
@@ -192,23 +192,23 @@  discard block
 block discarded – undo
192 192
 
193 193
                     <!-- Tracking -->
194 194
                     <?php
195
-                    $title       = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' );
196
-                    $description = esc_html__( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' );
197
-                    if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ){
198
-                        echo monsterinsights_make_checkbox( 'anonymous_data', $title, $description );
199
-                    }
200
-                    ?>
195
+		    $title       = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' );
196
+		    $description = esc_html__( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' );
197
+		    if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ){
198
+			echo monsterinsights_make_checkbox( 'anonymous_data', $title, $description );
199
+		    }
200
+		    ?>
201 201
 
202 202
                     <?php 
203
-                    /** 
204
-                     * Developer Alert:
205
-                     *
206
-                     * Per the README, this is considered an internal hook and should
207
-                     * not be used by other developers. This hook's behavior may be modified
208
-                     * or the hook may be removed at any time, without warning.
209
-                     */
210
-                    do_action( 'monsterinsights_settings_general_box' ); 
211
-                    ?>
203
+		    /** 
204
+		     * Developer Alert:
205
+		     *
206
+		     * Per the README, this is considered an internal hook and should
207
+		     * not be used by other developers. This hook's behavior may be modified
208
+		     * or the hook may be removed at any time, without warning.
209
+		     */
210
+		    do_action( 'monsterinsights_settings_general_box' ); 
211
+		    ?>
212 212
                 </tbody>
213 213
             </table>
214 214
             <input type="hidden" name="monsterinsights_settings_tab" value="general"/>
@@ -235,28 +235,28 @@  discard block
 block discarded – undo
235 235
     $manual_ua_code_old = MonsterInsights()->auth->get_manual_ua();
236 236
     
237 237
     if ( $manual_ua_code && $manual_ua_code_old && $manual_ua_code_old === $manual_ua_code ) {
238
-        // Same code we had before
239
-            // Do nothing
238
+	// Same code we had before
239
+	    // Do nothing
240 240
     } else if ( $manual_ua_code && $manual_ua_code_old && $manual_ua_code_old !== $manual_ua_code ) {
241
-        // Different UA code
242
-        MonsterInsights()->auth->set_manual_ua( $manual_ua_code );
241
+	// Different UA code
242
+	MonsterInsights()->auth->set_manual_ua( $manual_ua_code );
243 243
     } else if ( $manual_ua_code && empty( $manual_ua_code_old ) ) {
244
-        // Move to manual
245
-        MonsterInsights()->auth->set_manual_ua( $manual_ua_code );
244
+	// Move to manual
245
+	MonsterInsights()->auth->set_manual_ua( $manual_ua_code );
246 246
     } else if ( empty( $manual_ua_code ) && $manual_ua_code_old ) {
247
-        // Deleted manual
248
-        MonsterInsights()->auth->delete_manual_ua();
247
+	// Deleted manual
248
+	MonsterInsights()->auth->delete_manual_ua();
249 249
     } else if ( isset( $_POST['manual_ua_code'] ) && empty( $manual_ua_code ) ) {
250
-        $throw_notice = true;
250
+	$throw_notice = true;
251 251
     } else {
252
-        // Not UA before or after
253
-            // Do nothing
252
+	// Not UA before or after
253
+	    // Do nothing
254 254
     }
255 255
 
256 256
     $dashboards_disabled     = isset( $_POST['dashboards_disabled'] ) ? 1 : 0;
257 257
     $dashboards_disabled_old = monsterinsights_get_option( 'dashboards_disabled', false );
258 258
     if ( $dashboards_disabled && ! $dashboards_disabled_old ) {
259
-        do_action( 'monsterinsights_reports_delete_aggregate_data' );
259
+	do_action( 'monsterinsights_reports_delete_aggregate_data' );
260 260
     }
261 261
     monsterinsights_update_option( 'dashboards_disabled', $dashboards_disabled );
262 262
 
@@ -264,16 +264,16 @@  discard block
 block discarded – undo
264 264
 
265 265
     $automatic_updates = isset( $_POST['automatic_updates'] ) && in_array( $_POST['automatic_updates'], array( 'all', 'minor', 'none' ) ) ? $_POST['automatic_updates'] : false;
266 266
     if ( $automatic_updates ) {
267
-        monsterinsights_update_option( 'automatic_updates', $automatic_updates );
267
+	monsterinsights_update_option( 'automatic_updates', $automatic_updates );
268 268
     }
269 269
 
270 270
     $anonymous_data = isset( $_POST['anonymous_data'] ) ? 1 : 0;
271 271
     if ( $anonymous_data ) {
272
-        if ( monsterinsights_is_pro_version() ) {
273
-             monsterinsights_update_option( 'anonymous_data', 1 );
274
-        } else {
275
-            monsterinsights_update_option( 'anonymous_data', $anonymous_data );
276
-        }
272
+	if ( monsterinsights_is_pro_version() ) {
273
+	     monsterinsights_update_option( 'anonymous_data', 1 );
274
+	} else {
275
+	    monsterinsights_update_option( 'anonymous_data', $anonymous_data );
276
+	}
277 277
     }
278 278
 
279 279
     /** 
@@ -287,9 +287,9 @@  discard block
 block discarded – undo
287 287
 
288 288
     // Output an admin notice so the user knows what happened
289 289
     if ( $throw_notice ) {
290
-        add_action( 'monsterinsights_settings_general_tab_notice', 'monsterinsights_invalid_ua_code' );
290
+	add_action( 'monsterinsights_settings_general_tab_notice', 'monsterinsights_invalid_ua_code' );
291 291
     } else {
292
-        add_action( 'monsterinsights_settings_general_tab_notice', 'monsterinsights_updated_settings' );
292
+	add_action( 'monsterinsights_settings_general_tab_notice', 'monsterinsights_updated_settings' );
293 293
     }
294 294
 }
295 295
 add_action( 'monsterinsights_settings_save_general', 'monsterinsights_settings_save_general', 11 );
296 296
\ 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
@@ -194,7 +194,7 @@
 block discarded – undo
194 194
                     <?php
195 195
                     $title       = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' );
196 196
                     $description = esc_html__( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' );
197
-                    if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ){
197
+                    if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ) {
198 198
                         echo monsterinsights_make_checkbox( 'anonymous_data', $title, $description );
199 199
                     }
200 200
                     ?>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                         <form id="monsterinsights-google-authenticate" method="post">
110 110
                             <?php if ( MonsterInsights()->auth->get_viewname() && MonsterInsights()->auth->get_ua() ) { ?>
111 111
                                 <?php if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->is_site_licensed() ) { ?>
112
-                                    <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.' , 'google-analytics-for-wordpress' ); ?></p>
112
+                                    <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.', 'google-analytics-for-wordpress' ); ?></p>
113 113
                                 <?php } else { ?>
114 114
                                     <p><?php echo esc_html__( 'Profile Active: ', 'google-analytics-for-wordpress' ) . MonsterInsights()->auth->get_viewname(); ?></p>
115 115
                                     <p><?php wp_nonce_field( 'monsterinsights-google-authenticated-nonce', 'monsterinsights-google-authenticated-nonce' ); ?>
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
                                 <?php } ?>
120 120
                             <?php } else { ?>
121 121
                                 <?php if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->is_site_licensed() ) { ?>
122
-                                    <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.' , 'google-analytics-for-wordpress' ); ?></p>
122
+                                    <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.', 'google-analytics-for-wordpress' ); ?></p>
123 123
                                 <?php } else { ?>
124 124
                                     <?php wp_nonce_field( 'monsterinsights-google-authenticate-nonce', 'monsterinsights-google-authenticate-nonce' ); ?>
125 125
                                     <?php submit_button( esc_html__( 'Authenticate with your Google account', 'google-analytics-for-wordpress' ), 'button-action', 'monsterinsights-google-authenticate-submit', false ); ?>
126
-                                    <p class="description"><?php printf( esc_html__( 'Already have a Google Account, but don’t know if you’ve setup Google Analytics? %s Click here to login and find out%s.', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'settings-page', 'already-have-ga-account-doc-link', 'https://www.monsterinsights.com/docs/find-out-if-you-already-have-a-google-analytics-account/?utm_source=monsterinsights-settings' ) .'">', '</a>' ); ?>
126
+                                    <p class="description"><?php printf( esc_html__( 'Already have a Google Account, but don’t know if you’ve setup Google Analytics? %s Click here to login and find out%s.', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'settings-page', 'already-have-ga-account-doc-link', 'https://www.monsterinsights.com/docs/find-out-if-you-already-have-a-google-analytics-account/?utm_source=monsterinsights-settings' ) . '">', '</a>' ); ?>
127 127
                                     <br />
128 128
                                     <?php printf( esc_html__( 'Having issues automatically authenticating? %s Click here to authenticate manually%s.', 'google-analytics-for-wordpress' ), '<a href="javascript:monsterinsights_show_manual()" data-action="show-manual-ua-box">', '</a>' ); ?></p>
129 129
                                 <?php } ?>
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                 <tbody>
143 143
                     <?php if ( ! MonsterInsights()->auth->get_viewname() ) { ?>
144 144
                     <!-- Manual UA -->
145
-                    <tr id="monsterinsights-google-ua-box" <?php echo ( ! MonsterInsights()->auth->get_manual_ua() ? 'class="monsterinsights-hideme"' : ''); ?> >
145
+                    <tr id="monsterinsights-google-ua-box" <?php echo ( ! MonsterInsights()->auth->get_manual_ua() ? 'class="monsterinsights-hideme"' : '' ); ?> >
146 146
                         <th scope="row">
147 147
                             <label for="monsterinsights-google-ua"><?php esc_html_e( 'Manually enter your UA code', 'google-analytics-for-wordpress' ); ?></label>
148 148
                         </th>
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
                         </th>
178 178
                         <td>
179 179
                             <p>
180
-                                <?php echo sprintf( esc_html__( 'Already purchased an upgrade to MonsterInsights Pro? To unlock your Pro features and addons, %sfollow our upgrade guide%s to install MonsterInsights Pro.' ), '<a href="'. monsterinsights_get_url( 'settings-page', 'general-tab-upgrade-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) .'">', '</a>' ); ?>
180
+                                <?php echo sprintf( esc_html__( 'Already purchased an upgrade to MonsterInsights Pro? To unlock your Pro features and addons, %sfollow our upgrade guide%s to install MonsterInsights Pro.' ), '<a href="' . monsterinsights_get_url( 'settings-page', 'general-tab-upgrade-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) . '">', '</a>' ); ?>
181 181
                             </p>
182 182
                             <p>
183
-                                <?php echo sprintf( esc_html__( "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro." ), '<a href="'. monsterinsights_get_upgrade_link( 'settings-page', 'general-tab-upgrade-link' ) .'">', '</a>' ); ?>
183
+                                <?php echo sprintf( esc_html__( "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro." ), '<a href="' . monsterinsights_get_upgrade_link( 'settings-page', 'general-tab-upgrade-link' ) . '">', '</a>' ); ?>
184 184
                             </p>
185 185
                         </td>
186 186
                     </tr>
@@ -193,16 +193,16 @@  discard block
 block discarded – undo
193 193
                     echo monsterinsights_make_checkbox( 'dashboards_disabled', $title, $description );
194 194
                     ?>
195 195
 
196
-                    <?php if ( $automatic_updates !== 'all' && $automatic_updates !== 'minor' ){  ?>
196
+                    <?php if ( $automatic_updates !== 'all' && $automatic_updates !== 'minor' ) {  ?>
197 197
                     <?php $automatic_updates = $automatic_updates ? $automatic_updates : 'none'; ?>
198 198
                     <tr id="monsterinsights-automatic-updates-mode">
199 199
                         <th scope="row">
200 200
                             <label for="monsterinsights-automatic-updates-mode"><?php esc_html_e( 'Automatic Updates', 'google-analytics-for-wordpress' ); ?></label>
201 201
                         </th>
202 202
                         <td>
203
-                            <label><input type="radio" name="automatic_updates" value="all" <?php checked( $automatic_updates, 'all' ); ?> ><?php esc_html_e('Yes (Recommended) - Get the latest features, bugfixes, and security updates as they are released.', 'google-analytics-for-wordpress'); ?> </label>
204
-                            <label><input type="radio" name="automatic_updates" value="minor" <?php checked( $automatic_updates, 'minor' ); ?> ><?php esc_html_e( 'Minor Only - Only get bugfixes and security updates, but not major features.', 'google-analytics-for-wordpress'); ?> </label>
205
-                            <label><input type="radio" name="automatic_updates" value="none" <?php checked( $automatic_updates, 'none' ); ?> ><?php esc_html_e( 'None - Manually update everything.', 'google-analytics-for-wordpress'); ?> </label>
203
+                            <label><input type="radio" name="automatic_updates" value="all" <?php checked( $automatic_updates, 'all' ); ?> ><?php esc_html_e( 'Yes (Recommended) - Get the latest features, bugfixes, and security updates as they are released.', 'google-analytics-for-wordpress' ); ?> </label>
204
+                            <label><input type="radio" name="automatic_updates" value="minor" <?php checked( $automatic_updates, 'minor' ); ?> ><?php esc_html_e( 'Minor Only - Only get bugfixes and security updates, but not major features.', 'google-analytics-for-wordpress' ); ?> </label>
205
+                            <label><input type="radio" name="automatic_updates" value="none" <?php checked( $automatic_updates, 'none' ); ?> ><?php esc_html_e( 'None - Manually update everything.', 'google-analytics-for-wordpress' ); ?> </label>
206 206
                         </td>
207 207
                     </tr>
208 208
                     <?php } ?>
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                     <?php
212 212
                     $title       = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' );
213 213
                     $description = esc_html__( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' );
214
-                    if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ){
214
+                    if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ) {
215 215
                         echo monsterinsights_make_checkbox( 'anonymous_data', $title, $description );
216 216
                     }
217 217
                     ?>
Please login to merge, or discard this patch.