Passed
Push — master ( cf9d65...a7feb4 )
by Chris
03:29
created
includes/frontend/frontend.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
     do_action( 'monsterinsights_tracking_before_' . $mode );
38 38
     do_action( 'monsterinsights_tracking_before', $mode );
39 39
     if ( $mode === 'preview' ) {
40
-        require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/tracking/class-tracking-preview.php';
41
-        $tracking = new MonsterInsights_Tracking_Preview();
42
-        echo $tracking->frontend_output();
40
+	require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/tracking/class-tracking-preview.php';
41
+	$tracking = new MonsterInsights_Tracking_Preview();
42
+	echo $tracking->frontend_output();
43 43
     } else {
44
-         require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/tracking/class-tracking-analytics.php';
45
-         $tracking = new MonsterInsights_Tracking_Analytics();
46
-         echo $tracking->frontend_output();
44
+	 require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/tracking/class-tracking-analytics.php';
45
+	 $tracking = new MonsterInsights_Tracking_Analytics();
46
+	 echo $tracking->frontend_output();
47 47
     }
48 48
 
49 49
     do_action( 'monsterinsights_tracking_after_' . $mode );
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
     $track_user    = monsterinsights_track_user();
70 70
 
71 71
     if ( $track_user && ( $events_mode === 'js' || $events_mode === 'php' ) ) {
72
-        require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/events/class-analytics-events.php';
73
-        new MonsterInsights_Analytics_Events();
72
+	require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/events/class-analytics-events.php';
73
+	new MonsterInsights_Analytics_Events();
74 74
     } else {
75
-        // User is in the disabled group or events mode is off
75
+	// User is in the disabled group or events mode is off
76 76
     }
77 77
 }
78 78
 add_action( 'template_redirect', 'monsterinsights_events_tracking', 9 );
@@ -91,17 +91,17 @@  discard block
 block discarded – undo
91 91
     global $post;
92 92
 
93 93
     if ( monsterinsights_get_option( 'tag_links_in_rss', false ) ){
94
-        if ( is_feed() ) {
95
-            if ( monsterinsights_get_option( 'allow_anchor', false ) ) {
96
-                $delimiter = '#';
97
-            } else {
98
-                $delimiter = '?';
99
-                if ( strpos( $guid, $delimiter ) > 0 ) {
100
-                    $delimiter = '&';
101
-                }
102
-            }
103
-            return $guid . $delimiter . 'utm_source=rss&utm_medium=rss&utm_campaign=' . urlencode( $post->post_name );
104
-        }
94
+	if ( is_feed() ) {
95
+	    if ( monsterinsights_get_option( 'allow_anchor', false ) ) {
96
+		$delimiter = '#';
97
+	    } else {
98
+		$delimiter = '?';
99
+		if ( strpos( $guid, $delimiter ) > 0 ) {
100
+		    $delimiter = '&';
101
+		}
102
+	    }
103
+	    return $guid . $delimiter . 'utm_source=rss&utm_medium=rss&utm_campaign=' . urlencode( $post->post_name );
104
+	}
105 105
     }
106 106
     return $guid;
107 107
 }
