PluginProbe
Elementor Website Builder – more than just a page builder / 4.0.3
Elementor Website Builder – more than just a page builder v4.0.3
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 +4 -52 4.1.54.0.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;
@@ -13,9 +12,8 @@
13 12 use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Popups_Menu;
14 13 use Elementor\Modules\Promotions\AdminMenuItems\Editor_One_Submissions_Menu;
15 14 use Elementor\Modules\Promotions\AdminMenuItems\Go_Pro_Promotion_Item;
16 15 use Elementor\Modules\Promotions\Controls\Atomic_Promotion_Control;
17 -use Elementor\Modules\Promotions\Conversion_Banner;
18 16 use Elementor\Modules\Promotions\Pointers\Birthday;
19 17 use Elementor\Modules\Promotions\Pointers\Black_Friday;
20 18 use Elementor\Modules\Promotions\PropTypes\Promotion_Prop_Type;
21 19 use Elementor\Modules\Promotions\Widgets\Ally_Dashboard_Widget;
@@ -23,9 +21,8 @@
23 21 use Elementor\Widgets_Manager;
24 22 use Elementor\Utils;
25 23 use Elementor\Includes\EditorAssetsAPI;
26 24 use Elementor\Plugin;
27 -use Elementor\Modules\EditorOne\Classes\Menu_Config;
28 25 use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
29 26
30 27 if ( ! defined( 'ABSPATH' ) ) {
31 28 exit; // Exit if accessed directly.
@@ -37,9 +34,9 @@
37 34
38 35 const ADMIN_MENU_PROMOTIONS_PRIORITY = 120;
39 36
40 37 public static function is_active() {
41 - return ! Utils::has_pro() || ! Utils::is_license_active();
38 + return ! Utils::has_pro();
42 39 }
43 40
44 41 public function get_name() {
45 42 return 'promotions';
@@ -47,17 +44,8 @@
47 44
48 45 public function __construct() {
49 46 parent::__construct();
50 47
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 48 add_action( 'admin_init', function () {
61 49 $this->handle_external_redirects();
62 50 } );
63 51
@@ -64,12 +52,8 @@
64 52 add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
65 53 $this->register_editor_one_menu_items( $menu_data_provider );
66 54 } );
67 55
68 - if ( Utils::is_sale_time() ) {
69 - add_filter( 'add_menu_classes', [ $this, 'override_one_menu_upgrade_label_during_sale' ] );
70 - }
71 -
72 56 add_action( 'elementor/widgets/register', function( Widgets_Manager $manager ) {
73 57 foreach ( Api::get_promotion_widgets() as $widget_data ) {
74 58 $manager->register( new Widgets\Pro_Widget_Promotion( [], [
75 59 'widget_name' => $widget_data['name'],
@@ -85,14 +69,12 @@
85 69 if ( Black_Friday::should_display_notice() ) {
86 70 new Black_Friday();
87 71 }
88 72
89 - if ( Conversion_Banner::should_display_banner() ) {
90 - new Conversion_Banner();
73 + if ( Utils::has_pro() ) {
74 + return;
91 75 }
92 76
93 - add_filter( 'elementor/editor/localize_settings', [ $this, 'add_editing_panel_sticky_promotion' ] );
94 -
95 77 add_action( 'elementor/controls/register', function ( Controls_Manager $controls_manager ) {
96 78 $controls_manager->register( new Controls\Promotion_Control() );
97 79 } );
98 80
@@ -97,8 +79,9 @@
97 79 } );
98 80
99 81 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_react_data' ] );
100 82 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_editor_v4_alphachip' ] );
83 + add_filter( 'elementor/editor/localize_settings', [ $this, 'add_v4_promotions_data' ] );
101 84
102 85 // Add Ally promo
103 86 Ally_Dashboard_Widget::init();
104 87
@@ -125,28 +108,8 @@
125 108 die;
126 109 }
127 110 }
128 111
129 - public function override_one_menu_upgrade_label_during_sale( $menu ) {
130 - global $submenu;
131 -
132 - $parent_slug = Menu_Config::ELEMENTOR_HOME_MENU_SLUG;
133 - $upgrade_slug = 'elementor-one-upgrade';
134 -
135 - if ( empty( $submenu[ $parent_slug ] ) ) {
136 - return $menu;
137 - }
138 -
139 - foreach ( $submenu[ $parent_slug ] as &$item ) {
140 - if ( isset( $item[2] ) && $upgrade_slug === $item[2] ) {
141 - $item[0] = esc_html__( 'Sale!', 'elementor' ) . '<br />' . esc_html__( 'Upgrade Now', 'elementor' ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
142 - break;
143 - }
144 - }
145 -
146 - return $menu;
147 - }
148 -
149 112 private function register_editor_one_menu_items( Menu_Data_Provider $menu_data_provider ) {
150 113 $menu_data_provider->register_menu( new Editor_One_Custom_Elements_Menu() );
151 114 $menu_data_provider->register_menu( new Editor_One_Submissions_Menu() );
152 115 $menu_data_provider->register_menu( new Editor_One_Fonts_Menu() );
@@ -170,9 +133,8 @@
170 133 'react-dom',
171 134 'backbone-marionette',
172 135 'elementor-editor-modules',
173 136 'elementor-v2-ui',
174 - 'elementor-v2-icons',
175 137 ],
176 138 ELEMENTOR_VERSION,
177 139 true
178 140 );
@@ -219,18 +181,8 @@
219 181 EditorAssetsAPI::ASSETS_DATA_URL => 'https://assets.elementor.com/free-to-pro-upsell/v1/free-to-pro-upsell.json',
220 182 EditorAssetsAPI::ASSETS_DATA_TRANSIENT_KEY => '_elementor_free_to_pro_upsell',
221 183 EditorAssetsAPI::ASSETS_DATA_KEY => 'free-to-pro-upsell',
222 184 ];
223 - }
224 -
225 - public function add_editing_panel_sticky_promotion( array $settings ): array {
226 - if ( ! Plugin::$instance->experiments->is_feature_active( 'e_panel_promotions' ) ) {
227 - return $settings;
228 - }
229 -
230 - $settings['editingPanelStickyPromotion'] = Filtered_Promotions_Manager::get_editor_panel_sticky_promotion();
231 -
232 - return $settings;
233 185 }
234 186
235 187 public function add_v4_promotions_data( array $settings ): array {
236 188 if ( ! current_user_can( 'manage_options' ) ) {