PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.3
Elementor Website Builder – more than just a page builder v4.1.3
4.3.4 4.3.3 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 All 457 releases
← All changes | modules/promotions/module.php +25 -42 4.3.3 → 4.1.3 View file →
@@ -4,9 +4,8 @@
4 4
5 5 use Elementor\Api;
6 6 use Elementor\Controls_Manager;
7 7 use Elementor\Core\Base\Module as Base_Module;
8 -use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager;
9 8 use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Custom_Code_Menu;
10 9 use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Custom_Elements_Menu;
11 10 use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Fonts_Menu;
12 11 use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Icons_Menu;
@@ -17,10 +16,11 @@
17 16 use Elementor\Modules\Promotions\Conversion_Banner;
18 17 use Elementor\Modules\Promotions\Pointers\Birthday;
19 18 use Elementor\Modules\Promotions\Pointers\Black_Friday;
20 19 use Elementor\Modules\Promotions\PropTypes\Promotion_Prop_Type;
20 +use Elementor\Modules\Promotions\Widgets\Ally_Dashboard_Widget;
21 21 use Elementor\Modules\Promotions\Widgets\Atomic_Form_Widget_Promotion;
22 -use Elementor\Modules\Promotions\Widgets\Collection_Loop_Widget_Promotion;
22 +use Elementor\Modules\Promotions\Widgets\Birthday_Easter_Egg_Promotion;
23 23 use Elementor\Widgets_Manager;
24 24 use Elementor\Utils;
25 25 use Elementor\Includes\EditorAssetsAPI;
26 26 use Elementor\Plugin;
@@ -37,13 +37,9 @@
37 37
38 38 const ADMIN_MENU_PROMOTIONS_PRIORITY = 120;
39 39
40 40 public static function is_active() {
41 - if ( Utils::has_pro() ) {
42 - return true;
43 - }
44 -
45 - return ! Utils::is_license_active();
41 + return ! Utils::has_pro();
46 42 }
47 43
48 44 public function get_name() {
49 45 return 'promotions';
@@ -51,17 +47,8 @@
51 47
52 48 public function __construct() {
53 49 parent::__construct();
54 50
55 - add_filter( 'elementor/editor/localize_settings', [ $this, 'add_v4_promotions_data' ] );
56 -
57 - if ( Utils::has_pro() ) {
58 - add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_react_data' ] );
59 - $this->register_atomic_promotions();
60 -
61 - return;
62 - }
63 -
64 51 add_action( 'admin_init', function () {
65 52 $this->handle_external_redirects();
66 53 } );
67 54
@@ -89,18 +76,18 @@
89 76 if ( Black_Friday::should_display_notice() ) {
90 77 new Black_Friday();
91 78 }
92 79
93 - if ( ! Utils::has_pro() ) {
94 - Conversion_Banner::register_cache_invalidation_hooks();
80 + if ( Conversion_Banner::should_display_banner() ) {
81 + new Conversion_Banner();
82 + }
95 83
96 - if ( Conversion_Banner::should_display_banner() ) {
97 - new Conversion_Banner();
98 - }
84 + add_filter( 'elementor/editor/localize_settings', [ $this, 'add_v4_promotions_data' ] );
85 +
86 + if ( Utils::has_pro() ) {
87 + return;
99 88 }
100 89
101 - add_filter( 'elementor/editor/localize_settings', [ $this, 'add_editing_panel_sticky_promotion' ] );
102 -
103 90 add_action( 'elementor/controls/register', function ( Controls_Manager $controls_manager ) {
104 91 $controls_manager->register( new Controls\Promotion_Control() );
105 92 } );
106 93
@@ -106,11 +93,23 @@
106 93
107 94 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_react_data' ] );
108 95 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_editor_v4_alphachip' ] );
109 96
97 + // Add Ally promo
98 + Ally_Dashboard_Widget::init();
99 +
110 100 $this->register_atomic_promotions();
111 101 }
112 102
103 + /**
104 + * Get Ally Scanner URL
105 + *
106 + * @return string
107 + */
108 + public static function get_ally_external_scanner_url(): string {
109 + return apply_filters( 'elementor/ally_external_scanner_url', 'https://go.elementor.com/acc-checker-dashboard-plg' );
110 + }
111 +
113 112 private function handle_external_redirects() {
114 113 $page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
115 114 if ( empty( $page ) ) {
116 115 return;
@@ -115,9 +114,9 @@
115 114 if ( empty( $page ) ) {
116 115 return;
117 116 }
118 117
119 - if ( in_array( $page, [ 'go_elementor_pro', 'elementor-one-upgrade' ], true ) ) {
118 + if ( 'go_elementor_pro' === $page ) {
120 119 wp_redirect( Go_Pro_Promotion_Item::get_url() ); // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect
121 120 die;
122 121 }
123 122 }
@@ -166,9 +165,8 @@
166 165 'react-dom',
167 166 'backbone-marionette',
168 167 'elementor-editor-modules',
169 168 'elementor-v2-ui',
170 - 'elementor-v2-icons',
171 169 ],
172 170 ELEMENTOR_VERSION,
173 171 true
174 172 );
@@ -217,14 +215,8 @@
217 215 EditorAssetsAPI::ASSETS_DATA_KEY => 'free-to-pro-upsell',
218 216 ];
219 217 }
220 218
221 - public function add_editing_panel_sticky_promotion( array $settings ): array {
222 - $settings['editingPanelStickyPromotion'] = Filtered_Promotions_Manager::get_editor_panel_sticky_promotion();
223 -
224 - return $settings;
225 - }
226 -
227 219 public function add_v4_promotions_data( array $settings ): array {
228 220 if ( ! current_user_can( 'manage_options' ) ) {
229 221 return $settings;
230 222 }
@@ -265,19 +257,9 @@
265 257 ],
266 258 ];
267 259 }
268 260
269 - private function should_register_core_atomic_panel_promotions(): bool {
270 - // Pro with an active license registers real atomic widgets (or its own panel
271 - // promotion layer). Core stubs caused duplicate panel entries after ED-25600.
272 - return ! Utils::has_pro() || ! Utils::is_license_active();
273 - }
274 -
275 261 private function register_atomic_promotions(): void {
276 - if ( ! $this->should_register_core_atomic_panel_promotions() ) {
277 - return;
278 - }
279 -
280 262 add_action( 'elementor/init', function() {
281 263 if ( ! $this->is_atomic_widgets_active() ) {
282 264 return;
283 265 }
@@ -294,12 +276,13 @@
294 276 $config['priority'],
295 277 2
296 278 );
297 279 }
280 +
281 + ( new Birthday_Easter_Egg_Promotion() )->register();
298 282 } );
299 283
300 284 ( new Atomic_Form_Widget_Promotion() )->register();
301 - ( new Collection_Loop_Widget_Promotion() )->register();
302 285 }
303 286
304 287 public function inject_atomic_promotion_props( array $schema ): array {
305 288 foreach ( $this->get_atomic_promotion_configs() as $config ) {