PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.4.3
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.4.3
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/helpers/FrmAppHelper.php +196 -346 6.3.25.4.3 View file →
@@ -15,9 +15,9 @@
15 15
16 16 /**
17 17 * @since 2.0
18 18 */
19 - public static $plug_version = '6.3.2';
19 + public static $plug_version = '5.4.3';
20 20
21 21 /**
22 22 * @since 1.07.02
23 23 *
@@ -252,15 +252,15 @@
252 252 global $pagenow;
253 253 $get_page = self::simple_get( 'page', 'sanitize_title' );
254 254 if ( $pagenow ) {
255 255 // allow this to be true during ajax load i.e. ajax form builder loading
256 - $is_page = ( $pagenow === 'admin.php' || $pagenow === 'admin-ajax.php' ) && $get_page === $page;
256 + $is_page = ( $pagenow == 'admin.php' || $pagenow == 'admin-ajax.php' ) && $get_page == $page;
257 257 if ( $is_page ) {
258 258 return true;
259 259 }
260 260 }
261 261
262 - return is_admin() && $get_page === $page;
262 + return is_admin() && $get_page == $page;
263 263 }
264 264
265 265 /**
266 266 * If the current page is for editing or creating a view.
@@ -332,18 +332,14 @@
332 332 * Check if on an admin page
333 333 *
334 334 * @since 2.0
335 335 *
336 + * @param None
337 + *
336 338 * @return boolean
337 339 */
338 340 public static function is_admin() {
339 - $is_admin = is_admin() && ! wp_doing_ajax();
340 -
341 - /**
342 - * @since 6.0
343 - * @param bool $is_admin
344 - */
345 - return apply_filters( 'frm_is_admin', $is_admin );
341 + return is_admin() && ! wp_doing_ajax();
346 342 }
347 343
348 344 /**
349 345 * Check if value contains blank value or empty array
@@ -376,17 +372,26 @@
376 372 return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
377 373 }
378 374
379 375 /**
380 - * Check for the IP address in several places (when custom headers are enabled).
381 - * Used by [ip] shortcode.
376 + * Check for the IP address in several places
377 + * Used by [ip] shortcode
382 378 *
383 379 * @return string The IP address of the current user
384 380 */
385 381 public static function get_ip_address() {
386 - $ip_options = self::should_use_custom_header_ip() ? self::get_custom_header_keys_for_ip() : array( 'REMOTE_ADDR' );
387 - $ip = '';
388 -
382 + $ip_options = array(
383 + 'HTTP_CLIENT_IP',
384 + 'HTTP_CF_CONNECTING_IP',
385 + 'HTTP_X_FORWARDED_FOR',
386 + 'HTTP_X_FORWARDED',
387 + 'HTTP_X_CLUSTER_CLIENT_IP',
388 + 'HTTP_X_REAL_IP',
389 + 'HTTP_FORWARDED_FOR',
390 + 'HTTP_FORWARDED',
391 + 'REMOTE_ADDR',
392 + );
393 + $ip = '';
389 394 foreach ( $ip_options as $key ) {
390 395 if ( ! isset( $_SERVER[ $key ] ) ) {
391 396 continue;
392 397 }
@@ -392,9 +397,9 @@
392 397 }
393 398
394 399 $key = self::get_server_value( $key );
395 400 foreach ( explode( ',', $key ) as $ip ) {
396 - $ip = trim( $ip ); // Just to be safe.
401 + $ip = trim( $ip ); // just to be safe.
397 402
398 403 if ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) !== false ) {
399 404 return sanitize_text_field( $ip );
400 405 }
@@ -403,52 +408,8 @@
403 408
404 409 return sanitize_text_field( $ip );
405 410 }
406 411
407 - /**
408 - * @since 6.1
409 - *
410 - * @return array
411 - */
412 - public static function get_custom_header_keys_for_ip() {
413 - return array(
414 - 'HTTP_CLIENT_IP',
415 - 'HTTP_CF_CONNECTING_IP',
416 - 'HTTP_X_FORWARDED_FOR',
417 - 'HTTP_X_FORWARDED',
418 - 'HTTP_X_CLUSTER_CLIENT_IP',
419 - 'HTTP_X_REAL_IP',
420 - 'HTTP_FORWARDED_FOR',
421 - 'HTTP_FORWARDED',
422 - 'REMOTE_ADDR',
423 - );
424 - }
425 -
426 - /**
427 - * Check if we should check every HTTP header or just $_SERVER['REMOTE_ADDR'].
428 - * The other HTTP headers can be spoofed so this isn't recommended.
429 - * But in some cases (like reverse proxies), the IP may be empty if you use $_SERVER['REMOTE_ADDR'].
430 - *
431 - * @since 6.1
432 - *
433 - * @return bool
434 - */
435 - private static function should_use_custom_header_ip() {
436 - $settings = self::get_settings();
437 - $should_use_custom_header_ip = ! $settings->no_ips && $settings->custom_header_ip;
438 -
439 - /**
440 - * Filter whether to check spoofable HTTP headers.
441 - * This uses the custom_header_ip setting, but it is hidden if the GDPR option is also on.
442 - * As the IP is still checked for blacklist checks, someone with the GDPR option may still want to enable this when behind a reverse proxy.
443 - *
444 - * @since 6.1
445 - *
446 - * @param bool $should_use_custom_header_ip
447 - */
448 - return apply_filters( 'frm_use_custom_header_ip', $should_use_custom_header_ip );
449 - }
450 -
451 412 public static function get_param( $param, $default = '', $src = 'get', $sanitize = '' ) {
452 413 if ( strpos( $param, '[' ) ) {
453 414 $params = explode( '[', $param );
454 415 $param = $params[0];
@@ -965,18 +926,8 @@
965 926
966 927 $html_atts = self::array_to_html_params( $atts );
967 928
968 929 $icon = trim( str_replace( array( 'frm_icon_font', 'frmfont ' ), '', $class ) );
969 -
970 - // Replace icons that have been removed.
971 - $deprecated = array(
972 - 'frm_clone_solid_icon' => 'frm_clone_icon',
973 - );
974 - if ( isset( $deprecated[ $icon ] ) ) {
975 - $icon = $deprecated[ $icon ];
976 - $class = str_replace( $icon, $deprecated[ $icon ], $class );
977 - }
978 -
979 930 if ( $icon === $class ) {
980 931 $icon = '<i class="' . esc_attr( $class ) . '"' . $html_atts . '></i>';
981 932 } else {
982 933 $class = strpos( $icon, ' ' ) === false ? '' : ' ' . $icon;
@@ -1033,9 +984,9 @@
1033 984 * @param array $allowed_attr
1034 985 * @return array
1035 986 */
1036 987 public static function allow_vars_in_styles( $allowed_attr ) {
1037 - $allowed_attr[] = '--primary-700';
988 + $allowed_attr[] = '--primary-hover';
1038 989 return $allowed_attr;
1039 990 }
1040 991
1041 992 /**
@@ -1044,9 +995,9 @@
1044 995 * @param bool $allow_css
1045 996 * @param string $css_string
1046 997 */
1047 998 public static function allow_style( $allow_css, $css_string ) {
1048 - if ( ! $allow_css && 0 === strpos( $css_string, '--primary-700:' ) ) {
999 + if ( ! $allow_css && 0 === strpos( $css_string, '--primary-hover:' ) ) {
1049 1000 $split = explode( ':', $css_string, 2 );
1050 1001 $allow_css = 2 === count( $split ) && self::is_a_valid_color( $split[1] );
1051 1002 }
1052 1003 return $allow_css;
@@ -1113,11 +1064,9 @@
1113 1064 if ( ! $echo ) {
1114 1065 ob_start();
1115 1066 }
1116 1067
1117 - if ( is_callable( $echo_function ) ) {
1118 - $echo_function();
1119 - }
1068 + $echo_function();
1120 1069
1121 1070 if ( ! $echo ) {
1122 1071 $return = ob_get_contents();
1123 1072 ob_end_clean();
@@ -1140,22 +1089,8 @@
1140 1089 include( self::plugin_path() . '/classes/views/shared/admin-header.php' );
1141 1090 }
1142 1091
1143 1092 /**
1144 - * @since 6.0
1145 - *
1146 - * @param string $type
1147 - * @return void
1148 - */
1149 - public static function import_link( $type = 'secondary' ) {
1150 - ?>
1151 - <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-import' ) ); ?>" class="button frm-button-<?php echo esc_attr( $type ); ?> frm_animate_bg">
1152 - <?php esc_html_e( 'Import', 'formidable' ); ?>
1153 - </a>
1154 - <?php
1155 - }
1156 -
1157 - /**
1158 1093 * Print applicable admin banner.
1159 1094 *
1160 1095 * @since 5.4.2
1161 1096 *
@@ -1213,9 +1148,9 @@
1213 1148 return;
1214 1149 }
1215 1150
1216 1151 $href = ! empty( $atts['new_link'] ) ? esc_url( $atts['new_link'] ) : '#';
1217 - $class = 'button button-primary frm-button-primary';
1152 + $class = 'button button-primary frm-button-primary frm-with-plus';
1218 1153
1219 1154 if ( ! empty( $atts['trigger_new_form_modal'] ) ) {
1220 1155 $class .= ' frm-trigger-new-form-modal';
1221 1156 }
@@ -1466,8 +1401,9 @@
1466 1401 public static function post_edit_link( $post_id ) {
1467 1402 $post = get_post( $post_id );
1468 1403 if ( $post ) {
1469 1404 $post_url = admin_url( 'post.php?post=' . $post_id . '&action=edit' );
1405 + $post_url = self::maybe_full_screen_link( $post_url );
1470 1406
1471 1407 return '<a href="' . esc_url( $post_url ) . '">' . self::truncate( $post->post_title, 50 ) . '</a>';
1472 1408 }
1473 1409
@@ -1482,59 +1418,22 @@
1482 1418 * @return bool
1483 1419 */
1484 1420 public static function is_full_screen() {
1485 1421 return self::is_form_builder_page() ||
1486 - self::is_style_editor_page() ||
1487 - self::is_full_screen_view_builder_page();
1422 + self::is_admin_page( 'formidable-styles' ) ||
1423 + self::is_admin_page( 'formidable-styles2' ) ||
1424 + self::simple_get( 'frm-full', 'absint' ) ||
1425 + self::is_view_builder_page();
1488 1426 }
1489 1427
1490 1428 /**
1491 - * Check if user is on the style editor or its alternative URL.
1492 - * The first URL is a submenu "Styles" in the Formidable menu /wp-admin/admin.php?page=formidable-styles.
1493 - * The alternative URL is linked as a submenu "Forms" item of the Appearance menu /wp-admin/themes.php?page=formidable-styles2.
1494 - *
1495 - * @since 5.5.3
1496 - * @since 6.0 Added the $view parameter. Previously there was only a 'edit' view.
1497 - *
1498 - * @param string $view Supports 'edit', 'list', and ''. If '', both 'edit' and 'list' will match.
1499 - * @return bool
1500 - */
1501 - public static function is_style_editor_page( $view = '' ) {
1502 - if ( ! self::is_admin_page( 'formidable-styles' ) && ! self::is_admin_page( 'formidable-styles2' ) ) {
1503 - return false;
1504 - }
1505 -
1506 - if ( ! in_array( $view, array( 'list', 'edit' ), true ) ) {
1507 - return true;
1508 - }
1509 -
1510 - $action = self::simple_get( 'frm_action' );
1511 - $is_edit_mode = 'edit' === $action || ( ! $action && ! self::simple_get( 'id' ) && ! self::simple_get( 'form' ) );
1512 -
1513 - if ( ! $is_edit_mode && class_exists( 'FrmProStylesController' ) && in_array( $action, array( 'new_style', 'duplicate' ), true ) ) {
1514 - $is_edit_mode = true;
1515 - }
1516 -
1517 - $checking_for_edit_mode = 'edit' === $view;
1518 -
1519 - return $is_edit_mode === $checking_for_edit_mode;
1520 - }
1521 -
1522 - /**
1523 - * @since 5.5.3
1524 - *
1525 - * @return bool
1526 - */
1527 - private static function is_full_screen_view_builder_page() {
1528 - return self::is_admin_page( 'formidable-views-editor' );
1529 - }
1530 -
1531 - /**
1532 1429 * @since 4.0
1533 - * @deprecated 5.5.3
1534 1430 */
1535 1431 public static function maybe_full_screen_link( $link ) {
1536 - _deprecated_function( __METHOD__, '5.5.3' );
1432 + $is_full = self::simple_get( 'frm-full', 'absint' );
1433 + if ( $is_full && ! empty( $link ) && $link !== '#' ) {
1434 + $link .= '&frm-full=1';
1435 + }
1537 1436 return $link;
1538 1437 }
1539 1438
1540 1439 /**
@@ -2394,9 +2293,9 @@
2394 2293 *
2395 2294 * @return string $time_ago
2396 2295 */
2397 2296 public static function human_time_diff( $from, $to = '', $levels = 1 ) {
2398 - if ( empty( $to ) && 0 !== $to ) {
2297 + if ( empty( $to ) ) {
2399 2298 $now = new DateTime();
2400 2299 } else {
2401 2300 $now = new DateTime( '@' . $to );
2402 2301 }
@@ -2647,9 +2546,8 @@
2647 2546 'reply_to' => __( 'If you would like a different reply to address than the "from" address, add a single address here. FORMAT: Name <[email protected]> or [email protected].', 'formidable' ),
2648 2547 'from' => __( 'Enter the name and/or email address of the sender. FORMAT: John Bates <[email protected]> or [email protected].', 'formidable' ),
2649 2548 /* translators: %1$s: Form name, %2$s: Date */
2650 2549 'email_subject' => esc_attr( sprintf( __( 'If you leave the subject blank, the default will be used: %1$s Form submitted on %2$s', 'formidable' ), $form_name, self::site_name() ) ),
2651 - 'new_tab' => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ),
2652 2550 );
2653 2551
2654 2552 if ( ! isset( $tooltips[ $name ] ) ) {
2655 2553 return;
@@ -2738,15 +2636,12 @@
2738 2636 }
2739 2637 }
2740 2638
2741 2639 /**
2742 - * Check for either json or serialized data. This is temporary while transitioning
2640 + * Check for either json or serilized data. This is temporary while transitioning
2743 2641 * all data to json.
2744 2642 *
2745 2643 * @since 4.02.03
2746 - *
2747 - * @param array|string $value
2748 - * @return void
2749 2644 */
2750 2645 public static function unserialize_or_decode( &$value ) {
2751 2646 if ( is_array( $value ) ) {
2752 2647 return;
@@ -2752,9 +2647,9 @@
2752 2647 return;
2753 2648 }
2754 2649
2755 2650 if ( is_serialized( $value ) ) {
2756 - $value = self::maybe_unserialize_array( $value );
2651 + $value = maybe_unserialize( $value );
2757 2652 } else {
2758 2653 $value = self::maybe_json_decode( $value, false );
2759 2654 }
2760 2655 }
@@ -2759,35 +2654,8 @@
2759 2654 }
2760 2655 }
2761 2656
2762 2657 /**
2763 - * Safely unserialize an array if necessary.
2764 - * This function doesn't actually use unserialize. The string is parsed instead.
2765 - *
2766 - * @since 6.2
2767 - *
2768 - * @param mixed $value
2769 - * @return mixed
2770 - */
2771 - public static function maybe_unserialize_array( $value ) {
2772 - if ( ! is_string( $value ) ) {
2773 - return $value;
2774 - }
2775 -
2776 - // Since we only expect an array, skip anything that doesn't start with a:.
2777 - if ( ! is_serialized( $value ) || 'a:' !== substr( $value, 0, 2 ) ) {
2778 - return $value;
2779 - }
2780 -
2781 - $parsed = FrmSerializedStringParserHelper::get()->parse( $value );
2782 - if ( is_array( $parsed ) ) {
2783 - $value = $parsed;
2784 - }
2785 -
2786 - return $value;
2787 - }
2788 -
2789 - /**
2790 2658 * Decode a JSON string.
2791 2659 * Do not switch shortcodes like [24] to array unless intentional ie XML values.
2792 2660 *
2793 2661 * @param mixed $string
@@ -2814,36 +2682,8 @@
2814 2682 return $string;
2815 2683 }
2816 2684
2817 2685 /**
2818 - * @since 6.2.3
2819 - *
2820 - * @param string $value
2821 - * @return string
2822 - */
2823 - public static function maybe_utf8_encode( $value ) {
2824 - $from_format = 'ISO-8859-1';
2825 - $to_format = 'UTF-8';
2826 -
2827 - if ( function_exists( 'mb_check_encoding' ) && function_exists( 'mb_convert_encoding' ) ) {
2828 - if ( mb_check_encoding( $value, $from_format ) ) {
2829 - return mb_convert_encoding( $value, $to_format, $from_format );
2830 - }
2831 - return $value;
2832 - }
2833 -
2834 - if ( function_exists( 'iconv' ) ) {
2835 - $converted = iconv( $from_format, $to_format, $value );
2836 - // Value is false if $value is not ISO-8859-1.
2837 - if ( false !== $converted ) {
2838 - return $converted;
2839 - }
2840 - }
2841 -
2842 - return $value;
2843 - }
2844 -
2845 - /**
2846 2686 * Reformat the json serialized array in name => value array.
2847 2687 *
2848 2688 * @since 4.02.03
2849 2689 */
@@ -2969,10 +2809,10 @@
2969 2809 $admin_script_strings = array(
2970 2810 'desc' => __( '(Click to add description)', 'formidable' ),
2971 2811 'blank' => __( '(Blank)', 'formidable' ),
2972 2812 'no_label' => __( '(no label)', 'formidable' ),
2973 - 'saving' => '', // Deprecated in 6.0.
2974 - 'saved' => '', // Deprecated in 6.0.
2813 + 'saving' => esc_attr( __( 'Saving', 'formidable' ) ),
2814 + 'saved' => esc_attr( __( 'Saved', 'formidable' ) ),
2975 2815 'ok' => __( 'OK', 'formidable' ),
2976 2816 'cancel' => __( 'Cancel', 'formidable' ),
2977 2817 'default_label' => __( 'Default', 'formidable' ),
2978 2818 'clear_default' => __( 'Clear default value when typing', 'formidable' ),
@@ -2978,8 +2818,9 @@
2978 2818 'clear_default' => __( 'Clear default value when typing', 'formidable' ),
2979 2819 'no_clear_default' => __( 'Do not clear default value when typing', 'formidable' ),
2980 2820 'valid_default' => __( 'Default value will pass form validation', 'formidable' ),
2981 2821 'no_valid_default' => __( 'Default value will NOT pass form validation', 'formidable' ),
2822 + 'caution' => __( 'Heads up', 'formidable' ),
2982 2823 'confirm' => __( 'Are you sure?', 'formidable' ),
2983 2824 'conf_delete' => __( 'Are you sure you want to delete this field and all data associated with it?', 'formidable' ),
2984 2825 'conf_delete_sec' => __( 'All fields inside this Section will be deleted along with their data. Are you sure you want to delete this group of fields?', 'formidable' ),
2985 2826 'conf_no_repeat' => __( 'Warning: If you have entries with multiple rows, all but the first row will be lost.', 'formidable' ),
@@ -3014,9 +2855,8 @@
3014 2855 'install' => __( 'Install', 'formidable' ),
3015 2856 'active' => __( 'Active', 'formidable' ),
3016 2857 'select_a_field' => __( 'Select a Field', 'formidable' ),
3017 2858 'no_items_found' => __( 'No items found.', 'formidable' ),
3018 - 'field_already_used' => __( 'Oops. You have already used that field.', 'formidable' ),
3019 2859 );
3020 2860 $admin_script_strings = apply_filters( 'frm_admin_script_strings', $admin_script_strings );
3021 2861
3022 2862 $data = $wp_scripts->get_data( 'formidable_admin', 'data' );
@@ -3091,9 +2931,9 @@
3091 2931
3092 2932 $pro_version = FrmProDb::$plug_version;
3093 2933 $expired = FrmAddonsController::is_license_expired();
3094 2934 ?>
3095 - <div class="frm-banner-alert frm_error_style frm_previous_install">
2935 + <div class="error frm_previous_install">
3096 2936 <?php
3097 2937 esc_html_e( 'You are running a version of Formidable Forms that may not be compatible with your version of Formidable Forms Pro.', 'formidable' );
3098 2938 if ( empty( $expired ) ) {
3099 2939 echo ' Please <a href="' . esc_url( admin_url( 'plugins.php?s=formidable%20forms%20pro' ) ) . '">update now</a>.';
@@ -3132,9 +2972,9 @@
3132 2972 }
3133 2973
3134 2974 foreach ( $message as $m ) {
3135 2975 ?>
3136 - <div class="frm-banner-alert frm_error_style frm_previous_install">
2976 + <div class="error frm_previous_install">
3137 2977 <?php echo esc_html( $m ); ?>
3138 2978 </div>
3139 2979 <?php
3140 2980 }
@@ -3139,25 +2979,17 @@
3139 2979 <?php
3140 2980 }
3141 2981 }
3142 2982
3143 - /**
3144 - * @param string $type
3145 - * @return array<string,string>
3146 - */
3147 2983 public static function locales( $type = 'date' ) {
3148 2984 $locales = array(
3149 2985 'en' => __( 'English', 'formidable' ),
3150 2986 'af' => __( 'Afrikaans', 'formidable' ),
3151 2987 'sq' => __( 'Albanian', 'formidable' ),
3152 - 'ar-DZ' => __( 'Algerian Arabic', 'formidable' ),
3153 - 'am' => __( 'Amharic', 'formidable' ),
3154 2988 'ar' => __( 'Arabic', 'formidable' ),
3155 2989 'hy' => __( 'Armenian', 'formidable' ),
3156 2990 'az' => __( 'Azerbaijani', 'formidable' ),
3157 2991 'eu' => __( 'Basque', 'formidable' ),
3158 - 'be' => __( 'Belarusian', 'formidable' ),
3159 - 'bn' => __( 'Bengali', 'formidable' ),
3160 2992 'bs' => __( 'Bosnian', 'formidable' ),
3161 2993 'bg' => __( 'Bulgarian', 'formidable' ),
3162 2994 'ca' => __( 'Catalan', 'formidable' ),
3163 2995 'zh-HK' => __( 'Chinese Hong Kong', 'formidable' ),
@@ -3176,15 +3008,12 @@
3176 3008 'fi' => __( 'Finnish', 'formidable' ),
3177 3009 'fr' => __( 'French', 'formidable' ),
3178 3010 'fr-CA' => __( 'French/Canadian', 'formidable' ),
3179 3011 'fr-CH' => __( 'French/Swiss', 'formidable' ),
3180 - 'gl' => __( 'Galician', 'formidable' ),
3181 - 'ka' => __( 'Georgian', 'formidable' ),
3182 3012 'de' => __( 'German', 'formidable' ),
3183 3013 'de-AT' => __( 'German/Austria', 'formidable' ),
3184 3014 'de-CH' => __( 'German/Switzerland', 'formidable' ),
3185 3015 'el' => __( 'Greek', 'formidable' ),
3186 - 'gu' => __( 'Gujarati', 'formidable' ),
3187 3016 'he' => __( 'Hebrew', 'formidable' ),
3188 3017 'iw' => __( 'Hebrew', 'formidable' ),
3189 3018 'hi' => __( 'Hindi', 'formidable' ),
3190 3019 'hu' => __( 'Hungarian', 'formidable' ),
@@ -3191,74 +3020,44 @@
3191 3020 'is' => __( 'Icelandic', 'formidable' ),
3192 3021 'id' => __( 'Indonesian', 'formidable' ),
3193 3022 'it' => __( 'Italian', 'formidable' ),
3194 3023 'ja' => __( 'Japanese', 'formidable' ),
3195 - 'kn' => __( 'Kannada', 'formidable' ),
3196 - 'kk' => __( 'Kazakh', 'formidable' ),
3197 - 'km' => __( 'Khmer', 'formidable' ),
3198 3024 'ko' => __( 'Korean', 'formidable' ),
3199 - 'ky' => __( 'Kyrgyz', 'formidable' ),
3200 - 'lo' => __( 'Laothian', 'formidable' ),
3201 3025 'lv' => __( 'Latvian', 'formidable' ),
3202 3026 'lt' => __( 'Lithuanian', 'formidable' ),
3203 - 'lb' => __( 'Luxembourgish', 'formidable' ),
3204 - 'mk' => __( 'Macedonian', 'formidable' ),
3205 - 'ml' => __( 'Malayalam', 'formidable' ),
3206 3027 'ms' => __( 'Malaysian', 'formidable' ),
3207 - 'mr' => __( 'Marathi', 'formidable' ),
3208 3028 'no' => __( 'Norwegian', 'formidable' ),
3209 - 'nb' => __( 'Norwegian Bokmål', 'formidable' ),
3210 - 'nn' => __( 'Norwegian Nynorsk', 'formidable' ),
3211 3029 'pl' => __( 'Polish', 'formidable' ),
3212 3030 'pt' => __( 'Portuguese', 'formidable' ),
3213 3031 'pt-BR' => __( 'Portuguese/Brazilian', 'formidable' ),
3214 3032 'pt-PT' => __( 'Portuguese/Portugal', 'formidable' ),
3215 - 'rm' => __( 'Romansh', 'formidable' ),
3216 3033 'ro' => __( 'Romanian', 'formidable' ),
3217 3034 'ru' => __( 'Russian', 'formidable' ),
3218 3035 'sr' => __( 'Serbian', 'formidable' ),
3219 3036 'sr-SR' => __( 'Serbian', 'formidable' ),
3220 - 'si' => __( 'Sinhalese', 'formidable' ),
3221 3037 'sk' => __( 'Slovak', 'formidable' ),
3222 3038 'sl' => __( 'Slovenian', 'formidable' ),
3223 3039 'es' => __( 'Spanish', 'formidable' ),
3224 3040 'es-419' => __( 'Spanish/Latin America', 'formidable' ),
3225 - 'sw' => __( 'Swahili', 'formidable' ),
3226 3041 'sv' => __( 'Swedish', 'formidable' ),
3227 3042 'ta' => __( 'Tamil', 'formidable' ),
3228 - 'te' => __( 'Telugu', 'formidable' ),
3229 3043 'th' => __( 'Thai', 'formidable' ),
3230 - 'tj' => __( 'Tajiki', 'formidable' ),
3231 3044 'tr' => __( 'Turkish', 'formidable' ),
3232 3045 'uk' => __( 'Ukrainian', 'formidable' ),
3233 - 'ur' => __( 'Urdu', 'formidable' ),
3234 3046 'vi' => __( 'Vietnamese', 'formidable' ),
3235 - 'cy-GB' => __( 'Welsh', 'formidable' ),
3236 - 'zu' => __( 'Zulu', 'formidable' ),
3237 3047 );
3238 3048
3239 3049 if ( $type === 'captcha' ) {
3240 3050 // remove the languages unavailable for the captcha
3241 - $unset = array( 'sq', 'bs', 'eo', 'fo', 'fr-CH', 'sr-SR', 'ar-DZ', 'be', 'cy-GB', 'kk', 'km', 'ky', 'lb', 'mk', 'nb', 'nn', 'rm', 'tj' );
3051 + $unset = array( 'af', 'sq', 'hy', 'az', 'eu', 'bs', 'zh-HK', 'eo', 'et', 'fo', 'fr-CH', 'he', 'is', 'ms', 'sr-SR', 'ta' );
3242 3052 } else {
3243 3053 // remove the languages unavailable for the datepicker
3244 - $unset = array( 'fil', 'fr-CA', 'de-AT', 'de-CH', 'iw', 'hi', 'pt', 'pt-PT', 'es-419', 'mr', 'lo', 'kn', 'si', 'gu', 'bn', 'zu', 'ur', 'te', 'sw', 'am' );
3054 + $unset = array( 'fil', 'fr-CA', 'de-AT', 'de-CH', 'iw', 'hi', 'pt', 'pt-PT', 'es-419' );
3245 3055 }
3246 3056
3247 3057 $locales = array_diff_key( $locales, array_flip( $unset ) );
3058 + $locales = apply_filters( 'frm_locales', $locales );
3248 3059
3249 - /**
3250 - * Filter available locale options.
3251 - *
3252 - * @since 5.4.5 Added $args parameter with type.
3253 - *
3254 - * @param array<string,string> $locales
3255 - * @param array $args {
3256 - * @type string $type
3257 - * }
3258 - */
3259 - $locales = apply_filters( 'frm_locales', $locales, compact( 'type' ) );
3260 -
3261 3060 return $locales;
3262 3061 }
3263 3062
3264 3063 /**
@@ -3741,54 +3540,8 @@
3741 3540 return array( 'list', 'trash', 'untrash', 'destroy' );
3742 3541 }
3743 3542
3744 3543 /**
3745 - * Safely call get_plugins, importing the required files if they are not yet loaded.
3746 - *
3747 - * @since 5.5
3748 - *
3749 - * @return array
3750 - */
3751 - public static function get_plugins() {
3752 - if ( ! function_exists( 'get_plugins' ) ) {
3753 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
3754 - }
3755 - return get_plugins();
3756 - }
3757 -
3758 - /**
3759 - * Make sure that the file we're trying to load is in fact the expected file type, and that it's coming from our S3 bucket.
3760 - * This is to make sure that the URL can't be exploited for a SSRF attack.
3761 - *
3762 - * @since 5.5.5
3763 - *
3764 - * @param string $url
3765 - * @param string $expected_extension
3766 - * @return bool
3767 - */
3768 - public static function validate_url_is_in_s3_bucket( $url, $expected_extension ) {
3769 - $file_is_in_expected_s3_bucket = 0 === strpos( $url, 'https://s3.amazonaws.com/fp.strategy11.com' );
3770 - if ( ! $file_is_in_expected_s3_bucket ) {
3771 - return false;
3772 - }
3773 -
3774 - $parsed = parse_url( $url );
3775 - if ( ! is_array( $parsed ) ) {
3776 - // URL is malformed.
3777 - return false;
3778 - }
3779 -
3780 - $path = $parsed['path'];
3781 - $ext = pathinfo( $path, PATHINFO_EXTENSION );
3782 - if ( $expected_extension !== $ext ) {
3783 - // The URL isn't to an XML file.
3784 - return false;
3785 - }
3786 -
3787 - return true;
3788 - }
3789 -
3790 - /**
3791 3544 * @since 4.08
3792 3545 * @deprecated 4.09.01
3793 3546 */
3794 3547 public static function expiring_message() {
@@ -3817,8 +3570,18 @@
3817 3570 FrmFormsHelper::insert_opt_html( $args );
3818 3571 }
3819 3572
3820 3573 /**
3574 + * Used to filter shortcode in text widgets
3575 + *
3576 + * @deprecated 2.5.4
3577 + * @codeCoverageIgnore
3578 + */
3579 + public static function widget_text_filter_callback( $matches ) {
3580 + return FrmDeprecated::widget_text_filter_callback( $matches );
3581 + }
3582 +
3583 + /**
3821 3584 * @deprecated 3.01
3822 3585 * @codeCoverageIgnore
3823 3586 */
3824 3587 public static function sanitize_array( &$values ) {
@@ -3825,86 +3588,173 @@
3825 3588 FrmDeprecated::sanitize_array( $values );
3826 3589 }
3827 3590
3828 3591 /**
3829 - * @since 2.0
3830 - * @deprecated 5.0.13
3592 + * @param array $settings
3593 + * @param string $group
3831 3594 *
3832 - * @return string The base Google APIS url for the current version of jQuery UI
3595 + * @since 2.0.6
3596 + * @deprecated 2.05.06
3597 + * @codeCoverageIgnore
3833 3598 */
3834 - public static function jquery_ui_base_url() {
3835 - _deprecated_function( __FUNCTION__, '5.0.13', 'FrmProAppHelper::jquery_ui_base_url' );
3836 - return is_callable( 'FrmProAppHelper::jquery_ui_base_url' ) ? FrmProAppHelper::jquery_ui_base_url() : '';
3599 + public static function save_settings( $settings, $group ) {
3600 + return FrmDeprecated::save_settings( $settings, $group );
3837 3601 }
3838 3602
3839 3603 /**
3840 - * @since 4.07
3841 - * @deprecated 6.0
3604 + * @since 2.0.4
3605 + * @deprecated 2.05.06
3606 + * @codeCoverageIgnore
3842 3607 */
3843 - public static function renewal_message() {
3844 - _deprecated_function( __METHOD__, '6.0', 'FrmProAddonsController::renewal_message' );
3608 + public static function save_json_post( $settings ) {
3609 + return FrmDeprecated::save_json_post( $settings );
3845 3610 }
3846 3611
3847 3612 /**
3848 - * Display a dismissable warning message and save its dismissal state.
3613 + * @since 2.0
3614 + * @deprecated 2.05.06
3615 + * @codeCoverageIgnore
3849 3616 *
3850 - * @since 6.3
3617 + * @param string $cache_key The unique name for this cache
3618 + * @param string $group The name of the cache group
3619 + * @param string $query If blank, don't run a db call
3620 + * @param string $type The wpdb function to use with this query
3851 3621 *
3852 - * @param string $message The warning message to display.
3853 - * @param string $option The unique identifier for the dismissal state of the message and the WP Ajax action.
3854 - * @return void
3622 + * @return mixed $results The cache or query results
3855 3623 */
3856 - public static function add_dismissable_warning_message( $message = '', $option = '' ) {
3857 - if ( ! $message || ! $option ) {
3858 - return;
3859 - }
3624 + public static function check_cache( $cache_key, $group = '', $query = '', $type = 'get_var', $time = 300 ) {
3625 + return FrmDeprecated::check_cache( $cache_key, $group, $query, $type, $time );
3626 + }
3860 3627
3861 - $ajax_callback = function() use ( $option ) {
3862 - self::dismiss_warning_message( $option );
3863 - };
3628 + /**
3629 + * @deprecated 2.05.06
3630 + * @codeCoverageIgnore
3631 + */
3632 + public static function set_cache( $cache_key, $results, $group = '', $time = 300 ) {
3633 + return FrmDeprecated::set_cache( $cache_key, $results, $group, $time );
3634 + }
3864 3635
3865 - // We're handling JS codes with `doJsonPost` and it adds 'frm_' to the beginning of the action.
3866 - // To prevent any issues, we add 'frm_' from the beginning of the action.
3867 - add_action( 'wp_ajax_frm_' . $option, $ajax_callback );
3636 + /**
3637 + * @deprecated 2.05.06
3638 + * @codeCoverageIgnore
3639 + */
3640 + public static function add_key_to_group_cache( $key, $group ) {
3641 + FrmDeprecated::add_key_to_group_cache( $key, $group );
3642 + }
3868 3643
3869 - add_filter(
3870 - 'frm_message_list',
3871 - function( $show_messages ) use ( $message, $option ) {
3872 - if ( get_option( $option, false ) ) {
3873 - return $show_messages;
3874 - }
3644 + /**
3645 + * @deprecated 2.05.06
3646 + * @codeCoverageIgnore
3647 + */
3648 + public static function get_group_cached_keys( $group ) {
3649 + return FrmDeprecated::get_group_cached_keys( $group );
3650 + }
3875 3651
3876 - $dismiss_icon = self::icon_by_class(
3877 - 'frmfont frm_close_icon',
3878 - array(
3879 - 'aria-label' => _x( 'Dismiss', 'warning message: close icon label', 'formidable' ),
3880 - 'echo' => false,
3881 - )
3882 - );
3652 + /**
3653 + * @since 2.0
3654 + * @deprecated 2.05.06
3655 + * @codeCoverageIgnore
3656 + * @return mixed The cached value or false
3657 + */
3658 + public static function check_cache_and_transient( $cache_key ) {
3659 + return FrmDeprecated::check_cache( $cache_key );
3660 + }
3883 3661
3884 - $show_messages[] = $message;
3885 - $show_messages[] = '<span class="frm-warning-dismiss frmsvg" data-action="' . esc_attr( $option ) . '">' . $dismiss_icon . '</span>';
3662 + /**
3663 + * @since 2.0
3664 + * @deprecated 2.05.06
3665 + * @codeCoverageIgnore
3666 + *
3667 + * @param string $cache_key
3668 + */
3669 + public static function delete_cache_and_transient( $cache_key, $group = 'default' ) {
3670 + FrmDeprecated::delete_cache_and_transient( $cache_key, $group );
3671 + }
3886 3672
3887 - return $show_messages;
3888 - }
3889 - );
3673 + /**
3674 + * @since 2.0
3675 + * @deprecated 2.05.06
3676 + * @codeCoverageIgnore
3677 + *
3678 + * @param string $group The name of the cache group
3679 + */
3680 + public static function cache_delete_group( $group ) {
3681 + FrmDeprecated::cache_delete_group( $group );
3890 3682 }
3891 3683
3892 3684 /**
3893 - * Dismiss a warning message and update the dismissal state.
3685 + * @since 1.07.10
3686 + * @deprecated 2.05.06
3687 + * @codeCoverageIgnore
3894 3688 *
3895 - * @since 6.3
3689 + * @param string $term The value to escape
3896 3690 *
3897 - * @param string $option The unique identifier for the dismissal state of the message.
3898 - * @return void
3691 + * @return string The escaped value
3899 3692 */
3900 - public static function dismiss_warning_message( $option = '' ) {
3901 - self::permission_check( 'frm_change_settings' );
3902 - check_ajax_referer( 'frm_ajax', 'nonce' );
3693 + public static function esc_like( $term ) {
3694 + return FrmDeprecated::esc_like( $term );
3695 + }
3903 3696
3904 - if ( $option ) {
3905 - update_option( $option, true, 'no' );
3906 - }
3697 + /**
3698 + * @param string $order_query
3699 + *
3700 + * @deprecated 2.05.06
3701 + * @codeCoverageIgnore
3702 + */
3703 + public static function esc_order( $order_query ) {
3704 + return FrmDeprecated::esc_order( $order_query );
3705 + }
3907 3706
3908 - wp_send_json_success();
3707 + /**
3708 + * @deprecated 2.05.06
3709 + * @codeCoverageIgnore
3710 + */
3711 + public static function esc_order_by( &$order_by ) {
3712 + FrmDeprecated::esc_order_by( $order_by );
3713 + }
3714 +
3715 + /**
3716 + * @param string $limit
3717 + *
3718 + * @deprecated 2.05.06
3719 + * @codeCoverageIgnore
3720 + */
3721 + public static function esc_limit( $limit ) {
3722 + return FrmDeprecated::esc_limit( $limit );
3723 + }
3724 +
3725 + /**
3726 + * @since 2.0
3727 + * @deprecated 2.05.06
3728 + * @codeCoverageIgnore
3729 + */
3730 + public static function prepare_array_values( $array, $type = '%s' ) {
3731 + return FrmDeprecated::prepare_array_values( $array, $type );
3732 + }
3733 +
3734 + /**
3735 + * @deprecated 2.05.06
3736 + * @codeCoverageIgnore
3737 + */
3738 + public static function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ) {
3739 + return FrmDeprecated::prepend_and_or_where( $starts_with, $where );
3740 + }
3741 +
3742 + /**
3743 + * @since 2.0
3744 + * @deprecated 5.0.13
3745 + *
3746 + * @return string The base Google APIS url for the current version of jQuery UI
3747 + */
3748 + public static function jquery_ui_base_url() {
3749 + _deprecated_function( __FUNCTION__, '5.0.13', 'FrmProAppHelper::jquery_ui_base_url' );
3750 + return is_callable( 'FrmProAppHelper::jquery_ui_base_url' ) ? FrmProAppHelper::jquery_ui_base_url() : '';
3751 + }
3752 +
3753 + /**
3754 + * @since 4.07
3755 + * @deprecated x.x
3756 + */
3757 + public static function renewal_message() {
3758 + _deprecated_function( __METHOD__, 'x.x', 'FrmProAddonsController::renewal_message' );
3909 3759 }
3910 3760 }