PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.4
Elementor Website Builder – more than just a page builder v4.1.4
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 4.0.8 All 454 releases
← All changes | modules/promotions/module.php +29 -18 4.3.14.1.4 View file →
@@ -17,10 +17,11 @@
17 17 use Elementor\Modules\Promotions\Conversion_Banner;
18 18 use Elementor\Modules\Promotions\Pointers\Birthday;
19 19 use Elementor\Modules\Promotions\Pointers\Black_Friday;
20 20 use Elementor\Modules\Promotions\PropTypes\Promotion_Prop_Type;
21 +use Elementor\Modules\Promotions\Widgets\Ally_Dashboard_Widget;
21 22 use Elementor\Modules\Promotions\Widgets\Atomic_Form_Widget_Promotion;
22 -use Elementor\Modules\Promotions\Widgets\Collection_Loop_Widget_Promotion;
23 +use Elementor\Modules\Promotions\Widgets\Birthday_Easter_Egg_Promotion;
23 24 use Elementor\Widgets_Manager;
24 25 use Elementor\Utils;
25 26 use Elementor\Includes\EditorAssetsAPI;
26 27 use Elementor\Plugin;
@@ -37,9 +38,9 @@
37 38
38 39 const ADMIN_MENU_PROMOTIONS_PRIORITY = 120;
39 40
40 41 public static function is_active() {
41 - return ! Utils::has_pro() || ! Utils::is_license_active();
42 + return ! Utils::has_pro();
42 43 }
43 44
44 45 public function get_name() {
45 46 return 'promotions';
@@ -47,17 +48,8 @@
47 48
48 49 public function __construct() {
49 50 parent::__construct();
50 51
51 - add_filter( 'elementor/editor/localize_settings', [ $this, 'add_v4_promotions_data' ] );
52 -
53 - if ( Utils::has_pro() ) {
54 - add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_react_data' ] );
55 - $this->register_atomic_promotions();
56 -
57 - return;
58 - }
59 -
60 52 add_action( 'admin_init', function () {
61 53 $this->handle_external_redirects();
62 54 } );
63 55
@@ -85,14 +77,16 @@
85 77 if ( Black_Friday::should_display_notice() ) {
86 78 new Black_Friday();
87 79 }
88 80
89 - if ( ! Utils::has_pro() ) {
90 - Conversion_Banner::register_cache_invalidation_hooks();
81 + if ( Conversion_Banner::should_display_banner() ) {
82 + new Conversion_Banner();
83 + }
91 84
92 - if ( Conversion_Banner::should_display_banner() ) {
93 - new Conversion_Banner();
94 - }
85 + add_filter( 'elementor/editor/localize_settings', [ $this, 'add_v4_promotions_data' ] );
86 +
87 + if ( Utils::has_pro() ) {
88 + return;
95 89 }
96 90
97 91 add_filter( 'elementor/editor/localize_settings', [ $this, 'add_editing_panel_sticky_promotion' ] );
98 92
@@ -102,11 +96,23 @@
102 96
103 97 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_react_data' ] );
104 98 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_editor_v4_alphachip' ] );
105 99
100 + // Add Ally promo
101 + Ally_Dashboard_Widget::init();
102 +
106 103 $this->register_atomic_promotions();
107 104 }
108 105
106 + /**
107 + * Get Ally Scanner URL
108 + *
109 + * @return string
110 + */
111 + public static function get_ally_external_scanner_url(): string {
112 + return apply_filters( 'elementor/ally_external_scanner_url', 'https://go.elementor.com/acc-checker-dashboard-plg' );
113 + }
114 +
109 115 private function handle_external_redirects() {
110 116 $page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
111 117 if ( empty( $page ) ) {
112 118 return;
@@ -111,9 +117,9 @@
111 117 if ( empty( $page ) ) {
112 118 return;
113 119 }
114 120
115 - if ( in_array( $page, [ 'go_elementor_pro', 'elementor-one-upgrade' ], true ) ) {
121 + if ( 'go_elementor_pro' === $page ) {
116 122 wp_redirect( Go_Pro_Promotion_Item::get_url() ); // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect
117 123 die;
118 124 }
119 125 }
@@ -214,8 +220,12 @@
214 220 ];
215 221 }
216 222
217 223 public function add_editing_panel_sticky_promotion( array $settings ): array {
224 + if ( ! Plugin::$instance->experiments->is_feature_active( 'e_panel_promotions' ) ) {
225 + return $settings;
226 + }
227 +
218 228 $settings['editingPanelStickyPromotion'] = Filtered_Promotions_Manager::get_editor_panel_sticky_promotion();
219 229
220 230 return $settings;
221 231 }
@@ -280,12 +290,13 @@
280 290 $config['priority'],
281 291 2
282 292 );
283 293 }
294 +
295 + ( new Birthday_Easter_Egg_Promotion() )->register();
284 296 } );
285 297
286 298 ( new Atomic_Form_Widget_Promotion() )->register();
287 - ( new Collection_Loop_Widget_Promotion() )->register();
288 299 }
289 300
290 301 public function inject_atomic_promotion_props( array $schema ): array {
291 302 foreach ( $this->get_atomic_promotion_configs() as $config ) {