PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.12.1
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.12.1
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/controllers/FrmFormsController.php +69 -205 6.256.12.1 View file →
@@ -67,9 +67,9 @@
67 67 $data_message = __( 'Only show the fields you need and create branching forms. Upgrade to get conditional logic and question branching.', 'formidable' );
68 68 $data_message .= ' <img src="' . esc_url( $images_url ) . '/survey-logic.png" srcset="' . esc_url( $images_url ) . 'survey-logic@2x.png 2x" alt="' . esc_attr__( 'Conditional Logic options', 'formidable' ) . '"/>';
69 69 echo '<a href="javascript:void(0)" class="frm_noallow frm_show_upgrade frm_add_logic_link frm-collapsed frm-flex-justify" data-upgrade="' . esc_attr__( 'Conditional Logic options', 'formidable' ) . '" data-message="' . esc_attr( $data_message ) . '" data-medium="builder" data-content="logic">';
70 70 esc_html_e( 'Conditional Logic', 'formidable' );
71 - FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon', array( 'aria-hidden' => 'true' ) );
71 + FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) );
72 72 echo '</a>';
73 73 }
74 74
75 75 /**
@@ -107,22 +107,14 @@
107 107 *
108 108 * @since 2.02.11
109 109 *
110 110 * @param int|object $form
111 - * @return void
112 111 */
113 112 private static function create_default_email_action( $form ) {
114 113 FrmForm::maybe_get_form( $form );
115 - if ( ! is_object( $form ) ) {
116 - return;
117 - }
118 -
119 114 $create_email = apply_filters( 'frm_create_default_email_action', true, $form );
120 115
121 116 if ( $create_email ) {
122 - /**
123 - * @var FrmFormAction
124 - */
125 117 $action_control = FrmFormActionsController::get_form_actions( 'email' );
126 118 $action_control->create( $form->id );
127 119 }
128 120 }
@@ -132,15 +124,11 @@
132 124 *
133 125 * @since 6.0.0
134 126 *
135 127 * @param int|object $form Form object or ID.
136 - * @return void
137 128 */
138 129 private static function create_default_on_submit_action( $form ) {
139 130 FrmForm::maybe_get_form( $form );
140 - if ( ! is_object( $form ) ) {
141 - return;
142 - }
143 131
144 132 /**
145 133 * Enable or disable the default On Submit action.
146 134 *
@@ -151,11 +139,8 @@
151 139 */
152 140 $create = apply_filters( 'frm_create_default_on_submit_action', true, $form );
153 141
154 142 if ( $create ) {
155 - /**
156 - * @var FrmFormAction
157 - */
158 143 $action_control = FrmFormActionsController::get_form_actions( FrmOnSubmitAction::$slug );
159 144 $action_control->create( $form->id );
160 145 }
161 146 }
@@ -165,15 +150,11 @@
165 150 *
166 151 * @since 6.9
167 152 *
168 153 * @param int|object $form Form ID or object.
169 - * @return void
170 154 */
171 155 private static function create_submit_button_field( $form ) {
172 156 FrmForm::maybe_get_form( $form );
173 - if ( ! is_object( $form ) ) {
174 - return;
175 - }
176 157
177 158 if ( FrmSubmitHelper::get_submit_field( $form->id ) ) {
178 159 // Do not create submit button field if it exists.
179 160 return;
@@ -182,9 +163,9 @@
182 163 FrmField::create(
183 164 array(
184 165 'type' => FrmSubmitHelper::FIELD_TYPE,
185 166 'name' => __( 'Submit', 'formidable' ),
186 - 'field_order' => FrmSubmitHelper::DEFAULT_ORDER,
167 + 'field_order' => 9999,
187 168 'form_id' => $form->id,
188 169 'field_options' => FrmFieldsHelper::get_default_field_options( FrmSubmitHelper::FIELD_TYPE ),
189 170 'description' => '',
190 171 'default_value' => '',
@@ -389,14 +370,12 @@
389 370 * @return string|null
390 371 */
391 372 public static function page_preview() {
392 373 $params = FrmForm::list_page_params();
393 - if ( ! $params['form'] || is_numeric( $params['form'] ) ) {
374 + if ( ! $params['form'] ) {
394 375 return null;
395 376 }
396 377
397 - self::maybe_block_preview( $params['form'] );
398 -
399 378 $form = FrmForm::getOne( $params['form'] );
400 379 if ( ! $form ) {
401 380 return null;
402 381 }
@@ -409,18 +388,9 @@
409 388 *
410 389 * @return void
411 390 */
412 391 public static function show_page_preview() {
413 - $preview = self::page_preview();
414 - if ( is_null( $preview ) ) {
415 - wp_die(
416 - '<h1>' . esc_html__( 'Form key is invalid', 'formidable' ) . '</h1>',
417 - '<p>' . esc_html__( 'Form key is invalid', 'formidable' ) . '</p>',
418 - 404
419 - );
420 - }
421 -
422 - echo $preview; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
392 + echo self::page_preview(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
423 393 }
424 394
425 395 /**
426 396 * @return void
@@ -431,17 +401,8 @@
431 401
432 402 global $frm_vars;
433 403 $frm_vars['preview'] = true;
434 404
435 - // print_emoji_styles is deprecated.
436 - remove_action( 'wp_print_styles', 'print_emoji_styles' );
437 -
438 - if ( FrmTestModeController::should_add_test_mode_container() ) {
439 - do_action( 'frm_test_mode_init' );
440 - add_action( 'wp_enqueue_scripts', 'FrmTestModeController::register_and_enqueue_required_scripts' );
441 - add_filter( 'frm_filter_final_form', 'FrmTestModeController::maybe_add_test_mode_container', 99 );
442 - }
443 -
444 405 $include_theme = FrmAppHelper::get_param( 'theme', '', 'get', 'absint' );
445 406 if ( $include_theme ) {
446 407 self::set_preview_query();
447 408 self::load_theme_preview();
@@ -558,12 +519,8 @@
558 519 echo '<div class="container entry-content">';
559 520 the_content();
560 521 echo '</div>';
561 522
562 - // Prevent extra unexpected forms in the footer.
563 - // For some reason this happens in the Twenty Twenty Five theme.
564 - add_filter( 'frm_filter_final_form', '__return_empty_string' );
565 -
566 523 self::get_template( 'footer' );
567 524 }
568 525 }
569 526
@@ -653,36 +610,23 @@
653 610 /**
654 611 * @since 3.0
655 612 */
656 613 private static function load_direct_preview() {
614 + header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
615 +
616 + // print_emoji_styles is deprecated.
617 + remove_action( 'wp_print_styles', 'print_emoji_styles' );
618 +
657 619 $key = FrmAppHelper::simple_get( 'form', 'sanitize_title' );
658 620 if ( $key == '' ) {
659 621 $key = FrmAppHelper::get_post_param( 'form', '', 'sanitize_title' );
660 622 }
661 623
662 - if ( ! $key ) {
663 - $error = __( 'Form key is missing', 'formidable' );
664 - wp_die(
665 - '<h1>' . esc_html( $error ) . '</h1>',
666 - '<p>' . esc_html( $error ) . '</p>',
667 - 404
668 - );
669 - }
670 -
671 - self::maybe_block_preview( $key );
672 -
673 624 $form = FrmForm::getAll( array( 'form_key' => $key ), '', 1 );
674 - if ( ! $form ) {
675 - $error = __( 'Form does not exist', 'formidable' );
676 - wp_die(
677 - '<h1>' . esc_html( $error ) . '</h1>',
678 - '<p>' . esc_html( $error ) . '</p>',
679 - 404
680 - );
625 + if ( empty( $form ) ) {
626 + $form = FrmForm::getAll( array(), '', 1 );
681 627 }
682 628
683 - header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
684 -
685 629 self::fix_deprecated_null_param_warning();
686 630
687 631 require FrmAppHelper::plugin_path() . '/classes/views/frm-entries/direct.php';
688 632 }
@@ -687,30 +631,8 @@
687 631 require FrmAppHelper::plugin_path() . '/classes/views/frm-entries/direct.php';
688 632 }
689 633
690 634 /**
691 - * Block the form preview for the contact form by default if the user cannot view forms.
692 - * This is to prevent the contact form being exploited.
693 - * Since this form is added by default and every site uses the same key, it is too easy
694 - * to guess this form.
695 - *
696 - * @since 6.20
697 - *
698 - * @param string $form_key Form key.
699 - * @return void
700 - */
701 - public static function maybe_block_preview( $form_key ) {
702 - if ( FrmFormsHelper::should_block_preview( $form_key ) ) {
703 - $error = __( 'You do not have permission to view this form', 'formidable' );
704 - wp_die(
705 - '<h1>' . esc_html( $error ) . '</h1>',
706 - '<p>' . esc_html( $error ) . '</p>',
707 - 403
708 - );
709 - }
710 - }
711 -
712 - /**
713 635 * Some themes have a null $src value.
714 636 * This function adds a filter to ensure that $src is not null.
715 637 * WP will call str_starts_with with the null value triggering a deprecated message otherwise.
716 638 *
@@ -837,12 +759,8 @@
837 759 ++$count;
838 760 }
839 761 }
840 762
841 - if ( ! $count ) {
842 - return '';
843 - }
844 -
845 763 $current_page = FrmAppHelper::get_simple_request(
846 764 array(
847 765 'param' => 'form_type',
848 766 'type' => 'request',
@@ -1135,14 +1053,8 @@
1135 1053 wp_redirect( esc_url_raw( add_query_arg( 'paged', $total_pages ) ) );
1136 1054 die();
1137 1055 }
1138 1056
1139 - $inbox = new FrmInbox();
1140 - $error = $inbox->check_for_error();
1141 - if ( $error ) {
1142 - $show_messages = array( $error['subject'] . '. ' . $error['message'] );
1143 - }
1144 -
1145 1057 require FrmAppHelper::plugin_path() . '/classes/views/frm-forms/list.php';
1146 1058 }
1147 1059
1148 1060 /**
@@ -1149,16 +1061,14 @@
1149 1061 * @param array<string,string> $columns
1150 1062 * @return array<string,string>
1151 1063 */
1152 1064 public static function get_columns( $columns ) {
1153 - $columns['cb'] = '<input type="checkbox" />';
1154 - $columns['name'] = esc_html__( 'Form Title', 'formidable' );
1155 - $columns['entries'] = esc_html__( 'Entries', 'formidable' );
1156 - $columns['id'] = 'ID';
1157 - $columns['form_key'] = esc_html__( 'Key', 'formidable' );
1158 - if ( 'trash' !== FrmAppHelper::simple_get( 'form_type' ) ) {
1159 - $columns['shortcode'] = esc_html__( 'Actions', 'formidable' );
1160 - }
1065 + $columns['cb'] = '<input type="checkbox" />';
1066 + $columns['name'] = esc_html__( 'Form Title', 'formidable' );
1067 + $columns['entries'] = esc_html__( 'Entries', 'formidable' );
1068 + $columns['id'] = 'ID';
1069 + $columns['form_key'] = esc_html__( 'Key', 'formidable' );
1070 + $columns['shortcode'] = esc_html__( 'Actions', 'formidable' );
1161 1071 $columns['created_at'] = esc_html__( 'Date', 'formidable' );
1162 1072
1163 1073 add_screen_option(
1164 1074 'per_page',
@@ -1298,9 +1208,10 @@
1298 1208 }
1299 1209
1300 1210 self::maybe_update_form_builder_message( $message );
1301 1211
1302 - $has_fields = ! empty( $values['fields'] ) && ! FrmSubmitHelper::only_contains_submit_field( $values['fields'] );
1212 + $all_templates = FrmForm::getAll( array( 'is_template' => 1 ), 'name' );
1213 + $has_fields = ! empty( $values['fields'] ) && ! FrmSubmitHelper::only_contains_submit_field( $values['fields'] );
1303 1214
1304 1215 if ( defined( 'DOING_AJAX' ) ) {
1305 1216 wp_die();
1306 1217 }
@@ -1416,9 +1327,9 @@
1416 1327 $sections = array(
1417 1328 'advanced' => array(
1418 1329 'name' => __( 'General', 'formidable' ),
1419 1330 'title' => __( 'General Form Settings', 'formidable' ),
1420 - 'function' => array( self::class, 'advanced_settings' ),
1331 + 'function' => array( __CLASS__, 'advanced_settings' ),
1421 1332 'icon' => 'frm_icon_font frm_settings_icon',
1422 1333 ),
1423 1334 'email' => array(
1424 1335 'name' => __( 'Actions & Notifications', 'formidable' ),
@@ -1448,9 +1359,9 @@
1448 1359 ),
1449 1360 ),
1450 1361 'buttons' => array(
1451 1362 'name' => __( 'Buttons', 'formidable' ),
1452 - 'class' => self::class,
1363 + 'class' => __CLASS__,
1453 1364 'function' => 'buttons_settings',
1454 1365 'icon' => 'frm_icon_font frm_button_icon',
1455 1366 ),
1456 1367 'landing' => array(
@@ -1486,18 +1397,14 @@
1486 1397 ),
1487 1398 ),
1488 1399 'html' => array(
1489 1400 'name' => __( 'Customize HTML', 'formidable' ),
1490 - 'class' => self::class,
1401 + 'class' => __CLASS__,
1491 1402 'function' => 'html_settings',
1492 1403 'icon' => 'frm_icon_font frm_code_icon',
1493 1404 ),
1494 1405 );
1495 1406
1496 - if ( ! has_action( 'frm_add_form_style_tab_options' ) && ! has_action( 'frm_add_form_button_options' ) ) {
1497 - unset( $sections['buttons'] );
1498 - }
1499 -
1500 1407 foreach ( array( 'landing', 'chat', 'abandonment' ) as $feature ) {
1501 1408 if ( ! FrmAppHelper::show_new_feature( $feature ) ) {
1502 1409 unset( $sections[ $feature ] );
1503 1410 }
@@ -1552,9 +1459,9 @@
1552 1459 public static function render_spam_settings( $values ) {
1553 1460 if ( function_exists( 'akismet_http_post' ) ) {
1554 1461 include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/spam-settings/akismet.php';
1555 1462 }
1556 - include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/spam-settings/stopforumspam.php';
1463 + include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/spam-settings/honeypot.php';
1557 1464 include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/spam-settings/antispam.php';
1558 1465 }
1559 1466
1560 1467 /**
@@ -1733,16 +1640,21 @@
1733 1640 'updated-at' => __( 'Entry updated', 'formidable' ),
1734 1641 '' => '',
1735 1642 'siteurl' => __( 'Site URL', 'formidable' ),
1736 1643 'sitename' => __( 'Site Name', 'formidable' ),
1737 - 'form_name' => __( 'Form Name', 'formidable' ),
1738 1644 );
1739 1645
1740 - $entry_shortcodes = array_merge( FrmShortcodeHelper::get_contextual_shortcode_values(), $entry_shortcodes );
1741 1646 if ( ! FrmAppHelper::pro_is_installed() ) {
1742 1647 unset( $entry_shortcodes['post_id'] );
1743 1648 }
1744 1649
1650 + if ( $settings_tab ) {
1651 + $entry_shortcodes['default-message'] = __( 'Default Msg', 'formidable' );
1652 + $entry_shortcodes['default-html'] = __( 'Default HTML', 'formidable' );
1653 + $entry_shortcodes['default-plain'] = __( 'Default Plain', 'formidable' );
1654 + $entry_shortcodes['form_name'] = __( 'Form Name', 'formidable' );
1655 + }
1656 +
1745 1657 /**
1746 1658 * Use this hook to add or remove buttons in the helpers section
1747 1659 * in the customization panel
1748 1660 *
@@ -1768,9 +1680,9 @@
1768 1680 echo ' frm_js_validate ';
1769 1681 self::add_js_validate_form_to_global_vars( $form );
1770 1682 }
1771 1683
1772 - if ( FrmForm::is_ajax_on( $form ) ) {
1684 + if ( ! FrmFormsHelper::should_use_pro_for_ajax_submit() && FrmForm::is_ajax_on( $form ) ) {
1773 1685 echo ' frm_ajax_submit ';
1774 1686 }
1775 1687 }
1776 1688
@@ -1932,26 +1844,13 @@
1932 1844
1933 1845 return $errors;
1934 1846 }
1935 1847
1936 - /**
1937 - * Includes html that shows a message when the device is too small to use Formidable Forms admin pages.
1938 - *
1939 - * @since 6.20
1940 - * @return void
1941 - */
1942 - public static function include_device_too_small_message() {
1943 - if ( ! FrmAppHelper::is_formidable_admin() ) {
1944 - return;
1945 - }
1946 -
1947 - include FrmAppHelper::plugin_path() . '/classes/views/shared/small-device-message.php';
1948 - }
1949 -
1950 1848 public static function route() {
1951 1849 $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action';
1952 1850 $vars = array();
1953 1851 FrmAppHelper::include_svg();
1852 +
1954 1853 if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1955 1854 FrmAppHelper::permission_check( 'frm_edit_forms' );
1956 1855
1957 1856 // Javascript needs to be allowed in some field settings.
@@ -2055,32 +1954,12 @@
2055 1954 // Get posted data
2056 1955 $form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' );
2057 1956 $name = FrmAppHelper::get_post_param( 'form_name', '', 'sanitize_text_field' );
2058 1957
2059 - $form = FrmForm::getOne( $form_id );
2060 - if ( ! $form ) {
2061 - wp_send_json_error( __( 'Form not found', 'formidable' ) );
2062 - }
1958 + // Update the form name and form key.
1959 + $form_key = FrmAppHelper::get_unique_key( sanitize_title( $name ), 'frm_forms', 'form_key' );
1960 + FrmForm::update( $form_id, compact( 'name', 'form_key' ) );
2063 1961
2064 - if ( $name === $form->name ) {
2065 - // Nothing to change so exit early.
2066 - wp_send_json_success();
2067 - }
2068 -
2069 - $to_update = array(
2070 - 'name' => $name,
2071 - );
2072 -
2073 - if ( '' !== $name ) {
2074 - // Only update form_key if name is not empty.
2075 - $form_key = FrmAppHelper::get_unique_key( sanitize_title( $name ), 'frm_forms', 'form_key' );
2076 - $to_update['form_key'] = $form_key;
2077 - } else {
2078 - $form_key = $form->form_key;
2079 - }
2080 -
2081 - FrmForm::update( $form_id, $to_update );
2082 -
2083 1962 wp_send_json_success( compact( 'form_key' ) );
2084 1963 }
2085 1964
2086 1965 public static function json_error( $errors ) {
@@ -2089,8 +1968,18 @@
2089 1968 return $errors;
2090 1969 }
2091 1970
2092 1971 /**
1972 + * Education for premium features.
1973 + *
1974 + * @since 4.05
1975 + * @return void
1976 + */
1977 + public static function add_form_style_tab_options() {
1978 + include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/add_form_style_options.php';
1979 + }
1980 +
1981 + /**
2093 1982 * Add education about views.
2094 1983 *
2095 1984 * @since 4.07
2096 1985 *
@@ -2195,9 +2084,9 @@
2195 2084 $wp_admin_bar->add_node(
2196 2085 array(
2197 2086 'parent' => 'frm-forms',
2198 2087 'id' => 'edit_form_' . $form_id,
2199 - 'title' => empty( $name ) ? FrmFormsHelper::get_no_title_text() : $name,
2088 + 'title' => empty( $name ) ? __( '(no title)', 'formidable' ) : $name,
2200 2089 'href' => FrmForm::get_edit_link( $form_id ),
2201 2090 )
2202 2091 );
2203 2092 }
@@ -2485,9 +2374,9 @@
2485 2374 * @param array $args See {@see FrmFormsController::maybe_trigger_redirect()}.
2486 2375 */
2487 2376 public static function maybe_trigger_redirect_with_action( $conf_method, $form, $params, $args ) {
2488 2377 if ( is_array( $conf_method ) && 1 === count( $conf_method ) ) {
2489 - if ( 'redirect' === FrmOnSubmitHelper::get_action_type( $conf_method[0] ) && empty( $conf_method[0]->post_content['redirect_delay'] ) ) {
2378 + if ( 'redirect' === FrmOnSubmitHelper::get_action_type( $conf_method[0] ) ) {
2490 2379 $event = FrmOnSubmitHelper::current_event( $params );
2491 2380 FrmOnSubmitHelper::populate_on_submit_data( $form->options, $conf_method[0], $event );
2492 2381 $conf_method = 'redirect';
2493 2382 }
@@ -2822,9 +2711,9 @@
2822 2711 echo json_encode( self::get_ajax_redirect_response_data( $args + compact( 'success_url' ) ) );
2823 2712 wp_die();
2824 2713 }
2825 2714
2826 - if ( ! headers_sent() && empty( $args['force_delay_redirect'] ) && empty( $args['form']->options['redirect_delay'] ) ) {
2715 + if ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) {
2827 2716 // Not AJAX submit, no headers sent, and there is just one Redirect action runs.
2828 2717 if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) {
2829 2718 self::print_open_in_new_tab_js_with_fallback_handler( $success_url, $args );
2830 2719 self::$redirected_in_new_tab[ $args['form']->id ] = 1;
@@ -2869,46 +2758,28 @@
2869 2758 * @param array $args See {@see FrmFormsController::run_success_action()}.
2870 2759 * @return array
2871 2760 */
2872 2761 private static function get_ajax_redirect_response_data( $args ) {
2873 - $response_data = array(
2874 - 'redirect' => $args['success_url'],
2875 - 'content' => '',
2876 - );
2877 - $unset_content = true;
2762 + $response_data = array( 'redirect' => $args['success_url'] );
2878 2763
2879 - if ( ! empty( $args['form']->options['redirect_delay'] ) ) {
2880 - $response_data['delay'] = $args['form']->options['redirect_delay_time'];
2881 - $response_data['content'] .= self::get_redirect_message( $args['success_url'], $args['form']->options['redirect_delay_msg'], $args );
2882 - $unset_content = false;
2883 - }
2884 -
2885 2764 if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) {
2886 2765 $response_data['openInNewTab'] = 1;
2887 2766
2888 - // Only show open in new tab text if there is no delay.
2889 - if ( empty( $response_data['content'] ) ) {
2890 - $args['message'] = FrmOnSubmitHelper::get_default_new_tab_msg();
2767 + $args['message'] = FrmOnSubmitHelper::get_default_new_tab_msg();
2891 2768
2892 - $args['form']->options['success_msg'] = $args['message'];
2893 - $args['form']->options['edit_msg'] = $args['message'];
2894 - if ( ! isset( $args['fields'] ) ) {
2895 - $args['fields'] = FrmField::get_all_for_form( $args['form']->id );
2896 - }
2769 + $args['form']->options['success_msg'] = $args['message'];
2770 + $args['form']->options['edit_msg'] = $args['message'];
2771 + if ( ! isset( $args['fields'] ) ) {
2772 + $args['fields'] = FrmField::get_all_for_form( $args['form']->id );
2773 + }
2897 2774
2898 - $args['message'] = self::prepare_submit_message( $args['form'], $args['entry_id'], $args );
2775 + $args['message'] = self::prepare_submit_message( $args['form'], $args['entry_id'], $args );
2899 2776
2900 - ob_start();
2901 - self::show_lone_success_message( $args );
2902 - $response_data['content'] .= ob_get_clean();
2903 - $unset_content = false;
2904 - }//end if
2777 + ob_start();
2778 + self::show_lone_success_message( $args );
2779 + $response_data['content'] = ob_get_clean();
2905 2780
2906 2781 $response_data['fallbackMsg'] = self::get_redirect_fallback_message( $args['success_url'], $args );
2907 - }//end if
2908 -
2909 - if ( $unset_content && '' === $response_data['content'] ) {
2910 - unset( $response_data['content'] );
2911 2782 }
2912 2783
2913 2784 return $response_data;
2914 2785 }
@@ -2920,9 +2791,9 @@
2920 2791 *
2921 2792 * @param array $args See {@see FrmFormsController::run_success_action()}.
2922 2793 */
2923 2794 private static function redirect_after_submit_using_js( $args ) {
2924 - $success_msg = $args['form']->options['redirect_delay_msg'];
2795 + $success_msg = FrmOnSubmitHelper::get_default_redirect_msg();
2925 2796 $redirect_msg = self::get_redirect_message( $args['success_url'], $success_msg, $args );
2926 2797 $success_url = esc_url_raw( $args['success_url'] );
2927 2798
2928 2799 /**
@@ -2931,9 +2802,9 @@
2931 2802 * @since 6.0
2932 2803 *
2933 2804 * @param int $delay_time Delay time in milliseconds.
2934 2805 */
2935 - $delay_time = apply_filters( 'frm_redirect_delay_time', 1000 * $args['form']->options['redirect_delay_time'] );
2806 + $delay_time = apply_filters( 'frm_redirect_delay_time', 8000 );
2936 2807
2937 2808 if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) {
2938 2809 $redirect_js = 'window.open("' . $success_url . '", "_blank")';
2939 2810 } else {
@@ -2962,10 +2833,8 @@
2962 2833 * @param string $success_msg
2963 2834 * @param array $args
2964 2835 */
2965 2836 private static function get_redirect_message( $success_url, $success_msg, $args ) {
2966 - $success_msg = apply_filters( 'frm_content', $success_msg, $args['form'], $args['entry_id'] );
2967 - $success_msg = do_shortcode( FrmAppHelper::use_wpautop( $success_msg ) );
2968 2837 $redirect_msg = '<div class="' . esc_attr( FrmFormsHelper::get_form_style_class( $args['form'] ) ) . '"><div class="frm-redirect-msg" role="status">' . $success_msg . '<br/>' .
2969 2838 self::get_redirect_fallback_message( $success_url, $args ) .
2970 2839 '</div></div>';
2971 2840
@@ -3051,9 +2920,9 @@
3051 2920
3052 2921 $include_form_tag = apply_filters( 'frm_include_form_tag', true, $form );
3053 2922
3054 2923 $frm_settings = FrmAppHelper::get_settings();
3055 - $submit = $form->options['submit_value'] ?? $frm_settings->submit_value;
2924 + $submit = isset( $form->options['submit_value'] ) ? $form->options['submit_value'] : $frm_settings->submit_value;
3056 2925
3057 2926 global $frm_vars;
3058 2927 self::maybe_load_css( $form, $values['custom_style'], $frm_vars['load_css'] );
3059 2928
@@ -3141,12 +3010,12 @@
3141 3010 * @return string
3142 3011 */
3143 3012 private static function prepare_submit_message( $form, $entry_id, $args = array() ) {
3144 3013 $frm_settings = FrmAppHelper::get_settings( array( 'current_form' => $form->id ) );
3145 - $opt = $args['success_opt'] ?? 'success';
3014 + $opt = isset( $args['success_opt'] ) ? $args['success_opt'] : 'success';
3146 3015
3147 3016 if ( $entry_id && is_numeric( $entry_id ) ) {
3148 - $message = $form->options[ $opt . '_msg' ] ?? $frm_settings->success_msg;
3017 + $message = isset( $form->options[ $opt . '_msg' ] ) ? $form->options[ $opt . '_msg' ] : $frm_settings->success_msg;
3149 3018 $class = 'frm_message';
3150 3019 } else {
3151 3020 $message = $frm_settings->failed_msg;
3152 3021 $class = FrmFormsHelper::form_error_class();
@@ -3250,10 +3119,8 @@
3250 3119
3251 3120 if ( ! FrmAppHelper::is_admin() && $location !== 'header' && ! empty( $frm_vars['forms_loaded'] ) ) {
3252 3121 // load formidable js
3253 3122 wp_enqueue_script( 'formidable' );
3254 -
3255 - FrmHoneypot::maybe_print_honeypot_js();
3256 3123 }
3257 3124 }
3258 3125
3259 3126 /**
@@ -3398,16 +3265,13 @@
3398 3265 self::update( $values );
3399 3266 }
3400 3267
3401 3268 /**
3402 - * Education for premium features.
3269 + * @deprecated 6.7
3403 3270 *
3404 - * @since 4.05
3405 - * @deprecated 6.16.3
3406 - *
3407 - * @return void
3271 + * @return bool
3408 3272 */
3409 - public static function add_form_style_tab_options() {
3410 - _deprecated_function( __METHOD__, '6.16.3' );
3411 - include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/add_form_style_options.php';
3273 + public static function expired() {
3274 + _deprecated_function( __METHOD__, '6.7' );
3275 + return FrmAddonsController::is_license_expired();
3412 3276 }
3413 3277 }