| @@ -37,9 +37,13 @@ | ||
| 37 | 37 | |
| 38 | 38 | const ADMIN_MENU_PROMOTIONS_PRIORITY = 120; |
| 39 | 39 | |
| 40 | 40 | public static function is_active() { |
| 41 | - return ! Utils::has_pro() || ! Utils::is_license_active(); | |
| 41 | + if ( Utils::has_pro() ) { | |
| 42 | + return true; | |
| 43 | + } | |
| 44 | + | |
| 45 | + return ! Utils::is_license_active(); | |
| 42 | 46 | } |
| 43 | 47 | |
| 44 | 48 | public function get_name() { |
| 45 | 49 | return 'promotions'; |
| @@ -85,10 +89,14 @@ | ||
| 85 | 89 | if ( Black_Friday::should_display_notice() ) { |
| 86 | 90 | new Black_Friday(); |
| 87 | 91 | } |
| 88 | 92 | |
| 89 | - if ( Conversion_Banner::should_display_banner() ) { | |
| 90 | - new Conversion_Banner(); | |
| 93 | + if ( ! Utils::has_pro() ) { | |
| 94 | + Conversion_Banner::register_cache_invalidation_hooks(); | |
| 95 | + | |
| 96 | + if ( Conversion_Banner::should_display_banner() ) { | |
| 97 | + new Conversion_Banner(); | |
| 98 | + } | |
| 91 | 99 | } |
| 92 | 100 | |
| 93 | 101 | add_filter( 'elementor/editor/localize_settings', [ $this, 'add_editing_panel_sticky_promotion' ] ); |
| 94 | 102 | |
| @@ -210,12 +218,8 @@ | ||
| 210 | 218 | ]; |
| 211 | 219 | } |
| 212 | 220 | |
| 213 | 221 | public function add_editing_panel_sticky_promotion( array $settings ): array { |
| 214 | - if ( ! Plugin::$instance->experiments->is_feature_active( 'e_panel_promotions' ) ) { | |
| 215 | - return $settings; | |
| 216 | - } | |
| 217 | - | |
| 218 | 222 | $settings['editingPanelStickyPromotion'] = Filtered_Promotions_Manager::get_editor_panel_sticky_promotion(); |
| 219 | 223 | |
| 220 | 224 | return $settings; |
| 221 | 225 | } |
| @@ -261,9 +265,19 @@ | ||
| 261 | 265 | ], |
| 262 | 266 | ]; |
| 263 | 267 | } |
| 264 | 268 | |
| 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 | + | |
| 265 | 275 | private function register_atomic_promotions(): void { |
| 276 | + if ( ! $this->should_register_core_atomic_panel_promotions() ) { | |
| 277 | + return; | |
| 278 | + } | |
| 279 | + | |
| 266 | 280 | add_action( 'elementor/init', function() { |
| 267 | 281 | if ( ! $this->is_atomic_widgets_active() ) { |
| 268 | 282 | return; |
| 269 | 283 | } |