Please login to merge, or discard this patch.
includes/admin/admin.php 1 patch
Indentation   +174 added lines, -174 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,164 +271,164 @@  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
316 316
     if ( ! is_network_admin() ) {
317
-        if ( ! get_option( 'monsterinsights_tracking_notice' ) ) {
318
-            if ( ! monsterinsights_get_option( 'anonymous_data', false ) ) {
319
-                if ( ! monsterinsights_is_dev_url( network_site_url( '/' ) ) ) {
320
-                    if ( monsterinsights_is_pro_version() ) {
321
-                        monsterinsights_update_option( 'anonymous_data', 1 );
322
-                        return;
323
-                    }
324
-                    $optin_url  = add_query_arg( 'mi_action', 'opt_into_tracking' );
325
-                    $optout_url = add_query_arg( 'mi_action', 'opt_out_of_tracking' );
326
-                    echo '<div class="updated"><p>';
327
-                    echo esc_html__( 'Allow MonsterInsights to track plugin usage? Opt-in to tracking and our newsletter to stay informed of the latest changes to MonsterInsights and help us ensure compatibility.', 'google-analytics-for-wordpress' );
328
-                    echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'google-analytics-for-wordpress' ) . '</a>';
329
-                    echo '&nbsp;<a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'google-analytics-for-wordpress' ) . '</a>';
330
-                    echo '</p></div>';
331
-                    return;
332
-                } else {
333
-                    // is testing site
334
-                     update_option( 'monsterinsights_tracking_notice', '1' );
335
-                }
336
-            }
337
-        }
317
+	if ( ! get_option( 'monsterinsights_tracking_notice' ) ) {
318
+	    if ( ! monsterinsights_get_option( 'anonymous_data', false ) ) {
319
+		if ( ! monsterinsights_is_dev_url( network_site_url( '/' ) ) ) {
320
+		    if ( monsterinsights_is_pro_version() ) {
321
+			monsterinsights_update_option( 'anonymous_data', 1 );
322
+			return;
323
+		    }
324
+		    $optin_url  = add_query_arg( 'mi_action', 'opt_into_tracking' );
325
+		    $optout_url = add_query_arg( 'mi_action', 'opt_out_of_tracking' );
326
+		    echo '<div class="updated"><p>';
327
+		    echo esc_html__( 'Allow MonsterInsights to track plugin usage? Opt-in to tracking and our newsletter to stay informed of the latest changes to MonsterInsights and help us ensure compatibility.', 'google-analytics-for-wordpress' );
328
+		    echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'google-analytics-for-wordpress' ) . '</a>';
329
+		    echo '&nbsp;<a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'google-analytics-for-wordpress' ) . '</a>';
330
+		    echo '</p></div>';
331
+		    return;
332
+		} else {
333
+		    // is testing site
334
+		     update_option( 'monsterinsights_tracking_notice', '1' );
335
+		}
336
+	    }
337
+	}
338 338
     }
339 339
 
340 340
     $notices = array();
341 341
     if ( ! is_network_admin() || ( ! monsterinsights_is_pro_version() && ( class_exists( 'WooCommerce' ) || class_exists( 'Easy_Digital_Downloads' ) ) ) ) {
342
-        $notices   = get_option( 'monsterinsights_notices' );
343
-        if ( ! is_array( $notices ) ) {
344
-            $notices = array();
345
-        }
342
+	$notices   = get_option( 'monsterinsights_notices' );
343
+	if ( ! is_array( $notices ) ) {
344
+	    $notices = array();
345
+	}
346 346
     }
347 347
     // 5. Automatic updates not configured
348 348
     $authed   = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed();
349 349
     $url      = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
350 350
 
351 351
     if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { 
352
-        echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">';
353
-            echo '<p>';
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>' ); 
355
-            echo '</p>';
356
-        echo '</div>';
357
-        return;
352
+	echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">';
353
+	    echo '<p>';
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>' ); 
355
+	    echo '</p>';
356
+	echo '</div>';
357
+	return;
358 358
     }
359 359
 
360 360
     // 6. Authetnicate, not manual
361 361
     if ( ! is_network_admin() ) {
362
-        $updates   = monsterinsights_get_option( 'automatic_updates', false );
363
-        $url       = admin_url( 'admin.php?page=monsterinsights_settings' );
364
-
365
-        if ( empty( $updates) && ! isset( $notices['monsterinsights_automatic_updates' ] ) ) { 
366
-            echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">';
367
-                echo '<p>';
368
-                echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); 
369
-                echo '</p>';
370
-            echo '</div>';
371
-            return;
372
-        }
362
+	$updates   = monsterinsights_get_option( 'automatic_updates', false );
363
+	$url       = admin_url( 'admin.php?page=monsterinsights_settings' );
364
+
365
+	if ( empty( $updates) && ! isset( $notices['monsterinsights_automatic_updates' ] ) ) { 
366
+	    echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">';
367
+		echo '<p>';
368
+		echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); 
369
+		echo '</p>';
370
+	    echo '</div>';
371
+	    return;
372
+	}
373 373
     }
374 374
 
375 375
     if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
