PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.4
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.4
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 +219 -393 6.45.4 View file →
@@ -15,9 +15,9 @@
15 15
16 16 /**
17 17 * @since 2.0
18 18 */
19 - public static $plug_version = '6.4';
19 + public static $plug_version = '5.4';
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,58 +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 - * Print applicable admin banner.
1159 - *
1160 - * @since 5.4.2
1161 - *
1162 - * @param bool $should_show_lite_upgrade
1163 - * @return void
1164 - */
1165 - public static function print_admin_banner( $should_show_lite_upgrade ) {
1166 - if ( ! current_user_can( 'administrator' ) ) {
1167 - FrmInbox::maybe_show_banner();
1168 - return;
1169 - }
1170 -
1171 - if ( self::maybe_show_license_warning() || FrmInbox::maybe_show_banner() || ! $should_show_lite_upgrade || self::pro_is_installed() ) {
1172 - // Print license warning or inbox banner and exit if either prints.
1173 - // And exit before printing the upgrade bar if it shouldn't be shown.
1174 - return;
1175 - }
1176 - ?>
1177 - <div class="frm-upgrade-bar">
1178 - <span>You're using Formidable Forms Lite. To unlock more features consider</span>
1179 - <a href="<?php echo esc_url( self::admin_upgrade_link( 'top-bar' ) ); ?>" target="_blank" rel="noopener">upgrading to Pro</a>.
1180 - </div>
1181 - <?php
1182 - }
1183 -
1184 - /**
1185 - * @since 5.4.2
1186 - *
1187 - * @return bool True if a banner is available and shown.
1188 - */
1189 - private static function maybe_show_license_warning() {
1190 - return is_callable( 'FrmProAddonsController::admin_banner' ) && FrmProAddonsController::admin_banner();
1191 - }
1192 -
1193 - /**
1194 1093 * Render a button for a new item (Form, Application, etc).
1195 1094 *
1196 1095 * @since 3.0
1197 1096 * @param array $atts {
@@ -1213,9 +1112,9 @@
1213 1112 return;
1214 1113 }
1215 1114
1216 1115 $href = ! empty( $atts['new_link'] ) ? esc_url( $atts['new_link'] ) : '#';
1217 - $class = 'button button-primary frm-button-primary';
1116 + $class = 'button button-primary frm-button-primary frm-with-plus';
1218 1117
1219 1118 if ( ! empty( $atts['trigger_new_form_modal'] ) ) {
1220 1119 $class .= ' frm-trigger-new-form-modal';
1221 1120 }
@@ -1466,8 +1365,9 @@
1466 1365 public static function post_edit_link( $post_id ) {
1467 1366 $post = get_post( $post_id );
1468 1367 if ( $post ) {
1469 1368 $post_url = admin_url( 'post.php?post=' . $post_id . '&action=edit' );
1369 + $post_url = self::maybe_full_screen_link( $post_url );
1470 1370
1471 1371 return '<a href="' . esc_url( $post_url ) . '">' . self::truncate( $post->post_title, 50 ) . '</a>';
1472 1372 }
1473 1373
@@ -1482,59 +1382,22 @@
1482 1382 * @return bool
1483 1383 */
1484 1384 public static function is_full_screen() {
1485 1385 return self::is_form_builder_page() ||
1486 - self::is_style_editor_page() ||
1487 - self::is_full_screen_view_builder_page();
1386 + self::is_admin_page( 'formidable-styles' ) ||
1387 + self::is_admin_page( 'formidable-styles2' ) ||
1388 + self::simple_get( 'frm-full', 'absint' ) ||
1389 + self::is_view_builder_page();
1488 1390 }
1489 1391
1490 1392 /**
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 1393 * @since 4.0
1533 - * @deprecated 5.5.3
1534 1394 */
1535 1395 public static function maybe_full_screen_link( $link ) {
1536 - _deprecated_function( __METHOD__, '5.5.3' );
1396 + $is_full = self::simple_get( 'frm-full', 'absint' );
1397 + if ( $is_full && ! empty( $link ) && $link !== '#' ) {
1398 + $link .= '&frm-full=1';
1399 + }
1537 1400 return $link;
1538 1401 }
1539 1402
1540 1403 /**
@@ -2394,9 +2257,9 @@
2394 2257 *
2395 2258 * @return string $time_ago
2396 2259 */
2397 2260 public static function human_time_diff( $from, $to = '', $levels = 1 ) {
2398 - if ( empty( $to ) && 0 !== $to ) {
2261 + if ( empty( $to ) ) {
2399 2262 $now = new DateTime();
2400 2263 } else {
2401 2264 $now = new DateTime( '@' . $to );
2402 2265 }
@@ -2647,9 +2510,8 @@
2647 2510 'reply_to' => __( 'If you would like a different reply to address than the "from" address, add a single address here. FORMAT: Name <name@email.com> or name@email.com.', 'formidable' ),
2648 2511 'from' => __( 'Enter the name and/or email address of the sender. FORMAT: John Bates <john@example.com> or john@example.com.', 'formidable' ),
2649 2512 /* translators: %1$s: Form name, %2$s: Date */
2650 2513 '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 2514 );
2653 2515
2654 2516 if ( ! isset( $tooltips[ $name ] ) ) {
2655 2517 return;
@@ -2676,12 +2538,8 @@
2676 2538 return;
2677 2539 }
2678 2540
2679 2541 $frm_action = self::simple_get( 'frm_action', 'sanitize_title' );
2680 - if ( 'lite-reports' === $frm_action ) {
2681 - $frm_action = 'reports';
2682 - }
2683 -
2684 2542 if ( empty( $action ) || ( ! empty( $frm_action ) && in_array( $frm_action, $action ) ) ) {
2685 2543 echo ' class="current_page"';
2686 2544 }
2687 2545 }
@@ -2738,15 +2596,12 @@
2738 2596 }
2739 2597 }
2740 2598
2741 2599 /**
2742 - * Check for either json or serialized data. This is temporary while transitioning
2600 + * Check for either json or serilized data. This is temporary while transitioning
2743 2601 * all data to json.
2744 2602 *
2745 2603 * @since 4.02.03
2746 - *
2747 - * @param array|string $value
2748 - * @return void
2749 2604 */
2750 2605 public static function unserialize_or_decode( &$value ) {
2751 2606 if ( is_array( $value ) ) {
2752 2607 return;
@@ -2752,9 +2607,9 @@
2752 2607 return;
2753 2608 }
2754 2609
2755 2610 if ( is_serialized( $value ) ) {
2756 - $value = self::maybe_unserialize_array( $value );
2611 + $value = maybe_unserialize( $value );
2757 2612 } else {
2758 2613 $value = self::maybe_json_decode( $value, false );
2759 2614 }
2760 2615 }
@@ -2759,35 +2614,8 @@
2759 2614 }
2760 2615 }
2761 2616
2762 2617 /**
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 2618 * Decode a JSON string.
2791 2619 * Do not switch shortcodes like [24] to array unless intentional ie XML values.
2792 2620 *
2793 2621 * @param mixed $string
@@ -2814,36 +2642,8 @@
2814 2642 return $string;
2815 2643 }
2816 2644
2817 2645 /**
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 2646 * Reformat the json serialized array in name => value array.
2847 2647 *
2848 2648 * @since 4.02.03
2849 2649 */
@@ -2917,9 +2717,8 @@
2917 2717 'applicationsUrl' => admin_url( 'admin.php?page=formidable-applications' ),
2918 2718 'canAccessApplicationDashboard' => current_user_can( is_callable( 'FrmProApplicationsHelper::get_required_templates_capability' ) ? FrmProApplicationsHelper::get_required_templates_capability() : 'frm_edit_forms' ),
2919 2719 'loading' => __( 'Loading&hellip;', 'formidable' ),
2920 2720 'nonce' => wp_create_nonce( 'frm_ajax' ),
2921 - 'proIncludesSliderJs' => is_callable( 'FrmProFormsHelper::prepare_custom_currency' ),
2922 2721 );
2923 2722 wp_localize_script( 'formidable_admin_global', 'frmGlobal', $global_strings );
2924 2723
2925 2724 if ( $load ) {
@@ -2969,10 +2768,10 @@
2969 2768 $admin_script_strings = array(
2970 2769 'desc' => __( '(Click to add description)', 'formidable' ),
2971 2770 'blank' => __( '(Blank)', 'formidable' ),
2972 2771 'no_label' => __( '(no label)', 'formidable' ),
2973 - 'saving' => '', // Deprecated in 6.0.
2974 - 'saved' => '', // Deprecated in 6.0.
2772 + 'saving' => esc_attr( __( 'Saving', 'formidable' ) ),
2773 + 'saved' => esc_attr( __( 'Saved', 'formidable' ) ),
2975 2774 'ok' => __( 'OK', 'formidable' ),
2976 2775 'cancel' => __( 'Cancel', 'formidable' ),
2977 2776 'default_label' => __( 'Default', 'formidable' ),
2978 2777 'clear_default' => __( 'Clear default value when typing', 'formidable' ),
@@ -2978,8 +2777,9 @@
2978 2777 'clear_default' => __( 'Clear default value when typing', 'formidable' ),
2979 2778 'no_clear_default' => __( 'Do not clear default value when typing', 'formidable' ),
2980 2779 'valid_default' => __( 'Default value will pass form validation', 'formidable' ),
2981 2780 'no_valid_default' => __( 'Default value will NOT pass form validation', 'formidable' ),
2781 + 'caution' => __( 'Heads up', 'formidable' ),
2982 2782 'confirm' => __( 'Are you sure?', 'formidable' ),
2983 2783 'conf_delete' => __( 'Are you sure you want to delete this field and all data associated with it?', 'formidable' ),
2984 2784 '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 2785 'conf_no_repeat' => __( 'Warning: If you have entries with multiple rows, all but the first row will be lost.', 'formidable' ),
@@ -3014,9 +2814,8 @@
3014 2814 'install' => __( 'Install', 'formidable' ),
3015 2815 'active' => __( 'Active', 'formidable' ),
3016 2816 'select_a_field' => __( 'Select a Field', 'formidable' ),
3017 2817 'no_items_found' => __( 'No items found.', 'formidable' ),
3018 - 'field_already_used' => __( 'Oops. You have already used that field.', 'formidable' ),
3019 2818 );
3020 2819 $admin_script_strings = apply_filters( 'frm_admin_script_strings', $admin_script_strings );
3021 2820
3022 2821 $data = $wp_scripts->get_data( 'formidable_admin', 'data' );
@@ -3072,10 +2871,8 @@
3072 2871 /**
3073 2872 * If Pro is far outdated, show a message.
3074 2873 *
3075 2874 * @since 4.0.01
3076 - *
3077 - * @return void
3078 2875 */
3079 2876 public static function min_pro_version_notice( $min_version ) {
3080 2877 if ( ! self::is_formidable_admin() ) {
3081 2878 // Don't show admin-wide.
@@ -3091,9 +2888,9 @@
3091 2888
3092 2889 $pro_version = FrmProDb::$plug_version;
3093 2890 $expired = FrmAddonsController::is_license_expired();
3094 2891 ?>
3095 - <div class="frm-banner-alert frm_error_style frm_previous_install">
2892 + <div class="error frm_previous_install">
3096 2893 <?php
3097 2894 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 2895 if ( empty( $expired ) ) {
3099 2896 echo ' Please <a href="' . esc_url( admin_url( 'plugins.php?s=formidable%20forms%20pro' ) ) . '">update now</a>.';
@@ -3132,9 +2929,9 @@
3132 2929 }
3133 2930
3134 2931 foreach ( $message as $m ) {
3135 2932 ?>
3136 - <div class="frm-banner-alert frm_error_style frm_previous_install">
2933 + <div class="error frm_previous_install">
3137 2934 <?php echo esc_html( $m ); ?>
3138 2935 </div>
3139 2936 <?php
3140 2937 }
@@ -3139,25 +2936,17 @@
3139 2936 <?php
3140 2937 }
3141 2938 }
3142 2939
3143 - /**
3144 - * @param string $type
3145 - * @return array<string,string>
3146 - */
3147 2940 public static function locales( $type = 'date' ) {
3148 2941 $locales = array(
3149 2942 'en' => __( 'English', 'formidable' ),
3150 2943 'af' => __( 'Afrikaans', 'formidable' ),
3151 2944 'sq' => __( 'Albanian', 'formidable' ),
3152 - 'ar-DZ' => __( 'Algerian Arabic', 'formidable' ),
3153 - 'am' => __( 'Amharic', 'formidable' ),
3154 2945 'ar' => __( 'Arabic', 'formidable' ),
3155 2946 'hy' => __( 'Armenian', 'formidable' ),
3156 2947 'az' => __( 'Azerbaijani', 'formidable' ),
3157 2948 'eu' => __( 'Basque', 'formidable' ),
3158 - 'be' => __( 'Belarusian', 'formidable' ),
3159 - 'bn' => __( 'Bengali', 'formidable' ),
3160 2949 'bs' => __( 'Bosnian', 'formidable' ),
3161 2950 'bg' => __( 'Bulgarian', 'formidable' ),
3162 2951 'ca' => __( 'Catalan', 'formidable' ),
3163 2952 'zh-HK' => __( 'Chinese Hong Kong', 'formidable' ),
@@ -3176,15 +2965,12 @@
3176 2965 'fi' => __( 'Finnish', 'formidable' ),
3177 2966 'fr' => __( 'French', 'formidable' ),
3178 2967 'fr-CA' => __( 'French/Canadian', 'formidable' ),
3179 2968 'fr-CH' => __( 'French/Swiss', 'formidable' ),
3180 - 'gl' => __( 'Galician', 'formidable' ),
3181 - 'ka' => __( 'Georgian', 'formidable' ),
3182 2969 'de' => __( 'German', 'formidable' ),
3183 2970 'de-AT' => __( 'German/Austria', 'formidable' ),
3184 2971 'de-CH' => __( 'German/Switzerland', 'formidable' ),
3185 2972 'el' => __( 'Greek', 'formidable' ),
3186 - 'gu' => __( 'Gujarati', 'formidable' ),
3187 2973 'he' => __( 'Hebrew', 'formidable' ),
3188 2974 'iw' => __( 'Hebrew', 'formidable' ),
3189 2975 'hi' => __( 'Hindi', 'formidable' ),
3190 2976 'hu' => __( 'Hungarian', 'formidable' ),
@@ -3191,74 +2977,44 @@
3191 2977 'is' => __( 'Icelandic', 'formidable' ),
3192 2978 'id' => __( 'Indonesian', 'formidable' ),
3193 2979 'it' => __( 'Italian', 'formidable' ),
3194 2980 'ja' => __( 'Japanese', 'formidable' ),
3195 - 'kn' => __( 'Kannada', 'formidable' ),
3196 - 'kk' => __( 'Kazakh', 'formidable' ),
3197 - 'km' => __( 'Khmer', 'formidable' ),
3198 2981 'ko' => __( 'Korean', 'formidable' ),
3199 - 'ky' => __( 'Kyrgyz', 'formidable' ),
3200 - 'lo' => __( 'Laothian', 'formidable' ),
3201 2982 'lv' => __( 'Latvian', 'formidable' ),
3202 2983 'lt' => __( 'Lithuanian', 'formidable' ),
3203 - 'lb' => __( 'Luxembourgish', 'formidable' ),
3204 - 'mk' => __( 'Macedonian', 'formidable' ),
3205 - 'ml' => __( 'Malayalam', 'formidable' ),
3206 2984 'ms' => __( 'Malaysian', 'formidable' ),
3207 - 'mr' => __( 'Marathi', 'formidable' ),
3208 2985 'no' => __( 'Norwegian', 'formidable' ),
3209 - 'nb' => __( 'Norwegian Bokmål', 'formidable' ),
3210 - 'nn' => __( 'Norwegian Nynorsk', 'formidable' ),
3211 2986 'pl' => __( 'Polish', 'formidable' ),
3212 2987 'pt' => __( 'Portuguese', 'formidable' ),
3213 2988 'pt-BR' => __( 'Portuguese/Brazilian', 'formidable' ),
3214 2989 'pt-PT' => __( 'Portuguese/Portugal', 'formidable' ),
3215 - 'rm' => __( 'Romansh', 'formidable' ),
3216 2990 'ro' => __( 'Romanian', 'formidable' ),
3217 2991 'ru' => __( 'Russian', 'formidable' ),
3218 2992 'sr' => __( 'Serbian', 'formidable' ),
3219 2993 'sr-SR' => __( 'Serbian', 'formidable' ),
3220 - 'si' => __( 'Sinhalese', 'formidable' ),
3221 2994 'sk' => __( 'Slovak', 'formidable' ),
3222 2995 'sl' => __( 'Slovenian', 'formidable' ),
3223 2996 'es' => __( 'Spanish', 'formidable' ),
3224 2997 'es-419' => __( 'Spanish/Latin America', 'formidable' ),
3225 - 'sw' => __( 'Swahili', 'formidable' ),
3226 2998 'sv' => __( 'Swedish', 'formidable' ),
3227 2999 'ta' => __( 'Tamil', 'formidable' ),
3228 - 'te' => __( 'Telugu', 'formidable' ),
3229 3000 'th' => __( 'Thai', 'formidable' ),
3230 - 'tj' => __( 'Tajiki', 'formidable' ),
3231 3001 'tr' => __( 'Turkish', 'formidable' ),
3232 3002 'uk' => __( 'Ukrainian', 'formidable' ),
3233 - 'ur' => __( 'Urdu', 'formidable' ),
3234 3003 'vi' => __( 'Vietnamese', 'formidable' ),
3235 - 'cy-GB' => __( 'Welsh', 'formidable' ),
3236 - 'zu' => __( 'Zulu', 'formidable' ),
3237 3004 );
3238 3005
3239 3006 if ( $type === 'captcha' ) {
3240 3007 // 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' );
3008 + $unset = array( 'af', 'sq', 'hy', 'az', 'eu', 'bs', 'zh-HK', 'eo', 'et', 'fo', 'fr-CH', 'he', 'is', 'ms', 'sr-SR', 'ta' );
3242 3009 } else {
3243 3010 // 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' );
3011 + $unset = array( 'fil', 'fr-CA', 'de-AT', 'de-CH', 'iw', 'hi', 'pt', 'pt-PT', 'es-419' );
3245 3012 }
3246 3013
3247 3014 $locales = array_diff_key( $locales, array_flip( $unset ) );
3015 + $locales = apply_filters( 'frm_locales', $locales );
3248 3016
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 3017 return $locales;
3262 3018 }
3263 3019
3264 3020 /**
@@ -3564,12 +3320,11 @@
3564 3320 * @return array
3565 3321 */
3566 3322 public static function get_landing_page_upgrade_data_params( $medium = 'landing' ) {
3567 3323 $params = array(
3568 - 'medium' => $medium,
3569 - 'upgrade' => __( 'Form Landing Pages', 'formidable' ),
3570 - 'message' => __( 'Easily manage a landing page for your form. Upgrade to get form landing pages.', 'formidable' ),
3571 - 'screenshot' => 'landing.png',
3324 + 'medium' => $medium,
3325 + 'upgrade' => __( 'Form Landing Pages', 'formidable' ),
3326 + 'message' => __( 'Easily manage a landing page for your form. Upgrade to get form landing pages.', 'formidable' ),
3572 3327 );
3573 3328 return self::get_upgrade_data_params( 'landing', $params );
3574 3329 }
3575 3330
@@ -3651,8 +3406,36 @@
3651 3406 set_current_screen();
3652 3407 }
3653 3408
3654 3409 /**
3410 + * @since 4.07
3411 + * @deprecated 4.09.01
3412 + */
3413 + public static function renewal_message() {
3414 + if ( is_callable( 'FrmProAddonsController::renewal_message' ) ) {
3415 + FrmProAddonsController::renewal_message();
3416 + return;
3417 + }
3418 +
3419 + if ( ! FrmAddonsController::is_license_expired() ) {
3420 + return;
3421 + }
3422 +
3423 + ?>
3424 + <div class="frm_error_style" style="text-align:left">
3425 + <?php self::icon_by_class( 'frmfont frm_alert_icon' ); ?>
3426 + &nbsp;
3427 + <?php esc_html_e( 'Your account has expired', 'formidable' ); ?>
3428 + <div style="float:right">
3429 + <a href="<?php echo esc_url( self::admin_upgrade_link( 'form-expired', 'account/downloads/' ) ); ?>">
3430 + <?php esc_html_e( 'Renew Now', 'formidable' ); ?>
3431 + </a>
3432 + </div>
3433 + </div>
3434 + <?php
3435 + }
3436 +
3437 + /**
3655 3438 * Shows pill text.
3656 3439 *
3657 3440 * @since 5.2.02
3658 3441 *
@@ -3741,54 +3524,8 @@
3741 3524 return array( 'list', 'trash', 'untrash', 'destroy' );
3742 3525 }
3743 3526
3744 3527 /**
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 3528 * @since 4.08
3792 3529 * @deprecated 4.09.01
3793 3530 */
3794 3531 public static function expiring_message() {
@@ -3817,8 +3554,18 @@
3817 3554 FrmFormsHelper::insert_opt_html( $args );
3818 3555 }
3819 3556
3820 3557 /**
3558 + * Used to filter shortcode in text widgets
3559 + *
3560 + * @deprecated 2.5.4
3561 + * @codeCoverageIgnore
3562 + */
3563 + public static function widget_text_filter_callback( $matches ) {
3564 + return FrmDeprecated::widget_text_filter_callback( $matches );
3565 + }
3566 +
3567 + /**
3821 3568 * @deprecated 3.01
3822 3569 * @codeCoverageIgnore
3823 3570 */
3824 3571 public static function sanitize_array( &$values ) {
@@ -3825,86 +3572,165 @@
3825 3572 FrmDeprecated::sanitize_array( $values );
3826 3573 }
3827 3574
3828 3575 /**
3829 - * @since 2.0
3830 - * @deprecated 5.0.13
3576 + * @param array $settings
3577 + * @param string $group
3831 3578 *
3832 - * @return string The base Google APIS url for the current version of jQuery UI
3579 + * @since 2.0.6
3580 + * @deprecated 2.05.06
3581 + * @codeCoverageIgnore
3833 3582 */
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() : '';
3583 + public static function save_settings( $settings, $group ) {
3584 + return FrmDeprecated::save_settings( $settings, $group );
3837 3585 }
3838 3586
3839 3587 /**
3840 - * @since 4.07
3841 - * @deprecated 6.0
3588 + * @since 2.0.4
3589 + * @deprecated 2.05.06
3590 + * @codeCoverageIgnore
3842 3591 */
3843 - public static function renewal_message() {
3844 - _deprecated_function( __METHOD__, '6.0', 'FrmProAddonsController::renewal_message' );
3592 + public static function save_json_post( $settings ) {
3593 + return FrmDeprecated::save_json_post( $settings );
3845 3594 }
3846 3595
3847 3596 /**
3848 - * Display a dismissable warning message and save its dismissal state.
3597 + * @since 2.0
3598 + * @deprecated 2.05.06
3599 + * @codeCoverageIgnore
3849 3600 *
3850 - * @since 6.3
3601 + * @param string $cache_key The unique name for this cache
3602 + * @param string $group The name of the cache group
3603 + * @param string $query If blank, don't run a db call
3604 + * @param string $type The wpdb function to use with this query
3851 3605 *
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
3606 + * @return mixed $results The cache or query results
3855 3607 */
3856 - public static function add_dismissable_warning_message( $message = '', $option = '' ) {
3857 - if ( ! $message || ! $option ) {
3858 - return;
3859 - }
3608 + public static function check_cache( $cache_key, $group = '', $query = '', $type = 'get_var', $time = 300 ) {
3609 + return FrmDeprecated::check_cache( $cache_key, $group, $query, $type, $time );
3610 + }
3860 3611
3861 - $ajax_callback = function() use ( $option ) {
3862 - self::dismiss_warning_message( $option );
3863 - };
3612 + /**
3613 + * @deprecated 2.05.06
3614 + * @codeCoverageIgnore
3615 + */
3616 + public static function set_cache( $cache_key, $results, $group = '', $time = 300 ) {
3617 + return FrmDeprecated::set_cache( $cache_key, $results, $group, $time );
3618 + }
3864 3619
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 );
3620 + /**
3621 + * @deprecated 2.05.06
3622 + * @codeCoverageIgnore
3623 + */
3624 + public static function add_key_to_group_cache( $key, $group ) {
3625 + FrmDeprecated::add_key_to_group_cache( $key, $group );
3626 + }
3868 3627
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 - }
3628 + /**
3629 + * @deprecated 2.05.06
3630 + * @codeCoverageIgnore
3631 + */
3632 + public static function get_group_cached_keys( $group ) {
3633 + return FrmDeprecated::get_group_cached_keys( $group );
3634 + }
3875 3635
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 - );
3636 + /**
3637 + * @since 2.0
3638 + * @deprecated 2.05.06
3639 + * @codeCoverageIgnore
3640 + * @return mixed The cached value or false
3641 + */
3642 + public static function check_cache_and_transient( $cache_key ) {
3643 + return FrmDeprecated::check_cache( $cache_key );
3644 + }
3883 3645
3884 - $show_messages[] = $message;
3885 - $show_messages[] = '<span class="frm-warning-dismiss frmsvg" data-action="' . esc_attr( $option ) . '">' . $dismiss_icon . '</span>';
3646 + /**
3647 + * @since 2.0
3648 + * @deprecated 2.05.06
3649 + * @codeCoverageIgnore
3650 + *
3651 + * @param string $cache_key
3652 + */
3653 + public static function delete_cache_and_transient( $cache_key, $group = 'default' ) {
3654 + FrmDeprecated::delete_cache_and_transient( $cache_key, $group );
3655 + }
3886 3656
3887 - return $show_messages;
3888 - }
3889 - );
3657 + /**
3658 + * @since 2.0
3659 + * @deprecated 2.05.06
3660 + * @codeCoverageIgnore
3661 + *
3662 + * @param string $group The name of the cache group
3663 + */
3664 + public static function cache_delete_group( $group ) {
3665 + FrmDeprecated::cache_delete_group( $group );
3890 3666 }
3891 3667
3892 3668 /**
3893 - * Dismiss a warning message and update the dismissal state.
3669 + * @since 1.07.10
3670 + * @deprecated 2.05.06
3671 + * @codeCoverageIgnore
3894 3672 *
3895 - * @since 6.3
3673 + * @param string $term The value to escape
3896 3674 *
3897 - * @param string $option The unique identifier for the dismissal state of the message.
3898 - * @return void
3675 + * @return string The escaped value
3899 3676 */
3900 - public static function dismiss_warning_message( $option = '' ) {
3901 - self::permission_check( 'frm_change_settings' );
3902 - check_ajax_referer( 'frm_ajax', 'nonce' );
3677 + public static function esc_like( $term ) {
3678 + return FrmDeprecated::esc_like( $term );
3679 + }
3903 3680
3904 - if ( $option ) {
3905 - update_option( $option, true, 'no' );
3906 - }
3681 + /**
3682 + * @param string $order_query
3683 + *
3684 + * @deprecated 2.05.06
3685 + * @codeCoverageIgnore
3686 + */
3687 + public static function esc_order( $order_query ) {
3688 + return FrmDeprecated::esc_order( $order_query );
3689 + }
3907 3690
3908 - wp_send_json_success();
3691 + /**
3692 + * @deprecated 2.05.06
3693 + * @codeCoverageIgnore
3694 + */
3695 + public static function esc_order_by( &$order_by ) {
3696 + FrmDeprecated::esc_order_by( $order_by );
3697 + }
3698 +
3699 + /**
3700 + * @param string $limit
3701 + *
3702 + * @deprecated 2.05.06
3703 + * @codeCoverageIgnore
3704 + */
3705 + public static function esc_limit( $limit ) {
3706 + return FrmDeprecated::esc_limit( $limit );
3707 + }
3708 +
3709 + /**
3710 + * @since 2.0
3711 + * @deprecated 2.05.06
3712 + * @codeCoverageIgnore
3713 + */
3714 + public static function prepare_array_values( $array, $type = '%s' ) {
3715 + return FrmDeprecated::prepare_array_values( $array, $type );
3716 + }
3717 +
3718 + /**
3719 + * @deprecated 2.05.06
3720 + * @codeCoverageIgnore
3721 + */
3722 + public static function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ) {
3723 + return FrmDeprecated::prepend_and_or_where( $starts_with, $where );
3724 + }
3725 +
3726 + /**
3727 + * @since 2.0
3728 + * @deprecated 5.0.13
3729 + *
3730 + * @return string The base Google APIS url for the current version of jQuery UI
3731 + */
3732 + public static function jquery_ui_base_url() {
3733 + _deprecated_function( __FUNCTION__, '5.0.13', 'FrmProAppHelper::jquery_ui_base_url' );
3734 + return is_callable( 'FrmProAppHelper::jquery_ui_base_url' ) ? FrmProAppHelper::jquery_ui_base_url() : '';
3909 3735 }
3910 3736 }