| @@ -404,9 +404,9 @@ | ||
| 404 | 404 | update_metadata( 'post', $post_id, '_elementor_data', $json_value ); |
| 405 | 405 | |
| 406 | 406 | // Clear WP cache for next step. |
| 407 | 407 | wp_cache_flush(); |
| 408 | - } | |
| 408 | + } // End foreach(). | |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | /** |
| 412 | 412 | * @param Updater $updater |
| @@ -479,9 +479,9 @@ | ||
| 479 | 479 | // We need the `wp_slash` in order to avoid the unslashing during the `update_post_meta` |
| 480 | 480 | $json_value = wp_slash( wp_json_encode( $data ) ); |
| 481 | 481 | |
| 482 | 482 | update_metadata( 'post', $post_id, '_elementor_data', $json_value ); |
| 483 | - } | |
| 483 | + } // End foreach(). | |
| 484 | 484 | |
| 485 | 485 | return $updater->should_run_again( $post_ids ); |
| 486 | 486 | } |
| 487 | 487 | |
| @@ -515,9 +515,9 @@ | ||
| 515 | 515 | continue; |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | $document->save_template_type(); |
| 519 | - } | |
| 519 | + } // End foreach(). | |
| 520 | 520 | |
| 521 | 521 | return $updater->should_run_again( $post_ids ); |
| 522 | 522 | } |
| 523 | 523 | |
| @@ -529,9 +529,9 @@ | ||
| 529 | 529 | add_option( 'elementor_load_fa4_shim', 'yes' ); |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | /** |
| 533 | - * Migrate Icon control string value to Icons control array value | |
| 533 | + * migrate Icon control string value to Icons control array value | |
| 534 | 534 | * |
| 535 | 535 | * @param array $element |
| 536 | 536 | * @param array $args |
| 537 | 537 | * |
| @@ -581,10 +581,11 @@ | ||
| 581 | 581 | /** |
| 582 | 582 | * Update database to separate page from post. |
| 583 | 583 | * |
| 584 | 584 | * @param Updater $updater |
| 585 | - * @param string $type | |
| 586 | 585 | * |
| 586 | + * @param string $type | |
| 587 | + * | |
| 587 | 588 | * @return bool |
| 588 | 589 | */ |
| 589 | 590 | public static function rename_document_base_to_wp( $updater, $type ) { |
| 590 | 591 | global $wpdb; |
| @@ -608,8 +609,26 @@ | ||
| 608 | 609 | return $updater->should_run_again( $post_ids ); |
| 609 | 610 | } |
| 610 | 611 | |
| 611 | 612 | /** |
| 613 | + * Update database to separate page from post. | |
| 614 | + * | |
| 615 | + * @param Updater $updater | |
| 616 | + * | |
| 617 | + * @return bool | |
| 618 | + */ | |
| 619 | + // Because the query is slow on large sites, temporary don't upgrade. | |
| 620 | + /* public static function _v_2_7_0_rename_document_types_to_wp( $updater ) { | |
| 621 | + return self::rename_document_base_to_wp( $updater, 'post' ) || self::rename_document_base_to_wp( $updater, 'page' ); | |
| 622 | + }*/ | |
| 623 | + | |
| 624 | + // Upgrade code was fixed & moved to _v_2_7_1_remove_old_usage_data. | |
| 625 | + /* public static function _v_2_7_0_remove_old_usage_data() {} */ | |
| 626 | + | |
| 627 | + // Upgrade code moved to _v_2_7_1_recalc_usage_data. | |
| 628 | + /* public static function _v_2_7_0_recalc_usage_data( $updater ) {} */ | |
| 629 | + | |
| 630 | + /** | |
| 612 | 631 | * Don't use the old data anymore. |
| 613 | 632 | * Since 2.7.1 the key was changed from `elementor_elements_usage` to `elementor_controls_usage`. |
| 614 | 633 | */ |
| 615 | 634 | public static function _v_2_7_1_remove_old_usage_data() { |
| @@ -837,38 +856,8 @@ | ||
| 837 | 856 | self::maybe_add_gap_control_data( $option_name ); |
| 838 | 857 | } |
| 839 | 858 | } |
| 840 | 859 | |
| 841 | - /** | |
| 842 | - * Upgrade Elementor 3.26.0 - Delete old experiments from the DB. | |
| 843 | - * | |
| 844 | - * @since 3.26.0 | |
| 845 | - * @static | |
| 846 | - * @access public | |
| 847 | - */ | |
| 848 | - public static function _v_3_26_0() { | |
| 849 | - delete_option( 'elementor_experiment-ai-layout' ); | |
| 850 | - delete_option( 'elementor_experiment-block_editor_assets_optimize' ); | |
| 851 | - delete_option( 'elementor_experiment-container_grid' ); | |
| 852 | - delete_option( 'elementor_experiment-display-conditions' ); | |
| 853 | - delete_option( 'elementor_experiment-e_dom_optimization' ); | |
| 854 | - delete_option( 'elementor_experiment-e_global_styleguide' ); | |
| 855 | - delete_option( 'elementor_experiment-e_image_loading_optimization' ); | |
| 856 | - delete_option( 'elementor_experiment-e_lazyload' ); | |
| 857 | - delete_option( 'elementor_experiment-e_optimized_assets_loading' ); | |
| 858 | - delete_option( 'elementor_experiment-e_optimized_css_loading' ); | |
| 859 | - delete_option( 'elementor_experiment-e_scroll_snap' ); | |
| 860 | - delete_option( 'elementor_experiment-floating-buttons' ); | |
| 861 | - delete_option( 'elementor_experiment-form-submissions' ); | |
| 862 | - delete_option( 'elementor_experiment-link-in-bio' ); | |
| 863 | - delete_option( 'elementor_experiment-loop' ); | |
| 864 | - delete_option( 'elementor_experiment-notes' ); | |
| 865 | - delete_option( 'elementor_experiment-off-canvas' ); | |
| 866 | - delete_option( 'elementor_experiment-page-transitions' ); | |
| 867 | - delete_option( 'elementor_experiment-search' ); | |
| 868 | - delete_option( 'elementor_experiment-taxonomy-filter' ); | |
| 869 | - } | |
| 870 | - | |
| 871 | 860 | private static function maybe_add_gap_control_data( $option_name ) { |
| 872 | 861 | $kit_id = get_option( $option_name ); |
| 873 | 862 | |
| 874 | 863 | if ( ! $kit_id ) { |
| @@ -941,8 +930,14 @@ | ||
| 941 | 930 | $logger = Plugin::$instance->logger->get_logger(); |
| 942 | 931 | $logger->notice( $message ); |
| 943 | 932 | } |
| 944 | 933 | |
| 934 | + /** | |
| 935 | + * @param \wpdb $wpdb | |
| 936 | + * @param string $element_type | |
| 937 | + * | |
| 938 | + * @return array | |
| 939 | + */ | |
| 945 | 940 | public static function get_post_ids_by_element_type( $updater, string $element_type ): array { |
| 946 | 941 | global $wpdb; |
| 947 | 942 | |
| 948 | 943 | return $updater->query_col( |