| @@ -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.5'; | |
| 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 <name@email.com> or name@email.com.', 'formidable' ), |
| 2648 | 2547 | 'from' => __( 'Enter the name and/or email address of the sender. FORMAT: John Bates <john@example.com> or john@example.com.', '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 | } |
| @@ -3755,40 +3595,8 @@ | ||
| 3755 | 3595 | return get_plugins(); |
| 3756 | 3596 | } |
| 3757 | 3597 | |
| 3758 | 3598 | /** |
| 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 | 3599 | * @since 4.08 |
| 3792 | 3600 | * @deprecated 4.09.01 |
| 3793 | 3601 | */ |
| 3794 | 3602 | public static function expiring_message() { |
| @@ -3817,8 +3625,18 @@ | ||
| 3817 | 3625 | FrmFormsHelper::insert_opt_html( $args ); |
| 3818 | 3626 | } |
| 3819 | 3627 | |
| 3820 | 3628 | /** |
| 3629 | + * Used to filter shortcode in text widgets | |
| 3630 | + * | |
| 3631 | + * @deprecated 2.5.4 | |
| 3632 | + * @codeCoverageIgnore | |
| 3633 | + */ | |
| 3634 | + public static function widget_text_filter_callback( $matches ) { | |
| 3635 | + return FrmDeprecated::widget_text_filter_callback( $matches ); | |
| 3636 | + } | |
| 3637 | + | |
| 3638 | + /** | |
| 3821 | 3639 | * @deprecated 3.01 |
| 3822 | 3640 | * @codeCoverageIgnore |
| 3823 | 3641 | */ |
| 3824 | 3642 | public static function sanitize_array( &$values ) { |
| @@ -3825,86 +3643,173 @@ | ||
| 3825 | 3643 | FrmDeprecated::sanitize_array( $values ); |
| 3826 | 3644 | } |
| 3827 | 3645 | |
| 3828 | 3646 | /** |
| 3829 | - * @since 2.0 | |
| 3830 | - * @deprecated 5.0.13 | |
| 3647 | + * @param array $settings | |
| 3648 | + * @param string $group | |
| 3831 | 3649 | * |
| 3832 | - * @return string The base Google APIS url for the current version of jQuery UI | |
| 3650 | + * @since 2.0.6 | |
| 3651 | + * @deprecated 2.05.06 | |
| 3652 | + * @codeCoverageIgnore | |
| 3833 | 3653 | */ |
| 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() : ''; | |
| 3654 | + public static function save_settings( $settings, $group ) { | |
| 3655 | + return FrmDeprecated::save_settings( $settings, $group ); | |
| 3837 | 3656 | } |
| 3838 | 3657 | |
| 3839 | 3658 | /** |
| 3840 | - * @since 4.07 | |
| 3841 | - * @deprecated 6.0 | |
| 3659 | + * @since 2.0.4 | |
| 3660 | + * @deprecated 2.05.06 | |
| 3661 | + * @codeCoverageIgnore | |
| 3842 | 3662 | */ |
| 3843 | - public static function renewal_message() { | |
| 3844 | - _deprecated_function( __METHOD__, '6.0', 'FrmProAddonsController::renewal_message' ); | |
| 3663 | + public static function save_json_post( $settings ) { | |
| 3664 | + return FrmDeprecated::save_json_post( $settings ); | |
| 3845 | 3665 | } |
| 3846 | 3666 | |
| 3847 | 3667 | /** |
| 3848 | - * Display a dismissable warning message and save its dismissal state. | |
| 3668 | + * @since 2.0 | |
| 3669 | + * @deprecated 2.05.06 | |
| 3670 | + * @codeCoverageIgnore | |
| 3849 | 3671 | * |
| 3850 | - * @since 6.3 | |
| 3672 | + * @param string $cache_key The unique name for this cache | |
| 3673 | + * @param string $group The name of the cache group | |
| 3674 | + * @param string $query If blank, don't run a db call | |
| 3675 | + * @param string $type The wpdb function to use with this query | |
| 3851 | 3676 | * |
| 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 | |
| 3677 | + * @return mixed $results The cache or query results | |
| 3855 | 3678 | */ |
| 3856 | - public static function add_dismissable_warning_message( $message = '', $option = '' ) { | |
| 3857 | - if ( ! $message || ! $option ) { | |
| 3858 | - return; | |
| 3859 | - } | |
| 3679 | + public static function check_cache( $cache_key, $group = '', $query = '', $type = 'get_var', $time = 300 ) { | |
| 3680 | + return FrmDeprecated::check_cache( $cache_key, $group, $query, $type, $time ); | |
| 3681 | + } | |
| 3860 | 3682 | |
| 3861 | - $ajax_callback = function() use ( $option ) { | |
| 3862 | - self::dismiss_warning_message( $option ); | |
| 3863 | - }; | |
| 3683 | + /** | |
| 3684 | + * @deprecated 2.05.06 | |
| 3685 | + * @codeCoverageIgnore | |
| 3686 | + */ | |
| 3687 | + public static function set_cache( $cache_key, $results, $group = '', $time = 300 ) { | |
| 3688 | + return FrmDeprecated::set_cache( $cache_key, $results, $group, $time ); | |
| 3689 | + } | |
| 3864 | 3690 | |
| 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 ); | |
| 3691 | + /** | |
| 3692 | + * @deprecated 2.05.06 | |
| 3693 | + * @codeCoverageIgnore | |
| 3694 | + */ | |
| 3695 | + public static function add_key_to_group_cache( $key, $group ) { | |
| 3696 | + FrmDeprecated::add_key_to_group_cache( $key, $group ); | |
| 3697 | + } | |
| 3868 | 3698 | |
| 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 | - } | |
| 3699 | + /** | |
| 3700 | + * @deprecated 2.05.06 | |
| 3701 | + * @codeCoverageIgnore | |
| 3702 | + */ | |
| 3703 | + public static function get_group_cached_keys( $group ) { | |
| 3704 | + return FrmDeprecated::get_group_cached_keys( $group ); | |
| 3705 | + } | |
| 3875 | 3706 | |
| 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 | - ); | |
| 3707 | + /** | |
| 3708 | + * @since 2.0 | |
| 3709 | + * @deprecated 2.05.06 | |
| 3710 | + * @codeCoverageIgnore | |
| 3711 | + * @return mixed The cached value or false | |
| 3712 | + */ | |
| 3713 | + public static function check_cache_and_transient( $cache_key ) { | |
| 3714 | + return FrmDeprecated::check_cache( $cache_key ); | |
| 3715 | + } | |
| 3883 | 3716 | |
| 3884 | - $show_messages[] = $message; | |
| 3885 | - $show_messages[] = '<span class="frm-warning-dismiss frmsvg" data-action="' . esc_attr( $option ) . '">' . $dismiss_icon . '</span>'; | |
| 3717 | + /** | |
| 3718 | + * @since 2.0 | |
| 3719 | + * @deprecated 2.05.06 | |
| 3720 | + * @codeCoverageIgnore | |
| 3721 | + * | |
| 3722 | + * @param string $cache_key | |
| 3723 | + */ | |
| 3724 | + public static function delete_cache_and_transient( $cache_key, $group = 'default' ) { | |
| 3725 | + FrmDeprecated::delete_cache_and_transient( $cache_key, $group ); | |
| 3726 | + } | |
| 3886 | 3727 | |
| 3887 | - return $show_messages; | |
| 3888 | - } | |
| 3889 | - ); | |
| 3728 | + /** | |
| 3729 | + * @since 2.0 | |
| 3730 | + * @deprecated 2.05.06 | |
| 3731 | + * @codeCoverageIgnore | |
| 3732 | + * | |
| 3733 | + * @param string $group The name of the cache group | |
| 3734 | + */ | |
| 3735 | + public static function cache_delete_group( $group ) { | |
| 3736 | + FrmDeprecated::cache_delete_group( $group ); | |
| 3890 | 3737 | } |
| 3891 | 3738 | |
| 3892 | 3739 | /** |
| 3893 | - * Dismiss a warning message and update the dismissal state. | |
| 3740 | + * @since 1.07.10 | |
| 3741 | + * @deprecated 2.05.06 | |
| 3742 | + * @codeCoverageIgnore | |
| 3894 | 3743 | * |
| 3895 | - * @since 6.3 | |
| 3744 | + * @param string $term The value to escape | |
| 3896 | 3745 | * |
| 3897 | - * @param string $option The unique identifier for the dismissal state of the message. | |
| 3898 | - * @return void | |
| 3746 | + * @return string The escaped value | |
| 3899 | 3747 | */ |
| 3900 | - public static function dismiss_warning_message( $option = '' ) { | |
| 3901 | - self::permission_check( 'frm_change_settings' ); | |
| 3902 | - check_ajax_referer( 'frm_ajax', 'nonce' ); | |
| 3748 | + public static function esc_like( $term ) { | |
| 3749 | + return FrmDeprecated::esc_like( $term ); | |
| 3750 | + } | |
| 3903 | 3751 | |
| 3904 | - if ( $option ) { | |
| 3905 | - update_option( $option, true, 'no' ); | |
| 3906 | - } | |
| 3752 | + /** | |
| 3753 | + * @param string $order_query | |
| 3754 | + * | |
| 3755 | + * @deprecated 2.05.06 | |
| 3756 | + * @codeCoverageIgnore | |
| 3757 | + */ | |
| 3758 | + public static function esc_order( $order_query ) { | |
| 3759 | + return FrmDeprecated::esc_order( $order_query ); | |
| 3760 | + } | |
| 3907 | 3761 | |
| 3908 | - wp_send_json_success(); | |
| 3762 | + /** | |
| 3763 | + * @deprecated 2.05.06 | |
| 3764 | + * @codeCoverageIgnore | |
| 3765 | + */ | |
| 3766 | + public static function esc_order_by( &$order_by ) { | |
| 3767 | + FrmDeprecated::esc_order_by( $order_by ); | |
| 3768 | + } | |
| 3769 | + | |
| 3770 | + /** | |
| 3771 | + * @param string $limit | |
| 3772 | + * | |
| 3773 | + * @deprecated 2.05.06 | |
| 3774 | + * @codeCoverageIgnore | |
| 3775 | + */ | |
| 3776 | + public static function esc_limit( $limit ) { | |
| 3777 | + return FrmDeprecated::esc_limit( $limit ); | |
| 3778 | + } | |
| 3779 | + | |
| 3780 | + /** | |
| 3781 | + * @since 2.0 | |
| 3782 | + * @deprecated 2.05.06 | |
| 3783 | + * @codeCoverageIgnore | |
| 3784 | + */ | |
| 3785 | + public static function prepare_array_values( $array, $type = '%s' ) { | |
| 3786 | + return FrmDeprecated::prepare_array_values( $array, $type ); | |
| 3787 | + } | |
| 3788 | + | |
| 3789 | + /** | |
| 3790 | + * @deprecated 2.05.06 | |
| 3791 | + * @codeCoverageIgnore | |
| 3792 | + */ | |
| 3793 | + public static function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ) { | |
| 3794 | + return FrmDeprecated::prepend_and_or_where( $starts_with, $where ); | |
| 3795 | + } | |
| 3796 | + | |
| 3797 | + /** | |
| 3798 | + * @since 2.0 | |
| 3799 | + * @deprecated 5.0.13 | |
| 3800 | + * | |
| 3801 | + * @return string The base Google APIS url for the current version of jQuery UI | |
| 3802 | + */ | |
| 3803 | + public static function jquery_ui_base_url() { | |
| 3804 | + _deprecated_function( __FUNCTION__, '5.0.13', 'FrmProAppHelper::jquery_ui_base_url' ); | |
| 3805 | + return is_callable( 'FrmProAppHelper::jquery_ui_base_url' ) ? FrmProAppHelper::jquery_ui_base_url() : ''; | |
| 3806 | + } | |
| 3807 | + | |
| 3808 | + /** | |
| 3809 | + * @since 4.07 | |
| 3810 | + * @deprecated x.x | |
| 3811 | + */ | |
| 3812 | + public static function renewal_message() { | |
| 3813 | + _deprecated_function( __METHOD__, 'x.x', 'FrmProAddonsController::renewal_message' ); | |
| 3909 | 3814 | } |
| 3910 | 3815 | } |