| @@ -2,18 +2,15 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Elementor\Modules\Variables; |
| 4 | 4 | |
| 5 | 5 | use Elementor\Core\Base\Module as BaseModule; |
| 6 | -use Elementor\Core\Experiments\Manager as ExperimentsManager; | |
| 7 | 6 | use Elementor\Modules\AtomicWidgets\Module as AtomicWidgetsModule; |
| 8 | 7 | use Elementor\Modules\Variables\Classes\Variable_Types_Registry; |
| 9 | 8 | use Elementor\Modules\Variables\ImportExportCustomization\Import_Export_Customization; |
| 10 | 9 | use Elementor\Modules\Variables\PropTypes\Color_Variable_Prop_Type; |
| 11 | 10 | use Elementor\Modules\Variables\PropTypes\Font_Variable_Prop_Type; |
| 12 | -use Elementor\Modules\Variables\PropTypes\Size_Variable_Prop_Type; | |
| 13 | 11 | use Elementor\Modules\Variables\Storage\Constants; |
| 14 | 12 | use Elementor\Plugin; |
| 15 | -use Elementor\Utils; | |
| 16 | 13 | |
| 17 | 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 18 | 15 | exit; |
| 19 | 16 | } |
| @@ -19,10 +16,9 @@ | ||
| 19 | 16 | } |
| 20 | 17 | |
| 21 | 18 | class Module extends BaseModule { |
| 22 | 19 | const MODULE_NAME = 'e-variables'; |
| 23 | - const EXPERIMENT_NAME = 'e_variables'; | |
| 24 | - const EXPERIMENT_MANAGER_NAME = 'e_variables_manager'; | |
| 20 | + const EXPERIMENT_NAME = AtomicWidgetsModule::EXPERIMENT_NAME; | |
| 25 | 21 | |
| 26 | 22 | private Variable_Types_Registry $variable_types_registry; |
| 27 | 23 | |
| 28 | 24 | public function get_name() { |
| @@ -28,19 +24,8 @@ | ||
| 28 | 24 | public function get_name() { |
| 29 | 25 | return self::MODULE_NAME; |
| 30 | 26 | } |
| 31 | 27 | |
| 32 | - public static function get_experimental_data(): array { | |
| 33 | - return [ | |
| 34 | - 'name' => self::EXPERIMENT_NAME, | |
| 35 | - 'title' => esc_html__( 'Variables', 'elementor' ), | |
| 36 | - 'description' => esc_html__( 'Enable variables. (For this feature to work - Atomic Widgets must be active)', 'elementor' ), | |
| 37 | - 'hidden' => true, | |
| 38 | - 'default' => ExperimentsManager::STATE_ACTIVE, | |
| 39 | - 'release_status' => ExperimentsManager::RELEASE_STATUS_ALPHA, | |
| 40 | - ]; | |
| 41 | - } | |
| 42 | - | |
| 43 | 28 | private function hooks() { |
| 44 | 29 | return new Hooks(); |
| 45 | 30 | } |
| 46 | 31 | |
| @@ -49,9 +34,8 @@ | ||
| 49 | 34 | |
| 50 | 35 | if ( ! $this->is_experiment_active() ) { |
| 51 | 36 | return; |
| 52 | 37 | } |
| 53 | - $this->register_features(); | |
| 54 | 38 | |
| 55 | 39 | $this->hooks()->register(); |
| 56 | 40 | |
| 57 | 41 | ( new Import_Export_Customization() )->register_hooks(); |
| @@ -60,22 +44,10 @@ | ||
| 60 | 44 | add_filter( 'elementor/kit/meta_to_preserve_on_kit_import', [ $this, 'add_meta_to_preserve_on_kit_import' ] ); |
| 61 | 45 | add_action( 'elementor/editor/before_enqueue_scripts', fn () => $this->enqueue_editor_scripts() ); |
| 62 | 46 | } |
| 63 | 47 | |
| 64 | - private function register_features() { | |
| 65 | - Plugin::$instance->experiments->add_feature([ | |
| 66 | - 'name' => self::EXPERIMENT_MANAGER_NAME, | |
| 67 | - 'title' => esc_html__( 'Variables Manager', 'elementor' ), | |
| 68 | - 'description' => esc_html__( 'Enable variables manager. (For this feature to work - Variables must be active)', 'elementor' ), | |
| 69 | - 'hidden' => true, | |
| 70 | - 'default' => ExperimentsManager::STATE_ACTIVE, | |
| 71 | - 'release_status' => ExperimentsManager::RELEASE_STATUS_ALPHA, | |
| 72 | - ]); | |
| 73 | - } | |
| 74 | - | |
| 75 | 48 | private function is_experiment_active(): bool { |
| 76 | - return Plugin::$instance->experiments->is_feature_active( self::EXPERIMENT_NAME ) | |
| 77 | - && Plugin::$instance->experiments->is_feature_active( AtomicWidgetsModule::EXPERIMENT_NAME ); | |
| 49 | + return Plugin::$instance->experiments->is_feature_active( AtomicWidgetsModule::EXPERIMENT_NAME ); | |
| 78 | 50 | } |
| 79 | 51 | |
| 80 | 52 | public function init_variable_types_registry(): void { |
| 81 | 53 | $this->variable_types_registry = new Variable_Types_Registry(); |