| Conditions | 49 |
| Paths | > 20000 |
| Total Lines | 320 |
| Code Lines | 156 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 7 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 464 | function monsterinsights_admin_setup_notices() |
||
| 465 | { |
||
| 466 | // Make sure they have the permissions to do something |
||
| 467 | if (!current_user_can('monsterinsights_save_settings')) { |
||
| 468 | return; |
||
| 469 | } |
||
| 470 | |||
| 471 | // Priority: |
||
| 472 | // 0. UA sunset |
||
| 473 | // 1. Google Analytics not authenticated |
||
| 474 | // 2. License key not entered for pro |
||
| 475 | // 3. License key not valid/okay for pro |
||
| 476 | // 4. WordPress + PHP min versions |
||
| 477 | // 5. (old) Optin setting not configured |
||
| 478 | // 6. Manual UA code |
||
| 479 | // 7. Automatic updates not configured |
||
| 480 | // 8. Woo upsell |
||
| 481 | // 9. EDD upsell |
||
| 482 | |||
| 483 | // 0. UA sunset supported alert |
||
| 484 | $profile = is_network_admin() ? MonsterInsights()->auth->get_network_analytics_profile() : MonsterInsights()->auth->get_analytics_profile(); |
||
| 485 | |||
| 486 | if ( !empty($profile['ua']) && empty($profile['v4']) && !monsterinsights_is_own_admin_page() ) { |
||
| 487 | $title = __('Urgent: Your Website is Not Tracking Any Google Analytics Data!', 'google-analytics-for-wordpress'); |
||
| 488 | $message = __('Google Analytics 3 (UA) and support was sunset on July 1, 2023. Your website is currently NOT tracking any analytics. </br>Create or connect a new Google Analytics 4 property immediately to start tracking.', 'google-analytics-for-wordpress'); |
||
| 489 | |||
| 490 | $wizard_url = admin_url('admin.php?page=monsterinsights-onboarding'); |
||
| 491 | |||
| 492 | echo '<div class="notice notice-error is-dismissible monsterinsights-notice" data-notice="monsterinsights_ua_sunset">'; |
||
| 493 | echo '<p><strong>' . $title . '</strong></p>'; |
||
| 494 | echo '<p>' . $message . '</p>'; |
||
| 495 | echo '<p>'; |
||
| 496 | echo '<a href="https://www.monsterinsights.com/docs/connect-google-analytics/" |
||
| 497 | target="_blank" rel="noopener noreferrer">' . |
||
| 498 | __( 'Learn How to Create a GA4 Property', 'google-analytics-for-wordpress' ) . |
||
| 499 | '</a><br>'; |
||
| 500 | echo '<a href="' . $wizard_url . '">' . |
||
| 501 | __( 'Connect a Property', 'google-analytics-for-wordpress' ) . |
||
| 502 | '</a><br>'; |
||
| 503 | echo '</p>'; |
||
| 504 | echo '</div>'; |
||
| 505 | |||
| 506 | return; |
||
| 507 | } |
||
| 508 | |||
| 509 | $is_plugins_page = 'plugins' === get_current_screen()->id; |
||
| 510 | |||
| 511 | // 1. Google Analytics not authenticated |
||
| 512 | if ( ! is_network_admin() && ! monsterinsights_get_v4_id() && ! defined( 'MONSTERINSIGHTS_DISABLE_TRACKING' ) && ! monsterinsights_is_own_admin_page() ) { |
||
| 513 | |||
| 514 | $submenu_base = is_network_admin() ? add_query_arg( 'page', 'monsterinsights_network', network_admin_url( 'admin.php' ) ) : add_query_arg( 'page', 'monsterinsights_settings', admin_url( 'admin.php' ) ); |
||
| 515 | $title = esc_html__( 'Please Setup Website Analytics to See Audience Insights', 'google-analytics-for-wordpress' ); |
||
| 516 | $primary = esc_html__( 'Please Connect Your Website to MonsterInsights', 'google-analytics-for-wordpress' ); |
||
| 517 | $urlone = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights-onboarding' ) : admin_url( 'admin.php?page=monsterinsights-onboarding' ); |
||
| 518 | $secondary = esc_html__( 'Learn More', 'google-analytics-for-wordpress' ); |
||
| 519 | $urltwo = $submenu_base . '#/about/getting-started'; |
||
| 520 | $message = esc_html__( 'MonsterInsights, the #1 WordPress Analytics Plugin, helps you easily connect your website to Google Analytics, so that you can see how people find and use your website. Over 3 million website owners use MonsterInsights to see the stats that matter and grow their business.', 'google-analytics-for-wordpress' ); |
||
| 521 | 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>'; |
||
| 522 | |||
| 523 | return; |
||
| 524 | } |
||
| 525 | |||
| 526 | // 2. License key not entered for pro |
||
| 527 | $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : ''; |
||
| 528 | if (monsterinsights_is_pro_version() && empty($key)) { |
||
| 529 | $page = is_network_admin() ? network_admin_url('admin.php?page=monsterinsights_network') : admin_url('admin.php?page=monsterinsights_settings'); |
||
| 530 | // Translators: Adds a link to retrieve the license. |
||
| 531 | $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>'); |
||
| 532 | echo '<div class="error"><p>' . $message . '</p></div>'; // phpcs:ignore |
||
| 533 | |||
| 534 | return; |
||
| 535 | } |
||
| 536 | |||
| 537 | // 3. License key not valid/okay for pro |
||
| 538 | if (monsterinsights_is_pro_version()) { |
||
| 539 | $message = ''; |
||
| 540 | if (MonsterInsights()->license->get_site_license_key()) { |
||
| 541 | if (MonsterInsights()->license->site_license_expired()) { |
||
| 542 | // Translators: Adds a link to the license renewal. |
||
| 543 | $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>'); |
||
| 544 | } else if (MonsterInsights()->license->site_license_disabled()) { |
||
| 545 | $message = esc_html__('Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress'); |
||
| 546 | } else if (MonsterInsights()->license->site_license_invalid()) { |
||
| 547 | $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'); |
||
| 548 | } |
||
| 549 | } else if (MonsterInsights()->license->get_network_license_key()) { |
||
| 550 | if (MonsterInsights()->license->network_license_expired()) { |
||
| 551 | // Translators: Adds a link to renew license. |
||
| 552 | $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>'); |
||
| 553 | } else if (MonsterInsights()->license->network_license_disabled()) { |
||
| 554 | $message = esc_html__('Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress'); |
||
| 555 | } else if (MonsterInsights()->license->network_license_invalid()) { |
||
| 556 | $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'); |
||
| 557 | } |
||
| 558 | } |
||
| 559 | if (!empty($message)) { |
||
| 560 | echo '<div class="error"><p>' . $message . '</p></div>'; // phpcs:ignore |
||
| 561 | |||
| 562 | return; |
||
| 563 | } |
||
| 564 | } |
||
| 565 | |||
| 566 | // 4. Notices for PHP/WP version deprecations |
||
| 567 | if (current_user_can('update_core')) { |
||
| 568 | global $wp_version; |
||
| 569 | |||
| 570 | $compatible_php_version = apply_filters('monsterinsights_compatible_php_version', false); |
||
| 571 | $compatible_wp_version = apply_filters('monsterinsights_compatible_wp_version', false); |
||
| 572 | |||
| 573 | $url = monsterinsights_get_url('global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/'); |
||
| 574 | |||
| 575 | $message = false; |
||
| 576 | if (version_compare(phpversion(), $compatible_php_version['required'], '<')) { |
||
| 577 | // Translators: Placeholders add the PHP version, a link to the MonsterInsights blog and a line break. |
||
| 578 | $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 stopped 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>'); |
||
| 579 | } else if (version_compare(phpversion(), $compatible_php_version['warning'], '<')) { |
||
| 580 | // Translators: Placeholders add the PHP version, a link to the MonsterInsights blog and a line break. |
||
| 581 | $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 stopped supporting your PHP version in November, 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>'); |
||
| 582 | } else if (version_compare(phpversion(), $compatible_php_version['recommended'], '<')) { |
||
| 583 | // Translators: Placeholders add the PHP version, a link to the MonsterInsights blog and a line break. |
||
| 584 | $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 is working towards discontinuing support for your PHP version.%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>'); |
||
| 585 | } |
||
| 586 | |||
| 587 | if ($message) { |
||
| 588 | echo '<div class="error"><p>' . wp_kses($message, [ |
||
| 589 | 'br' => array(), |
||
| 590 | 'b' => array(), |
||
| 591 | 'strong' => array(), |
||
| 592 | 'i' => array(), |
||
| 593 | 'a' => array( |
||
| 594 | 'href' => array(), |
||
| 595 | 'target' => array(), |
||
| 596 | 'title' => array(), |
||
| 597 | ), |
||
| 598 | ]) . '</p></div>'; |
||
| 599 | return; |
||
| 600 | } |
||
| 601 | |||
| 602 | // WordPress 4.9 |
||
| 603 | /* else if ( version_compare( $wp_version, '5.0', '<' ) ) { |
||
| 604 | $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' ); |
||
| 605 | // Translators: Placeholders add the current WordPress version and links to the MonsterInsights blog |
||
| 606 | $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 5.0 in 2021.%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>' ); |
||
| 607 | echo '<div class="error"><p>'. $message.'</p></div>'; |
||
| 608 | return; |
||
| 609 | } */ |
||
| 610 | // PHP 5.4/5.5 |
||
| 611 | // else if ( version_compare( phpversion(), '5.6', '<' ) ) { |
||
| 612 | // $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' ); |
||
| 613 | // $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>' ); |
||
| 614 | // echo '<div class="error"><p>'. $message.'</p></div>'; |
||
| 615 | // return; |
||
| 616 | // } |
||
| 617 | // // WordPress 4.6 - 4.8 |
||
| 618 | // else if ( version_compare( $wp_version, '4.9', '<' ) ) { |
||
| 619 | // $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' ); |
||
| 620 | // $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.9 in October, 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>' ); |
||
| 621 | // echo '<div class="error"><p>'. $message.'</p></div>'; |
||
| 622 | // return; |
||
| 623 | // } |
||
| 624 | |||
| 625 | } |
||
| 626 | |||
| 627 | // 5. Optin setting not configured |
||
| 628 | // if ( ! is_network_admin() ) { |
||
| 629 | // if ( ! get_option( 'monsterinsights_tracking_notice' ) ) { |
||
| 630 | // if ( ! monsterinsights_get_option( 'anonymous_data', false ) ) { |
||
| 631 | // if ( ! monsterinsights_is_dev_url( network_site_url( '/' ) ) ) { |
||
| 632 | // if ( monsterinsights_is_pro_version() ) { |
||
| 633 | // monsterinsights_update_option( 'anonymous_data', 1 ); |
||
| 634 | // return; |
||
| 635 | // } |
||
| 636 | // $optin_url = add_query_arg( 'mi_action', 'opt_into_tracking' ); |
||
| 637 | // $optout_url = add_query_arg( 'mi_action', 'opt_out_of_tracking' ); |
||
| 638 | // echo '<div class="updated"><p>'; |
||
| 639 | // 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' ); |
||
| 640 | // echo ' <a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'google-analytics-for-wordpress' ) . '</a>'; |
||
| 641 | // echo ' <a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'google-analytics-for-wordpress' ) . '</a>'; |
||
| 642 | // echo '</p></div>'; |
||
| 643 | // return; |
||
| 644 | // } else { |
||
| 645 | // // is testing site |
||
| 646 | // update_option( 'monsterinsights_tracking_notice', '1' ); |
||
| 647 | // } |
||
| 648 | // } |
||
| 649 | // } |
||
| 650 | // } |
||
| 651 | |||
| 652 | $notices = get_option('monsterinsights_notices'); |
||
| 653 | if (!is_array($notices)) { |
||
| 654 | $notices = array(); |
||
| 655 | } |
||
| 656 | |||
| 657 | // 6. Authenticate, not manual |
||
| 658 | $authed = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed(); |
||
| 659 | $url = is_network_admin() ? network_admin_url('admin.php?page=monsterinsights_network') : admin_url('admin.php?page=monsterinsights_settings'); |
||
| 660 | $tracking_code = monsterinsights_get_v4_id_to_output(); |
||
| 661 | // Translators: Placeholders add links to the settings panel. |
||
| 662 | $manual_text = sprintf(esc_html__('Important: You are currently using manual GA4 Measurement ID 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>'); |
||
| 663 | $migrated = monsterinsights_get_option('gadwp_migrated', 0); |
||
| 664 | if ($migrated > 0) { |
||
| 665 | $url = admin_url('admin.php?page=monsterinsights-getting-started&monsterinsights-migration=1'); |
||
| 666 | // Translators: Placeholders add links to the settings panel. |
||
| 667 | $text = esc_html__('Click %1$shere%2$s to reauthenticate to be able to access reports. For more information why this is required, see our %3$sblog post%4$s.', 'google-analytics-for-wordpress'); |
||
| 668 | $manual_text = sprintf($text, '<a href="' . esc_url($url) . '">', '</a>', '<a href="' . monsterinsights_get_url('notice', 'manual-ua', 'https://www.exactmetrics.com/why-did-we-implement-the-new-google-analytics-authentication-flow-challenges-explained/') . '" target="_blank">', '</a>'); |
||
| 669 | } |
||
| 670 | |||
| 671 | if (empty($authed) && !isset($notices['monsterinsights_auth_not_manual']) && !empty($tracking_code)) { |
||
| 672 | echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">'; |
||
| 673 | echo '<p>'; |
||
| 674 | echo $manual_text; // phpcs:ignore |
||
| 675 | echo '</p>'; |
||
| 676 | echo '</div>'; |
||
| 677 | |||
| 678 | return; |
||
| 679 | } |
||
| 680 | |||
| 681 | // 7. Automatic updates not configured |
||
| 682 | // if ( ! is_network_admin() ) { |
||
| 683 | // $updates = monsterinsights_get_option( 'automatic_updates', false ); |
||
| 684 | // $url = admin_url( 'admin.php?page=monsterinsights_settings' ); |
||
| 685 | |||
| 686 | // if ( empty( $updates) && ! isset( $notices['monsterinsights_automatic_updates' ] ) ) { |
||
| 687 | // echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">'; |
||
| 688 | // echo '<p>'; |
||
| 689 | // echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
||
| 690 | // echo '</p>'; |
||
| 691 | // echo '</div>'; |
||
| 692 | // return; |
||
| 693 | // } |
||
| 694 | // } |
||
| 695 | |||
| 696 | // 8. WooUpsell |
||
| 697 | if (!monsterinsights_is_pro_version() && class_exists('WooCommerce') && $is_plugins_page) { |
||
| 698 | if (!isset($notices['monsterinsights_woocommerce_tracking_available'])) { |
||
| 699 | $woo_notice_template = '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available"> |
||
| 700 | %1$s |
||
| 701 | <div class="monsterinsights-wooedd-upsell-left"> |
||
| 702 | <p><strong>%2$s</strong></p> |
||
| 703 | <p>%3$s</p> |
||
| 704 | <p>%4$s</p> |
||
| 705 | <p>%5$s</p> |
||
| 706 | <p>%6$s</p> |
||
| 707 | %7$s |
||
| 708 | %8$s |
||
| 709 | </div> |
||
| 710 | </div>'; |
||
| 711 | |||
| 712 | $woo_notice_button = sprintf( |
||
| 713 | // Translators: Placeholders add a link to the MonsterInsights website. |
||
| 714 | esc_html__('%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress'), |
||
| 715 | '<a class="button button-primary button-hero" target="_blank" href="' . esc_url(monsterinsights_get_upgrade_link('admin-notices', 'woocommerce-upgrade')) . '">', |
||
| 716 | ' »</a>' |
||
| 717 | ); |
||
| 718 | |||
| 719 | $woo_notice_offer = sprintf( |
||
| 720 | '<div class="monsterinsights-wooedd-upsell-offer">%1$s</div>', |
||
| 721 | __('Save <span>50%</span> Off MonsterInsights Pro', 'google-analytics-for-wordpress') |
||
| 722 | ); |
||
| 723 | |||
| 724 | $woo_notice_bg = esc_url(trailingslashit(MONSTERINSIGHTS_PLUGIN_URL)) . 'assets/images/upsell/monsterinsights-woo-edd-upsell.svg'; |
||
| 725 | $woo_notice_offer_icon = esc_url(trailingslashit(MONSTERINSIGHTS_PLUGIN_URL)) . 'assets/images/upsell/woo-offer-icon.svg'; |
||
| 726 | $woo_notice_style = "<style>.monsterinsights-wooedd-upsell-left .button-hero,.monsterinsights-wooedd-upsell-offer{width:270px;margin-bottom:20px;text-align:center}.monsterinsights-wooedd-upsell-row{display:flex;background-image:url($woo_notice_bg);background-repeat:no-repeat;background-position:96% bottom}.monsterinsights-wooedd-upsell-left{margin-left:20px}.monsterinsights-wooedd-upsell-offer{background:#fafeb0;padding:6px 0;position:relative;font-weight:700;font-size:15px;line-height:28px}.monsterinsights-wooedd-upsell-offer span{color:#338eef}.monsterinsights-wooedd-upsell-offer:before{content:url('$woo_notice_offer_icon');position:absolute;left:-23px;bottom:-30px}@media (max-width:1300px){.monsterinsights-wooedd-upsell-row{background-size:60%}}@media (max-width:900px){.monsterinsights-wooedd-upsell-row{background-image:none}.monsterinsights-wooedd-upsell-left,.monsterinsights-wooedd-upsell-left .button-hero,.monsterinsights-wooedd-upsell-offer{width:100%}}</style>"; |
||
| 727 | |||
| 728 | echo sprintf( |
||
| 729 | $woo_notice_template, |
||
| 730 | $woo_notice_style, |
||
| 731 | __('Add eCommerce Analytics to your WooCommerce Store', 'google-analytics-for-wordpress'), |
||
| 732 | __('Unlock all of our advanced eCommerce features specifically designed to help your store make more money..', 'google-analytics-for-wordpress'), |
||
| 733 | __('MonsterInsights Pro users instantly gain access to valuable insights such as average order value, conversion rates, as well as marketing performance with UTM tracking.', 'google-analytics-for-wordpress'), |
||
| 734 | __('And by upgrading, Pro users also get enhanced tracking for Forms, User Journeys, PPC Pixels, Custom UserID tracking, SEO Reports, and much more.', 'google-analytics-for-wordpress'), |
||
| 735 | __('Start making better data-driven decisions today!', 'google-analytics-for-wordpress'), |
||
| 736 | $woo_notice_offer, |
||
| 737 | $woo_notice_button |
||
| 738 | ); |
||
| 739 | return; |
||
| 740 | } |
||
| 741 | } |
||
| 742 | |||
| 743 | // 9. EDDUpsell |
||
| 744 | if (!monsterinsights_is_pro_version() && class_exists('Easy_Digital_Downloads') && $is_plugins_page) { |
||
| 745 | if (!isset($notices['monsterinsights_edd_tracking_available'])) { |
||
| 746 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
||
| 747 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
||
| 748 | echo '<p><strong>'; |
||
| 749 | echo esc_html('Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress'); |
||
| 750 | echo '</strong></p>'; |
||
| 751 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . esc_url(trailingslashit(MONSTERINSIGHTS_PLUGIN_URL)) . 'assets/images/upsell/woo-edd-upsell.png">'; |
||
| 752 | echo '<p>'; |
||
| 753 | echo esc_html('MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress'); |
||
| 754 | echo '</p>'; |
||
| 755 | echo '<p>'; |
||
| 756 | 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'); |
||
| 757 | echo '</p>'; |
||
| 758 | echo '<p>'; |
||
| 759 | echo esc_html('Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress'); |
||
| 760 | echo '</p>'; |
||
| 761 | echo '<p>'; |
||
| 762 | echo esc_html('Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress'); |
||
| 763 | echo '</p>'; |
||
| 764 | echo sprintf(esc_html__('%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress'), '<a class="button button-primary button-hero" target="_blank" href="' . esc_url(monsterinsights_get_upgrade_link('admin-notices', 'edd-upgrade')) . '">', ' »</a>'); |
||
| 765 | echo '</p>'; |
||
| 766 | echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
||
| 767 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . esc_url(trailingslashit(MONSTERINSIGHTS_PLUGIN_URL)) . 'assets/images/upsell/woo-edd-upsell.png">'; |
||
| 768 | echo '</div>'; |
||
| 769 | echo '</div>'; |
||
| 770 | |||
| 771 | return; |
||
| 772 | } |
||
| 773 | } |
||
| 774 | |||
| 775 | |||
| 776 | if (isset($notices['monsterinsights_cross_domains_extracted']) && false === $notices['monsterinsights_cross_domains_extracted']) { |
||
| 777 | $page = is_network_admin() ? network_admin_url('admin.php?page=monsterinsights_network') : admin_url('admin.php?page=monsterinsights_settings'); |
||
| 778 | $page = $page . '#/advanced'; |
||
| 779 | // Translators: Adds a link to the settings panel. |
||
| 780 | $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>'); |
||
| 781 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>' . $message . '</p></div>'; // phpcs:ignore |
||
| 782 | |||
| 783 | return; |
||
| 784 | } |
||
| 883 |