PluginProbe
Elementor Website Builder – more than just a page builder / 3.30.1
Elementor Website Builder – more than just a page builder v3.30.1
4.3.2 4.3.1 4.3.0 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 All 455 releases
← All changes | core/admin/admin-notices.php +150 -203 4.3.1 → 3.30.1 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,10 @@
28 26 'tracker',
29 27 'tracker_last_update',
30 28 'rate_us_feedback',
31 29 'role_manager_promote',
30 + 'experiment_promotion',
31 + 'site_mailer_promotion',
32 32 'plugin_image_optimization',
33 33 'ally_pages_promotion',
34 34 ];
35 35
@@ -91,9 +91,9 @@
91 91 if ( ! current_user_can( 'update_plugins' ) ) {
92 92 return false;
93 93 }
94 94
95 - if ( ! $this->is_elementor_admin_screen_with_system_info() ) {
95 + if ( ! in_array( $this->current_screen_id, [ 'toplevel_page_elementor', 'edit-elementor_library', 'elementor_page_elementor-system-info', 'dashboard' ], true ) ) {
96 96 return false;
97 97 }
98 98
99 99 // Check for upgrades.
@@ -131,16 +131,16 @@
131 131 $message = sprintf(
132 132 /* translators: 1: Details URL, 2: Accessibility text, 3: Version number, 4: Update URL, 5: Accessibility text. */
133 133 __( '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 134 esc_url( $details_url ),
135 - sprintf(
135 + esc_attr( sprintf(
136 136 /* translators: %s: Elementor version. */
137 - esc_attr__( 'View Elementor version %s details', 'elementor' ),
137 + __( 'View Elementor version %s details', 'elementor' ),
138 138 $new_version
139 - ),
139 + ) ),
140 140 $new_version,
141 141 esc_url( $upgrade_url ),
142 - esc_attr__( 'Update Now', 'elementor' )
142 + esc_attr( esc_html__( 'Update Now', 'elementor' ) )
143 143 );
144 144
145 145 $options = [
146 146 'title' => esc_html__( 'Update Notification', 'elementor' ),
@@ -167,9 +167,9 @@
167 167 if ( ! current_user_can( 'manage_options' ) ) {
168 168 return false;
169 169 }
170 170
171 - if ( ! $this->is_elementor_admin_screen_with_system_info() ) {
171 + if ( ! in_array( $this->current_screen_id, [ 'toplevel_page_elementor', 'edit-elementor_library', 'elementor_page_elementor-system-info', 'dashboard' ], true ) ) {
172 172 return false;
173 173 }
174 174
175 175 $notice_id = 'admin_notice_api_' . $admin_notice['notice_id'];
@@ -380,43 +380,55 @@
380 380
381 381 return true;
382 382 }
383 383
384 - private function get_installed_form_plugin_name() {
385 - static $detected_form_plugin = null;
384 + private function notice_experiment_promotion() {
385 + $notice_id = 'experiment_promotion';
386 386
387 - if ( null !== $detected_form_plugin ) {
388 - return $detected_form_plugin;
387 + if ( ! current_user_can( 'manage_options' ) || User::is_user_notice_viewed( $notice_id ) ) {
388 + return false;
389 389 }
390 390
391 - $form_plugins_constants_to_name_mapper = [
392 - 'WPFORMS_VERSION' => 'WPForms',
393 - 'WPCF7_VERSION' => 'Contact Form 7',
394 - ];
391 + $experiments = Plugin::$instance->experiments;
392 + $is_all_performance_features_active = (
393 + $experiments->is_feature_active( 'e_element_cache' ) &&
394 + $experiments->is_feature_active( 'e_font_icon_svg' )
395 + );
395 396
396 - foreach ( $form_plugins_constants_to_name_mapper as $constant => $name ) {
397 - if ( defined( $constant ) ) {
398 - $detected_form_plugin = $name;
399 - return $detected_form_plugin;
400 - }
397 + if ( $is_all_performance_features_active ) {
398 + return false;
401 399 }
402 400
403 - $form_plugins_classes_to_name_mapper = [
404 - '\GFCommon' => 'Gravity Forms',
405 - '\Ninja_Forms' => 'Ninja Forms',
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 + ],
406 416 ];
407 417
408 - foreach ( $form_plugins_classes_to_name_mapper as $class => $name ) {
409 - if ( class_exists( $class ) ) {
410 - $detected_form_plugin = $name;
411 - return $detected_form_plugin;
412 - }
413 - }
418 + $this->print_admin_notice( $options );
414 419
415 - $detected_form_plugin = false;
416 - return $detected_form_plugin;
420 + return true;
417 421 }
418 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 +
419 431 private function notice_ally_pages_promotion() {
420 432 global $pagenow;
421 433 $notice_id = 'ally_pages_promotion';
422 434
@@ -423,133 +435,139 @@
423 435 if ( 'edit.php' !== $pagenow || empty( $_GET['post_type'] ) || 'page' !== $_GET['post_type'] ) {
424 436 return false;
425 437 }
426 438
427 - if ( ! current_user_can( 'manage_options' ) ) {
439 + if ( ! current_user_can( 'manage_options' ) || User::is_user_notice_viewed( $notice_id ) ) {
428 440 return false;
429 441 }
430 442
431 - if ( User::is_user_notice_viewed( $notice_id ) ) {
443 + $plugin_file_path = 'pojo-accessibility/pojo-accessibility.php';
444 + $plugin_slug = 'pojo-accessibility';
445 +
446 + $cta_data = $this->get_plugin_cta_data( $plugin_slug, $plugin_file_path );
447 + if ( empty( $cta_data ) ) {
432 448 return false;
433 449 }
434 450
435 - $plugin_slug = 'pojo-accessibility';
436 - $plugin_file_path = 'pojo-accessibility/pojo-accessibility.php';
451 + $options = [
452 + 'title' => esc_html__( 'Make sure your site has an accessibility statement page', 'elementor' ),
453 + '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' ),
454 + 'id' => $notice_id,
455 + 'type' => 'cta',
456 + 'button' => [
457 + 'text' => $cta_data['text'],
458 + 'url' => self::add_plg_campaign_data( $cta_data['url'], [
459 + 'name' => 'elementor_ea11y_campaign',
460 + 'campaign' => 'acc-statement-plg-pages',
461 + 'source' => 'wp-pages',
462 + 'medium' => 'wp-dash',
463 + ] ),
464 + 'type' => 'cta',
465 + ],
466 + 'button_secondary' => [
467 + 'text' => esc_html__( 'Learn more', 'elementor' ),
468 + 'url' => 'https://go.elementor.com/acc-plg-learn-more',
469 + 'new_tab' => true,
470 + 'type' => 'cta',
471 + ],
472 + ];
437 473
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 );
474 + $this->print_admin_notice( $options );
441 475
442 - if ( $is_active ) {
476 + return true;
477 + }
478 +
479 + private function notice_site_mailer_promotion() {
480 + $notice_id = 'site_mailer_promotion';
481 + $has_forms = $this->site_has_forms_plugins();
482 + $has_woocommerce = $this->site_has_woocommerce();
483 +
484 + if ( ! $has_forms && ! $has_woocommerce ) {
443 485 return false;
444 486 }
445 487
446 - if ( $one_subscription ) {
447 - $learn_more_url = 'https://go.elementor.com/acc-plg-learn-more-one';
488 + if ( ! $this->is_elementor_page() && ! in_array( $this->current_screen_id, [ 'toplevel_page_elementor', 'edit-elementor_library', 'dashboard' ], true ) ) {
489 + return false;
490 + }
448 491
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';
492 + if ( ( Utils::has_pro() && ! $has_woocommerce ) || ! current_user_can( 'install_plugins' ) || User::is_user_notice_viewed( $notice_id ) ) {
493 + return false;
494 + }
473 495
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 - }
496 + $plugin_file_path = 'site-mailer/site-mailer.php';
497 + $plugin_slug = 'site-mailer';
498 +
499 + $cta_data = $this->get_plugin_cta_data( $plugin_slug, $plugin_file_path );
500 + if ( empty( $cta_data ) ) {
501 + return false;
493 502 }
494 503
495 504 $options = [
496 - 'title' => esc_html__( 'Make sure your site has an accessibility statement page', 'elementor' ),
497 - 'description' => $description,
505 + 'title' => esc_html__( 'Ensure your form emails avoid the spam folder!', 'elementor' ),
506 + 'description' => esc_html__( 'Use Site Mailer for improved email deliverability, detailed email logs, and an easy setup.', 'elementor' ),
498 507 'id' => $notice_id,
499 508 'type' => 'cta',
500 509 'button' => [
501 - 'text' => $button_text,
502 - 'url' => self::add_plg_campaign_data( $button_url, $campaign_data ),
510 + 'text' => $cta_data['text'],
511 + 'url' => $cta_data['url'],
503 512 'type' => 'cta',
504 513 ],
505 514 'button_secondary' => [
506 515 'text' => esc_html__( 'Learn more', 'elementor' ),
507 - 'url' => $learn_more_url,
516 + 'url' => 'https://go.elementor.com/sm-core-form/',
508 517 'new_tab' => true,
509 518 'type' => 'cta',
510 519 ],
511 520 ];
512 521
522 + if ( $this->should_render_woocommerce_hint( $has_forms, $has_woocommerce ) ) {
523 + // We include WP's default notice class so it will be properly handled by WP's js handler
524 + // And add a new one to distinguish between the two types of notices
525 + $options['classes'] = [ 'notice', 'e-notice', 'sm-notice-wc' ];
526 + $options['title'] = esc_html__( 'Improve Transactional Email Deliverability', 'elementor' );
527 + $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' );
528 + }
529 +
513 530 $this->print_admin_notice( $options );
514 531
515 532 return true;
516 533 }
517 534
518 - private function is_elementor_page(): bool {
519 - return 0 === strpos( $this->current_screen_id, 'elementor_page' );
520 - }
535 + private function should_render_woocommerce_hint( $has_forms, $has_woocommerce ): bool {
536 + if ( ! $has_forms && ! $has_woocommerce ) {
537 + return false;
538 + }
521 539
522 - private function is_elementor_admin_screen(): bool {
523 - return in_array( $this->current_screen_id, [ 'toplevel_page_elementor', 'edit-elementor_library' ], true );
524 - }
540 + if ( ! $has_forms && $has_woocommerce ) {
541 + return true;
542 + }
525 543
526 - private function is_elementor_admin_screen_with_system_info(): bool {
527 - return in_array( $this->current_screen_id, [ 'toplevel_page_elementor', 'edit-elementor_library', 'elementor_page_elementor-system-info', 'dashboard' ], true );
528 - }
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 - }
544 + if ( $has_forms && $has_woocommerce && Utils::has_pro() ) {
545 + return true;
546 + }
532 547
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 );
548 + if ( ! $has_woocommerce ) {
549 + return false;
550 + }
551 +
552 + return (bool) wp_rand( 0, 1 );
535 553 }
536 554
537 - private function get_plugin_button_connect_url( $plugin_settings_page ) {
538 - return self_admin_url( $plugin_settings_page );
555 + private function is_elementor_page(): bool {
556 + return 0 === strpos( $this->current_screen_id, 'elementor_page' );
539 557 }
540 558
541 559 private function get_plugin_cta_data( $plugin_slug, $plugin_file_path ) {
542 - if ( Hints::is_plugin_active( $plugin_slug ) ) {
560 + if ( is_plugin_active( $plugin_file_path ) ) {
543 561 return false;
544 562 }
545 563
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' );
564 + if ( $this->is_plugin_installed( $plugin_file_path ) ) {
565 + $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 );
566 + $cta_text = esc_html__( 'Activate Plugin', 'elementor' );
549 567 } else {
550 - $url = $this->get_plugin_button_install_url( $plugin_slug );
551 - $cta_text = esc_html__( 'Install now', 'elementor' );
568 + $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $plugin_slug ), 'install-plugin_' . $plugin_slug );
569 + $cta_text = esc_html__( 'Install Plugin', 'elementor' );
552 570 }
553 571
554 572 return [
555 573 'url' => $url,
@@ -570,16 +588,12 @@
570 588 if ( 'upload' !== $this->current_screen_id ) {
571 589 return false;
572 590 }
573 591
574 - if ( ! current_user_can( 'manage_options' ) ) {
592 + if ( ! current_user_can( 'manage_options' ) || User::is_user_notice_viewed( $notice_id ) ) {
575 593 return false;
576 594 }
577 595
578 - if ( User::is_user_notice_viewed( $notice_id ) ) {
579 - return false;
580 - }
581 -
582 596 $attachments = new \WP_Query( [
583 597 'post_type' => 'attachment',
584 598 'post_status' => 'any',
585 599 'fields' => 'ids',
@@ -588,79 +602,26 @@
588 602 if ( 1 > $attachments->found_posts ) {
589 603 return false;
590 604 }
591 605
606 + $plugin_file_path = 'image-optimization/image-optimization.php';
592 607 $plugin_slug = 'image-optimization';
593 - $plugin_file_path = 'image-optimization/image-optimization.php';
594 608
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 );
609 + $cta_data = $this->get_plugin_cta_data( $plugin_slug, $plugin_file_path );
598 610
599 - if ( $is_active ) {
611 + if ( empty( $cta_data ) ) {
600 612 return false;
601 613 }
602 614
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 615 $options = [
650 - 'title' => esc_html__( 'Speed up your website with Image Optimization', 'elementor' ),
651 - 'description' => $description,
616 + 'title' => esc_html__( 'Speed up your website with Image Optimizer by Elementor', 'elementor' ),
617 + '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 618 'id' => $notice_id,
653 619 'type' => 'cta',
654 - 'button' => [
655 - 'text' => $button_text,
656 - 'url' => self::add_plg_campaign_data( $button_url, $campaign_data ),
620 + 'button_secondary' => [
621 + 'text' => $cta_data['text'],
622 + 'url' => $cta_data['url'],
657 623 'type' => 'cta',
658 - 'data' => [
659 - 'campaign' => $campaign_data['campaign'],
660 - 'source' => $campaign_data['source'],
661 - 'medium' => $campaign_data['medium'],
662 - ],
663 624 ],
664 625 ];
665 626
666 627 $this->print_admin_notice( $options );
@@ -667,8 +628,14 @@
667 628
668 629 return true;
669 630 }
670 631
632 + private function is_plugin_installed( $file_path ): bool {
633 + $installed_plugins = get_plugins();
634 +
635 + return isset( $installed_plugins[ $file_path ] );
636 + }
637 +
671 638 public function print_admin_notice( array $options, $exclude_pages = self::DEFAULT_EXCLUDED_PAGES ) {
672 639 global $pagenow;
673 640
674 641 if ( in_array( $pagenow, $exclude_pages, true ) ) {
@@ -681,9 +648,9 @@
681 648 'description' => '',
682 649 'classes' => [ 'notice', 'e-notice' ], // We include WP's default notice class so it will be properly handled by WP's js handler
683 650 'type' => '',
684 651 'dismissible' => true,
685 - 'icon' => 'eicon-elementor-circle',
652 + 'icon' => 'eicon-elementor',
686 653 'button' => [],
687 654 'button_secondary' => [],
688 655 ];
689 656
@@ -696,12 +663,9 @@
696 663 if ( $options['type'] ) {
697 664 $notice_classes[] = 'e-notice--' . $options['type'];
698 665 }
699 666
700 - $wrapper_attributes = [
701 - 'role' => 'region',
702 - 'aria-label' => esc_html__( 'Elementor notice', 'elementor' ),
703 - ];
667 + $wrapper_attributes = [];
704 668
705 669 if ( $options['dismissible'] ) {
706 670 $label = esc_html__( 'Dismiss this notice.', 'elementor' );
707 671 $notice_classes[] = 'e-notice--dismissible';
@@ -719,12 +683,8 @@
719 683
720 684 if ( $options['id'] ) {
721 685 $wrapper_attributes['data-notice_id'] = $options['id'];
722 686 }
723 -
724 - if ( ! empty( $options['source'] ) ) {
725 - $wrapper_attributes['data-source'] = $options['source'];
726 - }
727 687 ?>
728 688 <div <?php Utils::print_html_attributes( $wrapper_attributes ); ?>>
729 689 <?php echo $dismiss_button; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
730 690 <div class="e-notice__aside">
@@ -741,9 +701,8 @@
741 701
742 702 <?php if ( ! empty( $options['button']['text'] ) || ! empty( $options['button_secondary']['text'] ) ) { ?>
743 703 <div class="e-notice__actions">
744 704 <?php
745 - $one_subscription = Hints::is_plugin_connected_to_one_subscription();
746 705 foreach ( [ $options['button'], $options['button_secondary'] ] as $index => $button_settings ) {
747 706 if ( empty( $button_settings['variant'] ) && $index ) {
748 707 $button_settings['variant'] = 'outline';
749 708 }
@@ -751,20 +710,8 @@
751 710 if ( empty( $button_settings['text'] ) ) {
752 711 continue;
753 712 }
754 713
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 714 $button = new Button( $button_settings );
768 715 $button->print_button();
769 716 } ?>
770 717 </div>
@@ -804,8 +751,9 @@
804 751
805 752 $allowed_plgs = [
806 753 'elementor_image_optimization_campaign',
807 754 'elementor_ea11y_campaign',
755 + 'elementor_site_mailer_campaign',
808 756 ];
809 757
810 758 if ( ! in_array( $_GET['plg_campaign_name'], $allowed_plgs, true ) ) {
811 759 return;
@@ -831,9 +779,9 @@
831 779
832 780 set_transient( sanitize_key( $_GET['plg_campaign_name'] ), $campaign_data, 30 * DAY_IN_SECONDS );
833 781 }
834 782
835 - public static function add_plg_campaign_data( $url, $campaign_data ) {
783 + private static function add_plg_campaign_data( $url, $campaign_data ) {
836 784
837 785 foreach ( [ 'name', 'campaign' ] as $key ) {
838 786 if ( empty( $campaign_data[ $key ] ) ) {
839 787 return $url;
@@ -855,9 +803,8 @@
855 803 */
856 804 public function __construct() {
857 805 add_action( 'admin_notices', [ $this, 'admin_notices' ], 20 );
858 806 add_action( 'admin_action_install-plugin', [ $this, 'maybe_log_campaign' ] );
859 - add_action( 'admin_action_activate', [ $this, 'maybe_log_campaign' ] );
860 807 }
861 808
862 809 /**
863 810 * Get module name.