PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.0-dev3
Elementor Website Builder – more than just a page builder v3.32.0-dev3
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | core/admin/admin-notices.php +209 -171 4.3.0-beta33.32.0-dev3 View file →
@@ -3,11 +3,11 @@
3 3
4 4 use Elementor\Api;
5 5 use Elementor\Core\Admin\UI\Components\Button;
6 6 use Elementor\Core\Base\Module;
7 -use Elementor\Core\Utils\Hints;
8 7 use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager;
9 8 use Elementor\Plugin;
9 +use Elementor\Settings;
10 10 use Elementor\Tracker;
11 11 use Elementor\User;
12 12 use Elementor\Utils;
13 13 use Elementor\Core\Admin\Notices\Base_Notice;
@@ -19,10 +19,8 @@
19 19 class Admin_Notices extends Module {
20 20
21 21 const DEFAULT_EXCLUDED_PAGES = [ 'plugins.php', 'plugin-install.php', 'plugin-editor.php' ];
22 22
23 - const EXIT_EARLY_FOR_BACKWARD_COMPATIBILITY = false;
24 -
25 23 private $plain_notices = [
26 24 'api_notice',
27 25 'api_upgrade_plugin',
28 26 'tracker',
@@ -28,8 +26,11 @@
28 26 'tracker',
29 27 'tracker_last_update',
30 28 'rate_us_feedback',
31 29 'role_manager_promote',
30 + 'experiment_promotion',
31 + 'send_app_promotion',
32 + 'site_mailer_promotion',
32 33 'plugin_image_optimization',
33 34 'ally_pages_promotion',
34 35 ];
35 36
@@ -131,16 +132,16 @@
131 132 $message = sprintf(
132 133 /* translators: 1: Details URL, 2: Accessibility text, 3: Version number, 4: Update URL, 5: Accessibility text. */
133 134 __( 'There is a new version of Elementor Page Builder available. <a href="%1$s" class="thickbox open-plugin-details-modal" aria-label="%2$s">View version %3$s details</a> or <a href="%4$s" class="update-link" aria-label="%5$s">update now</a>.', 'elementor' ),
134 135 esc_url( $details_url ),
135 - sprintf(
136 + esc_attr( sprintf(
136 137 /* translators: %s: Elementor version. */
137 - esc_attr__( 'View Elementor version %s details', 'elementor' ),
138 + __( 'View Elementor version %s details', 'elementor' ),
138 139 $new_version
139 - ),
140 + ) ),
140 141 $new_version,
141 142 esc_url( $upgrade_url ),
142 - esc_attr__( 'Update Now', 'elementor' )
143 + esc_attr( esc_html__( 'Update Now', 'elementor' ) )
143 144 );
144 145
145 146 $options = [
146 147 'title' => esc_html__( 'Update Notification', 'elementor' ),
@@ -380,8 +381,54 @@
380 381
381 382 return true;
382 383 }
383 384
385 + private function notice_experiment_promotion() {
386 + $notice_id = 'experiment_promotion';
387 +
388 + if ( ! current_user_can( 'manage_options' ) || User::is_user_notice_viewed( $notice_id ) ) {
389 + return false;
390 + }
391 +
392 + $experiments = Plugin::$instance->experiments;
393 + $is_all_performance_features_active = (
394 + $experiments->is_feature_active( 'e_font_icon_svg' )
395 + );
396 +
397 + if ( $is_all_performance_features_active ) {
398 + return false;
399 + }
400 +
401 + $options = [
402 + 'title' => esc_html__( 'Improve your site’s performance score.', 'elementor' ),
403 + 'description' => esc_html__( 'With our experimental speed boosting features you can go faster than ever before. Look for the Performance label on our Experiments page and activate those experiments to improve your site loading speed.', 'elementor' ),
404 + 'id' => $notice_id,
405 + 'button' => [
406 + 'text' => esc_html__( 'Try it out', 'elementor' ),
407 + 'url' => Settings::get_settings_tab_url( 'experiments' ),
408 + 'type' => 'cta',
409 + ],
410 + 'button_secondary' => [
411 + 'text' => esc_html__( 'Learn more', 'elementor' ),
412 + 'url' => 'https://go.elementor.com/wp-dash-experiment-promotion/',
413 + 'new_tab' => true,
414 + 'type' => 'cta',
415 + ],
416 + ];
417 +
418 + $this->print_admin_notice( $options );
419 +
420 + return true;
421 + }
422 +
423 + private function site_has_forms_plugins() {
424 + return defined( 'WPFORMS_VERSION' ) || defined( 'WPCF7_VERSION' ) || defined( 'FLUENTFORM_VERSION' ) || class_exists( '\GFCommon' ) || class_exists( '\Ninja_Forms' ) || function_exists( 'load_formidable_forms' ) || did_action( 'metform/after_load' ) || defined( 'FORMINATOR_PLUGIN_BASENAME' );
425 + }
426 +
427 + private function site_has_woocommerce() {
428 + return class_exists( 'WooCommerce' );
429 + }
430 +
384 431 private function get_installed_form_plugin_name() {
385 432 static $detected_form_plugin = null;
386 433
387 434 if ( null !== $detected_form_plugin ) {
@@ -415,8 +462,56 @@
415 462 $detected_form_plugin = false;
416 463 return $detected_form_plugin;
417 464 }
418 465
466 + private function notice_send_app_promotion() {
467 + $notice_id = 'send_app_promotion';
468 +
469 + if ( ! $this->is_elementor_page() && ! $this->is_elementor_admin_screen() ) {
470 + return false;
471 + }
472 +
473 + if ( time() < $this->get_install_time() + ( 60 * DAY_IN_SECONDS ) ) {
474 + return false;
475 + }
476 +
477 + if ( ! current_user_can( 'install_plugins' ) || User::is_user_notice_viewed( $notice_id ) ) {
478 + return false;
479 + }
480 +
481 + $plugin_file_path = 'send/send-app.php';
482 + $plugin_slug = 'send-app';
483 +
484 + $cta_data = $this->get_plugin_cta_data( $plugin_slug, $plugin_file_path );
485 + if ( empty( $cta_data ) ) {
486 + return false;
487 + }
488 +
489 + $title = sprintf( esc_html__( 'Turn leads into loyal shoppers', 'elementor' ) );
490 +
491 + $options = [
492 + 'title' => $title,
493 + 'description' => esc_html__( 'Collecting leads is just the beginning. With Send by Elementor, you can manage contacts, launch automations, and turn form submissions into sales.', 'elementor' ),
494 + 'id' => $notice_id,
495 + 'type' => 'cta',
496 + 'button' => [
497 + 'text' => $cta_data['text'],
498 + 'url' => $cta_data['url'],
499 + 'type' => 'cta',
500 + ],
501 + 'button_secondary' => [
502 + 'text' => esc_html__( 'Learn more', 'elementor' ),
503 + 'url' => 'https://go.elementor.com/Formslearnmore',
504 + 'new_tab' => true,
505 + 'type' => 'cta',
506 + ],
507 + ];
508 +
509 + $this->print_admin_notice( $options );
510 +
511 + return true;
512 + }
513 +
419 514 private function notice_ally_pages_promotion() {
420 515 global $pagenow;
421 516 $notice_id = 'ally_pages_promotion';
422 517
@@ -423,99 +518,124 @@
423 518 if ( 'edit.php' !== $pagenow || empty( $_GET['post_type'] ) || 'page' !== $_GET['post_type'] ) {
424 519 return false;
425 520 }
426 521
427 - if ( ! current_user_can( 'manage_options' ) ) {
522 + if ( ! current_user_can( 'manage_options' ) || User::is_user_notice_viewed( $notice_id ) ) {
428 523 return false;
429 524 }
430 525
431 - if ( User::is_user_notice_viewed( $notice_id ) ) {
526 + $plugin_file_path = 'pojo-accessibility/pojo-accessibility.php';
527 + $plugin_slug = 'pojo-accessibility';
528 +
529 + $cta_data = $this->get_plugin_cta_data( $plugin_slug, $plugin_file_path );
530 + if ( empty( $cta_data ) ) {
432 531 return false;
433 532 }
434 533
435 - $plugin_slug = 'pojo-accessibility';
436 - $plugin_file_path = 'pojo-accessibility/pojo-accessibility.php';
534 + $options = [
535 + 'title' => esc_html__( 'Make sure your site has an accessibility statement page', 'elementor' ),
536 + 'description' => esc_html__( 'Create a more inclusive site experience for all your visitors. With Ally, it\'s easy to add your statement page in just a few clicks.', 'elementor' ),
537 + 'id' => $notice_id,
538 + 'type' => 'cta',
539 + 'button' => [
540 + 'text' => $cta_data['text'],
541 + 'url' => self::add_plg_campaign_data( $cta_data['url'], [
542 + 'name' => 'elementor_ea11y_campaign',
543 + 'campaign' => 'acc-statement-plg-pages',
544 + 'source' => 'wp-pages',
545 + 'medium' => 'wp-dash',
546 + ] ),
547 + 'type' => 'cta',
548 + ],
549 + 'button_secondary' => [
550 + 'text' => esc_html__( 'Learn more', 'elementor' ),
551 + 'url' => 'https://go.elementor.com/acc-plg-learn-more',
552 + 'new_tab' => true,
553 + 'type' => 'cta',
554 + ],
555 + ];
437 556
438 - $one_subscription = Hints::is_plugin_connected_to_one_subscription();
439 - $is_installed = Hints::is_plugin_installed( $plugin_slug );
440 - $is_active = Hints::is_plugin_active( $plugin_slug );
557 + $this->print_admin_notice( $options );
441 558
442 - if ( $is_active ) {
559 + return true;
560 + }
561 +
562 + private function notice_site_mailer_promotion() {
563 + $notice_id = 'site_mailer_promotion';
564 + $has_forms = $this->site_has_forms_plugins();
565 + $has_woocommerce = $this->site_has_woocommerce();
566 +
567 + if ( ! $has_forms && ! $has_woocommerce ) {
443 568 return false;
444 569 }
445 570
446 - if ( $one_subscription ) {
447 - $learn_more_url = 'https://go.elementor.com/acc-plg-learn-more-one';
571 + if ( ! $this->is_elementor_page() && ! $this->is_elementor_admin_screen() ) {
572 + return false;
573 + }
448 574
449 - if ( ! $is_installed ) {
450 - $description = esc_html__( 'Make sure your site has an accessibility statement page. Install Web Accessibility, included in ONE, to create it in a few clicks.', 'elementor' );
451 - $button_text = esc_html__( 'Install now', 'elementor' );
452 - $button_url = $this->get_plugin_button_install_url( $plugin_slug );
453 - $campaign_data = [
454 - 'name' => 'elementor_ea11y_campaign',
455 - 'campaign' => 'acc-statement-plg-pages-one-install',
456 - 'source' => 'wp-pages-one-install',
457 - 'medium' => 'wp-dash-one',
458 - ];
459 - } elseif ( ! $is_active ) {
460 - $description = esc_html__( 'Your ONE subscription includes Web Accessibility. Activate it to create your accessibility statement page quickly.', 'elementor' );
461 - $button_text = esc_html__( 'Activate now', 'elementor' );
462 - $button_url = $this->get_plugin_button_activate_url( $plugin_file_path );
463 - $campaign_data = [
464 - 'name' => 'elementor_ea11y_campaign',
465 - 'campaign' => 'acc-statement-plg-pages-one-activate',
466 - 'source' => 'wp-pages-one-activate',
467 - 'medium' => 'wp-dash-one',
468 - ];
469 - }
470 - } else {
471 - $description = esc_html__( "Create a more inclusive site experience for all your visitors. With Web Accessibility, it's easy to add your statement page in just a few clicks.", 'elementor' );
472 - $learn_more_url = 'https://go.elementor.com/acc-plg-learn-more';
575 + if ( ( Utils::has_pro() && ! $has_woocommerce ) || ! current_user_can( 'install_plugins' ) || User::is_user_notice_viewed( $notice_id ) ) {
576 + return false;
577 + }
473 578
474 - if ( ! $is_installed ) {
475 - $button_text = esc_html__( 'Install now', 'elementor' );
476 - $button_url = $this->get_plugin_button_install_url( $plugin_slug );
477 - $campaign_data = [
478 - 'name' => 'elementor_ea11y_campaign',
479 - 'campaign' => 'acc-statement-plg-pages-install',
480 - 'source' => 'wp-pages-install',
481 - 'medium' => 'wp-dash',
482 - ];
483 - } elseif ( ! $is_active ) {
484 - $button_text = esc_html__( 'Activate now', 'elementor' );
485 - $button_url = $this->get_plugin_button_activate_url( $plugin_file_path );
486 - $campaign_data = [
487 - 'name' => 'elementor_ea11y_campaign',
488 - 'campaign' => 'acc-statement-plg-pages-activate',
489 - 'source' => 'wp-pages-activate',
490 - 'medium' => 'wp-dash',
491 - ];
492 - }
579 + $plugin_file_path = 'site-mailer/site-mailer.php';
580 + $plugin_slug = 'site-mailer';
581 +
582 + $cta_data = $this->get_plugin_cta_data( $plugin_slug, $plugin_file_path );
583 + if ( empty( $cta_data ) ) {
584 + return false;
493 585 }
494 586
495 587 $options = [
496 - 'title' => esc_html__( 'Make sure your site has an accessibility statement page', 'elementor' ),
497 - 'description' => $description,
588 + 'title' => esc_html__( 'Ensure your form emails avoid the spam folder!', 'elementor' ),
589 + 'description' => esc_html__( 'Use Site Mailer for improved email deliverability, detailed email logs, and an easy setup.', 'elementor' ),
498 590 'id' => $notice_id,
499 591 'type' => 'cta',
500 592 'button' => [
501 - 'text' => $button_text,
502 - 'url' => self::add_plg_campaign_data( $button_url, $campaign_data ),
593 + 'text' => $cta_data['text'],
594 + 'url' => $cta_data['url'],
503 595 'type' => 'cta',
504 596 ],
505 597 'button_secondary' => [
506 598 'text' => esc_html__( 'Learn more', 'elementor' ),
507 - 'url' => $learn_more_url,
599 + 'url' => 'https://go.elementor.com/sm-core-form/',
508 600 'new_tab' => true,
509 601 'type' => 'cta',
510 602 ],
511 603 ];
512 604
605 + if ( $this->should_render_woocommerce_hint( $has_forms, $has_woocommerce ) ) {
606 + // We include WP's default notice class so it will be properly handled by WP's js handler
607 + // And add a new one to distinguish between the two types of notices
608 + $options['classes'] = [ 'notice', 'e-notice', 'sm-notice-wc' ];
609 + $options['title'] = esc_html__( 'Improve Transactional Email Deliverability', 'elementor' );
610 + $options['description'] = esc_html__( 'Use Elementor\'s Site Mailer to ensure your store emails like purchase confirmations, shipping updates and more are reliably delivered.', 'elementor' );
611 + }
612 +
513 613 $this->print_admin_notice( $options );
514 614
515 615 return true;
516 616 }
517 617
618 + private function should_render_woocommerce_hint( $has_forms, $has_woocommerce ): bool {
619 + if ( ! $has_forms && ! $has_woocommerce ) {
620 + return false;
621 + }
622 +
623 + if ( ! $has_forms && $has_woocommerce ) {
624 + return true;
625 + }
626 +
627 + if ( $has_forms && $has_woocommerce && Utils::has_pro() ) {
628 + return true;
629 + }
630 +
631 + if ( ! $has_woocommerce ) {
632 + return false;
633 + }
634 +
635 + return (bool) wp_rand( 0, 1 );
636 + }
637 +
518 638 private function is_elementor_page(): bool {
519 639 return 0 === strpos( $this->current_screen_id, 'elementor_page' );
520 640 }
521 641
@@ -525,31 +645,20 @@
525 645
526 646 private function is_elementor_admin_screen_with_system_info(): bool {
527 647 return in_array( $this->current_screen_id, [ 'toplevel_page_elementor', 'edit-elementor_library', 'elementor_page_elementor-system-info', 'dashboard' ], true );
528 648 }
529 - private function get_plugin_button_install_url( $plugin_slug ) {
530 - return wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $plugin_slug ), 'install-plugin_' . $plugin_slug );
531 - }
532 649
533 - private function get_plugin_button_activate_url( $plugin_file_path ) {
534 - return wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin_file_path . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin_file_path );
535 - }
536 -
537 - private function get_plugin_button_connect_url( $plugin_settings_page ) {
538 - return self_admin_url( $plugin_settings_page );
539 - }
540 -
541 650 private function get_plugin_cta_data( $plugin_slug, $plugin_file_path ) {
542 - if ( Hints::is_plugin_active( $plugin_slug ) ) {
651 + if ( is_plugin_active( $plugin_file_path ) ) {
543 652 return false;
544 653 }
545 654
546 - if ( Hints::is_plugin_installed( $plugin_slug ) ) {
547 - $url = $this->get_plugin_button_activate_url( $plugin_file_path );
548 - $cta_text = esc_html__( 'Activate now', 'elementor' );
655 + if ( $this->is_plugin_installed( $plugin_file_path ) ) {
656 + $url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin_file_path . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin_file_path );
657 + $cta_text = esc_html__( 'Activate Plugin', 'elementor' );
549 658 } else {
550 - $url = $this->get_plugin_button_install_url( $plugin_slug );
551 - $cta_text = esc_html__( 'Install now', 'elementor' );
659 + $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $plugin_slug ), 'install-plugin_' . $plugin_slug );
660 + $cta_text = esc_html__( 'Install Plugin', 'elementor' );
552 661 }
553 662
554 663 return [
555 664 'url' => $url,
@@ -570,16 +679,12 @@
570 679 if ( 'upload' !== $this->current_screen_id ) {
571 680 return false;
572 681 }
573 682
574 - if ( ! current_user_can( 'manage_options' ) ) {
683 + if ( ! current_user_can( 'manage_options' ) || User::is_user_notice_viewed( $notice_id ) ) {
575 684 return false;
576 685 }
577 686
578 - if ( User::is_user_notice_viewed( $notice_id ) ) {
579 - return false;
580 - }
581 -
582 687 $attachments = new \WP_Query( [
583 688 'post_type' => 'attachment',
584 689 'post_status' => 'any',
585 690 'fields' => 'ids',
@@ -588,79 +693,26 @@
588 693 if ( 1 > $attachments->found_posts ) {
589 694 return false;
590 695 }
591 696
697 + $plugin_file_path = 'image-optimization/image-optimization.php';
592 698 $plugin_slug = 'image-optimization';
593 - $plugin_file_path = 'image-optimization/image-optimization.php';
594 699
595 - $one_subscription = Hints::is_plugin_connected_to_one_subscription();
596 - $is_installed = Hints::is_plugin_installed( $plugin_slug );
597 - $is_active = Hints::is_plugin_active( $plugin_slug );
700 + $cta_data = $this->get_plugin_cta_data( $plugin_slug, $plugin_file_path );
598 701
599 - if ( $is_active ) {
702 + if ( empty( $cta_data ) ) {
600 703 return false;
601 704 }
602 705
603 - if ( $one_subscription ) {
604 - if ( ! $is_installed ) {
605 - $description = esc_html__( 'Automatically optimize images to improve site speed and performance. Included with your ONE subscription.', 'elementor' );
606 - $button_text = esc_html__( 'Install now', 'elementor' );
607 - $button_url = $this->get_plugin_button_install_url( $plugin_slug );
608 - $campaign_data = [
609 - 'name' => 'elementor_image_optimization_campaign',
610 - 'campaign' => 'io-plg-one',
611 - 'source' => 'io-wp-media-library-one-install',
612 - 'medium' => 'wp-dash-one',
613 - ];
614 - } elseif ( ! $is_active ) {
615 - $description = esc_html__( 'Your ONE subscription includes Image Optimization. Activate it to optimize images and improve site performance.', 'elementor' );
616 - $button_text = esc_html__( 'Activate now', 'elementor' );
617 - $button_url = $this->get_plugin_button_activate_url( $plugin_file_path );
618 - $campaign_data = [
619 - 'name' => 'elementor_image_optimization_campaign',
620 - 'campaign' => 'io-plg-one',
621 - 'source' => 'io-wp-media-library-one-activate',
622 - 'medium' => 'wp-dash-one',
623 - ];
624 - }
625 - } else {
626 - $description = esc_html__( 'Automatically compress and optimize images, resize larger files, or convert to WebP. Optimize images individually, in bulk, or on upload.', 'elementor' );
627 -
628 - if ( ! $is_installed ) {
629 - $button_text = esc_html__( 'Install now', 'elementor' );
630 - $button_url = $this->get_plugin_button_install_url( $plugin_slug );
631 - $campaign_data = [
632 - 'name' => 'elementor_image_optimization_campaign',
633 - 'campaign' => 'io-plg',
634 - 'source' => 'io-wp-media-library-install',
635 - 'medium' => 'wp-dash',
636 - ];
637 - } elseif ( ! $is_active ) {
638 - $button_text = esc_html__( 'Activate now', 'elementor' );
639 - $button_url = $this->get_plugin_button_activate_url( $plugin_file_path );
640 - $campaign_data = [
641 - 'name' => 'elementor_image_optimization_campaign',
642 - 'campaign' => 'io-plg',
643 - 'source' => 'io-wp-media-library-activate',
644 - 'medium' => 'wp-dash',
645 - ];
646 - }
647 - }
648 -
649 706 $options = [
650 - 'title' => esc_html__( 'Speed up your website with Image Optimization', 'elementor' ),
651 - 'description' => $description,
707 + 'title' => esc_html__( 'Speed up your website with Image Optimizer by Elementor', 'elementor' ),
708 + 'description' => esc_html__( 'Automatically compress and optimize images, resize larger files, or convert to WebP. Optimize images individually, in bulk, or on upload.', 'elementor' ),
652 709 'id' => $notice_id,
653 710 'type' => 'cta',
654 - 'button' => [
655 - 'text' => $button_text,
656 - 'url' => self::add_plg_campaign_data( $button_url, $campaign_data ),
711 + 'button_secondary' => [
712 + 'text' => $cta_data['text'],
713 + 'url' => $cta_data['url'],
657 714 'type' => 'cta',
658 - 'data' => [
659 - 'campaign' => $campaign_data['campaign'],
660 - 'source' => $campaign_data['source'],
661 - 'medium' => $campaign_data['medium'],
662 - ],
663 715 ],
664 716 ];
665 717
666 718 $this->print_admin_notice( $options );
@@ -667,8 +719,14 @@
667 719
668 720 return true;
669 721 }
670 722
723 + private function is_plugin_installed( $file_path ): bool {
724 + $installed_plugins = get_plugins();
725 +
726 + return isset( $installed_plugins[ $file_path ] );
727 + }
728 +
671 729 public function print_admin_notice( array $options, $exclude_pages = self::DEFAULT_EXCLUDED_PAGES ) {
672 730 global $pagenow;
673 731
674 732 if ( in_array( $pagenow, $exclude_pages, true ) ) {
@@ -681,9 +739,9 @@
681 739 'description' => '',
682 740 'classes' => [ 'notice', 'e-notice' ], // We include WP's default notice class so it will be properly handled by WP's js handler
683 741 'type' => '',
684 742 'dismissible' => true,
685 - 'icon' => 'eicon-elementor-circle',
743 + 'icon' => 'eicon-elementor',
686 744 'button' => [],
687 745 'button_secondary' => [],
688 746 ];
689 747
@@ -696,12 +754,9 @@
696 754 if ( $options['type'] ) {
697 755 $notice_classes[] = 'e-notice--' . $options['type'];
698 756 }
699 757
700 - $wrapper_attributes = [
701 - 'role' => 'region',
702 - 'aria-label' => esc_html__( 'Elementor notice', 'elementor' ),
703 - ];
758 + $wrapper_attributes = [];
704 759
705 760 if ( $options['dismissible'] ) {
706 761 $label = esc_html__( 'Dismiss this notice.', 'elementor' );
707 762 $notice_classes[] = 'e-notice--dismissible';
@@ -719,12 +774,8 @@
719 774
720 775 if ( $options['id'] ) {
721 776 $wrapper_attributes['data-notice_id'] = $options['id'];
722 777 }
723 -
724 - if ( ! empty( $options['source'] ) ) {
725 - $wrapper_attributes['data-source'] = $options['source'];
726 - }
727 778 ?>
728 779 <div <?php Utils::print_html_attributes( $wrapper_attributes ); ?>>
729 780 <?php echo $dismiss_button; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
730 781 <div class="e-notice__aside">
@@ -741,9 +792,8 @@
741 792
742 793 <?php if ( ! empty( $options['button']['text'] ) || ! empty( $options['button_secondary']['text'] ) ) { ?>
743 794 <div class="e-notice__actions">
744 795 <?php
745 - $one_subscription = Hints::is_plugin_connected_to_one_subscription();
746 796 foreach ( [ $options['button'], $options['button_secondary'] ] as $index => $button_settings ) {
747 797 if ( empty( $button_settings['variant'] ) && $index ) {
748 798 $button_settings['variant'] = 'outline';
749 799 }
@@ -751,20 +801,8 @@
751 801 if ( empty( $button_settings['text'] ) ) {
752 802 continue;
753 803 }
754 804
755 - if ( $one_subscription ) {
756 - if ( ! isset( $button_settings['classes'] ) ) {
757 - $button_settings['classes'] = [];
758 - }
759 - if ( ! is_array( $button_settings['classes'] ) ) {
760 - $button_settings['classes'] = [ $button_settings['classes'] ];
761 - }
762 - // index 0 = button, index 1 = button_secondary
763 - $button_class = ( 0 === $index ) ? 'button-primary' : 'button-secondary';
764 - $button_settings['classes'][] = $button_class;
765 - }
766 -
767 805 $button = new Button( $button_settings );
768 806 $button->print_button();
769 807 } ?>
770 808 </div>
@@ -804,8 +842,9 @@
804 842
805 843 $allowed_plgs = [
806 844 'elementor_image_optimization_campaign',
807 845 'elementor_ea11y_campaign',
846 + 'elementor_site_mailer_campaign',
808 847 ];
809 848
810 849 if ( ! in_array( $_GET['plg_campaign_name'], $allowed_plgs, true ) ) {
811 850 return;
@@ -855,9 +894,8 @@
855 894 */
856 895 public function __construct() {
857 896 add_action( 'admin_notices', [ $this, 'admin_notices' ], 20 );
858 897 add_action( 'admin_action_install-plugin', [ $this, 'maybe_log_campaign' ] );
859 - add_action( 'admin_action_activate', [ $this, 'maybe_log_campaign' ] );
860 898 }
861 899
862 900 /**
863 901 * Get module name.