PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.2
Elementor Website Builder – more than just a page builder v3.32.2
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 | includes/utils.php +28 -73 4.2.13.32.2 View file →
@@ -29,9 +29,8 @@
29 29 'a',
30 30 'article',
31 31 'aside',
32 32 'button',
33 - 'form',
34 33 'div',
35 34 'footer',
36 35 'h1',
37 36 'h2',
@@ -199,9 +198,9 @@
199 198 * @param string $from
200 199 * @param string $to
201 200 *
202 201 * @return string
203 - * @throws \Exception If URLs are missing or invalid URLs provided.
202 + * @throws \Exception Replace URL exception.
204 203 */
205 204 public static function replace_urls( $from, $to ) {
206 205 $from = trim( $from );
207 206 $to = trim( $to );
@@ -513,14 +512,14 @@
513 512 * @since 2.1.2
514 513 * @access public
515 514 * @static
516 515 */
517 - public static function array_inject( $base_array, $key, $insert ) {
518 - $length = array_search( $key, array_keys( $base_array ), true ) + 1;
516 + public static function array_inject( $array, $key, $insert ) {
517 + $length = array_search( $key, array_keys( $array ), true ) + 1;
519 518
520 - return array_slice( $base_array, 0, $length, true ) +
519 + return array_slice( $array, 0, $length, true ) +
521 520 $insert +
522 - array_slice( $base_array, $length, null, true );
521 + array_slice( $array, $length, null, true );
523 522 }
524 523
525 524 /**
526 525 * Render html attributes
@@ -637,34 +636,15 @@
637 636 public static function has_pro() {
638 637 return defined( 'ELEMENTOR_PRO_VERSION' );
639 638 }
640 639
641 - public static function is_license_active(): bool {
642 - return class_exists( '\ElementorPro\License\API' ) && \ElementorPro\License\API::is_license_active();
643 - }
644 -
645 - public static function is_pro_installed_and_not_active(): bool {
646 - if ( ! function_exists( 'get_plugins' ) ) {
647 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
648 - }
649 -
650 - $file_path = self::get_elementor_pro_file_path();
651 - $installed_plugins = get_plugins();
652 -
653 - return isset( $installed_plugins[ $file_path ] );
654 - }
655 -
656 - private static function get_elementor_pro_file_path(): string {
657 - return 'elementor-pro/elementor-pro.php';
658 - }
659 -
660 640 /**
661 641 * Convert HTMLEntities to UTF-8 characters
662 642 *
663 - * @param string $html_string
643 + * @param string $string
664 644 * @return string
665 645 */
666 - public static function urlencode_html_entities( $html_string ) {
646 + public static function urlencode_html_entities( $string ) {
667 647 $entities_dictionary = [
668 648 '‘' => "'", // Opening single quote
669 649 '’' => "'", // Closing single quote
670 650 '“' => '"', // Closing double quote
@@ -677,11 +657,11 @@
677 657 '„' => '"', // Double low quote
678 658 ];
679 659
680 660 // Decode decimal entities
681 - $html_string = str_replace( array_keys( $entities_dictionary ), array_values( $entities_dictionary ), $html_string );
661 + $string = str_replace( array_keys( $entities_dictionary ), array_values( $entities_dictionary ), $string );
682 662
683 - return rawurlencode( html_entity_decode( $html_string, ENT_QUOTES | ENT_HTML5, 'UTF-8' ) );
663 + return rawurlencode( html_entity_decode( $string, ENT_QUOTES | ENT_HTML5, 'UTF-8' ) );
684 664 }
685 665
686 666 /**
687 667 * Parse attributes that come as a string of comma-delimited key|value pairs.
@@ -733,19 +713,13 @@
733 713 if ( $id === $element['id'] ) {
734 714 return $element;
735 715 }
736 716
737 - $inner_elements = apply_filters(
738 - 'elementor/utils/find_element_recursive/inner_elements',
739 - $element['elements'] ?? [],
740 - $element
741 - );
717 + if ( ! empty( $element['elements'] ) ) {
718 + $element = self::find_element_recursive( $element['elements'], $id );
742 719
743 - if ( ! empty( $inner_elements ) ) {
744 - $found = self::find_element_recursive( $inner_elements, $id );
745 -
746 - if ( $found ) {
747 - return $found;
720 + if ( $element ) {
721 + return $element;
748 722 }
749 723 }
750 724 }
751 725
@@ -798,10 +772,10 @@
798 772
799 773 /**
800 774 * Print internal content (not user input) without escaping.
801 775 */
802 - public static function print_unescaped_internal_string( $internal_string ) {
803 - echo $internal_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
776 + public static function print_unescaped_internal_string( $string ) {
777 + echo $string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
804 778 }
805 779
806 780 /**
807 781 * Get recently edited posts query.
@@ -826,9 +800,9 @@
826 800
827 801 return new \WP_Query( $args );
828 802 }
829 803
830 - public static function print_wp_kses_extended( $text, array $tags ) {
804 + public static function print_wp_kses_extended( $string, array $tags ) {
831 805 $allowed_html = wp_kses_allowed_html( 'post' );
832 806
833 807 foreach ( $tags as $tag ) {
834 808 if ( isset( self::EXTENDED_ALLOWED_HTML_TAGS[ $tag ] ) ) {
@@ -836,17 +810,11 @@
836 810 $allowed_html = array_replace_recursive( $allowed_html, $extended_tags );
837 811 }
838 812 }
839 813
840 - echo wp_kses( $text, $allowed_html );
814 + echo wp_kses( $string, $allowed_html );
841 815 }
842 816
843 - public static function kses_post_deep( $data ) {
844 - return map_deep( $data, function ( $value ) {
845 - return is_string( $value ) ? wp_kses_post( $value ) : $value;
846 - } );
847 - }
848 -
849 817 public static function is_elementor_path( $path ) {
850 818 $path = wp_normalize_path( $path );
851 819
852 820 /**
@@ -908,21 +876,21 @@
908 876
909 877 /**
910 878 * Return specific object property value if exist from array of keys.
911 879 *
912 - * @param array $base_array
880 + * @param array $array
913 881 * @param array $keys
914 882 * @return mixed|null
915 883 */
916 - public static function get_array_value_by_keys( $base_array, $keys ) {
884 + public static function get_array_value_by_keys( $array, $keys ) {
917 885 $keys = (array) $keys;
918 886 foreach ( $keys as $key ) {
919 - if ( ! isset( $base_array[ $key ] ) ) {
887 + if ( ! isset( $array[ $key ] ) ) {
920 888 return null;
921 889 }
922 - $base_array = $base_array[ $key ];
890 + $array = $array[ $key ];
923 891 }
924 - return $base_array;
892 + return $array;
925 893 }
926 894
927 895 public static function get_cached_callback( $callback, $cache_key, $cache_time = 24 * HOUR_IN_SECONDS ) {
928 896 $cache = get_site_transient( $cache_key );
@@ -938,10 +906,10 @@
938 906 return $cache;
939 907 }
940 908
941 909 public static function is_sale_time(): bool {
942 - $sale_start_time = gmmktime( 10, 0, 0, 6, 15, 2026 );
943 - $sale_end_time = gmmktime( 3, 59, 0, 6, 17, 2026 );
910 + $sale_start_time = gmmktime( 12, 0, 0, 6, 10, 2025 );
911 + $sale_end_time = gmmktime( 3, 59, 0, 6, 17, 2025 );
944 912
945 913 $now_time = gmdate( 'U' );
946 914
947 915 return $now_time >= $sale_start_time && $now_time <= $sale_end_time;
@@ -977,29 +945,16 @@
977 945 public static function is_custom_kit_applied() {
978 946 return (bool) Plugin::$instance->kits_manager->get_previous_id();
979 947 }
980 948
981 - public static function decode_string( string $encoded_string, ?string $fallback = '' ) {
949 + public static function decode_string( string $string, ?string $fallback = '' ) {
982 950 try {
983 - return base64_decode( $encoded_string, true ) ?? $fallback;
951 + return base64_decode( $string, true ) ?? $fallback;
984 952 } catch ( \Exception $e ) {
985 953 return $fallback;
986 954 }
987 955 }
988 956
989 - public static function encode_string( string $decoded_string ): string {
990 - return base64_encode( $decoded_string );
991 - }
992 -
993 - public static function html_to_plain_text( string $html ): string {
994 - if ( empty( $html ) ) {
995 - return '';
996 - }
997 -
998 - $text = preg_replace( '#<br\s*/?\s*>#i', ' ', $html );
999 - $text = preg_replace( '#</?[a-z][^>]*>#i', ' ', $text );
1000 - $text = html_entity_decode( $text, ENT_QUOTES, 'UTF-8' );
1001 - $text = str_replace( "\xE2\x80\x8B", '', $text );
1002 -
1003 - return trim( preg_replace( '/\s+/', ' ', $text ) );
957 + public static function encode_string( string $string ): string {
958 + return base64_encode( $string );
1004 959 }
1005 960 }