| @@ -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,20 +12,16 @@ | ||
| 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; |
| 22 | -use Elementor\Modules\Promotions\Widgets\Atomic_Form_Widget_Promotion; | |
| 23 | -use Elementor\Modules\Promotions\Widgets\Birthday_Easter_Egg_Promotion; | |
| 24 | 20 | use Elementor\Widgets_Manager; |
| 25 | 21 | use Elementor\Utils; |
| 26 | 22 | use Elementor\Includes\EditorAssetsAPI; |
| 27 | 23 | use Elementor\Plugin; |
| 28 | -use Elementor\Modules\EditorOne\Classes\Menu_Config; | |
| 29 | 24 | use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider; |
| 30 | 25 | |
| 31 | 26 | if ( ! defined( 'ABSPATH' ) ) { |
| 32 | 27 | exit; // Exit if accessed directly. |
| @@ -56,12 +51,8 @@ | ||
| 56 | 51 | add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) { |
| 57 | 52 | $this->register_editor_one_menu_items( $menu_data_provider ); |
| 58 | 53 | } ); |
| 59 | 54 | |
| 60 | - if ( Utils::is_sale_time() ) { | |
| 61 | - add_filter( 'add_menu_classes', [ $this, 'override_one_menu_upgrade_label_during_sale' ] ); | |
| 62 | - } | |
| 63 | - | |
| 64 | 55 | add_action( 'elementor/widgets/register', function( Widgets_Manager $manager ) { |
| 65 | 56 | foreach ( Api::get_promotion_widgets() as $widget_data ) { |
| 66 | 57 | $manager->register( new Widgets\Pro_Widget_Promotion( [], [ |
| 67 | 58 | 'widget_name' => $widget_data['name'], |
| @@ -77,20 +68,12 @@ | ||
| 77 | 68 | if ( Black_Friday::should_display_notice() ) { |
| 78 | 69 | new Black_Friday(); |
| 79 | 70 | } |
| 80 | 71 | |
| 81 | - if ( Conversion_Banner::should_display_banner() ) { | |
| 82 | - new Conversion_Banner(); | |
| 83 | - } | |
| 84 | - | |
| 85 | - add_filter( 'elementor/editor/localize_settings', [ $this, 'add_v4_promotions_data' ] ); | |
| 86 | - | |
| 87 | 72 | if ( Utils::has_pro() ) { |
| 88 | 73 | return; |
| 89 | 74 | } |
| 90 | 75 | |
| 91 | - add_filter( 'elementor/editor/localize_settings', [ $this, 'add_editing_panel_sticky_promotion' ] ); | |
| 92 | - | |
| 93 | 76 | add_action( 'elementor/controls/register', function ( Controls_Manager $controls_manager ) { |
| 94 | 77 | $controls_manager->register( new Controls\Promotion_Control() ); |
| 95 | 78 | } ); |
| 96 | 79 | |
| @@ -95,8 +78,9 @@ | ||
| 95 | 78 | } ); |
| 96 | 79 | |
| 97 | 80 | add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_react_data' ] ); |
| 98 | 81 | add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_editor_v4_alphachip' ] ); |
| 82 | + add_filter( 'elementor/editor/localize_settings', [ $this, 'add_v4_promotions_data' ] ); | |
| 99 | 83 | |
| 100 | 84 | // Add Ally promo |
| 101 | 85 | Ally_Dashboard_Widget::init(); |
| 102 | 86 | |
| @@ -108,9 +92,9 @@ | ||
| 108 | 92 | * |
| 109 | 93 | * @return string |
| 110 | 94 | */ |
| 111 | 95 | 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' ); | |
| 96 | + return apply_filters( 'elementor/ally_external_scanner_url', 'https://elementor.com/tools/ally-accessibility-checker/scanner' ); | |
| 113 | 97 | } |
| 114 | 98 | |
| 115 | 99 | private function handle_external_redirects() { |
| 116 | 100 | $page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS ); |
| @@ -123,28 +107,8 @@ | ||
| 123 | 107 | die; |
| 124 | 108 | } |
| 125 | 109 | } |
| 126 | 110 | |
| 127 | - public function override_one_menu_upgrade_label_during_sale( $menu ) { | |
| 128 | - global $submenu; | |
| 129 | - | |
| 130 | - $parent_slug = Menu_Config::ELEMENTOR_HOME_MENU_SLUG; | |
| 131 | - $upgrade_slug = 'elementor-one-upgrade'; | |
| 132 | - | |
| 133 | - if ( empty( $submenu[ $parent_slug ] ) ) { | |
| 134 | - return $menu; | |
| 135 | - } | |
| 136 | - | |
| 137 | - foreach ( $submenu[ $parent_slug ] as &$item ) { | |
| 138 | - if ( isset( $item[2] ) && $upgrade_slug === $item[2] ) { | |
| 139 | - $item[0] = esc_html__( 'Sale!', 'elementor' ) . '<br />' . esc_html__( 'Upgrade Now', 'elementor' ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited | |
| 140 | - break; | |
| 141 | - } | |
| 142 | - } | |
| 143 | - | |
| 144 | - return $menu; | |
| 145 | - } | |
| 146 | - | |
| 147 | 111 | private function register_editor_one_menu_items( Menu_Data_Provider $menu_data_provider ) { |
| 148 | 112 | $menu_data_provider->register_menu( new Editor_One_Custom_Elements_Menu() ); |
| 149 | 113 | $menu_data_provider->register_menu( new Editor_One_Submissions_Menu() ); |
| 150 | 114 | $menu_data_provider->register_menu( new Editor_One_Fonts_Menu() ); |
| @@ -168,9 +132,8 @@ | ||
| 168 | 132 | 'react-dom', |
| 169 | 133 | 'backbone-marionette', |
| 170 | 134 | 'elementor-editor-modules', |
| 171 | 135 | 'elementor-v2-ui', |
| 172 | - 'elementor-v2-icons', | |
| 173 | 136 | ], |
| 174 | 137 | ELEMENTOR_VERSION, |
| 175 | 138 | true |
| 176 | 139 | ); |
| @@ -219,18 +182,8 @@ | ||
| 219 | 182 | EditorAssetsAPI::ASSETS_DATA_KEY => 'free-to-pro-upsell', |
| 220 | 183 | ]; |
| 221 | 184 | } |
| 222 | 185 | |
| 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 | - | |
| 228 | - $settings['editingPanelStickyPromotion'] = Filtered_Promotions_Manager::get_editor_panel_sticky_promotion(); | |
| 229 | - | |
| 230 | - return $settings; | |
| 231 | - } | |
| 232 | - | |
| 233 | 186 | public function add_v4_promotions_data( array $settings ): array { |
| 234 | 187 | if ( ! current_user_can( 'manage_options' ) ) { |
| 235 | 188 | return $settings; |
| 236 | 189 | } |
| @@ -290,13 +243,9 @@ | ||
| 290 | 243 | $config['priority'], |
| 291 | 244 | 2 |
| 292 | 245 | ); |
| 293 | 246 | } |
| 294 | - | |
| 295 | - ( new Birthday_Easter_Egg_Promotion() )->register(); | |
| 296 | 247 | } ); |
| 297 | - | |
| 298 | - ( new Atomic_Form_Widget_Promotion() )->register(); | |
| 299 | 248 | } |
| 300 | 249 | |
| 301 | 250 | public function inject_atomic_promotion_props( array $schema ): array { |
| 302 | 251 | foreach ( $this->get_atomic_promotion_configs() as $config ) { |