| @@ -120,11 +120,9 @@ | ||
| 120 | 120 | private function install_compare( $version ) { |
| 121 | 121 | $installs_history = Upgrade_Manager::get_installs_history(); |
| 122 | 122 | |
| 123 | 123 | if ( empty( $installs_history ) ) { |
| 124 | - // Fresh installation: upgrade manager hasn't written history yet on this first request. | |
| 125 | - // Use the current plugin version as the effective first-install version. | |
| 126 | - return version_compare( ELEMENTOR_VERSION, $version, '>=' ); | |
| 124 | + return false; | |
| 127 | 125 | } |
| 128 | 126 | |
| 129 | 127 | $cleaned_version = preg_replace( '/-(beta|cloud|dev)\d*$/', '', key( $installs_history ) ); |
| 130 | 128 | |
| @@ -372,22 +370,9 @@ | ||
| 372 | 370 | 'title' => esc_html__( 'Optimized Markup', 'elementor' ), |
| 373 | 371 | 'tag' => esc_html__( 'Performance', 'elementor' ), |
| 374 | 372 | 'description' => esc_html__( 'Reduce the DOM size by eliminating HTML tags in various elements and widgets. This experiment includes markup changes so it might require updating custom CSS/JS code and cause compatibility issues with third party plugins.', 'elementor' ), |
| 375 | 373 | 'release_status' => self::RELEASE_STATUS_STABLE, |
| 376 | - 'default' => self::STATE_INACTIVE, | |
| 377 | - 'new_site' => [ | |
| 378 | - 'default_active' => true, | |
| 379 | - 'minimum_installation_version' => '3.30.0', | |
| 380 | - ], | |
| 381 | - ] ); | |
| 382 | - | |
| 383 | - $this->add_feature( [ | |
| 384 | - 'name' => 'e_panel_promotions', | |
| 385 | - 'title' => esc_html__( 'Panel Promotions', 'elementor' ), | |
| 386 | - 'description' => esc_html__( 'Enable experimental rendering for targeted promotions within the elements panels.', 'elementor' ), | |
| 387 | - 'release_status' => self::RELEASE_STATUS_DEV, | |
| 388 | 374 | 'default' => self::STATE_ACTIVE, |
| 389 | - 'type' => self::TYPE_HIDDEN, | |
| 390 | 375 | ] ); |
| 391 | 376 | } |
| 392 | 377 | |
| 393 | 378 | /** |
| @@ -663,12 +648,9 @@ | ||
| 663 | 648 | <div class="e-experiment__title"> |
| 664 | 649 | <div class="<?php echo $indicator_classes; ?>" data-tooltip="<?php echo $indicator_tooltip; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"></div> |
| 665 | 650 | <label class="e-experiment__title__label" for="e-experiment-<?php echo $feature['name']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"><?php echo $feature['title']; ?></label> |
| 666 | 651 | <?php foreach ( $feature['tags'] as $tag ) { ?> |
| 667 | - <?php | |
| 668 | - $tag_classes = 'e-experiment__title__tag e-experiment__title__tag__' . $tag['type'] . ' e-editor-one'; | |
| 669 | - ?> | |
| 670 | - <span class="<?php echo esc_attr( $tag_classes ); ?>"><?php echo $tag['label']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span> | |
| 652 | + <span class="e-experiment__title__tag e-experiment__title__tag__<?php echo $tag['type']; ?>"><?php echo $tag['label']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span> | |
| 671 | 653 | <?php } ?> |
| 672 | 654 | <?php if ( $feature['deprecated'] ) { ?> |
| 673 | 655 | <span class="e-experiment__title__tag e-experiment__title__tag__deprecated"><?php echo esc_html__( 'Deprecated', 'elementor' ); ?></span> |
| 674 | 656 | <?php } ?> |
| @@ -739,8 +721,10 @@ | ||
| 739 | 721 | * |
| 740 | 722 | * @param array $old_feature_data |
| 741 | 723 | * @param string $new_state |
| 742 | 724 | * @param string $old_state |
| 725 | + * | |
| 726 | + * @throws Dependency_Exception If the feature dependency is not available or not active. | |
| 743 | 727 | */ |
| 744 | 728 | private function on_feature_state_change( array $old_feature_data, $new_state, $old_state ) { |
| 745 | 729 | $new_feature_data = $this->get_features( $old_feature_data['name'] ); |
| 746 | 730 | $this->validate_dependency( $new_feature_data, $new_state ); |
| @@ -757,9 +741,9 @@ | ||
| 757 | 741 | do_action( 'elementor/experiments/feature-state-change/' . $old_feature_data['name'], $old_state, $new_state ); |
| 758 | 742 | } |
| 759 | 743 | |
| 760 | 744 | /** |
| 761 | - * @throws Exceptions\Dependency_Exception If the feature dependency is not available or not active. | |
| 745 | + * @throws Dependency_Exception If the feature dependency is not available or not active. | |
| 762 | 746 | */ |
| 763 | 747 | private function validate_dependency( array $feature, $new_state ) { |
| 764 | 748 | $rollback = function ( $feature_option_key, $state ) { |
| 765 | 749 | remove_all_actions( 'add_option_' . $feature_option_key ); |
| @@ -947,9 +931,9 @@ | ||
| 947 | 931 | /** |
| 948 | 932 | * @param array $experimental_data |
| 949 | 933 | * @return array |
| 950 | 934 | * |
| 951 | - * @throws Exceptions\Dependency_Exception If the feature dependency is not initialized or depends on a hidden experiment. | |
| 935 | + * @throws Dependency_Exception If the feature dependency is not initialized or depends on a hidden experiment. | |
| 952 | 936 | */ |
| 953 | 937 | private function initialize_feature_dependencies( array $experimental_data ): array { |
| 954 | 938 | foreach ( $experimental_data['dependencies'] as $key => $dependency ) { |
| 955 | 939 | $feature = $this->get_features( $dependency ); |