@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | |
29 | 29 | if ( $hook === 'monsterinsights_settings' ) { |
30 | 30 | // If dashboards disabled, first settings page |
31 | - add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
31 | + add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
32 | 32 | $hook = 'monsterinsights_settings'; |
33 | 33 | |
34 | 34 | add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
35 | 35 | } else { |
36 | 36 | // if dashboards enabled, first dashboard |
37 | - add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
37 | + add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
38 | 38 | |
39 | 39 | add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' ); |
40 | 40 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
89 | 89 | $hook = 'monsterinsights_network'; |
90 | 90 | $submenu_base = add_query_arg( 'page', 'monsterinsights_network', network_admin_url( 'admin.php' ) ); |
91 | - add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', $menu_icon_inline, '100.00013467543' ); |
|
91 | + add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', $menu_icon_inline, '100.00013467543' ); |
|
92 | 92 | |
93 | 93 | add_submenu_page( $hook, __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Network Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page' ); |
94 | 94 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | function monsterinsights_add_admin_body_class_tools_page( $classes ) { |
130 | 130 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
131 | 131 | |
132 | - if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id ) { |
|
132 | + if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id ) { |
|
133 | 133 | return $classes; |
134 | 134 | } |
135 | 135 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | function monsterinsights_add_admin_body_class_addons_page( $classes ) { |
147 | 147 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
148 | - if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id ) { |
|
148 | + if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id ) { |
|
149 | 149 | return $classes; |
150 | 150 | } |
151 | 151 | |
@@ -161,21 +161,21 @@ discard block |
||
161 | 161 | * @return array $links |
162 | 162 | */ |
163 | 163 | function monsterinsights_add_action_links( $links ) { |
164 | - $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="'. monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) .'"">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>'; |
|
164 | + $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="' . monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) . '"">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>'; |
|
165 | 165 | array_unshift( $links, $docs ); |
166 | 166 | |
167 | 167 | // If lite, show a link where they can get pro from |
168 | 168 | if ( ! monsterinsights_is_pro_version() ) { |
169 | - $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="'. monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
169 | + $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '" href="' . monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) . '">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
170 | 170 | array_unshift( $links, $get_pro ); |
171 | 171 | } |
172 | 172 | |
173 | 173 | // If Lite, support goes to forum. If pro, it goes to our website |
174 | 174 | if ( monsterinsights_is_pro_version() ) { |
175 | - $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
175 | + $support = '<a title="MonsterInsights Pro Support" href="' . monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) . '">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
176 | 176 | array_unshift( $links, $support ); |
177 | 177 | } else { |
178 | - $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
178 | + $support = '<a title="MonsterInsights Lite Support" href="' . monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) . '">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
179 | 179 | array_unshift( $links, $support ); |
180 | 180 | } |
181 | 181 | |
@@ -204,14 +204,14 @@ discard block |
||
204 | 204 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
205 | 205 | |
206 | 206 | if ( file_exists( $dir . $template . '.php' ) ) { |
207 | - require_once( $dir . $template . '.php' ); |
|
207 | + require_once( $dir . $template . '.php' ); |
|
208 | 208 | return true; |
209 | 209 | } |
210 | 210 | } else { |
211 | 211 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
212 | 212 | |
213 | 213 | if ( file_exists( $dir . $template . '.php' ) ) { |
214 | - require_once( $dir . $template . '.php' ); |
|
214 | + require_once( $dir . $template . '.php' ); |
|
215 | 215 | return true; |
216 | 216 | } |
217 | 217 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' ); |
220 | 220 | |
221 | 221 | if ( file_exists( $dir . $template . '.php' ) ) { |
222 | - require_once( $dir . $template . '.php' ); |
|
222 | + require_once( $dir . $template . '.php' ); |
|
223 | 223 | return true; |
224 | 224 | } |
225 | 225 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | global $current_screen; |
239 | 239 | if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) { |
240 | 240 | $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
241 | - $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"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
241 | + $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"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
242 | 242 | } |
243 | 243 | return $text; |
244 | 244 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | $secondary = esc_html__( 'Learn More', 'google-analytics-for-wordpress' ); |
280 | 280 | $urltwo = $submenu_base . '#/about/getting-started'; |
281 | 281 | $message = esc_html__( 'MonsterInsights, WordPress analytics plugin, helps you connect your website with Google Analytics, so you can see how people find and use your website. Over 2 million website owners use MonsterInsights to see the stats that matter and grow their business.', 'google-analytics-for-wordpress' ); |
282 | - echo '<div class="notice notice-info"><p style="font-weight:700">'. $title .'</p><p>'. $message.'</p><p><a href="'. $urlone .'" class="button-primary">'. $primary .'</a> <a href="'. $urltwo .'" class="button-secondary">'. $secondary .'</a></p></div>'; |
|
282 | + echo '<div class="notice notice-info"><p style="font-weight:700">' . $title . '</p><p>' . $message . '</p><p><a href="' . $urlone . '" class="button-primary">' . $primary . '</a> <a href="' . $urltwo . '" class="button-secondary">' . $secondary . '</a></p></div>'; |
|
283 | 283 | return; |
284 | 284 | } |
285 | 285 | |
@@ -287,17 +287,17 @@ discard block |
||
287 | 287 | $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : ''; |
288 | 288 | if ( monsterinsights_is_pro_version() && empty( $key ) ) { |
289 | 289 | $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
290 | - $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>' ); |
|
291 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
290 | + $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>' ); |
|
291 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
292 | 292 | return; |
293 | 293 | } |
294 | 294 | |
295 | 295 | // 3. License key not valid/okay for pro |
296 | 296 | if ( monsterinsights_is_pro_version() ) { |
297 | 297 | $message = ''; |
298 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
298 | + if ( MonsterInsights()->license->get_site_license_key() ) { |
|
299 | 299 | if ( MonsterInsights()->license->site_license_expired() ) { |
300 | - $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="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
300 | + $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="' . monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
301 | 301 | } else if ( MonsterInsights()->license->site_license_disabled() ) { |
302 | 302 | $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
303 | 303 | } else if ( MonsterInsights()->license->site_license_invalid() ) { |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | } |
306 | 306 | } else if ( MonsterInsights()->license->get_network_license_key() ) { |
307 | 307 | if ( MonsterInsights()->license->network_license_expired() ) { |
308 | - $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="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
308 | + $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="' . monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
309 | 309 | } else if ( MonsterInsights()->license->network_license_disabled() ) { |
310 | 310 | $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
311 | 311 | } else if ( MonsterInsights()->license->network_license_invalid() ) { |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | } |
314 | 314 | } |
315 | 315 | if ( ! empty( $message ) ) { |
316 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
316 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
317 | 317 | return; |
318 | 318 | } |
319 | 319 | } |
@@ -326,14 +326,14 @@ discard block |
||
326 | 326 | if ( version_compare( phpversion(), '5.4', '<' ) ) { |
327 | 327 | $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' ); |
328 | 328 | $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress will stop supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
329 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
329 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
330 | 330 | return; |
331 | 331 | } |
332 | 332 | // WordPress 3.0 - 4.5 |
333 | 333 | else if ( version_compare( $wp_version, '4.6', '<' ) ) { |
334 | 334 | $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' ); |
335 | 335 | $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.6 in April, 2019.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
336 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
336 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
337 | 337 | return; |
338 | 338 | } |
339 | 339 | // PHP 5.4/5.5 |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | // } |
378 | 378 | // } |
379 | 379 | |
380 | - $notices = get_option( 'monsterinsights_notices' ); |
|
380 | + $notices = get_option( 'monsterinsights_notices' ); |
|
381 | 381 | if ( ! is_array( $notices ) ) { |
382 | 382 | $notices = array(); |
383 | 383 | } |
@@ -386,10 +386,10 @@ discard block |
||
386 | 386 | $authed = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed(); |
387 | 387 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
388 | 388 | |
389 | - if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { |
|
389 | + if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual'] ) ) { |
|
390 | 390 | echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">'; |
391 | 391 | echo '<p>'; |
392 | - 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>' ); |
|
392 | + 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>' ); |
|
393 | 393 | echo '</p>'; |
394 | 394 | echo '</div>'; |
395 | 395 | return; |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | |
413 | 413 | // 8. WooUpsell |
414 | 414 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
415 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
415 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available'] ) ) { |
|
416 | 416 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
417 | 417 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
418 | 418 | echo '<p><strong>'; |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | echo '<p>'; |
432 | 432 | echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
433 | 433 | echo '</p>'; |
434 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' »</a>' ); |
|
434 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="' . monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) . '">', ' »</a>' ); |
|
435 | 435 | echo '</p>'; |
436 | 436 | echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
437 | 437 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | |
444 | 444 | // 9. EDDUpsell |
445 | 445 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
446 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
446 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available'] ) ) { |
|
447 | 447 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
448 | 448 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
449 | 449 | echo '<p><strong>'; |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | echo '<p>'; |
463 | 463 | echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
464 | 464 | echo '</p>'; |
465 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' »</a>' ); |
|
465 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="' . monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) . '">', ' »</a>' ); |
|
466 | 466 | echo '</p>'; |
467 | 467 | echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
468 | 468 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
@@ -475,8 +475,8 @@ discard block |
||
475 | 475 | if ( isset( $notices['monsterinsights_cross_domains_extracted'] ) && false === $notices['monsterinsights_cross_domains_extracted'] ) { |
476 | 476 | $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
477 | 477 | $page = $page . '#/advanced'; |
478 | - $message = sprintf( esc_html__( 'Warning: MonsterInsights found cross-domain settings in the custom code field and converted them to the new settings structure. %1$sPlease click here to review and remove the code no longer needed.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
479 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>'. $message.'</p></div>'; |
|
478 | + $message = sprintf( esc_html__( 'Warning: MonsterInsights found cross-domain settings in the custom code field and converted them to the new settings structure. %1$sPlease click here to review and remove the code no longer needed.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . esc_url( $page ) . '">', '</a>' ); |
|
479 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>' . $message . '</p></div>'; |
|
480 | 480 | return; |
481 | 481 | } |
482 | 482 | } |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | |
99 | 99 | if ( $create && ! empty( $create ) && is_array( $create ) ) { |
100 | 100 | $create = json_encode( $create ); |
101 | - $create = str_replace( '"', "'", $create ); |
|
102 | - $options['create'] = "'create', '" . esc_js( $ua_code ). "', '" . esc_js( $domain ) . "', " . $create; |
|
101 | + $create = str_replace( '"', "'", $create ); |
|
102 | + $options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "', " . $create; |
|
103 | 103 | } else { |
104 | 104 | $options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "'"; |
105 | 105 | } |
@@ -191,18 +191,18 @@ discard block |
||
191 | 191 | * @return string Javascript to output. |
192 | 192 | */ |
193 | 193 | public function frontend_output( ) { |
194 | - $options = $this->frontend_tracking_options(); |
|
194 | + $options = $this->frontend_tracking_options(); |
|
195 | 195 | $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics.js' ); |
196 | - $compat_mode = monsterinsights_get_option( 'gatracker_compatibility_mode', false ); |
|
196 | + $compat_mode = monsterinsights_get_option( 'gatracker_compatibility_mode', false ); |
|
197 | 197 | $compat = $compat_mode ? 'window.ga = __gaTracker;' : ''; |
198 | 198 | $track_user = monsterinsights_track_user(); |
199 | 199 | $ua = monsterinsights_get_ua(); |
200 | 200 | $output = ''; |
201 | 201 | $reason = ''; |
202 | - $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) ); |
|
202 | + $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) ); |
|
203 | 203 | $attr_string = ''; |
204 | 204 | if ( ! empty( $attributes ) ) { |
205 | - foreach( $attributes as $attr_name => $attr_value ) { |
|
205 | + foreach ( $attributes as $attr_name => $attr_value ) { |
|
206 | 206 | if ( ! empty( $attr_name ) ) { |
207 | 207 | $attr_string .= ' ' . sanitize_key( $attr_name ) . '="' . esc_attr( $attr_value ) . '"'; |
208 | 208 | } else { |
@@ -216,21 +216,21 @@ discard block |
||
216 | 216 | <?php if ( ! $track_user ) { |
217 | 217 | if ( empty( $ua ) ) { |
218 | 218 | $reason = __( 'Note: MonsterInsights is not currently configured on this site. The site owner needs to authenticate with Google Analytics in the MonsterInsights settings panel.', 'google-analytics-for-wordpress' ); |
219 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
219 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
220 | 220 | } else if ( current_user_can( 'monsterinsights_save_settings' ) ) { |
221 | - $reason = __( 'Note: MonsterInsights does not track you as a logged-in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.'. PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' ); |
|
222 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
221 | + $reason = __( 'Note: MonsterInsights does not track you as a logged-in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.' . PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' ); |
|
222 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
223 | 223 | } else { |
224 | 224 | $reason = __( 'Note: The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' ); |
225 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
225 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
226 | 226 | } |
227 | 227 | echo $output; |
228 | 228 | } ?> |
229 | 229 | <?php if ( $ua ) { ?> |
230 | -<script<?php echo $attr_string;?>> |
|
230 | +<script<?php echo $attr_string; ?>> |
|
231 | 231 | var mi_version = '<?php echo MONSTERINSIGHTS_VERSION; ?>'; |
232 | 232 | var mi_track_user = <?php echo ( $track_user ? 'true' : 'false' ); ?>; |
233 | - var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason) . "'": "''" ); ?>; |
|
233 | + var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason ) . "'" : "''" ); ?>; |
|
234 | 234 | <?php do_action( 'monsterinsights_tracking_analytics_frontend_output_after_mi_track_user' ); ?> |
235 | 235 | |
236 | 236 | <?php if ( $this->should_do_optout() ) { ?> |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | ?> |
279 | 279 | } else { |
280 | 280 | <?php if ( $this->should_do_optout() ) { ?> |
281 | - console.log( "<?php echo esc_js( $reason );?>" ); |
|
281 | + console.log( "<?php echo esc_js( $reason ); ?>" ); |
|
282 | 282 | (function() { |
283 | 283 | /* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */ |
284 | 284 | var noopfn = function() { |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | } |
302 | 302 | var f = arguments[len-1]; |
303 | 303 | if ( typeof f !== 'object' || f === null || typeof f.hitCallback !== 'function' ) { |
304 | - console.log( '<?php echo esc_js( __("Not running function", "google-analytics-for-wordpress" ) );?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) );?> " + mi_no_track_reason ); |
|
304 | + console.log( '<?php echo esc_js( __( "Not running function", "google-analytics-for-wordpress" ) ); ?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) ); ?> " + mi_no_track_reason ); |
|
305 | 305 | return; |
306 | 306 | } |
307 | 307 | try { |
@@ -16,7 +16,7 @@ |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | // If user is in admin ajax or doing cron, return |
19 | - if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { |
|
19 | + if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { |
|
20 | 20 | return; |
21 | 21 | } |
22 | 22 |