| @@ -649,24 +649,14 @@ | ||
| 649 | 649 | if ( ! $is_installed ) { |
| 650 | 650 | $description = esc_html__( 'Use Site Mailer to ensure store emails like purchase confirmations and shipping updates reach the inbox every time. Included in your ONE subscription.', 'elementor' ); |
| 651 | 651 | $button_text = esc_html__( 'Install now', 'elementor' ); |
| 652 | 652 | $button_url = $this->get_plugin_button_install_url( $plugin_slug ); |
| 653 | - $campaign_data = [ | |
| 654 | - 'name' => 'elementor_site_mailer_campaign', | |
| 655 | - 'campaign' => 'sm-plg-one', | |
| 656 | - 'source' => 'sm-core-woo-one-install', | |
| 657 | - 'medium' => 'wp-dash', | |
| 658 | - ]; | |
| 653 | + $source = 'sm-core-woo-one-install'; | |
| 659 | 654 | } elseif ( ! $is_active ) { |
| 660 | 655 | $description = esc_html__( 'Site Mailer is installed and included in your ONE subscription. Activate it to ensure store emails like purchase confirmations and shipping updates reach the inbox every time.', 'elementor' ); |
| 661 | 656 | $button_text = esc_html__( 'Activate now', 'elementor' ); |
| 662 | 657 | $button_url = $this->get_plugin_button_activate_url( $plugin_file_path ); |
| 663 | - $campaign_data = [ | |
| 664 | - 'name' => 'elementor_site_mailer_campaign', | |
| 665 | - 'campaign' => 'sm-plg-one', | |
| 666 | - 'source' => 'sm-core-woo-one-activate', | |
| 667 | - 'medium' => 'wp-dash', | |
| 668 | - ]; | |
| 658 | + $source = 'sm-core-woo-one-activate'; | |
| 669 | 659 | } |
| 670 | 660 | } else { |
| 671 | 661 | $title = esc_html__( 'Keep your form emails out of the spam folder', 'elementor' ); |
| 672 | 662 | |
| @@ -673,24 +663,14 @@ | ||
| 673 | 663 | if ( ! $is_installed ) { |
| 674 | 664 | $description = esc_html__( 'Use Site Mailer to ensure emails reach the inbox and track delivery with built-in logs. Included in your ONE subscription.', 'elementor' ); |
| 675 | 665 | $button_text = esc_html__( 'Install now', 'elementor' ); |
| 676 | 666 | $button_url = $this->get_plugin_button_install_url( $plugin_slug ); |
| 677 | - $campaign_data = [ | |
| 678 | - 'name' => 'elementor_site_mailer_campaign', | |
| 679 | - 'campaign' => 'sm-plg-one', | |
| 680 | - 'source' => 'sm-core-form-one-install', | |
| 681 | - 'medium' => 'wp-dash', | |
| 682 | - ]; | |
| 667 | + $source = 'sm-core-form-one-install'; | |
| 683 | 668 | } elseif ( ! $is_active ) { |
| 684 | 669 | $description = esc_html__( 'Use Site Mailer to ensure emails reach the inbox and track delivery with built-in logs. Site Mailer is included in your ONE subscription. Activate it to continue.', 'elementor' ); |
| 685 | 670 | $button_text = esc_html__( 'Activate now', 'elementor' ); |
| 686 | 671 | $button_url = $this->get_plugin_button_activate_url( $plugin_file_path ); |
| 687 | - $campaign_data = [ | |
| 688 | - 'name' => 'elementor_site_mailer_campaign', | |
| 689 | - 'campaign' => 'sm-plg-one', | |
| 690 | - 'source' => 'sm-core-form-one-activate', | |
| 691 | - 'medium' => 'wp-dash', | |
| 692 | - ]; | |
| 672 | + $source = 'sm-core-form-one-activate'; | |
| 693 | 673 | } |
| 694 | 674 | } |
| 695 | 675 | // phpcs:ignore Universal.ControlStructures.DisallowLonelyIf.Found |
| 696 | 676 | } else { |
| @@ -700,23 +680,13 @@ | ||
| 700 | 680 | |
| 701 | 681 | if ( ! $is_installed ) { |
| 702 | 682 | $button_text = esc_html__( 'Install now', 'elementor' ); |
| 703 | 683 | $button_url = $this->get_plugin_button_install_url( $plugin_slug ); |
| 704 | - $campaign_data = [ | |
| 705 | - 'name' => 'elementor_site_mailer_campaign', | |
| 706 | - 'campaign' => 'sm-plg', | |
| 707 | - 'source' => 'sm-core-woo-install', | |
| 708 | - 'medium' => 'wp-dash', | |
| 709 | - ]; | |
| 684 | + $source = 'sm-core-woo-install'; | |
| 710 | 685 | } elseif ( ! $is_active ) { |
| 711 | 686 | $button_text = esc_html__( 'Activate now', 'elementor' ); |
| 712 | 687 | $button_url = $this->get_plugin_button_activate_url( $plugin_file_path ); |
| 713 | - $campaign_data = [ | |
| 714 | - 'name' => 'elementor_site_mailer_campaign', | |
| 715 | - 'campaign' => 'sm-plg', | |
| 716 | - 'source' => 'sm-core-woo-activate', | |
| 717 | - 'medium' => 'wp-dash', | |
| 718 | - ]; | |
| 688 | + $source = 'sm-core-woo-activate'; | |
| 719 | 689 | } |
| 720 | 690 | } else { |
| 721 | 691 | $title = esc_html__( 'Ensure your form emails avoid the spam folder!', 'elementor' ); |
| 722 | 692 | $description = esc_html__( 'Use Site Mailer for improved email deliverability, detailed email logs, and an easy setup.', 'elementor' ); |
| @@ -723,23 +693,13 @@ | ||
| 723 | 693 | |
| 724 | 694 | if ( ! $is_installed ) { |
| 725 | 695 | $button_text = esc_html__( 'Install now', 'elementor' ); |
| 726 | 696 | $button_url = $this->get_plugin_button_install_url( $plugin_slug ); |
| 727 | - $campaign_data = [ | |
| 728 | - 'name' => 'elementor_site_mailer_campaign', | |
| 729 | - 'campaign' => 'sm-plg', | |
| 730 | - 'source' => 'sm-core-form-install', | |
| 731 | - 'medium' => 'wp-dash', | |
| 732 | - ]; | |
| 697 | + $source = 'sm-core-form-install'; | |
| 733 | 698 | } elseif ( ! $is_active ) { |
| 734 | 699 | $button_text = esc_html__( 'Activate now', 'elementor' ); |
| 735 | 700 | $button_url = $this->get_plugin_button_activate_url( $plugin_file_path ); |
| 736 | - $campaign_data = [ | |
| 737 | - 'name' => 'elementor_site_mailer_campaign', | |
| 738 | - 'campaign' => 'sm-plg', | |
| 739 | - 'source' => 'sm-core-form-activate', | |
| 740 | - 'medium' => 'wp-dash', | |
| 741 | - ]; | |
| 701 | + $source = 'sm-core-form-activate'; | |
| 742 | 702 | } |
| 743 | 703 | } |
| 744 | 704 | } |
| 745 | 705 | |
| @@ -753,14 +713,12 @@ | ||
| 753 | 713 | 'id' => $notice_id, |
| 754 | 714 | 'type' => 'cta', |
| 755 | 715 | 'button' => [ |
| 756 | 716 | 'text' => $button_text, |
| 757 | - 'url' => self::add_plg_campaign_data( $button_url, $campaign_data ), | |
| 717 | + 'url' => $button_url, | |
| 758 | 718 | 'type' => 'cta', |
| 759 | 719 | 'data' => [ |
| 760 | - 'campaign' => $campaign_data['campaign'], | |
| 761 | - 'source' => $campaign_data['source'], | |
| 762 | - 'medium' => $campaign_data['medium'], | |
| 720 | + 'source' => $source, | |
| 763 | 721 | ], |
| 764 | 722 | ], |
| 765 | 723 | 'button_secondary' => [ |
| 766 | 724 | 'text' => esc_html__( 'Learn more', 'elementor' ), |
| @@ -892,9 +850,9 @@ | ||
| 892 | 850 | $button_text = esc_html__( 'Install now', 'elementor' ); |
| 893 | 851 | $button_url = $this->get_plugin_button_install_url( $plugin_slug ); |
| 894 | 852 | $campaign_data = [ |
| 895 | 853 | 'name' => 'elementor_image_optimization_campaign', |
| 896 | - 'campaign' => 'io-plg-one', | |
| 854 | + 'campaign' => 'image-optimization-plg-wp-media-library-one-install', | |
| 897 | 855 | 'source' => 'io-wp-media-library-one-install', |
| 898 | 856 | 'medium' => 'wp-dash-one', |
| 899 | 857 | ]; |
| 900 | 858 | } elseif ( ! $is_active ) { |
| @@ -902,9 +860,9 @@ | ||
| 902 | 860 | $button_text = esc_html__( 'Activate now', 'elementor' ); |
| 903 | 861 | $button_url = $this->get_plugin_button_activate_url( $plugin_file_path ); |
| 904 | 862 | $campaign_data = [ |
| 905 | 863 | 'name' => 'elementor_image_optimization_campaign', |
| 906 | - 'campaign' => 'io-plg-one', | |
| 864 | + 'campaign' => 'image-optimization-plg-wp-media-library-one-activate', | |
| 907 | 865 | 'source' => 'io-wp-media-library-one-activate', |
| 908 | 866 | 'medium' => 'wp-dash-one', |
| 909 | 867 | ]; |
| 910 | 868 | } |
| @@ -915,9 +873,9 @@ | ||
| 915 | 873 | $button_text = esc_html__( 'Install now', 'elementor' ); |
| 916 | 874 | $button_url = $this->get_plugin_button_install_url( $plugin_slug ); |
| 917 | 875 | $campaign_data = [ |
| 918 | 876 | 'name' => 'elementor_image_optimization_campaign', |
| 919 | - 'campaign' => 'io-plg', | |
| 877 | + 'campaign' => 'image-optimization-plg-wp-media-library-install', | |
| 920 | 878 | 'source' => 'io-wp-media-library-install', |
| 921 | 879 | 'medium' => 'wp-dash', |
| 922 | 880 | ]; |
| 923 | 881 | } elseif ( ! $is_active ) { |
| @@ -924,9 +882,9 @@ | ||
| 924 | 882 | $button_text = esc_html__( 'Activate now', 'elementor' ); |
| 925 | 883 | $button_url = $this->get_plugin_button_activate_url( $plugin_file_path ); |
| 926 | 884 | $campaign_data = [ |
| 927 | 885 | 'name' => 'elementor_image_optimization_campaign', |
| 928 | - 'campaign' => 'io-plg', | |
| 886 | + 'campaign' => 'image-optimization-plg-wp-media-library-activate', | |
| 929 | 887 | 'source' => 'io-wp-media-library-activate', |
| 930 | 888 | 'medium' => 'wp-dash', |
| 931 | 889 | ]; |
| 932 | 890 | } |
| @@ -938,14 +896,12 @@ | ||
| 938 | 896 | 'id' => $notice_id, |
| 939 | 897 | 'type' => 'cta', |
| 940 | 898 | 'button' => [ |
| 941 | 899 | 'text' => $button_text, |
| 942 | - 'url' => self::add_plg_campaign_data( $button_url, $campaign_data ), | |
| 900 | + 'url' => $button_url, | |
| 943 | 901 | 'type' => 'cta', |
| 944 | 902 | 'data' => [ |
| 945 | - 'campaign' => $campaign_data['campaign'], | |
| 946 | 903 | 'source' => $campaign_data['source'], |
| 947 | - 'medium' => $campaign_data['medium'], | |
| 948 | 904 | ], |
| 949 | 905 | ], |
| 950 | 906 | ]; |
| 951 | 907 | |
| @@ -982,12 +938,9 @@ | ||
| 982 | 938 | if ( $options['type'] ) { |
| 983 | 939 | $notice_classes[] = 'e-notice--' . $options['type']; |
| 984 | 940 | } |
| 985 | 941 | |
| 986 | - $wrapper_attributes = [ | |
| 987 | - 'role' => 'region', | |
| 988 | - 'aria-label' => esc_html__( 'Elementor notice', 'elementor' ), | |
| 989 | - ]; | |
| 942 | + $wrapper_attributes = []; | |
| 990 | 943 | |
| 991 | 944 | if ( $options['dismissible'] ) { |
| 992 | 945 | $label = esc_html__( 'Dismiss this notice.', 'elementor' ); |
| 993 | 946 | $notice_classes[] = 'e-notice--dismissible'; |
| @@ -1142,9 +1095,8 @@ | ||
| 1142 | 1095 | */ |
| 1143 | 1096 | public function __construct() { |
| 1144 | 1097 | add_action( 'admin_notices', [ $this, 'admin_notices' ], 20 ); |
| 1145 | 1098 | add_action( 'admin_action_install-plugin', [ $this, 'maybe_log_campaign' ] ); |
| 1146 | - add_action( 'admin_action_activate', [ $this, 'maybe_log_campaign' ] ); | |
| 1147 | 1099 | } |
| 1148 | 1100 | |
| 1149 | 1101 | /** |
| 1150 | 1102 | * Get module name. |