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