376
-        if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { 
377
-            echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
378
-                echo '<div class="monsterinsights-wooedd-upsell-left">';
379
-                    echo '<p><strong>';
380
-                    echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' );
381
-                    echo '</strong></p>';
382
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
383
-                    echo '<p>';
384
-                    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
385
-                    echo '</p>';
386
-                    echo '<p>';
387
-                    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' );
388
-                    echo '</p>';
389
-                    echo '<p>';
390
-                    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
391
-                    echo '</p>';
392
-                    echo '<p>';
393
-                    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
394
-                    echo '</p>';
395
-                    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>' ); 
396
-                    echo '</p>';
397
-                echo '</div><div class="monsterinsights-wooedd-upsell-right">';
398
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
399
-                echo '</div>';
400
-            echo '</div>';
401
-            return;
402
-        }
376
+	if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { 
377
+	    echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">';
378
+		echo '<div class="monsterinsights-wooedd-upsell-left">';
379
+		    echo '<p><strong>';
380
+		    echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' );
381
+		    echo '</strong></p>';
382
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
383
+		    echo '<p>';
384
+		    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
385
+		    echo '</p>';
386
+		    echo '<p>';
387
+		    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' );
388
+		    echo '</p>';
389
+		    echo '<p>';
390
+		    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
391
+		    echo '</p>';
392
+		    echo '<p>';
393
+		    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
394
+		    echo '</p>';
395
+		    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>' ); 
396
+		    echo '</p>';
397
+		echo '</div><div class="monsterinsights-wooedd-upsell-right">';
398
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
399
+		echo '</div>';
400
+	    echo '</div>';
401
+	    return;
402
+	}
403 403
     }
404 404
     if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) {
405
-        if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { 
406
-            echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
407
-                echo '<div class="monsterinsights-wooedd-upsell-left">';
408
-                    echo '<p><strong>';
409
-                    echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' );
410
-                    echo '</strong></p>';
411
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
412
-                    echo '<p>';
413
-                    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
414
-                    echo '</p>';
415
-                    echo '<p>';
416
-                    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' );
417
-                    echo '</p>';
418
-                    echo '<p>';
419
-                    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
420
-                    echo '</p>';
421
-                    echo '<p>';
422
-                    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
423
-                    echo '</p>';
424
-                    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>' ); 
425
-                    echo '</p>';
426
-                echo '</div><div class="monsterinsights-wooedd-upsell-right">';
427
-                    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
428
-                echo '</div>';
429
-            echo '</div>';
430
-            return;
431
-        }
405
+	if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { 
406
+	    echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">';
407
+		echo '<div class="monsterinsights-wooedd-upsell-left">';
408
+		    echo '<p><strong>';
409
+		    echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' );
410
+		    echo '</strong></p>';
411
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
412
+		    echo '<p>';
413
+		    echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' );
414
+		    echo '</p>';
415
+		    echo '<p>';
416
+		    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' );
417
+		    echo '</p>';
418
+		    echo '<p>';
419
+		    echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' );
420
+		    echo '</p>';
421
+		    echo '<p>';
422
+		    echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' );
423
+		    echo '</p>';
424
+		    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>' ); 
425
+		    echo '</p>';
426
+		echo '</div><div class="monsterinsights-wooedd-upsell-right">';
427
+		    echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">';
428
+		echo '</div>';
429
+	    echo '</div>';
430
+	    return;
431
+	}
432 432
     }
433 433
 }
434 434
 add_action( 'admin_notices', 'monsterinsights_admin_setup_notices' );
Please login to merge, or discard this patch.
includes/admin/common.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -239,15 +239,15 @@
 block discarded – undo
239 239
 		'rml-general', // WP Real Media Library
240 240
 		'rml-library', // WP Real Media Library
241 241
 		'rml-grid', // WP Real Media Library
242
-        'rml-list', // WP Real Media Library
243
-        'rml-modal', // WP Real Media Library
244
-        'rml-order', // WP Real Media Library
245
-        'rml-meta', // WP Real Media Library
246
-        'rml-uploader',  // WP Real Media Library
247
-        'rml-options',  // WP Real Media Library
248
-        'rml-usersettings',  // WP Real Media Library
249
-        'rml-main', // WP Real Media Library
250
-        'control-panel-sweet-alert', // Ken Theme
242
+	'rml-list', // WP Real Media Library
243
+	'rml-modal', // WP Real Media Library
244
+	'rml-order', // WP Real Media Library
245
+	'rml-meta', // WP Real Media Library
246
+	'rml-uploader',  // WP Real Media Library
247
+	'rml-options',  // WP Real Media Library
248
+	'rml-usersettings',  // WP Real Media Library
249
+	'rml-main', // WP Real Media Library
250
+	'control-panel-sweet-alert', // Ken Theme
251 251
 	);
252 252
 
253 253
 	if ( ! empty( $styles ) ) {
Please login to merge, or discard this patch.