| @@ -24,8 +24,12 @@ | ||
| 24 | 24 | parent::__construct(); |
| 25 | 25 | |
| 26 | 26 | $this->register_shortcode(); |
| 27 | 27 | |
| 28 | + if ( ! Plugin::$instance->experiments->is_feature_active( 'e_element_cache' ) ) { | |
| 29 | + return; | |
| 30 | + } | |
| 31 | + | |
| 28 | 32 | add_filter( 'elementor/element_cache/unique_id', [ $this, 'get_unique_id' ] ); |
| 29 | 33 | |
| 30 | 34 | $this->add_advanced_tab_actions(); |
| 31 | 35 | |
| @@ -33,8 +37,24 @@ | ||
| 33 | 37 | add_action( 'elementor/admin/after_create_settings/' . Settings::PAGE_ID, [ $this, 'register_admin_fields' ], 100 ); |
| 34 | 38 | } |
| 35 | 39 | |
| 36 | 40 | $this->clear_cache_on_site_changed(); |
| 41 | + } | |
| 42 | + | |
| 43 | + public static function get_experimental_data(): array { | |
| 44 | + return [ | |
| 45 | + 'name' => 'e_element_cache', | |
| 46 | + 'title' => esc_html__( 'Element Caching', 'elementor' ), | |
| 47 | + 'tag' => esc_html__( 'Performance', 'elementor' ), | |
| 48 | + 'description' => esc_html__( 'Elements caching reduces loading times by serving up a copy of an element instead of rendering it fresh every time the page is loaded. When active, Elementor will determine which elements can benefit from static loading - but you can override this.', 'elementor' ), | |
| 49 | + 'release_status' => ExperimentsManager::RELEASE_STATUS_STABLE, | |
| 50 | + 'default' => ExperimentsManager::STATE_INACTIVE, | |
| 51 | + 'new_site' => [ | |
| 52 | + 'default_active' => true, | |
| 53 | + 'minimum_installation_version' => '3.23.0', | |
| 54 | + ], | |
| 55 | + 'generator_tag' => true, | |
| 56 | + ]; | |
| 37 | 57 | } |
| 38 | 58 | |
| 39 | 59 | public function get_unique_id() { |
| 40 | 60 | $unique_id = get_option( static::OPTION_UNIQUE_ID ); |