PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.2.02
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.2.02
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 +321 -732 6.55.2.02 View file →
@@ -3,21 +3,16 @@
3 3 die( 'You are not allowed to call this page directly.' );
4 4 }
5 5
6 6 class FrmAppHelper {
7 - public static $db_version = 98; // Version of the database we are moving to.
7 + public static $db_version = 98; // Version of the database we are moving to.
8 8 public static $pro_db_version = 37; //deprecated
9 - public static $font_version = 7;
9 + public static $font_version = 7;
10 10
11 11 /**
12 - * @var bool $added_gmt_offset_filter
13 - */
14 - private static $added_gmt_offset_filter = false;
15 -
16 - /**
17 12 * @since 2.0
18 13 */
19 - public static $plug_version = '6.5';
14 + public static $plug_version = '5.2.02';
20 15
21 16 /**
22 17 * @since 1.07.02
23 18 *
@@ -152,24 +147,8 @@
152 147 return $frm_settings->menu;
153 148 }
154 149
155 150 /**
156 - * Determine if the current branding is set to 'formidable'.
157 - *
158 - * Checks the menu title, retrieved through get_menu_name,
159 - * and verifies if it matches the 'formidable' branding.
160 - *
161 - * @since 6.4.2
162 - *
163 - * @return bool True if the menu title is 'formidable', false otherwise.
164 - */
165 - public static function is_formidable_branding() {
166 - $menu_title = self::get_menu_name();
167 -
168 - return 'formidable' === strtolower( trim( $menu_title ) );
169 - }
170 -
171 - /**
172 151 * @since 3.05
173 152 */
174 153 public static function svg_logo( $atts = array() ) {
175 154 $defaults = array(
@@ -268,15 +247,15 @@
268 247 global $pagenow;
269 248 $get_page = self::simple_get( 'page', 'sanitize_title' );
270 249 if ( $pagenow ) {
271 250 // allow this to be true during ajax load i.e. ajax form builder loading
272 - $is_page = ( $pagenow === 'admin.php' || $pagenow === 'admin-ajax.php' ) && $get_page === $page;
251 + $is_page = ( $pagenow == 'admin.php' || $pagenow == 'admin-ajax.php' ) && $get_page == $page;
273 252 if ( $is_page ) {
274 253 return true;
275 254 }
276 255 }
277 256
278 - return is_admin() && $get_page === $page;
257 + return is_admin() && $get_page == $page;
279 258 }
280 259
281 260 /**
282 261 * If the current page is for editing or creating a view.
@@ -348,18 +327,14 @@
348 327 * Check if on an admin page
349 328 *
350 329 * @since 2.0
351 330 *
331 + * @param None
332 + *
352 333 * @return boolean
353 334 */
354 335 public static function is_admin() {
355 - $is_admin = is_admin() && ! wp_doing_ajax();
356 -
357 - /**
358 - * @since 6.0
359 - * @param bool $is_admin
360 - */
361 - return apply_filters( 'frm_is_admin', $is_admin );
336 + return is_admin() && ! wp_doing_ajax();
362 337 }
363 338
364 339 /**
365 340 * Check if value contains blank value or empty array
@@ -392,38 +367,26 @@
392 367 return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
393 368 }
394 369
395 370 /**
396 - * Get the server OS
371 + * Check for the IP address in several places
372 + * Used by [ip] shortcode
397 373 *
398 - * @since 6.4.x
399 - *
400 - * @return string
401 - */
402 - public static function get_server_os() {
403 -
404 - if ( function_exists( 'php_uname' ) ) {
405 - return php_uname( 's' );
406 - }
407 -
408 - if ( ! defined( 'PHP_OS' ) ) {
409 - return '';
410 - }
411 -
412 - // match the same response for Windows server as php_uname('s')
413 - return in_array( PHP_OS, array( 'WIN32', 'WINNT', 'Windows_NT' ), true ) ? 'Windows NT' : PHP_OS;
414 - }
415 -
416 - /**
417 - * Check for the IP address in several places (when custom headers are enabled).
418 - * Used by [ip] shortcode.
419 - *
420 374 * @return string The IP address of the current user
421 375 */
422 376 public static function get_ip_address() {
423 - $ip_options = self::should_use_custom_header_ip() ? self::get_custom_header_keys_for_ip() : array( 'REMOTE_ADDR' );
424 - $ip = '';
425 -
377 + $ip_options = array(
378 + 'HTTP_CLIENT_IP',
379 + 'HTTP_CF_CONNECTING_IP',
380 + 'HTTP_X_FORWARDED_FOR',
381 + 'HTTP_X_FORWARDED',
382 + 'HTTP_X_CLUSTER_CLIENT_IP',
383 + 'HTTP_X_REAL_IP',
384 + 'HTTP_FORWARDED_FOR',
385 + 'HTTP_FORWARDED',
386 + 'REMOTE_ADDR',
387 + );
388 + $ip = '';
426 389 foreach ( $ip_options as $key ) {
427 390 if ( ! isset( $_SERVER[ $key ] ) ) {
428 391 continue;
429 392 }
@@ -429,9 +392,9 @@
429 392 }
430 393
431 394 $key = self::get_server_value( $key );
432 395 foreach ( explode( ',', $key ) as $ip ) {
433 - $ip = trim( $ip ); // Just to be safe.
396 + $ip = trim( $ip ); // just to be safe.
434 397
435 398 if ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) !== false ) {
436 399 return sanitize_text_field( $ip );
437 400 }
@@ -440,52 +403,8 @@
440 403
441 404 return sanitize_text_field( $ip );
442 405 }
443 406
444 - /**
445 - * @since 6.1
446 - *
447 - * @return array
448 - */
449 - public static function get_custom_header_keys_for_ip() {
450 - return array(
451 - 'HTTP_CLIENT_IP',
452 - 'HTTP_CF_CONNECTING_IP',
453 - 'HTTP_X_FORWARDED_FOR',
454 - 'HTTP_X_FORWARDED',
455 - 'HTTP_X_CLUSTER_CLIENT_IP',
456 - 'HTTP_X_REAL_IP',
457 - 'HTTP_FORWARDED_FOR',
458 - 'HTTP_FORWARDED',
459 - 'REMOTE_ADDR',
460 - );
461 - }
462 -
463 - /**
464 - * Check if we should check every HTTP header or just $_SERVER['REMOTE_ADDR'].
465 - * The other HTTP headers can be spoofed so this isn't recommended.
466 - * But in some cases (like reverse proxies), the IP may be empty if you use $_SERVER['REMOTE_ADDR'].
467 - *
468 - * @since 6.1
469 - *
470 - * @return bool
471 - */
472 - private static function should_use_custom_header_ip() {
473 - $settings = self::get_settings();
474 - $should_use_custom_header_ip = ! $settings->no_ips && $settings->custom_header_ip;
475 -
476 - /**
477 - * Filter whether to check spoofable HTTP headers.
478 - * This uses the custom_header_ip setting, but it is hidden if the GDPR option is also on.
479 - * 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.
480 - *
481 - * @since 6.1
482 - *
483 - * @param bool $should_use_custom_header_ip
484 - */
485 - return apply_filters( 'frm_use_custom_header_ip', $should_use_custom_header_ip );
486 - }
487 -
488 407 public static function get_param( $param, $default = '', $src = 'get', $sanitize = '' ) {
489 408 if ( strpos( $param, '[' ) ) {
490 409 $params = explode( '[', $param );
491 410 $param = $params[0];
@@ -574,14 +493,14 @@
574 493 );
575 494 $args = wp_parse_args( $args, $defaults );
576 495
577 496 $value = $args['default'];
578 - if ( $args['type'] === 'get' ) {
497 + if ( $args['type'] == 'get' ) {
579 498 if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
580 499 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
581 500 $value = wp_unslash( $_GET[ $args['param'] ] );
582 501 }
583 - } elseif ( $args['type'] === 'post' ) {
502 + } elseif ( $args['type'] == 'post' ) {
584 503 if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
585 504 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
586 505 $value = wp_unslash( $_POST[ $args['param'] ] );
587 506 if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
@@ -1002,18 +921,8 @@
1002 921
1003 922 $html_atts = self::array_to_html_params( $atts );
1004 923
1005 924 $icon = trim( str_replace( array( 'frm_icon_font', 'frmfont ' ), '', $class ) );
1006 -
1007 - // Replace icons that have been removed.
1008 - $deprecated = array(
1009 - 'frm_clone_solid_icon' => 'frm_clone_icon',
1010 - );
1011 - if ( isset( $deprecated[ $icon ] ) ) {
1012 - $icon = $deprecated[ $icon ];
1013 - $class = str_replace( $icon, $deprecated[ $icon ], $class );
1014 - }
1015 -
1016 925 if ( $icon === $class ) {
1017 926 $icon = '<i class="' . esc_attr( $class ) . '"' . $html_atts . '></i>';
1018 927 } else {
1019 928 $class = strpos( $icon, ' ' ) === false ? '' : ' ' . $icon;
@@ -1070,9 +979,9 @@
1070 979 * @param array $allowed_attr
1071 980 * @return array
1072 981 */
1073 982 public static function allow_vars_in_styles( $allowed_attr ) {
1074 - $allowed_attr[] = '--primary-700';
983 + $allowed_attr[] = '--primary-hover';
1075 984 return $allowed_attr;
1076 985 }
1077 986
1078 987 /**
@@ -1081,9 +990,9 @@
1081 990 * @param bool $allow_css
1082 991 * @param string $css_string
1083 992 */
1084 993 public static function allow_style( $allow_css, $css_string ) {
1085 - if ( ! $allow_css && 0 === strpos( $css_string, '--primary-700:' ) ) {
994 + if ( ! $allow_css && 0 === strpos( $css_string, '--primary-hover:' ) ) {
1086 995 $split = explode( ':', $css_string, 2 );
1087 996 $allow_css = 2 === count( $split ) && self::is_a_valid_color( $split[1] );
1088 997 }
1089 998 return $allow_css;
@@ -1112,9 +1021,9 @@
1112 1021 *
1113 1022 * @since 4.0.02
1114 1023 */
1115 1024 public static function include_svg() {
1116 - include_once self::plugin_path() . '/images/icons.svg';
1025 + include_once( self::plugin_path() . '/images/icons.svg' );
1117 1026 }
1118 1027
1119 1028 /**
1120 1029 * Convert an associative array to HTML values.
@@ -1150,11 +1059,9 @@
1150 1059 if ( ! $echo ) {
1151 1060 ob_start();
1152 1061 }
1153 1062
1154 - if ( is_callable( $echo_function ) ) {
1155 - $echo_function();
1156 - }
1063 + $echo_function();
1157 1064
1158 1065 if ( ! $echo ) {
1159 1066 $return = ob_get_contents();
1160 1067 ob_end_clean();
@@ -1177,94 +1084,31 @@
1177 1084 include( self::plugin_path() . '/classes/views/shared/admin-header.php' );
1178 1085 }
1179 1086
1180 1087 /**
1181 - * @since 6.0
1182 - *
1183 - * @param string $type
1184 - * @return void
1185 - */
1186 - public static function import_link( $type = 'secondary' ) {
1187 - ?>
1188 - <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">
1189 - <?php esc_html_e( 'Import', 'formidable' ); ?>
1190 - </a>
1191 - <?php
1192 - }
1193 -
1194 - /**
1195 - * Print applicable admin banner.
1196 - *
1197 - * @since 5.4.2
1198 - *
1199 - * @param bool $should_show_lite_upgrade
1200 - * @return void
1201 - */
1202 - public static function print_admin_banner( $should_show_lite_upgrade ) {
1203 - if ( ! current_user_can( 'administrator' ) ) {
1204 - FrmInbox::maybe_show_banner();
1205 - return;
1206 - }
1207 -
1208 - if ( self::maybe_show_license_warning() || FrmInbox::maybe_show_banner() || ! $should_show_lite_upgrade || self::pro_is_installed() ) {
1209 - // Print license warning or inbox banner and exit if either prints.
1210 - // And exit before printing the upgrade bar if it shouldn't be shown.
1211 - return;
1212 - }
1213 - ?>
1214 - <div class="frm-upgrade-bar">
1215 - <span>You're using Formidable Forms Lite. To unlock more features consider</span>
1216 - <a href="<?php echo esc_url( self::admin_upgrade_link( 'top-bar' ) ); ?>" target="_blank" rel="noopener">upgrading to Pro</a>.
1217 - </div>
1218 - <?php
1219 - }
1220 -
1221 - /**
1222 - * @since 5.4.2
1223 - *
1224 - * @return bool True if a banner is available and shown.
1225 - */
1226 - private static function maybe_show_license_warning() {
1227 - return is_callable( 'FrmProAddonsController::admin_banner' ) && FrmProAddonsController::admin_banner();
1228 - }
1229 -
1230 - /**
1231 - * Render a button for a new item (Form, Application, etc).
1232 - *
1233 1088 * @since 3.0
1234 - * @param array $atts {
1235 - * @type array $link_hook Custom link hook, calls do_action and exits early.
1236 - * @type string $new_link Href value, default #.
1237 - * @type string $class Custom class names, space separated.
1238 - * @type string $button_text Button text. Default "Add New".
1239 - * }
1240 - * @return void
1089 + * @param array $atts
1241 1090 */
1242 1091 public static function add_new_item_link( $atts ) {
1243 - if ( isset( $atts['link_hook'] ) ) {
1092 + if ( ! empty( $atts['new_link'] ) ) {
1093 + ?>
1094 + <a href="<?php echo esc_url( $atts['new_link'] ); ?>" class="button button-primary frm-button-primary frm-with-plus">
1095 + <?php self::icon_by_class( 'frmfont frm_plus_icon frm_svg15' ); ?>
1096 + <?php esc_html_e( 'Add New', 'formidable' ); ?>
1097 + </a>
1098 + <?php
1099 + } elseif ( ! empty( $atts['trigger_new_form_modal'] ) ) {
1100 + ?>
1101 + <a href="#" class="button button-primary frm-button-primary frm-with-plus frm-trigger-new-form-modal">
1102 + <?php
1103 + self::icon_by_class( 'frmfont frm_plus_icon frm_svg15' );
1104 + esc_html_e( 'Add New', 'formidable' );
1105 + ?>
1106 + </a>
1107 + <?php
1108 + } elseif ( isset( $atts['link_hook'] ) ) {
1244 1109 do_action( $atts['link_hook']['hook'], $atts['link_hook']['param'] );
1245 - return;
1246 1110 }
1247 -
1248 - if ( empty( $atts['new_link'] ) && empty( $atts['trigger_new_form_modal'] ) && empty( $atts['class'] ) ) {
1249 - // Do not render a button if none of these attributes are set.
1250 - return;
1251 - }
1252 -
1253 - $href = ! empty( $atts['new_link'] ) ? esc_url( $atts['new_link'] ) : '#';
1254 - $class = 'button button-primary frm-button-primary';
1255 -
1256 - if ( ! empty( $atts['trigger_new_form_modal'] ) ) {
1257 - $class .= ' frm-trigger-new-form-modal';
1258 - }
1259 -
1260 - if ( ! empty( $atts['class'] ) ) {
1261 - $class .= ' ' . $atts['class'];
1262 - }
1263 -
1264 - $button_text = ! empty( $atts['button_text'] ) ? $atts['button_text'] : __( 'Add New', 'formidable' );
1265 -
1266 - require self::plugin_path() . '/classes/views/shared/add-button.php';
1267 1111 }
1268 1112
1269 1113 /**
1270 1114 * @since 3.06
@@ -1322,14 +1166,11 @@
1322 1166 }
1323 1167 }
1324 1168
1325 1169 /**
1326 - * Save all front-end js scripts into a single file.
1327 - * And save an additional single file of all front-end Stripe JS scripts.
1170 + * Save all front-end js scripts into a single file
1328 1171 *
1329 1172 * @since 3.0
1330 - *
1331 - * @return void
1332 1173 */
1333 1174 public static function save_combined_js() {
1334 1175 $file_atts = apply_filters(
1335 1176 'frm_js_location',
@@ -1342,34 +1183,10 @@
1342 1183
1343 1184 $files = array(
1344 1185 self::plugin_path() . '/js/formidable.min.js',
1345 1186 );
1346 - /**
1347 - * @param array $files
1348 - */
1349 1187 $files = apply_filters( 'frm_combined_js_files', $files );
1350 1188 $new_file->combine_files( $files );
1351 -
1352 - // Create the minified Stripe Script.
1353 - $file_atts = apply_filters(
1354 - 'frm_stripe_js_location',
1355 - array(
1356 - 'file_name' => 'frmstrp.min.js',
1357 - 'new_file_path' => self::plugin_path() . '/js',
1358 - )
1359 - );
1360 - $new_file = new FrmCreateFile( $file_atts );
1361 - $files = array(
1362 - FrmStrpLiteAppHelper::plugin_path() . 'js/frmstrp.min.js',
1363 - );
1364 -
1365 - /**
1366 - * @since 6.5
1367 - *
1368 - * @param array $files
1369 - */
1370 - $files = apply_filters( 'frm_stripe_combined_js_files', $files );
1371 - $new_file->combine_files( $files );
1372 1189 }
1373 1190
1374 1191 /**
1375 1192 * Check a value from a shortcode to see if true or false.
@@ -1530,8 +1347,9 @@
1530 1347 public static function post_edit_link( $post_id ) {
1531 1348 $post = get_post( $post_id );
1532 1349 if ( $post ) {
1533 1350 $post_url = admin_url( 'post.php?post=' . $post_id . '&action=edit' );
1351 + $post_url = self::maybe_full_screen_link( $post_url );
1534 1352
1535 1353 return '<a href="' . esc_url( $post_url ) . '">' . self::truncate( $post->post_title, 50 ) . '</a>';
1536 1354 }
1537 1355
@@ -1541,64 +1359,25 @@
1541 1359 /**
1542 1360 * Hide the WordPress menus on some pages.
1543 1361 *
1544 1362 * @since 4.0
1545 - *
1546 - * @return bool
1547 1363 */
1548 1364 public static function is_full_screen() {
1549 - return self::is_form_builder_page() ||
1550 - self::is_style_editor_page() ||
1551 - self::is_full_screen_view_builder_page();
1552 - }
1365 + $full_builder = self::is_form_builder_page();
1366 + $styler = self::is_admin_page( 'formidable-styles' ) || self::is_admin_page( 'formidable-styles2' );
1367 + $full_entries = self::simple_get( 'frm-full', 'absint' );
1553 1368
1554 - /**
1555 - * Check if user is on the style editor or its alternative URL.
1556 - * The first URL is a submenu "Styles" in the Formidable menu /wp-admin/admin.php?page=formidable-styles.
1557 - * The alternative URL is linked as a submenu "Forms" item of the Appearance menu /wp-admin/themes.php?page=formidable-styles2.
1558 - *
1559 - * @since 5.5.3
1560 - * @since 6.0 Added the $view parameter. Previously there was only a 'edit' view.
1561 - *
1562 - * @param string $view Supports 'edit', 'list', and ''. If '', both 'edit' and 'list' will match.
1563 - * @return bool
1564 - */
1565 - public static function is_style_editor_page( $view = '' ) {
1566 - if ( ! self::is_admin_page( 'formidable-styles' ) && ! self::is_admin_page( 'formidable-styles2' ) ) {
1567 - return false;
1568 - }
1569 -
1570 - if ( ! in_array( $view, array( 'list', 'edit' ), true ) ) {
1571 - return true;
1572 - }
1573 -
1574 - $action = self::simple_get( 'frm_action' );
1575 - $is_edit_mode = 'edit' === $action || ( ! $action && ! self::simple_get( 'id' ) && ! self::simple_get( 'form' ) );
1576 -
1577 - if ( ! $is_edit_mode && class_exists( 'FrmProStylesController' ) && in_array( $action, array( 'new_style', 'duplicate' ), true ) ) {
1578 - $is_edit_mode = true;
1579 - }
1580 -
1581 - $checking_for_edit_mode = 'edit' === $view;
1582 -
1583 - return $is_edit_mode === $checking_for_edit_mode;
1369 + return $full_builder || $full_entries || $styler || self::is_view_builder_page();
1584 1370 }
1585 1371
1586 1372 /**
1587 - * @since 5.5.3
1588 - *
1589 - * @return bool
1590 - */
1591 - private static function is_full_screen_view_builder_page() {
1592 - return self::is_admin_page( 'formidable-views-editor' );
1593 - }
1594 -
1595 - /**
1596 1373 * @since 4.0
1597 - * @deprecated 5.5.3
1598 1374 */
1599 1375 public static function maybe_full_screen_link( $link ) {
1600 - _deprecated_function( __METHOD__, '5.5.3' );
1376 + $is_full = self::simple_get( 'frm-full', 'absint' );
1377 + if ( $is_full && ! empty( $link ) && $link !== '#' ) {
1378 + $link .= '&frm-full=1';
1379 + }
1601 1380 return $link;
1602 1381 }
1603 1382
1604 1383 /**
@@ -1658,10 +1437,19 @@
1658 1437 * @param string $type Supports `auto`, `pro`, or `pro_only`.
1659 1438 * @return array
1660 1439 */
1661 1440 public static function frm_capabilities( $type = 'auto' ) {
1662 - if ( ! self::pro_is_installed() && ! in_array( $type, array( 'pro', 'pro_only' ), true ) ) {
1663 - return self::get_lite_capabilities();
1441 + $cap = array(
1442 + 'frm_view_forms' => __( 'View Forms', 'formidable' ),
1443 + 'frm_edit_forms' => __( 'Add and Edit Forms', 'formidable' ),
1444 + 'frm_delete_forms' => __( 'Delete Forms', 'formidable' ),
1445 + 'frm_change_settings' => __( 'Access this Settings Page', 'formidable' ),
1446 + 'frm_view_entries' => __( 'View Entries from Admin Area', 'formidable' ),
1447 + 'frm_delete_entries' => __( 'Delete Entries from Admin Area', 'formidable' ),
1448 + );
1449 +
1450 + if ( ! self::pro_is_installed() && 'pro' !== $type && 'pro_only' !== $type ) {
1451 + return $cap;
1664 1452 }
1665 1453
1666 1454 $pro_cap = array(
1667 1455 'frm_create_entries' => __( 'Add Entries from Admin Area', 'formidable' ),
@@ -1668,41 +1456,17 @@
1668 1456 'frm_edit_entries' => __( 'Edit Entries from Admin Area', 'formidable' ),
1669 1457 'frm_view_reports' => __( 'View Reports', 'formidable' ),
1670 1458 'frm_edit_displays' => __( 'Add/Edit Views', 'formidable' ),
1671 1459 );
1672 - /**
1673 - * @since 5.3.1
1674 - *
1675 - * @param array<string,string> $pro_cap
1676 - */
1677 - $pro_cap = apply_filters( 'frm_pro_capabilities', $pro_cap );
1678 1460
1679 1461 if ( 'pro_only' === $type ) {
1680 1462 return $pro_cap;
1681 1463 }
1682 1464
1683 - return self::get_lite_capabilities() + $pro_cap;
1465 + return $cap + $pro_cap;
1684 1466 }
1685 1467
1686 1468 /**
1687 - * Get the list of lite plugin capabilities.
1688 - *
1689 - * @since 5.3.1
1690 - *
1691 - * @return array<string,string>
1692 - */
1693 - private static function get_lite_capabilities() {
1694 - return array(
1695 - 'frm_view_forms' => __( 'View Forms', 'formidable' ),
1696 - 'frm_edit_forms' => __( 'Add and Edit Forms', 'formidable' ),
1697 - 'frm_delete_forms' => __( 'Delete Forms', 'formidable' ),
1698 - 'frm_change_settings' => __( 'Access this Settings Page', 'formidable' ),
1699 - 'frm_view_entries' => __( 'View Entries from Admin Area', 'formidable' ),
1700 - 'frm_delete_entries' => __( 'Delete Entries from Admin Area', 'formidable' ),
1701 - );
1702 - }
1703 -
1704 - /**
1705 1469 * Call the WordPress current_user_can but also validate empty strings as true for any logged in user
1706 1470 *
1707 1471 * @since 4.06.03
1708 1472 *
@@ -1902,9 +1666,9 @@
1902 1666 foreach ( $array as $key => $value ) {
1903 1667 if ( is_array( $value ) ) {
1904 1668 $return = array_merge( $return, self::array_flatten( $value, $keys ) );
1905 1669 } else {
1906 - if ( $keys === 'keep' ) {
1670 + if ( $keys == 'keep' ) {
1907 1671 $return[ $key ] = $value;
1908 1672 } else {
1909 1673 $return[] = $value;
1910 1674 }
@@ -1988,9 +1752,9 @@
1988 1752 return $user_id;
1989 1753 }
1990 1754
1991 1755 $user_id = sanitize_text_field( $user_id );
1992 - if ( $user_id === 'current' ) {
1756 + if ( $user_id == 'current' ) {
1993 1757 $user_id = get_current_user_id();
1994 1758 } else {
1995 1759 if ( is_email( $user_id ) ) {
1996 1760 $user = get_user_by( 'email', $user_id );
@@ -2040,38 +1804,21 @@
2040 1804 }
2041 1805
2042 1806 $key = self::prevent_numeric_and_reserved_keys( $key );
2043 1807
2044 - $similar_keys = FrmDb::get_col(
1808 + $key_check = FrmDb::get_var(
2045 1809 $table_name,
2046 1810 array(
2047 - $column . ' like%' => $key,
2048 - 'ID !' => $id,
1811 + $column => $key,
1812 + 'ID !' => $id,
2049 1813 ),
2050 1814 $column
2051 1815 );
2052 1816
2053 - // Create a unique field id if it has already been used.
2054 - if ( in_array( $key, $similar_keys, true ) ) {
1817 + if ( $key_check || is_numeric( $key_check ) ) {
2055 1818 $key = self::maybe_truncate_key_before_appending( $column, $key );
2056 -
2057 - /**
2058 - * Allow for a custom separator between the attempted key and the generated suffix.
2059 - *
2060 - * @since 5.2.03
2061 - *
2062 - * @param string $separator. Default empty.
2063 - * @param string $key the key without the added suffix.
2064 - */
2065 - $separator = apply_filters( 'frm_unique_' . $column . '_separator', '', $key );
2066 -
2067 - $suffix = 2;
2068 - do {
2069 - $key_check = $key . $separator . $suffix;
2070 - ++$suffix;
2071 - } while ( in_array( $key_check, $similar_keys, true ) );
2072 -
2073 - $key = $key_check;
1819 + // Create a unique field id if it has already been used.
1820 + $key = $key . substr( md5( microtime() . rand() ), 0, 10 );
2074 1821 }
2075 1822
2076 1823 return $key;
2077 1824 }
@@ -2088,11 +1835,8 @@
2088 1835 if ( in_array( $column, array( 'form_key', 'field_key' ), true ) ) {
2089 1836 $max_key_length_before_truncating = 60;
2090 1837 if ( strlen( $key ) > $max_key_length_before_truncating ) {
2091 1838 $key = substr( $key, 0, $max_key_length_before_truncating );
2092 - if ( is_numeric( $key ) ) {
2093 - $key .= 'a';
2094 - }
2095 1839 }
2096 1840 }
2097 1841 return $key;
2098 1842 }
@@ -2458,9 +2202,9 @@
2458 2202 *
2459 2203 * @return string $time_ago
2460 2204 */
2461 2205 public static function human_time_diff( $from, $to = '', $levels = 1 ) {
2462 - if ( empty( $to ) && 0 !== $to ) {
2206 + if ( empty( $to ) ) {
2463 2207 $now = new DateTime();
2464 2208 } else {
2465 2209 $now = new DateTime( '@' . $to );
2466 2210 }
@@ -2711,9 +2455,8 @@
2711 2455 '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' ),
2712 2456 'from' => __( 'Enter the name and/or email address of the sender. FORMAT: John Bates <john@example.com> or john@example.com.', 'formidable' ),
2713 2457 /* translators: %1$s: Form name, %2$s: Date */
2714 2458 '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() ) ),
2715 - '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' ),
2716 2459 );
2717 2460
2718 2461 if ( ! isset( $tooltips[ $name ] ) ) {
2719 2462 return;
@@ -2740,12 +2483,8 @@
2740 2483 return;
2741 2484 }
2742 2485
2743 2486 $frm_action = self::simple_get( 'frm_action', 'sanitize_title' );
2744 - if ( 'lite-reports' === $frm_action ) {
2745 - $frm_action = 'reports';
2746 - }
2747 -
2748 2487 if ( empty( $action ) || ( ! empty( $frm_action ) && in_array( $frm_action, $action ) ) ) {
2749 2488 echo ' class="current_page"';
2750 2489 }
2751 2490 }
@@ -2802,15 +2541,12 @@
2802 2541 }
2803 2542 }
2804 2543
2805 2544 /**
2806 - * Check for either json or serialized data. This is temporary while transitioning
2545 + * Check for either json or serilized data. This is temporary while transitioning
2807 2546 * all data to json.
2808 2547 *
2809 2548 * @since 4.02.03
2810 - *
2811 - * @param array|string $value
2812 - * @return void
2813 2549 */
2814 2550 public static function unserialize_or_decode( &$value ) {
2815 2551 if ( is_array( $value ) ) {
2816 2552 return;
@@ -2816,9 +2552,9 @@
2816 2552 return;
2817 2553 }
2818 2554
2819 2555 if ( is_serialized( $value ) ) {
2820 - $value = self::maybe_unserialize_array( $value );
2556 + $value = maybe_unserialize( $value );
2821 2557 } else {
2822 2558 $value = self::maybe_json_decode( $value, false );
2823 2559 }
2824 2560 }
@@ -2823,35 +2559,8 @@
2823 2559 }
2824 2560 }
2825 2561
2826 2562 /**
2827 - * Safely unserialize an array if necessary.
2828 - * This function doesn't actually use unserialize. The string is parsed instead.
2829 - *
2830 - * @since 6.2
2831 - *
2832 - * @param mixed $value
2833 - * @return mixed
2834 - */
2835 - public static function maybe_unserialize_array( $value ) {
2836 - if ( ! is_string( $value ) ) {
2837 - return $value;
2838 - }
2839 -
2840 - // Since we only expect an array, skip anything that doesn't start with a:.
2841 - if ( ! is_serialized( $value ) || 'a:' !== substr( $value, 0, 2 ) ) {
2842 - return $value;
2843 - }
2844 -
2845 - $parsed = FrmSerializedStringParserHelper::get()->parse( $value );
2846 - if ( is_array( $parsed ) ) {
2847 - $value = $parsed;
2848 - }
2849 -
2850 - return $value;
2851 - }
2852 -
2853 - /**
2854 2563 * Decode a JSON string.
2855 2564 * Do not switch shortcodes like [24] to array unless intentional ie XML values.
2856 2565 *
2857 2566 * @param mixed $string
@@ -2878,36 +2587,8 @@
2878 2587 return $string;
2879 2588 }
2880 2589
2881 2590 /**
2882 - * @since 6.2.3
2883 - *
2884 - * @param string $value
2885 - * @return string
2886 - */
2887 - public static function maybe_utf8_encode( $value ) {
2888 - $from_format = 'ISO-8859-1';
2889 - $to_format = 'UTF-8';
2890 -
2891 - if ( function_exists( 'mb_check_encoding' ) && function_exists( 'mb_convert_encoding' ) ) {
2892 - if ( mb_check_encoding( $value, $from_format ) ) {
2893 - return mb_convert_encoding( $value, $to_format, $from_format );
2894 - }
2895 - return $value;
2896 - }
2897 -
2898 - if ( function_exists( 'iconv' ) ) {
2899 - $converted = iconv( $from_format, $to_format, $value );
2900 - // Value is false if $value is not ISO-8859-1.
2901 - if ( false !== $converted ) {
2902 - return $converted;
2903 - }
2904 - }
2905 -
2906 - return $value;
2907 - }
2908 -
2909 - /**
2910 2591 * Reformat the json serialized array in name => value array.
2911 2592 *
2912 2593 * @since 4.02.03
2913 2594 */
@@ -2973,17 +2654,14 @@
2973 2654 $version = self::plugin_version();
2974 2655 wp_register_script( 'formidable_admin_global', self::plugin_url() . '/js/formidable_admin_global.js', array( 'jquery' ), $version );
2975 2656
2976 2657 $global_strings = array(
2977 - 'updating_msg' => __( 'Please wait while your site updates.', 'formidable' ),
2978 - 'deauthorize' => __( 'Are you sure you want to deauthorize Formidable Forms on this site?', 'formidable' ),
2979 - 'url' => self::plugin_url(),
2980 - 'app_url' => 'https://formidableforms.com/',
2981 - 'applicationsUrl' => admin_url( 'admin.php?page=formidable-applications' ),
2982 - 'canAccessApplicationDashboard' => current_user_can( is_callable( 'FrmProApplicationsHelper::get_required_templates_capability' ) ? FrmProApplicationsHelper::get_required_templates_capability() : 'frm_edit_forms' ),
2983 - 'loading' => __( 'Loading&hellip;', 'formidable' ),
2984 - 'nonce' => wp_create_nonce( 'frm_ajax' ),
2985 - 'proIncludesSliderJs' => is_callable( 'FrmProFormsHelper::prepare_custom_currency' ),
2658 + 'updating_msg' => __( 'Please wait while your site updates.', 'formidable' ),
2659 + 'deauthorize' => __( 'Are you sure you want to deauthorize Formidable Forms on this site?', 'formidable' ),
2660 + 'url' => self::plugin_url(),
2661 + 'app_url' => 'https://formidableforms.com/',
2662 + 'loading' => __( 'Loading&hellip;', 'formidable' ),
2663 + 'nonce' => wp_create_nonce( 'frm_ajax' ),
2986 2664 );
2987 2665 wp_localize_script( 'formidable_admin_global', 'frmGlobal', $global_strings );
2988 2666
2989 2667 if ( $load ) {
@@ -3003,89 +2681,87 @@
3003 2681 */
3004 2682 public static function localize_script( $location ) {
3005 2683 global $wp_scripts;
3006 2684
2685 + $ajax_url = admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' );
2686 + $ajax_url = apply_filters( 'frm_ajax_url', $ajax_url );
2687 +
3007 2688 $script_strings = array(
3008 - 'ajax_url' => esc_url_raw( self::get_ajax_url() ),
3009 - 'images_url' => self::plugin_url() . '/images',
3010 - 'loading' => __( 'Loading&hellip;', 'formidable' ),
3011 - 'remove' => __( 'Remove', 'formidable' ),
3012 - 'offset' => apply_filters( 'frm_scroll_offset', 4 ),
3013 - 'nonce' => wp_create_nonce( 'frm_ajax' ),
3014 - 'id' => __( 'ID', 'formidable' ),
3015 - 'no_results' => __( 'No results match', 'formidable' ),
3016 - 'file_spam' => __( 'That file looks like Spam.', 'formidable' ),
3017 - 'calc_error' => __( 'There is an error in the calculation in the field with key', 'formidable' ),
3018 - 'empty_fields' => __( 'Please complete the preceding required fields before uploading a file.', 'formidable' ),
3019 - 'focus_first_error' => self::should_focus_first_error(),
3020 - 'include_alert_role' => self::should_include_alert_role_on_field_errors(),
2689 + 'ajax_url' => $ajax_url,
2690 + 'images_url' => self::plugin_url() . '/images',
2691 + 'loading' => __( 'Loading&hellip;', 'formidable' ),
2692 + 'remove' => __( 'Remove', 'formidable' ),
2693 + 'offset' => apply_filters( 'frm_scroll_offset', 4 ),
2694 + 'nonce' => wp_create_nonce( 'frm_ajax' ),
2695 + 'id' => __( 'ID', 'formidable' ),
2696 + 'no_results' => __( 'No results match', 'formidable' ),
2697 + 'file_spam' => __( 'That file looks like Spam.', 'formidable' ),
2698 + 'calc_error' => __( 'There is an error in the calculation in the field with key', 'formidable' ),
2699 + 'empty_fields' => __( 'Please complete the preceding required fields before uploading a file.', 'formidable' ),
3021 2700 );
3022 2701
3023 2702 $data = $wp_scripts->get_data( 'formidable', 'data' );
3024 - if ( ! $data ) {
2703 + if ( empty( $data ) ) {
3025 2704 wp_localize_script( 'formidable', 'frm_js', $script_strings );
3026 2705 }
3027 2706
3028 - if ( $location === 'admin' ) {
2707 + if ( $location == 'admin' ) {
3029 2708 $frm_settings = self::get_settings();
3030 2709 $admin_script_strings = array(
3031 - 'desc' => __( '(Click to add description)', 'formidable' ),
3032 - 'blank' => __( '(Blank)', 'formidable' ),
3033 - 'no_label' => __( '(no label)', 'formidable' ),
3034 - 'ok' => __( 'OK', 'formidable' ),
3035 - 'cancel' => __( 'Cancel', 'formidable' ),
3036 - 'default_label' => __( 'Default', 'formidable' ),
3037 - 'clear_default' => __( 'Clear default value when typing', 'formidable' ),
3038 - 'no_clear_default' => __( 'Do not clear default value when typing', 'formidable' ),
3039 - 'valid_default' => __( 'Default value will pass form validation', 'formidable' ),
3040 - 'no_valid_default' => __( 'Default value will NOT pass form validation', 'formidable' ),
3041 - 'confirm' => __( 'Are you sure?', 'formidable' ),
3042 - 'conf_delete' => __( 'Are you sure you want to delete this field and all data associated with it?', 'formidable' ),
3043 - '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' ),
3044 - 'conf_no_repeat' => __( 'Warning: If you have entries with multiple rows, all but the first row will be lost.', 'formidable' ),
3045 - 'default_unique' => $frm_settings->unique_msg,
3046 - 'default_conf' => __( 'The entered values do not match', 'formidable' ),
3047 - 'enter_email' => __( 'Enter Email', 'formidable' ),
3048 - 'confirm_email' => __( 'Confirm Email', 'formidable' ),
3049 - 'conditional_text' => __( 'Conditional content here', 'formidable' ),
3050 - 'new_option' => __( 'New Option', 'formidable' ),
3051 - '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' ),
3052 - 'enter_password' => __( 'Enter Password', 'formidable' ),
3053 - 'confirm_password' => __( 'Confirm Password', 'formidable' ),
3054 - 'import_complete' => __( 'Import Complete', 'formidable' ),
3055 - 'updating' => __( 'Please wait while your site updates.', 'formidable' ),
3056 - 'no_save_warning' => __( 'Warning: There is no way to retrieve unsaved entries.', 'formidable' ),
3057 - 'private_label' => __( 'Private', 'formidable' ),
3058 - 'jquery_ui_url' => '',
3059 - 'pro_url' => is_callable( 'FrmProAppHelper::plugin_url' ) ? FrmProAppHelper::plugin_url() : '',
3060 - 'no_licenses' => __( 'No new licenses were found', 'formidable' ),
3061 - 'unmatched_parens' => __( 'This calculation has at least one unmatched ( ) { } [ ].', 'formidable' ),
3062 - 'view_shortcodes' => __( 'This calculation may have shortcodes that work in Views but not forms.', 'formidable' ),
3063 - 'text_shortcodes' => __( 'This calculation may have shortcodes that work in text calculations but not numeric calculations.', 'formidable' ),
3064 - 'only_one_action' => __( 'This form action is limited to one per form. Please edit the existing form action.', 'formidable' ),
3065 - 'unsafe_params' => FrmFormsHelper::reserved_words(),
2710 + 'desc' => __( '(Click to add description)', 'formidable' ),
2711 + 'blank' => __( '(Blank)', 'formidable' ),
2712 + 'no_label' => __( '(no label)', 'formidable' ),
2713 + 'saving' => esc_attr( __( 'Saving', 'formidable' ) ),
2714 + 'saved' => esc_attr( __( 'Saved', 'formidable' ) ),
2715 + 'ok' => __( 'OK', 'formidable' ),
2716 + 'cancel' => __( 'Cancel', 'formidable' ),
2717 + 'default_label' => __( 'Default', 'formidable' ),
2718 + 'clear_default' => __( 'Clear default value when typing', 'formidable' ),
2719 + 'no_clear_default' => __( 'Do not clear default value when typing', 'formidable' ),
2720 + 'valid_default' => __( 'Default value will pass form validation', 'formidable' ),
2721 + 'no_valid_default' => __( 'Default value will NOT pass form validation', 'formidable' ),
2722 + 'caution' => __( 'Heads up', 'formidable' ),
2723 + 'confirm' => __( 'Are you sure?', 'formidable' ),
2724 + 'conf_delete' => __( 'Are you sure you want to delete this field and all data associated with it?', 'formidable' ),
2725 + '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' ),
2726 + 'conf_no_repeat' => __( 'Warning: If you have entries with multiple rows, all but the first row will be lost.', 'formidable' ),
2727 + 'default_unique' => $frm_settings->unique_msg,
2728 + 'default_conf' => __( 'The entered values do not match', 'formidable' ),
2729 + 'enter_email' => __( 'Enter Email', 'formidable' ),
2730 + 'confirm_email' => __( 'Confirm Email', 'formidable' ),
2731 + 'conditional_text' => __( 'Conditional content here', 'formidable' ),
2732 + 'new_option' => __( 'New Option', 'formidable' ),
2733 + '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' ),
2734 + 'enter_password' => __( 'Enter Password', 'formidable' ),
2735 + 'confirm_password' => __( 'Confirm Password', 'formidable' ),
2736 + 'import_complete' => __( 'Import Complete', 'formidable' ),
2737 + 'updating' => __( 'Please wait while your site updates.', 'formidable' ),
2738 + 'no_save_warning' => __( 'Warning: There is no way to retrieve unsaved entries.', 'formidable' ),
2739 + 'private_label' => __( 'Private', 'formidable' ),
2740 + 'jquery_ui_url' => '',
2741 + 'pro_url' => is_callable( 'FrmProAppHelper::plugin_url' ) ? FrmProAppHelper::plugin_url() : '',
2742 + 'no_licenses' => __( 'No new licenses were found', 'formidable' ),
2743 + 'unmatched_parens' => __( 'This calculation has at least one unmatched ( ) { } [ ].', 'formidable' ),
2744 + 'view_shortcodes' => __( 'This calculation may have shortcodes that work in Views but not forms.', 'formidable' ),
2745 + 'text_shortcodes' => __( 'This calculation may have shortcodes that work in text calculations but not numeric calculations.', 'formidable' ),
2746 + 'only_one_action' => __( 'This form action is limited to one per form. Please edit the existing form action.', 'formidable' ),
2747 + 'unsafe_params' => FrmFormsHelper::reserved_words(),
3066 2748 /* Translators: %s is the name of a Detail Page Slug that is a reserved word.*/
3067 - 'slug_is_reserved' => sprintf( __( 'The Detail Page Slug "%s" is reserved by WordPress. This may cause problems. Is this intentional?', 'formidable' ), '****' ),
2749 + 'slug_is_reserved' => sprintf( __( 'The Detail Page Slug "%s" is reserved by WordPress. This may cause problems. Is this intentional?', 'formidable' ), '****' ),
3068 2750 /* 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. */
3069 - 'param_is_reserved' => sprintf( __( 'The parameter "%s" is reserved by WordPress. This may cause problems when included in the URL. Is this intentional? ', 'formidable' ), '****' ),
3070 - 'reserved_words' => __( 'See the list of reserved words in WordPress.', 'formidable' ),
3071 - 'repeat_limit_min' => __( 'Please enter a Repeat Limit that is greater than 1.', 'formidable' ),
3072 - 'checkbox_limit' => __( 'Please select a limit between 0 and 200.', 'formidable' ),
3073 - 'install' => __( 'Install', 'formidable' ),
3074 - 'active' => __( 'Active', 'formidable' ),
3075 - 'select_a_field' => __( 'Select a Field', 'formidable' ),
3076 - 'no_items_found' => __( 'No items found.', 'formidable' ),
3077 - 'field_already_used' => __( 'Oops. You have already used that field.', 'formidable' ),
3078 - 'saving' => '', // Deprecated in 6.0.
3079 - 'saved' => '', // Deprecated in 6.0.
2751 + 'param_is_reserved' => sprintf( __( 'The parameter "%s" is reserved by WordPress. This may cause problems when included in the URL. Is this intentional? ', 'formidable' ), '****' ),
2752 + 'reserved_words' => __( 'See the list of reserved words in WordPress.', 'formidable' ),
2753 + 'repeat_limit_min' => __( 'Please enter a Repeat Limit that is greater than 1.', 'formidable' ),
2754 + 'checkbox_limit' => __( 'Please select a limit between 0 and 200.', 'formidable' ),
2755 + 'install' => __( 'Install', 'formidable' ),
2756 + 'active' => __( 'Active', 'formidable' ),
2757 + 'select_a_field' => __( 'Select a Field', 'formidable' ),
2758 + 'no_items_found' => __( 'No items found.', 'formidable' ),
3080 2759 );
3081 - /**
3082 - * @param array $admin_script_strings
3083 - */
3084 2760 $admin_script_strings = apply_filters( 'frm_admin_script_strings', $admin_script_strings );
3085 2761
3086 2762 $data = $wp_scripts->get_data( 'formidable_admin', 'data' );
3087 - if ( ! $data ) {
2763 + if ( empty( $data ) ) {
3088 2764 wp_localize_script( 'formidable_admin', 'frm_admin_js', $admin_script_strings );
3089 2765 }
3090 2766 }
3091 2767 }
@@ -3090,46 +2766,8 @@
3090 2766 }
3091 2767 }
3092 2768
3093 2769 /**
3094 - * @since 6.5
3095 - *
3096 - * @return string
3097 - */
3098 - public static function get_ajax_url() {
3099 - $ajax_url = admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' );
3100 -
3101 - /**
3102 - * @since 2.0.13
3103 - *
3104 - * @param string $ajax_url
3105 - */
3106 - return apply_filters( 'frm_ajax_url', $ajax_url );
3107 - }
3108 -
3109 - /**
3110 - * Returns whether or not the first errored input should be auto-focused (default true).
3111 - *
3112 - * @since 5.2.05
3113 - *
3114 - * @return bool
3115 - */
3116 - private static function should_focus_first_error() {
3117 - return (bool) apply_filters( 'frm_focus_first_error', true );
3118 - }
3119 -
3120 - /**
3121 - * Returns whether or not field errors should include role="alert" (default true).
3122 - *
3123 - * @since 5.2.05
3124 - *
3125 - * @return bool
3126 - */
3127 - public static function should_include_alert_role_on_field_errors() {
3128 - return (bool) apply_filters( 'frm_include_alert_role_on_field_errors', true );
3129 - }
3130 -
3131 - /**
3132 2770 * Echo the message on the plugins listing page
3133 2771 *
3134 2772 * @since 1.07.10
3135 2773 *
@@ -3152,10 +2790,8 @@
3152 2790 /**
3153 2791 * If Pro is far outdated, show a message.
3154 2792 *
3155 2793 * @since 4.0.01
3156 - *
3157 - * @return void
3158 2794 */
3159 2795 public static function min_pro_version_notice( $min_version ) {
3160 2796 if ( ! self::is_formidable_admin() ) {
3161 2797 // Don't show admin-wide.
@@ -3171,9 +2807,9 @@
3171 2807
3172 2808 $pro_version = FrmProDb::$plug_version;
3173 2809 $expired = FrmAddonsController::is_license_expired();
3174 2810 ?>
3175 - <div class="frm-banner-alert frm_error_style frm_previous_install">
2811 + <div class="error frm_previous_install">
3176 2812 <?php
3177 2813 esc_html_e( 'You are running a version of Formidable Forms that may not be compatible with your version of Formidable Forms Pro.', 'formidable' );
3178 2814 if ( empty( $expired ) ) {
3179 2815 echo ' Please <a href="' . esc_url( admin_url( 'plugins.php?s=formidable%20forms%20pro' ) ) . '">update now</a>.';
@@ -3212,9 +2848,9 @@
3212 2848 }
3213 2849
3214 2850 foreach ( $message as $m ) {
3215 2851 ?>
3216 - <div class="frm-banner-alert frm_error_style frm_previous_install">
2852 + <div class="error frm_previous_install">
3217 2853 <?php echo esc_html( $m ); ?>
3218 2854 </div>
3219 2855 <?php
3220 2856 }
@@ -3219,25 +2855,17 @@
3219 2855 <?php
3220 2856 }
3221 2857 }
3222 2858
3223 - /**
3224 - * @param string $type
3225 - * @return array<string,string>
3226 - */
3227 2859 public static function locales( $type = 'date' ) {
3228 2860 $locales = array(
3229 2861 'en' => __( 'English', 'formidable' ),
3230 2862 'af' => __( 'Afrikaans', 'formidable' ),
3231 2863 'sq' => __( 'Albanian', 'formidable' ),
3232 - 'ar-DZ' => __( 'Algerian Arabic', 'formidable' ),
3233 - 'am' => __( 'Amharic', 'formidable' ),
3234 2864 'ar' => __( 'Arabic', 'formidable' ),
3235 2865 'hy' => __( 'Armenian', 'formidable' ),
3236 2866 'az' => __( 'Azerbaijani', 'formidable' ),
3237 2867 'eu' => __( 'Basque', 'formidable' ),
3238 - 'be' => __( 'Belarusian', 'formidable' ),
3239 - 'bn' => __( 'Bengali', 'formidable' ),
3240 2868 'bs' => __( 'Bosnian', 'formidable' ),
3241 2869 'bg' => __( 'Bulgarian', 'formidable' ),
3242 2870 'ca' => __( 'Catalan', 'formidable' ),
3243 2871 'zh-HK' => __( 'Chinese Hong Kong', 'formidable' ),
@@ -3256,15 +2884,12 @@
3256 2884 'fi' => __( 'Finnish', 'formidable' ),
3257 2885 'fr' => __( 'French', 'formidable' ),
3258 2886 'fr-CA' => __( 'French/Canadian', 'formidable' ),
3259 2887 'fr-CH' => __( 'French/Swiss', 'formidable' ),
3260 - 'gl' => __( 'Galician', 'formidable' ),
3261 - 'ka' => __( 'Georgian', 'formidable' ),
3262 2888 'de' => __( 'German', 'formidable' ),
3263 2889 'de-AT' => __( 'German/Austria', 'formidable' ),
3264 2890 'de-CH' => __( 'German/Switzerland', 'formidable' ),
3265 2891 'el' => __( 'Greek', 'formidable' ),
3266 - 'gu' => __( 'Gujarati', 'formidable' ),
3267 2892 'he' => __( 'Hebrew', 'formidable' ),
3268 2893 'iw' => __( 'Hebrew', 'formidable' ),
3269 2894 'hi' => __( 'Hindi', 'formidable' ),
3270 2895 'hu' => __( 'Hungarian', 'formidable' ),
@@ -3271,74 +2896,44 @@
3271 2896 'is' => __( 'Icelandic', 'formidable' ),
3272 2897 'id' => __( 'Indonesian', 'formidable' ),
3273 2898 'it' => __( 'Italian', 'formidable' ),
3274 2899 'ja' => __( 'Japanese', 'formidable' ),
3275 - 'kn' => __( 'Kannada', 'formidable' ),
3276 - 'kk' => __( 'Kazakh', 'formidable' ),
3277 - 'km' => __( 'Khmer', 'formidable' ),
3278 2900 'ko' => __( 'Korean', 'formidable' ),
3279 - 'ky' => __( 'Kyrgyz', 'formidable' ),
3280 - 'lo' => __( 'Laothian', 'formidable' ),
3281 2901 'lv' => __( 'Latvian', 'formidable' ),
3282 2902 'lt' => __( 'Lithuanian', 'formidable' ),
3283 - 'lb' => __( 'Luxembourgish', 'formidable' ),
3284 - 'mk' => __( 'Macedonian', 'formidable' ),
3285 - 'ml' => __( 'Malayalam', 'formidable' ),
3286 2903 'ms' => __( 'Malaysian', 'formidable' ),
3287 - 'mr' => __( 'Marathi', 'formidable' ),
3288 2904 'no' => __( 'Norwegian', 'formidable' ),
3289 - 'nb' => __( 'Norwegian Bokmål', 'formidable' ),
3290 - 'nn' => __( 'Norwegian Nynorsk', 'formidable' ),
3291 2905 'pl' => __( 'Polish', 'formidable' ),
3292 2906 'pt' => __( 'Portuguese', 'formidable' ),
3293 2907 'pt-BR' => __( 'Portuguese/Brazilian', 'formidable' ),
3294 2908 'pt-PT' => __( 'Portuguese/Portugal', 'formidable' ),
3295 - 'rm' => __( 'Romansh', 'formidable' ),
3296 2909 'ro' => __( 'Romanian', 'formidable' ),
3297 2910 'ru' => __( 'Russian', 'formidable' ),
3298 2911 'sr' => __( 'Serbian', 'formidable' ),
3299 2912 'sr-SR' => __( 'Serbian', 'formidable' ),
3300 - 'si' => __( 'Sinhalese', 'formidable' ),
3301 2913 'sk' => __( 'Slovak', 'formidable' ),
3302 2914 'sl' => __( 'Slovenian', 'formidable' ),
3303 2915 'es' => __( 'Spanish', 'formidable' ),
3304 2916 'es-419' => __( 'Spanish/Latin America', 'formidable' ),
3305 - 'sw' => __( 'Swahili', 'formidable' ),
3306 2917 'sv' => __( 'Swedish', 'formidable' ),
3307 2918 'ta' => __( 'Tamil', 'formidable' ),
3308 - 'te' => __( 'Telugu', 'formidable' ),
3309 2919 'th' => __( 'Thai', 'formidable' ),
3310 - 'tj' => __( 'Tajiki', 'formidable' ),
3311 2920 'tr' => __( 'Turkish', 'formidable' ),
3312 2921 'uk' => __( 'Ukrainian', 'formidable' ),
3313 - 'ur' => __( 'Urdu', 'formidable' ),
3314 2922 'vi' => __( 'Vietnamese', 'formidable' ),
3315 - 'cy-GB' => __( 'Welsh', 'formidable' ),
3316 - 'zu' => __( 'Zulu', 'formidable' ),
3317 2923 );
3318 2924
3319 2925 if ( $type === 'captcha' ) {
3320 2926 // remove the languages unavailable for the captcha
3321 - $unset = array( 'sq', 'bs', 'eo', 'fo', 'fr-CH', 'sr-SR', 'ar-DZ', 'be', 'cy-GB', 'kk', 'km', 'ky', 'lb', 'mk', 'nb', 'nn', 'rm', 'tj' );
2927 + $unset = array( 'af', 'sq', 'hy', 'az', 'eu', 'bs', 'zh-HK', 'eo', 'et', 'fo', 'fr-CH', 'he', 'is', 'ms', 'sr-SR', 'ta' );
3322 2928 } else {
3323 2929 // remove the languages unavailable for the datepicker
3324 - $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' );
2930 + $unset = array( 'fil', 'fr-CA', 'de-AT', 'de-CH', 'iw', 'hi', 'pt', 'pt-PT', 'es-419' );
3325 2931 }
3326 2932
3327 2933 $locales = array_diff_key( $locales, array_flip( $unset ) );
2934 + $locales = apply_filters( 'frm_locales', $locales );
3328 2935
3329 - /**
3330 - * Filter available locale options.
3331 - *
3332 - * @since 5.4.5 Added $args parameter with type.
3333 - *
3334 - * @param array<string,string> $locales
3335 - * @param array $args {
3336 - * @type string $type
3337 - * }
3338 - */
3339 - $locales = apply_filters( 'frm_locales', $locales, compact( 'type' ) );
3340 -
3341 2936 return $locales;
3342 2937 }
3343 2938
3344 2939 /**
@@ -3644,12 +3239,11 @@
3644 3239 * @return array
3645 3240 */
3646 3241 public static function get_landing_page_upgrade_data_params( $medium = 'landing' ) {
3647 3242 $params = array(
3648 - 'medium' => $medium,
3649 - 'upgrade' => __( 'Form Landing Pages', 'formidable' ),
3650 - 'message' => __( 'Easily manage a landing page for your form. Upgrade to get form landing pages.', 'formidable' ),
3651 - 'screenshot' => 'landing.png',
3243 + 'medium' => $medium,
3244 + 'upgrade' => __( 'Form Landing Pages', 'formidable' ),
3245 + 'message' => __( 'Easily manage a landing page for your form. Upgrade to get form landing pages.', 'formidable' ),
3652 3246 );
3653 3247 return self::get_upgrade_data_params( 'landing', $params );
3654 3248 }
3655 3249
@@ -3731,8 +3325,36 @@
3731 3325 set_current_screen();
3732 3326 }
3733 3327
3734 3328 /**
3329 + * @since 4.07
3330 + * @deprecated 4.09.01
3331 + */
3332 + public static function renewal_message() {
3333 + if ( is_callable( 'FrmProAddonsController::renewal_message' ) ) {
3334 + FrmProAddonsController::renewal_message();
3335 + return;
3336 + }
3337 +
3338 + if ( ! FrmAddonsController::is_license_expired() ) {
3339 + return;
3340 + }
3341 +
3342 + ?>
3343 + <div class="frm_error_style" style="text-align:left">
3344 + <?php self::icon_by_class( 'frmfont frm_alert_icon' ); ?>
3345 + &nbsp;
3346 + <?php esc_html_e( 'Your account has expired', 'formidable' ); ?>
3347 + <div style="float:right">
3348 + <a href="<?php echo esc_url( self::admin_upgrade_link( 'form-expired', 'account/downloads/' ) ); ?>">
3349 + <?php esc_html_e( 'Renew Now', 'formidable' ); ?>
3350 + </a>
3351 + </div>
3352 + </div>
3353 + <?php
3354 + }
3355 +
3356 + /**
3735 3357 * Shows pill text.
3736 3358 *
3737 3359 * @since 5.2.02
3738 3360 *
@@ -3745,246 +3367,213 @@
3745 3367 echo '<span class="frm-new-pill">' . esc_html( $text ) . '</span>';
3746 3368 }
3747 3369
3748 3370 /**
3749 - * Count the number of decimals digits.
3750 - *
3751 - * @since 5.2.07
3752 - *
3753 - * @param mixed $num Number.
3754 - * @return int|false Returns `false` if the passed parameter is not number.
3371 + * @since 4.08
3372 + * @deprecated 4.09.01
3755 3373 */
3756 - public static function count_decimals( $num ) {
3757 - if ( ! is_numeric( $num ) ) {
3758 - return false;
3374 + public static function expiring_message() {
3375 + _deprecated_function( __METHOD__, '4.09.01', 'FrmProAddonsController::expiring_message' );
3376 + if ( is_callable( 'FrmProAddonsController::expiring_message' ) ) {
3377 + FrmProAddonsController::expiring_message();
3759 3378 }
3760 -
3761 - $num = (string) $num;
3762 - $parts = explode( '.', $num );
3763 - if ( 1 === count( $parts ) ) {
3764 - return 0;
3765 - }
3766 -
3767 - return strlen( $parts[ count( $parts ) - 1 ] );
3768 3379 }
3769 3380
3770 3381 /**
3771 - * Prevent a fatal error in PHP8 if gmt_offset happens to be set an empty string.
3772 - * This is a bug in WordPress. It isn't safe to call current_time( 'timestamp' ) without this with an empty string offset.
3773 - * In the future this might be safe to remove. Keep an eye on the current_time function in functions.php.
3382 + * Use the WP 4.7 wp_doing_ajax function
3774 3383 *
3775 - * @since 5.3.1
3776 - *
3777 - * @return void
3384 + * @since 2.05.07
3385 + * @deprecated 4.04.04
3778 3386 */
3779 - public static function filter_gmt_offset() {
3780 - if ( self::$added_gmt_offset_filter ) {
3781 - // Avoid adding twice.
3782 - return;
3783 - }
3387 + public static function wp_doing_ajax() {
3388 + _deprecated_function( __METHOD__, '4.04.04', 'wp_doing_ajax' );
3389 + return wp_doing_ajax();
3390 + }
3784 3391
3785 - add_filter(
3786 - 'option_gmt_offset',
3787 - function( $offset ) {
3788 - if ( ! is_string( $offset ) || is_numeric( $offset ) ) {
3789 - // Leave a valid value alone.
3790 - return $offset;
3791 - }
3792 -
3793 - return 0;
3794 - }
3795 - );
3796 - self::$added_gmt_offset_filter = true;
3392 + /**
3393 + * @deprecated 4.0
3394 + */
3395 + public static function insert_opt_html( $args ) {
3396 + _deprecated_function( __METHOD__, '4.0', 'FrmFormsHelper::insert_opt_html' );
3397 + FrmFormsHelper::insert_opt_html( $args );
3797 3398 }
3798 3399
3799 3400 /**
3800 - * @since 5.3.1
3401 + * Used to filter shortcode in text widgets
3801 3402 *
3802 - * @return bool
3403 + * @deprecated 2.5.4
3404 + * @codeCoverageIgnore
3803 3405 */
3804 - public static function on_form_listing_page() {
3805 - if ( ! self::is_admin_page( 'formidable' ) ) {
3806 - return false;
3807 - }
3406 + public static function widget_text_filter_callback( $matches ) {
3407 + return FrmDeprecated::widget_text_filter_callback( $matches );
3408 + }
3808 3409
3809 - $action = self::simple_get( 'frm_action', 'sanitize_title' );
3810 - return ! $action || in_array( $action, self::get_form_listing_page_actions(), true );
3410 + /**
3411 + * @deprecated 3.01
3412 + * @codeCoverageIgnore
3413 + */
3414 + public static function sanitize_array( &$values ) {
3415 + FrmDeprecated::sanitize_array( $values );
3811 3416 }
3812 3417
3813 3418 /**
3814 - * Get all actions that also display the forms list.
3419 + * @param array $settings
3420 + * @param string $group
3815 3421 *
3816 - * @since 5.3.1
3817 - *
3818 - * @return array<string>
3422 + * @since 2.0.6
3423 + * @deprecated 2.05.06
3424 + * @codeCoverageIgnore
3819 3425 */
3820 - private static function get_form_listing_page_actions() {
3821 - return array( 'list', 'trash', 'untrash', 'destroy' );
3426 + public static function save_settings( $settings, $group ) {
3427 + return FrmDeprecated::save_settings( $settings, $group );
3822 3428 }
3823 3429
3824 3430 /**
3825 - * Safely call get_plugins, importing the required files if they are not yet loaded.
3826 - *
3827 - * @since 5.5
3828 - *
3829 - * @return array
3431 + * @since 2.0.4
3432 + * @deprecated 2.05.06
3433 + * @codeCoverageIgnore
3830 3434 */
3831 - public static function get_plugins() {
3832 - if ( ! function_exists( 'get_plugins' ) ) {
3833 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
3834 - }
3835 - return get_plugins();
3435 + public static function save_json_post( $settings ) {
3436 + return FrmDeprecated::save_json_post( $settings );
3836 3437 }
3837 3438
3838 3439 /**
3839 - * 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.
3840 - * This is to make sure that the URL can't be exploited for a SSRF attack.
3440 + * @since 2.0
3441 + * @deprecated 2.05.06
3442 + * @codeCoverageIgnore
3841 3443 *
3842 - * @since 5.5.5
3444 + * @param string $cache_key The unique name for this cache
3445 + * @param string $group The name of the cache group
3446 + * @param string $query If blank, don't run a db call
3447 + * @param string $type The wpdb function to use with this query
3843 3448 *
3844 - * @param string $url
3845 - * @param string $expected_extension
3846 - * @return bool
3449 + * @return mixed $results The cache or query results
3847 3450 */
3848 - public static function validate_url_is_in_s3_bucket( $url, $expected_extension ) {
3849 - $file_is_in_expected_s3_bucket = 0 === strpos( $url, 'https://s3.amazonaws.com/fp.strategy11.com' );
3850 - if ( ! $file_is_in_expected_s3_bucket ) {
3851 - return false;
3852 - }
3853 -
3854 - $parsed = parse_url( $url );
3855 - if ( ! is_array( $parsed ) ) {
3856 - // URL is malformed.
3857 - return false;
3858 - }
3859 -
3860 - $path = $parsed['path'];
3861 - $ext = pathinfo( $path, PATHINFO_EXTENSION );
3862 - if ( $expected_extension !== $ext ) {
3863 - // The URL isn't to an XML file.
3864 - return false;
3865 - }
3866 -
3867 - return true;
3451 + public static function check_cache( $cache_key, $group = '', $query = '', $type = 'get_var', $time = 300 ) {
3452 + return FrmDeprecated::check_cache( $cache_key, $group, $query, $type, $time );
3868 3453 }
3869 3454
3870 3455 /**
3871 - * @since 4.08
3872 - * @deprecated 4.09.01
3456 + * @deprecated 2.05.06
3457 + * @codeCoverageIgnore
3873 3458 */
3874 - public static function expiring_message() {
3875 - _deprecated_function( __METHOD__, '4.09.01', 'FrmProAddonsController::expiring_message' );
3876 - if ( is_callable( 'FrmProAddonsController::expiring_message' ) ) {
3877 - FrmProAddonsController::expiring_message();
3878 - }
3459 + public static function set_cache( $cache_key, $results, $group = '', $time = 300 ) {
3460 + return FrmDeprecated::set_cache( $cache_key, $results, $group, $time );
3879 3461 }
3880 3462
3881 3463 /**
3882 - * Use the WP 4.7 wp_doing_ajax function
3883 - *
3884 - * @since 2.05.07
3885 - * @deprecated 4.04.04
3464 + * @deprecated 2.05.06
3465 + * @codeCoverageIgnore
3886 3466 */
3887 - public static function wp_doing_ajax() {
3888 - _deprecated_function( __METHOD__, '4.04.04', 'wp_doing_ajax' );
3889 - return wp_doing_ajax();
3467 + public static function add_key_to_group_cache( $key, $group ) {
3468 + FrmDeprecated::add_key_to_group_cache( $key, $group );
3890 3469 }
3891 3470
3892 3471 /**
3893 - * @deprecated 4.0
3472 + * @deprecated 2.05.06
3473 + * @codeCoverageIgnore
3894 3474 */
3895 - public static function insert_opt_html( $args ) {
3896 - _deprecated_function( __METHOD__, '4.0', 'FrmFormsHelper::insert_opt_html' );
3897 - FrmFormsHelper::insert_opt_html( $args );
3475 + public static function get_group_cached_keys( $group ) {
3476 + return FrmDeprecated::get_group_cached_keys( $group );
3898 3477 }
3899 3478
3900 3479 /**
3901 - * @deprecated 3.01
3480 + * @since 2.0
3481 + * @deprecated 2.05.06
3902 3482 * @codeCoverageIgnore
3483 + * @return mixed The cached value or false
3903 3484 */
3904 - public static function sanitize_array( &$values ) {
3905 - FrmDeprecated::sanitize_array( $values );
3485 + public static function check_cache_and_transient( $cache_key ) {
3486 + return FrmDeprecated::check_cache( $cache_key );
3906 3487 }
3907 3488
3908 3489 /**
3909 3490 * @since 2.0
3910 - * @deprecated 5.0.13
3491 + * @deprecated 2.05.06
3492 + * @codeCoverageIgnore
3911 3493 *
3912 - * @return string The base Google APIS url for the current version of jQuery UI
3494 + * @param string $cache_key
3913 3495 */
3914 - public static function jquery_ui_base_url() {
3915 - _deprecated_function( __FUNCTION__, '5.0.13', 'FrmProAppHelper::jquery_ui_base_url' );
3916 - return is_callable( 'FrmProAppHelper::jquery_ui_base_url' ) ? FrmProAppHelper::jquery_ui_base_url() : '';
3496 + public static function delete_cache_and_transient( $cache_key, $group = 'default' ) {
3497 + FrmDeprecated::delete_cache_and_transient( $cache_key, $group );
3917 3498 }
3918 3499
3919 3500 /**
3920 - * @since 4.07
3921 - * @deprecated 6.0
3501 + * @since 2.0
3502 + * @deprecated 2.05.06
3503 + * @codeCoverageIgnore
3504 + *
3505 + * @param string $group The name of the cache group
3922 3506 */
3923 - public static function renewal_message() {
3924 - _deprecated_function( __METHOD__, '6.0', 'FrmProAddonsController::renewal_message' );
3507 + public static function cache_delete_group( $group ) {
3508 + FrmDeprecated::cache_delete_group( $group );
3925 3509 }
3926 3510
3927 3511 /**
3928 - * Display a dismissable warning message and save its dismissal state.
3512 + * @since 1.07.10
3513 + * @deprecated 2.05.06
3514 + * @codeCoverageIgnore
3929 3515 *
3930 - * @since 6.3
3516 + * @param string $term The value to escape
3931 3517 *
3932 - * @param string $message The warning message to display.
3933 - * @param string $option The unique identifier for the dismissal state of the message and the WP Ajax action.
3934 - * @return void
3518 + * @return string The escaped value
3935 3519 */
3936 - public static function add_dismissable_warning_message( $message = '', $option = '' ) {
3937 - if ( ! $message || ! $option ) {
3938 - return;
3939 - }
3520 + public static function esc_like( $term ) {
3521 + return FrmDeprecated::esc_like( $term );
3522 + }
3940 3523
3941 - $ajax_callback = function() use ( $option ) {
3942 - self::dismiss_warning_message( $option );
3943 - };
3524 + /**
3525 + * @param string $order_query
3526 + *
3527 + * @deprecated 2.05.06
3528 + * @codeCoverageIgnore
3529 + */
3530 + public static function esc_order( $order_query ) {
3531 + return FrmDeprecated::esc_order( $order_query );
3532 + }
3944 3533
3945 - // We're handling JS codes with `doJsonPost` and it adds 'frm_' to the beginning of the action.
3946 - // To prevent any issues, we add 'frm_' from the beginning of the action.
3947 - add_action( 'wp_ajax_frm_' . $option, $ajax_callback );
3534 + /**
3535 + * @deprecated 2.05.06
3536 + * @codeCoverageIgnore
3537 + */
3538 + public static function esc_order_by( &$order_by ) {
3539 + FrmDeprecated::esc_order_by( $order_by );
3540 + }
3948 3541
3949 - add_filter(
3950 - 'frm_message_list',
3951 - function( $show_messages ) use ( $message, $option ) {
3952 - if ( get_option( $option, false ) ) {
3953 - return $show_messages;
3954 - }
3542 + /**
3543 + * @param string $limit
3544 + *
3545 + * @deprecated 2.05.06
3546 + * @codeCoverageIgnore
3547 + */
3548 + public static function esc_limit( $limit ) {
3549 + return FrmDeprecated::esc_limit( $limit );
3550 + }
3955 3551
3956 - $dismiss_icon = self::icon_by_class(
3957 - 'frmfont frm_close_icon',
3958 - array(
3959 - 'aria-label' => _x( 'Dismiss', 'warning message: close icon label', 'formidable' ),
3960 - 'echo' => false,
3961 - )
3962 - );
3552 + /**
3553 + * @since 2.0
3554 + * @deprecated 2.05.06
3555 + * @codeCoverageIgnore
3556 + */
3557 + public static function prepare_array_values( $array, $type = '%s' ) {
3558 + return FrmDeprecated::prepare_array_values( $array, $type );
3559 + }
3963 3560
3964 - $show_messages[] = $message;
3965 - $show_messages[] = '<span class="frm-warning-dismiss frmsvg" data-action="' . esc_attr( $option ) . '">' . $dismiss_icon . '</span>';
3966 -
3967 - return $show_messages;
3968 - }
3969 - );
3561 + /**
3562 + * @deprecated 2.05.06
3563 + * @codeCoverageIgnore
3564 + */
3565 + public static function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ) {
3566 + return FrmDeprecated::prepend_and_or_where( $starts_with, $where );
3970 3567 }
3971 3568
3972 3569 /**
3973 - * Dismiss a warning message and update the dismissal state.
3570 + * @since 2.0
3571 + * @deprecated 5.0.13
3974 3572 *
3975 - * @since 6.3
3976 - *
3977 - * @param string $option The unique identifier for the dismissal state of the message.
3978 - * @return void
3573 + * @return string The base Google APIS url for the current version of jQuery UI
3979 3574 */
3980 - public static function dismiss_warning_message( $option = '' ) {
3981 - self::permission_check( 'frm_change_settings' );
3982 - check_ajax_referer( 'frm_ajax', 'nonce' );
3983 -
3984 - if ( $option ) {
3985 - update_option( $option, true, 'no' );
3986 - }
3987 -
3988 - wp_send_json_success();
3575 + public static function jquery_ui_base_url() {
3576 + _deprecated_function( __FUNCTION__, '5.0.13', 'FrmProAppHelper::jquery_ui_base_url' );
3577 + return is_callable( 'FrmProAppHelper::jquery_ui_base_url' ) ? FrmProAppHelper::jquery_ui_base_url() : '';
3989 3578 }
3990 3579 }