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 | includes/utils.php +24 -79 4.1.53.28.4 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,9 +810,9 @@
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 817 public static function is_elementor_path( $path ) {
844 818 $path = wp_normalize_path( $path );
@@ -902,21 +876,21 @@
902 876
903 877 /**
904 878 * Return specific object property value if exist from array of keys.
905 879 *
906 - * @param array $base_array
880 + * @param array $array
907 881 * @param array $keys
908 882 * @return mixed|null
909 883 */
910 - public static function get_array_value_by_keys( $base_array, $keys ) {
884 + public static function get_array_value_by_keys( $array, $keys ) {
911 885 $keys = (array) $keys;
912 886 foreach ( $keys as $key ) {
913 - if ( ! isset( $base_array[ $key ] ) ) {
887 + if ( ! isset( $array[ $key ] ) ) {
914 888 return null;
915 889 }
916 - $base_array = $base_array[ $key ];
890 + $array = $array[ $key ];
917 891 }
918 - return $base_array;
892 + return $array;
919 893 }
920 894
921 895 public static function get_cached_callback( $callback, $cache_key, $cache_time = 24 * HOUR_IN_SECONDS ) {
922 896 $cache = get_site_transient( $cache_key );
@@ -932,10 +906,10 @@
932 906 return $cache;
933 907 }
934 908
935 909 public static function is_sale_time(): bool {
936 - $sale_start_time = gmmktime( 10, 0, 0, 6, 15, 2026 );
937 - $sale_end_time = gmmktime( 3, 59, 0, 6, 17, 2026 );
910 + $sale_start_time = gmmktime( 13, 0, 0, 11, 26, 2024 );
911 + $sale_end_time = gmmktime( 9, 59, 0, 12, 4, 2024 );
938 912
939 913 $now_time = gmdate( 'U' );
940 914
941 915 return $now_time >= $sale_start_time && $now_time <= $sale_end_time;
@@ -965,35 +939,6 @@
965 939 $password_required = post_password_required( $post->ID )
966 940 && ! current_user_can( 'edit_post', $post->ID );
967 941
968 942 return $is_private || $not_allowed || $password_required;
969 - }
970 -
971 - public static function is_custom_kit_applied() {
972 - return (bool) Plugin::$instance->kits_manager->get_previous_id();
973 - }
974 -
975 - public static function decode_string( string $encoded_string, ?string $fallback = '' ) {
976 - try {
977 - return base64_decode( $encoded_string, true ) ?? $fallback;
978 - } catch ( \Exception $e ) {
979 - return $fallback;
980 - }
981 - }
982 -
983 - public static function encode_string( string $decoded_string ): string {
984 - return base64_encode( $decoded_string );
985 - }
986 -
987 - public static function html_to_plain_text( string $html ): string {
988 - if ( empty( $html ) ) {
989 - return '';
990 - }
991 -
992 - $text = preg_replace( '#<br\s*/?\s*>#i', ' ', $html );
993 - $text = preg_replace( '#</?[a-z][^>]*>#i', ' ', $text );
994 - $text = html_entity_decode( $text, ENT_QUOTES, 'UTF-8' );
995 - $text = str_replace( "\xE2\x80\x8B", '', $text );
996 -
997 - return trim( preg_replace( '/\s+/', ' ', $text ) );
998 943 }
999 944 }