| @@ -2,13 +2,14 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Elementor\Modules\AtomicOptIn; |
| 4 | 4 | |
| 5 | 5 | use Elementor\Core\Base\Module as BaseModule; |
| 6 | +use Elementor\Core\Experiments\Manager as Experiments_Manager; | |
| 6 | 7 | use Elementor\Modules\AtomicWidgets\OptIn\Opt_In as Atomic_Widgets_Opt_In; |
| 7 | 8 | use Elementor\Plugin; |
| 8 | 9 | |
| 9 | 10 | class Module extends BaseModule { |
| 10 | - const EXPERIMENT_NAME = Atomic_Widgets_Opt_In::EXPERIMENT_NAME; | |
| 11 | + const EXPERIMENT_NAME = 'e_opt_in_v4_page'; | |
| 11 | 12 | const MODULE_NAME = 'editor-v4-opt-in'; |
| 12 | 13 | const WELCOME_POPOVER_DISPLAYED_OPTION = '_e_welcome_popover_displayed'; |
| 13 | 14 | |
| 14 | 15 | public function get_name() { |
| @@ -14,8 +15,19 @@ | ||
| 14 | 15 | public function get_name() { |
| 15 | 16 | return 'atomic-opt-in'; |
| 16 | 17 | } |
| 17 | 18 | |
| 19 | + public static function get_experimental_data(): array { | |
| 20 | + return [ | |
| 21 | + 'name' => self::EXPERIMENT_NAME, | |
| 22 | + 'title' => esc_html__( 'Editor v4 (Opt In Page)', 'elementor' ), | |
| 23 | + 'description' => esc_html__( 'Enable the settings Opt In page', 'elementor' ), | |
| 24 | + 'hidden' => true, | |
| 25 | + 'default' => Experiments_Manager::STATE_ACTIVE, | |
| 26 | + 'release_status' => Experiments_Manager::RELEASE_STATUS_ALPHA, | |
| 27 | + ]; | |
| 28 | + } | |
| 29 | + | |
| 18 | 30 | public function get_opt_in_css_assets_url( string $path ) { |
| 19 | 31 | return $this->get_css_assets_url( $path ); |
| 20 | 32 | } |
| 21 | 33 | |
| @@ -20,8 +32,12 @@ | ||
| 20 | 32 | } |
| 21 | 33 | |
| 22 | 34 | public function __construct() { |
| 23 | 35 | ( new PanelChip() )->init(); |
| 36 | + | |
| 37 | + if ( ! Plugin::$instance->experiments->is_feature_active( self::EXPERIMENT_NAME ) ) { | |
| 38 | + return; | |
| 39 | + } | |
| 24 | 40 | |
| 25 | 41 | ( new Atomic_Widgets_Opt_In() )->init(); |
| 26 | 42 | ( new OptInPage( $this ) )->init(); |
| 27 | 43 | |