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 +254 -497 6.5.3 → 5.4.3 View file →
@@ -14,19 +14,12 @@
14 14 private static $added_gmt_offset_filter = false;
15 15
16 16 /**
17 17 * @since 2.0
18 - *
19 - * @var string
20 18 */
21 - public static $plug_version = '6.5.3';
19 + public static $plug_version = '5.4.3';
22 20
23 21 /**
24 - * @var bool
25 - */
26 - private static $included_svg = false;
27 -
28 - /**
29 22 * @since 1.07.02
30 23 *
31 24 * @param none
32 25 *
@@ -155,28 +148,12 @@
155 148
156 149 public static function get_menu_name() {
157 150 $frm_settings = self::get_settings();
158 151
159 - return FrmAddonsController::is_license_expired() ? 'Formidable' : $frm_settings->menu;
152 + return $frm_settings->menu;
160 153 }
161 154
162 155 /**
163 - * Determine if the current branding is set to 'formidable'.
164 - *
165 - * Checks the menu title, retrieved through get_menu_name,
166 - * and verifies if it matches the 'formidable' branding.
167 - *
168 - * @since 6.4.2
169 - *
170 - * @return bool True if the menu title is 'formidable', false otherwise.
171 - */
172 - public static function is_formidable_branding() {
173 - $menu_title = self::get_menu_name();
174 -
175 - return 'formidable' === strtolower( trim( $menu_title ) );
176 - }
177 -
178 - /**
179 156 * @since 3.05
180 157 */
181 158 public static function svg_logo( $atts = array() ) {
182 159 $defaults = array(
@@ -275,15 +252,15 @@
275 252 global $pagenow;
276 253 $get_page = self::simple_get( 'page', 'sanitize_title' );
277 254 if ( $pagenow ) {
278 255 // allow this to be true during ajax load i.e. ajax form builder loading
279 - $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;
280 257 if ( $is_page ) {
281 258 return true;
282 259 }
283 260 }
284 261
285 - return is_admin() && $get_page === $page;
262 + return is_admin() && $get_page == $page;
286 263 }
287 264
288 265 /**
289 266 * If the current page is for editing or creating a view.
@@ -355,18 +332,14 @@
355 332 * Check if on an admin page
356 333 *
357 334 * @since 2.0
358 335 *
336 + * @param None
337 + *
359 338 * @return boolean
360 339 */
361 340 public static function is_admin() {
362 - $is_admin = is_admin() && ! wp_doing_ajax();
363 -
364 - /**
365 - * @since 6.0
366 - * @param bool $is_admin
367 - */
368 - return apply_filters( 'frm_is_admin', $is_admin );
341 + return is_admin() && ! wp_doing_ajax();
369 342 }
370 343
371 344 /**
372 345 * Check if value contains blank value or empty array
@@ -399,37 +372,26 @@
399 372 return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
400 373 }
401 374
402 375 /**
403 - * Get the server OS
376 + * Check for the IP address in several places
377 + * Used by [ip] shortcode
404 378 *
405 - * @since 6.4.2
406 - *
407 - * @return string
408 - */
409 - public static function get_server_os() {
410 - if ( function_exists( 'php_uname' ) ) {
411 - return php_uname( 's' );
412 - }
413 -
414 - if ( ! defined( 'PHP_OS' ) ) {
415 - return '';
416 - }
417 -
418 - // match the same response for Windows server as php_uname('s')
419 - return in_array( PHP_OS, array( 'WIN32', 'WINNT', 'Windows_NT' ), true ) ? 'Windows NT' : PHP_OS;
420 - }
421 -
422 - /**
423 - * Check for the IP address in several places (when custom headers are enabled).
424 - * Used by [ip] shortcode.
425 - *
426 379 * @return string The IP address of the current user
427 380 */
428 381 public static function get_ip_address() {
429 - $ip_options = self::should_use_custom_header_ip() ? self::get_custom_header_keys_for_ip() : array( 'REMOTE_ADDR' );
430 - $ip = '';
431 -
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 = '';
432 394 foreach ( $ip_options as $key ) {
433 395 if ( ! isset( $_SERVER[ $key ] ) ) {
434 396 continue;
435 397 }
@@ -435,9 +397,9 @@
435 397 }
436 398
437 399 $key = self::get_server_value( $key );
438 400 foreach ( explode( ',', $key ) as $ip ) {
439 - $ip = trim( $ip ); // Just to be safe.
401 + $ip = trim( $ip ); // just to be safe.
440 402
441 403 if ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) !== false ) {
442 404 return sanitize_text_field( $ip );
443 405 }
@@ -446,52 +408,8 @@
446 408
447 409 return sanitize_text_field( $ip );
448 410 }
449 411
450 - /**
451 - * @since 6.1
452 - *
453 - * @return array
454 - */
455 - public static function get_custom_header_keys_for_ip() {
456 - return array(
457 - 'HTTP_CLIENT_IP',
458 - 'HTTP_CF_CONNECTING_IP',
459 - 'HTTP_X_FORWARDED_FOR',
460 - 'HTTP_X_FORWARDED',
461 - 'HTTP_X_CLUSTER_CLIENT_IP',
462 - 'HTTP_X_REAL_IP',
463 - 'HTTP_FORWARDED_FOR',
464 - 'HTTP_FORWARDED',
465 - 'REMOTE_ADDR',
466 - );
467 - }
468 -
469 - /**
470 - * Check if we should check every HTTP header or just $_SERVER['REMOTE_ADDR'].
471 - * The other HTTP headers can be spoofed so this isn't recommended.
472 - * But in some cases (like reverse proxies), the IP may be empty if you use $_SERVER['REMOTE_ADDR'].
473 - *
474 - * @since 6.1
475 - *
476 - * @return bool
477 - */
478 - private static function should_use_custom_header_ip() {
479 - $settings = self::get_settings();
480 - $should_use_custom_header_ip = ! $settings->no_ips && $settings->custom_header_ip;
481 -
482 - /**
483 - * Filter whether to check spoofable HTTP headers.
484 - * This uses the custom_header_ip setting, but it is hidden if the GDPR option is also on.
485 - * 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.
486 - *
487 - * @since 6.1
488 - *
489 - * @param bool $should_use_custom_header_ip
490 - */
491 - return apply_filters( 'frm_use_custom_header_ip', $should_use_custom_header_ip );
492 - }
493 -
494 412 public static function get_param( $param, $default = '', $src = 'get', $sanitize = '' ) {
495 413 if ( strpos( $param, '[' ) ) {
496 414 $params = explode( '[', $param );
497 415 $param = $params[0];
@@ -580,14 +498,14 @@
580 498 );
581 499 $args = wp_parse_args( $args, $defaults );
582 500
583 501 $value = $args['default'];
584 - if ( $args['type'] === 'get' ) {
502 + if ( $args['type'] == 'get' ) {
585 503 if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
586 504 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
587 505 $value = wp_unslash( $_GET[ $args['param'] ] );
588 506 }
589 - } elseif ( $args['type'] === 'post' ) {
507 + } elseif ( $args['type'] == 'post' ) {
590 508 if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
591 509 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
592 510 $value = wp_unslash( $_POST[ $args['param'] ] );
593 511 if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
@@ -1008,18 +926,8 @@
1008 926
1009 927 $html_atts = self::array_to_html_params( $atts );
1010 928
1011 929 $icon = trim( str_replace( array( 'frm_icon_font', 'frmfont ' ), '', $class ) );
1012 -
1013 - // Replace icons that have been removed.
1014 - $deprecated = array(
1015 - 'frm_clone_solid_icon' => 'frm_clone_icon',
1016 - );
1017 - if ( isset( $deprecated[ $icon ] ) ) {
1018 - $icon = $deprecated[ $icon ];
1019 - $class = str_replace( $icon, $deprecated[ $icon ], $class );
1020 - }
1021 -
1022 930 if ( $icon === $class ) {
1023 931 $icon = '<i class="' . esc_attr( $class ) . '"' . $html_atts . '></i>';
1024 932 } else {
1025 933 $class = strpos( $icon, ' ' ) === false ? '' : ' ' . $icon;
@@ -1076,9 +984,9 @@
1076 984 * @param array $allowed_attr
1077 985 * @return array
1078 986 */
1079 987 public static function allow_vars_in_styles( $allowed_attr ) {
1080 - $allowed_attr[] = '--primary-700';
988 + $allowed_attr[] = '--primary-hover';
1081 989 return $allowed_attr;
1082 990 }
1083 991
1084 992 /**
@@ -1087,9 +995,9 @@
1087 995 * @param bool $allow_css
1088 996 * @param string $css_string
1089 997 */
1090 998 public static function allow_style( $allow_css, $css_string ) {
1091 - if ( ! $allow_css && 0 === strpos( $css_string, '--primary-700:' ) ) {
999 + if ( ! $allow_css && 0 === strpos( $css_string, '--primary-hover:' ) ) {
1092 1000 $split = explode( ':', $css_string, 2 );
1093 1001 $allow_css = 2 === count( $split ) && self::is_a_valid_color( $split[1] );
1094 1002 }
1095 1003 return $allow_css;
@@ -1116,18 +1024,11 @@
1116 1024 /**
1117 1025 * Include svg images.
1118 1026 *
1119 1027 * @since 4.0.02
1120 - * @return void
1121 1028 */
1122 1029 public static function include_svg() {
1123 - if ( self::$included_svg ) {
1124 - return;
1125 - }
1126 -
1127 - // Use readfile instead of include_once because of a default security rule in Snuffleupagus.
1128 - readfile( self::plugin_path() . '/images/icons.svg' );
1129 - self::$included_svg = true;
1030 + include_once self::plugin_path() . '/images/icons.svg';
1130 1031 }
1131 1032
1132 1033 /**
1133 1034 * Convert an associative array to HTML values.
@@ -1163,11 +1064,9 @@
1163 1064 if ( ! $echo ) {
1164 1065 ob_start();
1165 1066 }
1166 1067
1167 - if ( is_callable( $echo_function ) ) {
1168 - $echo_function();
1169 - }
1068 + $echo_function();
1170 1069
1171 1070 if ( ! $echo ) {
1172 1071 $return = ob_get_contents();
1173 1072 ob_end_clean();
@@ -1190,22 +1089,8 @@
1190 1089 include( self::plugin_path() . '/classes/views/shared/admin-header.php' );
1191 1090 }
1192 1091
1193 1092 /**
1194 - * @since 6.0
1195 - *
1196 - * @param string $type
1197 - * @return void
1198 - */
1199 - public static function import_link( $type = 'secondary' ) {
1200 - ?>
1201 - <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">
1202 - <?php esc_html_e( 'Import', 'formidable' ); ?>
1203 - </a>
1204 - <?php
1205 - }
1206 -
1207 - /**
1208 1093 * Print applicable admin banner.
1209 1094 *
1210 1095 * @since 5.4.2
1211 1096 *
@@ -1263,9 +1148,9 @@
1263 1148 return;
1264 1149 }
1265 1150
1266 1151 $href = ! empty( $atts['new_link'] ) ? esc_url( $atts['new_link'] ) : '#';
1267 - $class = 'button button-primary frm-button-primary';
1152 + $class = 'button button-primary frm-button-primary frm-with-plus';
1268 1153
1269 1154 if ( ! empty( $atts['trigger_new_form_modal'] ) ) {
1270 1155 $class .= ' frm-trigger-new-form-modal';
1271 1156 }
@@ -1335,14 +1220,11 @@
1335 1220 }
1336 1221 }
1337 1222
1338 1223 /**
1339 - * Save all front-end js scripts into a single file.
1340 - * And save an additional single file of all front-end Stripe JS scripts.
1224 + * Save all front-end js scripts into a single file
1341 1225 *
1342 1226 * @since 3.0
1343 - *
1344 - * @return void
1345 1227 */
1346 1228 public static function save_combined_js() {
1347 1229 $file_atts = apply_filters(
1348 1230 'frm_js_location',
@@ -1355,34 +1237,10 @@
1355 1237
1356 1238 $files = array(
1357 1239 self::plugin_path() . '/js/formidable.min.js',
1358 1240 );
1359 - /**
1360 - * @param array $files
1361 - */
1362 1241 $files = apply_filters( 'frm_combined_js_files', $files );
1363 1242 $new_file->combine_files( $files );
1364 -
1365 - // Create the minified Stripe Script.
1366 - $file_atts = apply_filters(
1367 - 'frm_stripe_js_location',
1368 - array(
1369 - 'file_name' => 'frmstrp.min.js',
1370 - 'new_file_path' => self::plugin_path() . '/js',
1371 - )
1372 - );
1373 - $new_file = new FrmCreateFile( $file_atts );
1374 - $files = array(
1375 - FrmStrpLiteAppHelper::plugin_path() . 'js/frmstrp.min.js',
1376 - );
1377 -
1378 - /**
1379 - * @since 6.5
1380 - *
1381 - * @param array $files
1382 - */
1383 - $files = apply_filters( 'frm_stripe_combined_js_files', $files );
1384 - $new_file->combine_files( $files );
1385 1243 }
1386 1244
1387 1245 /**
1388 1246 * Check a value from a shortcode to see if true or false.
@@ -1543,8 +1401,9 @@
1543 1401 public static function post_edit_link( $post_id ) {
1544 1402 $post = get_post( $post_id );
1545 1403 if ( $post ) {
1546 1404 $post_url = admin_url( 'post.php?post=' . $post_id . '&action=edit' );
1405 + $post_url = self::maybe_full_screen_link( $post_url );
1547 1406
1548 1407 return '<a href="' . esc_url( $post_url ) . '">' . self::truncate( $post->post_title, 50 ) . '</a>';
1549 1408 }
1550 1409
@@ -1559,59 +1418,22 @@
1559 1418 * @return bool
1560 1419 */
1561 1420 public static function is_full_screen() {
1562 1421 return self::is_form_builder_page() ||
1563 - self::is_style_editor_page() ||
1564 - 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();
1565 1426 }
1566 1427
1567 1428 /**
1568 - * Check if user is on the style editor or its alternative URL.
1569 - * The first URL is a submenu "Styles" in the Formidable menu /wp-admin/admin.php?page=formidable-styles.
1570 - * The alternative URL is linked as a submenu "Forms" item of the Appearance menu /wp-admin/themes.php?page=formidable-styles2.
1571 - *
1572 - * @since 5.5.3
1573 - * @since 6.0 Added the $view parameter. Previously there was only a 'edit' view.
1574 - *
1575 - * @param string $view Supports 'edit', 'list', and ''. If '', both 'edit' and 'list' will match.
1576 - * @return bool
1577 - */
1578 - public static function is_style_editor_page( $view = '' ) {
1579 - if ( ! self::is_admin_page( 'formidable-styles' ) && ! self::is_admin_page( 'formidable-styles2' ) ) {
1580 - return false;
1581 - }
1582 -
1583 - if ( ! in_array( $view, array( 'list', 'edit' ), true ) ) {
1584 - return true;
1585 - }
1586 -
1587 - $action = self::simple_get( 'frm_action' );
1588 - $is_edit_mode = 'edit' === $action || ( ! $action && ! self::simple_get( 'id' ) && ! self::simple_get( 'form' ) );
1589 -
1590 - if ( ! $is_edit_mode && class_exists( 'FrmProStylesController' ) && in_array( $action, array( 'new_style', 'duplicate' ), true ) ) {
1591 - $is_edit_mode = true;
1592 - }
1593 -
1594 - $checking_for_edit_mode = 'edit' === $view;
1595 -
1596 - return $is_edit_mode === $checking_for_edit_mode;
1597 - }
1598 -
1599 - /**
1600 - * @since 5.5.3
1601 - *
1602 - * @return bool
1603 - */
1604 - private static function is_full_screen_view_builder_page() {
1605 - return self::is_admin_page( 'formidable-views-editor' );
1606 - }
1607 -
1608 - /**
1609 1429 * @since 4.0
1610 - * @deprecated 5.5.3
1611 1430 */
1612 1431 public static function maybe_full_screen_link( $link ) {
1613 - _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 + }
1614 1436 return $link;
1615 1437 }
1616 1438
1617 1439 /**
@@ -1915,9 +1737,9 @@
1915 1737 foreach ( $array as $key => $value ) {
1916 1738 if ( is_array( $value ) ) {
1917 1739 $return = array_merge( $return, self::array_flatten( $value, $keys ) );
1918 1740 } else {
1919 - if ( $keys === 'keep' ) {
1741 + if ( $keys == 'keep' ) {
1920 1742 $return[ $key ] = $value;
1921 1743 } else {
1922 1744 $return[] = $value;
1923 1745 }
@@ -2001,9 +1823,9 @@
2001 1823 return $user_id;
2002 1824 }
2003 1825
2004 1826 $user_id = sanitize_text_field( $user_id );
2005 - if ( $user_id === 'current' ) {
1827 + if ( $user_id == 'current' ) {
2006 1828 $user_id = get_current_user_id();
2007 1829 } else {
2008 1830 if ( is_email( $user_id ) ) {
2009 1831 $user = get_user_by( 'email', $user_id );
@@ -2471,9 +2293,9 @@
2471 2293 *
2472 2294 * @return string $time_ago
2473 2295 */
2474 2296 public static function human_time_diff( $from, $to = '', $levels = 1 ) {
2475 - if ( empty( $to ) && 0 !== $to ) {
2297 + if ( empty( $to ) ) {
2476 2298 $now = new DateTime();
2477 2299 } else {
2478 2300 $now = new DateTime( '@' . $to );
2479 2301 }
@@ -2724,9 +2546,8 @@
2724 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' ),
2725 2547 'from' => __( 'Enter the name and/or email address of the sender. FORMAT: John Bates <[email protected]> or [email protected].', 'formidable' ),
2726 2548 /* translators: %1$s: Form name, %2$s: Date */
2727 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() ) ),
2728 - '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' ),
2729 2550 );
2730 2551
2731 2552 if ( ! isset( $tooltips[ $name ] ) ) {
2732 2553 return;
@@ -2815,15 +2636,12 @@
2815 2636 }
2816 2637 }
2817 2638
2818 2639 /**
2819 - * 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
2820 2641 * all data to json.
2821 2642 *
2822 2643 * @since 4.02.03
2823 - *
2824 - * @param array|string $value
2825 - * @return void
2826 2644 */
2827 2645 public static function unserialize_or_decode( &$value ) {
2828 2646 if ( is_array( $value ) ) {
2829 2647 return;
@@ -2829,9 +2647,9 @@
2829 2647 return;
2830 2648 }
2831 2649
2832 2650 if ( is_serialized( $value ) ) {
2833 - $value = self::maybe_unserialize_array( $value );
2651 + $value = maybe_unserialize( $value );
2834 2652 } else {
2835 2653 $value = self::maybe_json_decode( $value, false );
2836 2654 }
2837 2655 }
@@ -2836,35 +2654,8 @@
2836 2654 }
2837 2655 }
2838 2656
2839 2657 /**
2840 - * Safely unserialize an array if necessary.
2841 - * This function doesn't actually use unserialize. The string is parsed instead.
2842 - *
2843 - * @since 6.2
2844 - *
2845 - * @param mixed $value
2846 - * @return mixed
2847 - */
2848 - public static function maybe_unserialize_array( $value ) {
2849 - if ( ! is_string( $value ) ) {
2850 - return $value;
2851 - }
2852 -
2853 - // Since we only expect an array, skip anything that doesn't start with a:.
2854 - if ( ! is_serialized( $value ) || 'a:' !== substr( $value, 0, 2 ) ) {
2855 - return $value;
2856 - }
2857 -
2858 - $parsed = FrmSerializedStringParserHelper::get()->parse( $value );
2859 - if ( is_array( $parsed ) ) {
2860 - $value = $parsed;
2861 - }
2862 -
2863 - return $value;
2864 - }
2865 -
2866 - /**
2867 2658 * Decode a JSON string.
2868 2659 * Do not switch shortcodes like [24] to array unless intentional ie XML values.
2869 2660 *
2870 2661 * @param mixed $string
@@ -2891,36 +2682,8 @@
2891 2682 return $string;
2892 2683 }
2893 2684
2894 2685 /**
2895 - * @since 6.2.3
2896 - *
2897 - * @param string $value
2898 - * @return string
2899 - */
2900 - public static function maybe_utf8_encode( $value ) {
2901 - $from_format = 'ISO-8859-1';
2902 - $to_format = 'UTF-8';
2903 -
2904 - if ( function_exists( 'mb_check_encoding' ) && function_exists( 'mb_convert_encoding' ) ) {
2905 - if ( mb_check_encoding( $value, $from_format ) ) {
2906 - return mb_convert_encoding( $value, $to_format, $from_format );
2907 - }
2908 - return $value;
2909 - }
2910 -
2911 - if ( function_exists( 'iconv' ) ) {
2912 - $converted = iconv( $from_format, $to_format, $value );
2913 - // Value is false if $value is not ISO-8859-1.
2914 - if ( false !== $converted ) {
2915 - return $converted;
2916 - }
2917 - }
2918 -
2919 - return $value;
2920 - }
2921 -
2922 - /**
2923 2686 * Reformat the json serialized array in name => value array.
2924 2687 *
2925 2688 * @since 4.02.03
2926 2689 */
@@ -3016,10 +2779,13 @@
3016 2779 */
3017 2780 public static function localize_script( $location ) {
3018 2781 global $wp_scripts;
3019 2782
2783 + $ajax_url = admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' );
2784 + $ajax_url = apply_filters( 'frm_ajax_url', $ajax_url );
2785 +
3020 2786 $script_strings = array(
3021 - 'ajax_url' => esc_url_raw( self::get_ajax_url() ),
2787 + 'ajax_url' => $ajax_url,
3022 2788 'images_url' => self::plugin_url() . '/images',
3023 2789 'loading' => __( 'Loading&hellip;', 'formidable' ),
3024 2790 'remove' => __( 'Remove', 'formidable' ),
3025 2791 'offset' => apply_filters( 'frm_scroll_offset', 4 ),
@@ -3033,72 +2799,69 @@
3033 2799 'include_alert_role' => self::should_include_alert_role_on_field_errors(),
3034 2800 );
3035 2801
3036 2802 $data = $wp_scripts->get_data( 'formidable', 'data' );
3037 - if ( ! $data ) {
2803 + if ( empty( $data ) ) {
3038 2804 wp_localize_script( 'formidable', 'frm_js', $script_strings );
3039 2805 }
3040 2806
3041 - if ( $location === 'admin' ) {
2807 + if ( $location == 'admin' ) {
3042 2808 $frm_settings = self::get_settings();
3043 2809 $admin_script_strings = array(
3044 - 'desc' => __( '(Click to add description)', 'formidable' ),
3045 - 'blank' => __( '(Blank)', 'formidable' ),
3046 - 'no_label' => __( '(no label)', 'formidable' ),
3047 - 'ok' => __( 'OK', 'formidable' ),
3048 - 'cancel' => __( 'Cancel', 'formidable' ),
3049 - 'default_label' => __( 'Default', 'formidable' ),
3050 - 'clear_default' => __( 'Clear default value when typing', 'formidable' ),
3051 - 'no_clear_default' => __( 'Do not clear default value when typing', 'formidable' ),
3052 - 'valid_default' => __( 'Default value will pass form validation', 'formidable' ),
3053 - 'no_valid_default' => __( 'Default value will NOT pass form validation', 'formidable' ),
3054 - 'confirm' => __( 'Are you sure?', 'formidable' ),
3055 - 'conf_delete' => __( 'Are you sure you want to delete this field and all data associated with it?', 'formidable' ),
3056 - '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' ),
3057 - 'conf_no_repeat' => __( 'Warning: If you have entries with multiple rows, all but the first row will be lost.', 'formidable' ),
3058 - 'default_unique' => $frm_settings->unique_msg,
3059 - 'default_conf' => __( 'The entered values do not match', 'formidable' ),
3060 - 'enter_email' => __( 'Enter Email', 'formidable' ),
3061 - 'confirm_email' => __( 'Confirm Email', 'formidable' ),
3062 - 'conditional_text' => __( 'Conditional content here', 'formidable' ),
3063 - 'new_option' => __( 'New Option', 'formidable' ),
3064 - 'css_invalid_size' => __( 'In certain browsers (e.g. Firefox) text will not display correctly if the field height is too small relative to the field padding and text size. Please increase your field height or decrease your field padding.', 'formidable' ),
3065 - 'enter_password' => __( 'Enter Password', 'formidable' ),
3066 - 'confirm_password' => __( 'Confirm Password', 'formidable' ),
3067 - 'import_complete' => __( 'Import Complete', 'formidable' ),
3068 - 'updating' => __( 'Please wait while your site updates.', 'formidable' ),
3069 - 'no_save_warning' => __( 'Warning: There is no way to retrieve unsaved entries.', 'formidable' ),
3070 - 'private_label' => __( 'Private', 'formidable' ),
3071 - 'jquery_ui_url' => '',
3072 - 'pro_url' => is_callable( 'FrmProAppHelper::plugin_url' ) ? FrmProAppHelper::plugin_url() : '',
3073 - 'no_licenses' => __( 'No new licenses were found', 'formidable' ),
3074 - 'unmatched_parens' => __( 'This calculation has at least one unmatched ( ) { } [ ].', 'formidable' ),
3075 - 'view_shortcodes' => __( 'This calculation may have shortcodes that work in Views but not forms.', 'formidable' ),
3076 - 'text_shortcodes' => __( 'This calculation may have shortcodes that work in text calculations but not numeric calculations.', 'formidable' ),
3077 - 'only_one_action' => __( 'This form action is limited to one per form. Please edit the existing form action.', 'formidable' ),
3078 - 'unsafe_params' => FrmFormsHelper::reserved_words(),
2810 + 'desc' => __( '(Click to add description)', 'formidable' ),
2811 + 'blank' => __( '(Blank)', 'formidable' ),
2812 + 'no_label' => __( '(no label)', 'formidable' ),
2813 + 'saving' => esc_attr( __( 'Saving', 'formidable' ) ),
2814 + 'saved' => esc_attr( __( 'Saved', 'formidable' ) ),
2815 + 'ok' => __( 'OK', 'formidable' ),
2816 + 'cancel' => __( 'Cancel', 'formidable' ),
2817 + 'default_label' => __( 'Default', 'formidable' ),
2818 + 'clear_default' => __( 'Clear default value when typing', 'formidable' ),
2819 + 'no_clear_default' => __( 'Do not clear default value when typing', 'formidable' ),
2820 + 'valid_default' => __( 'Default value will pass form validation', 'formidable' ),
2821 + 'no_valid_default' => __( 'Default value will NOT pass form validation', 'formidable' ),
2822 + 'caution' => __( 'Heads up', 'formidable' ),
2823 + 'confirm' => __( 'Are you sure?', 'formidable' ),
2824 + 'conf_delete' => __( 'Are you sure you want to delete this field and all data associated with it?', 'formidable' ),
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' ),
2826 + 'conf_no_repeat' => __( 'Warning: If you have entries with multiple rows, all but the first row will be lost.', 'formidable' ),
2827 + 'default_unique' => $frm_settings->unique_msg,
2828 + 'default_conf' => __( 'The entered values do not match', 'formidable' ),
2829 + 'enter_email' => __( 'Enter Email', 'formidable' ),
2830 + 'confirm_email' => __( 'Confirm Email', 'formidable' ),
2831 + 'conditional_text' => __( 'Conditional content here', 'formidable' ),
2832 + 'new_option' => __( 'New Option', 'formidable' ),
2833 + 'css_invalid_size' => __( 'In certain browsers (e.g. Firefox) text will not display correctly if the field height is too small relative to the field padding and text size. Please increase your field height or decrease your field padding.', 'formidable' ),
2834 + 'enter_password' => __( 'Enter Password', 'formidable' ),
2835 + 'confirm_password' => __( 'Confirm Password', 'formidable' ),
2836 + 'import_complete' => __( 'Import Complete', 'formidable' ),
2837 + 'updating' => __( 'Please wait while your site updates.', 'formidable' ),
2838 + 'no_save_warning' => __( 'Warning: There is no way to retrieve unsaved entries.', 'formidable' ),
2839 + 'private_label' => __( 'Private', 'formidable' ),
2840 + 'jquery_ui_url' => '',
2841 + 'pro_url' => is_callable( 'FrmProAppHelper::plugin_url' ) ? FrmProAppHelper::plugin_url() : '',
2842 + 'no_licenses' => __( 'No new licenses were found', 'formidable' ),
2843 + 'unmatched_parens' => __( 'This calculation has at least one unmatched ( ) { } [ ].', 'formidable' ),
2844 + 'view_shortcodes' => __( 'This calculation may have shortcodes that work in Views but not forms.', 'formidable' ),
2845 + 'text_shortcodes' => __( 'This calculation may have shortcodes that work in text calculations but not numeric calculations.', 'formidable' ),
2846 + 'only_one_action' => __( 'This form action is limited to one per form. Please edit the existing form action.', 'formidable' ),
2847 + 'unsafe_params' => FrmFormsHelper::reserved_words(),
3079 2848 /* Translators: %s is the name of a Detail Page Slug that is a reserved word.*/
3080 - 'slug_is_reserved' => sprintf( __( 'The Detail Page Slug "%s" is reserved by WordPress. This may cause problems. Is this intentional?', 'formidable' ), '****' ),
2849 + 'slug_is_reserved' => sprintf( __( 'The Detail Page Slug "%s" is reserved by WordPress. This may cause problems. Is this intentional?', 'formidable' ), '****' ),
3081 2850 /* Translators: %s is the name of a parameter that is a reserved word. More than one word could be listed here, though that would not be common. */
3082 - 'param_is_reserved' => sprintf( __( 'The parameter "%s" is reserved by WordPress. This may cause problems when included in the URL. Is this intentional? ', 'formidable' ), '****' ),
3083 - 'reserved_words' => __( 'See the list of reserved words in WordPress.', 'formidable' ),
3084 - 'repeat_limit_min' => __( 'Please enter a Repeat Limit that is greater than 1.', 'formidable' ),
3085 - 'checkbox_limit' => __( 'Please select a limit between 0 and 200.', 'formidable' ),
3086 - 'install' => __( 'Install', 'formidable' ),
3087 - 'active' => __( 'Active', 'formidable' ),
3088 - 'select_a_field' => __( 'Select a Field', 'formidable' ),
3089 - 'no_items_found' => __( 'No items found.', 'formidable' ),
3090 - 'field_already_used' => __( 'Oops. You have already used that field.', 'formidable' ),
3091 - 'saving' => '', // Deprecated in 6.0.
3092 - 'saved' => '', // Deprecated in 6.0.
2851 + 'param_is_reserved' => sprintf( __( 'The parameter "%s" is reserved by WordPress. This may cause problems when included in the URL. Is this intentional? ', 'formidable' ), '****' ),
2852 + 'reserved_words' => __( 'See the list of reserved words in WordPress.', 'formidable' ),
2853 + 'repeat_limit_min' => __( 'Please enter a Repeat Limit that is greater than 1.', 'formidable' ),
2854 + 'checkbox_limit' => __( 'Please select a limit between 0 and 200.', 'formidable' ),
2855 + 'install' => __( 'Install', 'formidable' ),
2856 + 'active' => __( 'Active', 'formidable' ),
2857 + 'select_a_field' => __( 'Select a Field', 'formidable' ),
2858 + 'no_items_found' => __( 'No items found.', 'formidable' ),
3093 2859 );
3094 - /**
3095 - * @param array $admin_script_strings
3096 - */
3097 2860 $admin_script_strings = apply_filters( 'frm_admin_script_strings', $admin_script_strings );
3098 2861
3099 2862 $data = $wp_scripts->get_data( 'formidable_admin', 'data' );
3100 - if ( ! $data ) {
2863 + if ( empty( $data ) ) {
3101 2864 wp_localize_script( 'formidable_admin', 'frm_admin_js', $admin_script_strings );
3102 2865 }
3103 2866 }
3104 2867 }
@@ -3103,24 +2866,8 @@
3103 2866 }
3104 2867 }
3105 2868
3106 2869 /**
3107 - * @since 6.5
3108 - *
3109 - * @return string
3110 - */
3111 - public static function get_ajax_url() {
3112 - $ajax_url = admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' );
3113 -
3114 - /**
3115 - * @since 2.0.13
3116 - *
3117 - * @param string $ajax_url
3118 - */
3119 - return apply_filters( 'frm_ajax_url', $ajax_url );
3120 - }
3121 -
3122 - /**
3123 2870 * Returns whether or not the first errored input should be auto-focused (default true).
3124 2871 *
3125 2872 * @since 5.2.05
3126 2873 *
@@ -3184,9 +2931,9 @@
3184 2931
3185 2932 $pro_version = FrmProDb::$plug_version;
3186 2933 $expired = FrmAddonsController::is_license_expired();
3187 2934 ?>
3188 - <div class="frm-banner-alert frm_error_style frm_previous_install">
2935 + <div class="error frm_previous_install">
3189 2936 <?php
3190 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' );
3191 2938 if ( empty( $expired ) ) {
3192 2939 echo ' Please <a href="' . esc_url( admin_url( 'plugins.php?s=formidable%20forms%20pro' ) ) . '">update now</a>.';
@@ -3225,9 +2972,9 @@
3225 2972 }
3226 2973
3227 2974 foreach ( $message as $m ) {
3228 2975 ?>
3229 - <div class="frm-banner-alert frm_error_style frm_previous_install">
2976 + <div class="error frm_previous_install">
3230 2977 <?php echo esc_html( $m ); ?>
3231 2978 </div>
3232 2979 <?php
3233 2980 }
@@ -3232,25 +2979,17 @@
3232 2979 <?php
3233 2980 }
3234 2981 }
3235 2982
3236 - /**
3237 - * @param string $type
3238 - * @return array<string,string>
3239 - */
3240 2983 public static function locales( $type = 'date' ) {
3241 2984 $locales = array(
3242 2985 'en' => __( 'English', 'formidable' ),
3243 2986 'af' => __( 'Afrikaans', 'formidable' ),
3244 2987 'sq' => __( 'Albanian', 'formidable' ),
3245 - 'ar-DZ' => __( 'Algerian Arabic', 'formidable' ),
3246 - 'am' => __( 'Amharic', 'formidable' ),
3247 2988 'ar' => __( 'Arabic', 'formidable' ),
3248 2989 'hy' => __( 'Armenian', 'formidable' ),
3249 2990 'az' => __( 'Azerbaijani', 'formidable' ),
3250 2991 'eu' => __( 'Basque', 'formidable' ),
3251 - 'be' => __( 'Belarusian', 'formidable' ),
3252 - 'bn' => __( 'Bengali', 'formidable' ),
3253 2992 'bs' => __( 'Bosnian', 'formidable' ),
3254 2993 'bg' => __( 'Bulgarian', 'formidable' ),
3255 2994 'ca' => __( 'Catalan', 'formidable' ),
3256 2995 'zh-HK' => __( 'Chinese Hong Kong', 'formidable' ),
@@ -3269,15 +3008,12 @@
3269 3008 'fi' => __( 'Finnish', 'formidable' ),
3270 3009 'fr' => __( 'French', 'formidable' ),
3271 3010 'fr-CA' => __( 'French/Canadian', 'formidable' ),
3272 3011 'fr-CH' => __( 'French/Swiss', 'formidable' ),
3273 - 'gl' => __( 'Galician', 'formidable' ),
3274 - 'ka' => __( 'Georgian', 'formidable' ),
3275 3012 'de' => __( 'German', 'formidable' ),
3276 3013 'de-AT' => __( 'German/Austria', 'formidable' ),
3277 3014 'de-CH' => __( 'German/Switzerland', 'formidable' ),
3278 3015 'el' => __( 'Greek', 'formidable' ),
3279 - 'gu' => __( 'Gujarati', 'formidable' ),
3280 3016 'he' => __( 'Hebrew', 'formidable' ),
3281 3017 'iw' => __( 'Hebrew', 'formidable' ),
3282 3018 'hi' => __( 'Hindi', 'formidable' ),
3283 3019 'hu' => __( 'Hungarian', 'formidable' ),
@@ -3284,74 +3020,44 @@
3284 3020 'is' => __( 'Icelandic', 'formidable' ),
3285 3021 'id' => __( 'Indonesian', 'formidable' ),
3286 3022 'it' => __( 'Italian', 'formidable' ),
3287 3023 'ja' => __( 'Japanese', 'formidable' ),
3288 - 'kn' => __( 'Kannada', 'formidable' ),
3289 - 'kk' => __( 'Kazakh', 'formidable' ),
3290 - 'km' => __( 'Khmer', 'formidable' ),
3291 3024 'ko' => __( 'Korean', 'formidable' ),
3292 - 'ky' => __( 'Kyrgyz', 'formidable' ),
3293 - 'lo' => __( 'Laothian', 'formidable' ),
3294 3025 'lv' => __( 'Latvian', 'formidable' ),
3295 3026 'lt' => __( 'Lithuanian', 'formidable' ),
3296 - 'lb' => __( 'Luxembourgish', 'formidable' ),
3297 - 'mk' => __( 'Macedonian', 'formidable' ),
3298 - 'ml' => __( 'Malayalam', 'formidable' ),
3299 3027 'ms' => __( 'Malaysian', 'formidable' ),
3300 - 'mr' => __( 'Marathi', 'formidable' ),
3301 3028 'no' => __( 'Norwegian', 'formidable' ),
3302 - 'nb' => __( 'Norwegian Bokmål', 'formidable' ),
3303 - 'nn' => __( 'Norwegian Nynorsk', 'formidable' ),
3304 3029 'pl' => __( 'Polish', 'formidable' ),
3305 3030 'pt' => __( 'Portuguese', 'formidable' ),
3306 3031 'pt-BR' => __( 'Portuguese/Brazilian', 'formidable' ),
3307 3032 'pt-PT' => __( 'Portuguese/Portugal', 'formidable' ),
3308 - 'rm' => __( 'Romansh', 'formidable' ),
3309 3033 'ro' => __( 'Romanian', 'formidable' ),
3310 3034 'ru' => __( 'Russian', 'formidable' ),
3311 3035 'sr' => __( 'Serbian', 'formidable' ),
3312 3036 'sr-SR' => __( 'Serbian', 'formidable' ),
3313 - 'si' => __( 'Sinhalese', 'formidable' ),
3314 3037 'sk' => __( 'Slovak', 'formidable' ),
3315 3038 'sl' => __( 'Slovenian', 'formidable' ),
3316 3039 'es' => __( 'Spanish', 'formidable' ),
3317 3040 'es-419' => __( 'Spanish/Latin America', 'formidable' ),
3318 - 'sw' => __( 'Swahili', 'formidable' ),
3319 3041 'sv' => __( 'Swedish', 'formidable' ),
3320 3042 'ta' => __( 'Tamil', 'formidable' ),
3321 - 'te' => __( 'Telugu', 'formidable' ),
3322 3043 'th' => __( 'Thai', 'formidable' ),
3323 - 'tj' => __( 'Tajiki', 'formidable' ),
3324 3044 'tr' => __( 'Turkish', 'formidable' ),
3325 3045 'uk' => __( 'Ukrainian', 'formidable' ),
3326 - 'ur' => __( 'Urdu', 'formidable' ),
3327 3046 'vi' => __( 'Vietnamese', 'formidable' ),
3328 - 'cy-GB' => __( 'Welsh', 'formidable' ),
3329 - 'zu' => __( 'Zulu', 'formidable' ),
3330 3047 );
3331 3048
3332 3049 if ( $type === 'captcha' ) {
3333 3050 // remove the languages unavailable for the captcha
3334 - $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' );
3335 3052 } else {
3336 3053 // remove the languages unavailable for the datepicker
3337 - $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' );
3338 3055 }
3339 3056
3340 3057 $locales = array_diff_key( $locales, array_flip( $unset ) );
3058 + $locales = apply_filters( 'frm_locales', $locales );
3341 3059
3342 - /**
3343 - * Filter available locale options.
3344 - *
3345 - * @since 5.4.5 Added $args parameter with type.
3346 - *
3347 - * @param array<string,string> $locales
3348 - * @param array $args {
3349 - * @type string $type
3350 - * }
3351 - */
3352 - $locales = apply_filters( 'frm_locales', $locales, compact( 'type' ) );
3353 -
3354 3060 return $locales;
3355 3061 }
3356 3062
3357 3063 /**
@@ -3834,54 +3540,8 @@
3834 3540 return array( 'list', 'trash', 'untrash', 'destroy' );
3835 3541 }
3836 3542
3837 3543 /**
3838 - * Safely call get_plugins, importing the required files if they are not yet loaded.
3839 - *
3840 - * @since 5.5
3841 - *
3842 - * @return array
3843 - */
3844 - public static function get_plugins() {
3845 - if ( ! function_exists( 'get_plugins' ) ) {
3846 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
3847 - }
3848 - return get_plugins();
3849 - }
3850 -
3851 - /**
3852 - * 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.
3853 - * This is to make sure that the URL can't be exploited for a SSRF attack.
3854 - *
3855 - * @since 5.5.5
3856 - *
3857 - * @param string $url
3858 - * @param string $expected_extension
3859 - * @return bool
3860 - */
3861 - public static function validate_url_is_in_s3_bucket( $url, $expected_extension ) {
3862 - $file_is_in_expected_s3_bucket = 0 === strpos( $url, 'https://s3.amazonaws.com/fp.strategy11.com' );
3863 - if ( ! $file_is_in_expected_s3_bucket ) {
3864 - return false;
3865 - }
3866 -
3867 - $parsed = parse_url( $url );
3868 - if ( ! is_array( $parsed ) ) {
3869 - // URL is malformed.
3870 - return false;
3871 - }
3872 -
3873 - $path = $parsed['path'];
3874 - $ext = pathinfo( $path, PATHINFO_EXTENSION );
3875 - if ( $expected_extension !== $ext ) {
3876 - // The URL isn't to an XML file.
3877 - return false;
3878 - }
3879 -
3880 - return true;
3881 - }
3882 -
3883 - /**
3884 3544 * @since 4.08
3885 3545 * @deprecated 4.09.01
3886 3546 */
3887 3547 public static function expiring_message() {
@@ -3910,8 +3570,18 @@
3910 3570 FrmFormsHelper::insert_opt_html( $args );
3911 3571 }
3912 3572
3913 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 + /**
3914 3584 * @deprecated 3.01
3915 3585 * @codeCoverageIgnore
3916 3586 */
3917 3587 public static function sanitize_array( &$values ) {
@@ -3918,86 +3588,173 @@
3918 3588 FrmDeprecated::sanitize_array( $values );
3919 3589 }
3920 3590
3921 3591 /**
3922 - * @since 2.0
3923 - * @deprecated 5.0.13
3592 + * @param array $settings
3593 + * @param string $group
3924 3594 *
3925 - * @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
3926 3598 */
3927 - public static function jquery_ui_base_url() {
3928 - _deprecated_function( __FUNCTION__, '5.0.13', 'FrmProAppHelper::jquery_ui_base_url' );
3929 - 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 );
3930 3601 }
3931 3602
3932 3603 /**
3933 - * @since 4.07
3934 - * @deprecated 6.0
3604 + * @since 2.0.4
3605 + * @deprecated 2.05.06
3606 + * @codeCoverageIgnore
3935 3607 */
3936 - public static function renewal_message() {
3937 - _deprecated_function( __METHOD__, '6.0', 'FrmProAddonsController::renewal_message' );
3608 + public static function save_json_post( $settings ) {
3609 + return FrmDeprecated::save_json_post( $settings );
3938 3610 }
3939 3611
3940 3612 /**
3941 - * Display a dismissable warning message and save its dismissal state.
3613 + * @since 2.0
3614 + * @deprecated 2.05.06
3615 + * @codeCoverageIgnore
3942 3616 *
3943 - * @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
3944 3621 *
3945 - * @param string $message The warning message to display.
3946 - * @param string $option The unique identifier for the dismissal state of the message and the WP Ajax action.
3947 - * @return void
3622 + * @return mixed $results The cache or query results
3948 3623 */
3949 - public static function add_dismissable_warning_message( $message = '', $option = '' ) {
3950 - if ( ! $message || ! $option ) {
3951 - return;
3952 - }
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 + }
3953 3627
3954 - $ajax_callback = function() use ( $option ) {
3955 - self::dismiss_warning_message( $option );
3956 - };
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 + }
3957 3635
3958 - // We're handling JS codes with `doJsonPost` and it adds 'frm_' to the beginning of the action.
3959 - // To prevent any issues, we add 'frm_' from the beginning of the action.
3960 - 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 + }
3961 3643
3962 - add_filter(
3963 - 'frm_message_list',
3964 - function( $show_messages ) use ( $message, $option ) {
3965 - if ( get_option( $option, false ) ) {
3966 - return $show_messages;
3967 - }
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 + }
3968 3651
3969 - $dismiss_icon = self::icon_by_class(
3970 - 'frmfont frm_close_icon',
3971 - array(
3972 - 'aria-label' => _x( 'Dismiss', 'warning message: close icon label', 'formidable' ),
3973 - 'echo' => false,
3974 - )
3975 - );
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 + }
3976 3661
3977 - $show_messages[] = $message;
3978 - $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 + }
3979 3672
3980 - return $show_messages;
3981 - }
3982 - );
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 );
3983 3682 }
3984 3683
3985 3684 /**
3986 - * Dismiss a warning message and update the dismissal state.
3685 + * @since 1.07.10
3686 + * @deprecated 2.05.06
3687 + * @codeCoverageIgnore
3987 3688 *
3988 - * @since 6.3
3689 + * @param string $term The value to escape
3989 3690 *
3990 - * @param string $option The unique identifier for the dismissal state of the message.
3991 - * @return void
3691 + * @return string The escaped value
3992 3692 */
3993 - public static function dismiss_warning_message( $option = '' ) {
3994 - self::permission_check( 'frm_change_settings' );
3995 - check_ajax_referer( 'frm_ajax', 'nonce' );
3693 + public static function esc_like( $term ) {
3694 + return FrmDeprecated::esc_like( $term );
3695 + }
3996 3696
3997 - if ( $option ) {
3998 - update_option( $option, true, 'no' );
3999 - }
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 + }
4000 3706
4001 - 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' );
4002 3759 }
4003 3760 }