PluginProbe
Elementor Website Builder – more than just a page builder / 3.28.4
Elementor Website Builder – more than just a page builder v3.28.4
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | modules/element-cache/module.php +19 -16 4.1.0-dev23.28.4 View file →
@@ -13,10 +13,8 @@
13 13 }
14 14
15 15 class Module extends BaseModule {
16 16
17 - const OPTION_UNIQUE_ID = '_elementor_element_cache_unique_id';
18 -
19 17 public function get_name() {
20 18 return 'element-cache';
21 19 }
22 20
@@ -24,9 +22,11 @@
24 22 parent::__construct();
25 23
26 24 $this->register_shortcode();
27 25
28 - add_filter( 'elementor/element_cache/unique_id', [ $this, 'get_unique_id' ] );
26 + if ( ! Plugin::$instance->experiments->is_feature_active( 'e_element_cache' ) ) {
27 + return;
28 + }
29 29
30 30 $this->add_advanced_tab_actions();
31 31
32 32 if ( is_admin() ) {
@@ -35,17 +35,22 @@
35 35
36 36 $this->clear_cache_on_site_changed();
37 37 }
38 38
39 - public function get_unique_id() {
40 - $unique_id = get_option( static::OPTION_UNIQUE_ID );
41 -
42 - if ( ! $unique_id ) {
43 - $unique_id = md5( uniqid( wp_generate_password() ) );
44 - update_option( static::OPTION_UNIQUE_ID, $unique_id );
45 - }
46 -
47 - return $unique_id;
39 + public static function get_experimental_data(): array {
40 + return [
41 + 'name' => 'e_element_cache',
42 + 'title' => esc_html__( 'Element Caching', 'elementor' ),
43 + 'tag' => esc_html__( 'Performance', 'elementor' ),
44 + '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' ),
45 + 'release_status' => ExperimentsManager::RELEASE_STATUS_BETA,
46 + 'default' => ExperimentsManager::STATE_INACTIVE,
47 + 'new_site' => [
48 + 'default_active' => true,
49 + 'minimum_installation_version' => '3.23.0',
50 + ],
51 + 'generator_tag' => true,
52 + ];
48 53 }
49 54
50 55 private function register_shortcode() {
51 56 add_shortcode( 'elementor-element', function ( $atts ) {
@@ -52,17 +57,15 @@
52 57 if ( empty( $atts['data'] ) ) {
53 58 return '';
54 59 }
55 60
56 - if ( empty( $atts['k'] ) || $atts['k'] !== $this->get_unique_id() ) {
57 - return '';
58 - }
59 -
60 61 $widget_data = json_decode( base64_decode( $atts['data'] ), true );
61 62
62 63 if ( empty( $widget_data ) || ! is_array( $widget_data ) ) {
63 64 return '';
64 65 }
66 +
67 + $widget_data['settings']['isShortcode'] = true;
65 68
66 69 ob_start();
67 70
68 71 $element = Plugin::$instance->elements_manager->create_element_instance( $widget_data );