@@ -1616,7 +1616,8 @@ discard block |
||
| 1616 | 1616 | $vars = array(); |
| 1617 | 1617 | FrmAppHelper::include_svg(); |
| 1618 | 1618 | |
| 1619 | - if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1619 | + if ( isset( $_POST['frm_compact_fields'] ) ) { |
|
| 1620 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1620 | 1621 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
| 1621 | 1622 | |
| 1622 | 1623 | // Javascript needs to be allowed in some field settings. |
@@ -2046,7 +2047,8 @@ discard block |
||
| 2046 | 2047 | private static function get_saved_errors( $form, $params ) { |
| 2047 | 2048 | global $frm_vars; |
| 2048 | 2049 | |
| 2049 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2050 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
| 2051 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2050 | 2052 | $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
| 2051 | 2053 | } else { |
| 2052 | 2054 | $errors = array(); |
@@ -788,7 +788,7 @@ discard block |
||
| 788 | 788 | * |
| 789 | 789 | * @return string |
| 790 | 790 | */ |
| 791 | - function ( $src ) { |
|
| 791 | + function( $src ) { |
|
| 792 | 792 | if ( is_null( $src ) ) { |
| 793 | 793 | $src = ''; |
| 794 | 794 | } |
@@ -854,11 +854,11 @@ discard block |
||
| 854 | 854 | ), |
| 855 | 855 | ); |
| 856 | 856 | |
| 857 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
| 857 | + if ( ! isset( $available_status[$status] ) ) { |
|
| 858 | 858 | return; |
| 859 | 859 | } |
| 860 | 860 | |
| 861 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
| 861 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
| 862 | 862 | |
| 863 | 863 | $params = FrmForm::list_page_params(); |
| 864 | 864 | |
@@ -867,8 +867,8 @@ discard block |
||
| 867 | 867 | |
| 868 | 868 | $count = 0; |
| 869 | 869 | |
| 870 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
| 871 | - ++$count; |
|
| 870 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
| 871 | + ++ $count; |
|
| 872 | 872 | } |
| 873 | 873 | |
| 874 | 874 | $form_type = FrmAppHelper::get_simple_request( |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
| 885 | 885 | $available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' ); |
| 886 | 886 | |
| 887 | - $message = $available_status[ $status ]['message']; |
|
| 887 | + $message = $available_status[$status]['message']; |
|
| 888 | 888 | |
| 889 | 889 | self::display_forms_list( $params, $message ); |
| 890 | 890 | } |
@@ -901,7 +901,7 @@ discard block |
||
| 901 | 901 | |
| 902 | 902 | foreach ( $ids as $id ) { |
| 903 | 903 | if ( FrmForm::trash( $id ) ) { |
| 904 | - ++$count; |
|
| 904 | + ++ $count; |
|
| 905 | 905 | } |
| 906 | 906 | } |
| 907 | 907 | |
@@ -936,7 +936,7 @@ discard block |
||
| 936 | 936 | $count = 0; |
| 937 | 937 | |
| 938 | 938 | if ( FrmForm::destroy( $params['id'] ) ) { |
| 939 | - ++$count; |
|
| 939 | + ++ $count; |
|
| 940 | 940 | } |
| 941 | 941 | |
| 942 | 942 | /* translators: %1$s: Number of forms */ |
@@ -959,7 +959,7 @@ discard block |
||
| 959 | 959 | $d = FrmForm::destroy( $id ); |
| 960 | 960 | |
| 961 | 961 | if ( $d ) { |
| 962 | - ++$count; |
|
| 962 | + ++ $count; |
|
| 963 | 963 | } |
| 964 | 964 | } |
| 965 | 965 | |
@@ -1487,7 +1487,7 @@ discard block |
||
| 1487 | 1487 | |
| 1488 | 1488 | add_action( |
| 1489 | 1489 | 'wp_enqueue_editor', |
| 1490 | - function () { |
|
| 1490 | + function() { |
|
| 1491 | 1491 | wp_print_media_templates(); |
| 1492 | 1492 | } |
| 1493 | 1493 | ); |
@@ -1627,7 +1627,7 @@ discard block |
||
| 1627 | 1627 | $section['id'] = $section['anchor']; |
| 1628 | 1628 | } |
| 1629 | 1629 | |
| 1630 | - $sections[ $key ] = $section; |
|
| 1630 | + $sections[$key] = $section; |
|
| 1631 | 1631 | }//end foreach |
| 1632 | 1632 | |
| 1633 | 1633 | return $sections; |
@@ -1762,7 +1762,7 @@ discard block |
||
| 1762 | 1762 | $user_helpers = array(); |
| 1763 | 1763 | |
| 1764 | 1764 | foreach ( $user_fields as $uk => $uf ) { |
| 1765 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
| 1765 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
| 1766 | 1766 | unset( $uk, $uf ); |
| 1767 | 1767 | } |
| 1768 | 1768 | |
@@ -1909,7 +1909,7 @@ discard block |
||
| 1909 | 1909 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
| 1910 | 1910 | $frm_vars['js_validate_forms'] = array(); |
| 1911 | 1911 | } |
| 1912 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
| 1912 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
| 1913 | 1913 | } |
| 1914 | 1914 | |
| 1915 | 1915 | public static function get_email_html() { |
@@ -2111,7 +2111,7 @@ discard block |
||
| 2111 | 2111 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
| 2112 | 2112 | } else { |
| 2113 | 2113 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
| 2114 | - $action = $vars[ $action ]; |
|
| 2114 | + $action = $vars[$action]; |
|
| 2115 | 2115 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 2116 | 2116 | $_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 2117 | 2117 | $_POST = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -2311,7 +2311,7 @@ discard block |
||
| 2311 | 2311 | |
| 2312 | 2312 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
| 2313 | 2313 | if ( is_object( $form ) ) { |
| 2314 | - $actions[ $form->id ] = $form->name; |
|
| 2314 | + $actions[$form->id] = $form->name; |
|
| 2315 | 2315 | } |
| 2316 | 2316 | unset( $form ); |
| 2317 | 2317 | } |
@@ -2598,8 +2598,8 @@ discard block |
||
| 2598 | 2598 | private static function get_saved_errors( $form, $params ) { |
| 2599 | 2599 | global $frm_vars; |
| 2600 | 2600 | |
| 2601 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2602 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
| 2601 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2602 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
| 2603 | 2603 | } else { |
| 2604 | 2604 | $errors = array(); |
| 2605 | 2605 | } |
@@ -2625,7 +2625,7 @@ discard block |
||
| 2625 | 2625 | public static function just_created_entry( $form_id ) { |
| 2626 | 2626 | global $frm_vars; |
| 2627 | 2627 | |
| 2628 | - return isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0; |
|
| 2628 | + return isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][$form_id] ) && isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ? $frm_vars['created_entries'][$form_id]['entry_id'] : 0; |
|
| 2629 | 2629 | } |
| 2630 | 2630 | |
| 2631 | 2631 | /** |
@@ -2646,7 +2646,7 @@ discard block |
||
| 2646 | 2646 | private static function get_confirmation_method( $atts ) { |
| 2647 | 2647 | $action = FrmOnSubmitHelper::current_event( $atts ); |
| 2648 | 2648 | $opt = 'update' === $action ? 'edit_action' : 'success_action'; |
| 2649 | - $method = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 2649 | + $method = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
| 2650 | 2650 | |
| 2651 | 2651 | if ( ! empty( $atts['entry_id'] ) ) { |
| 2652 | 2652 | $met_actions = self::get_met_on_submit_actions( $atts, $action ); |
@@ -2675,7 +2675,7 @@ discard block |
||
| 2675 | 2675 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
| 2676 | 2676 | if ( ! isset( $params['id'] ) ) { |
| 2677 | 2677 | global $frm_vars; |
| 2678 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
| 2678 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
| 2679 | 2679 | } |
| 2680 | 2680 | |
| 2681 | 2681 | $conf_method = self::get_confirmation_method( |
@@ -2764,7 +2764,7 @@ discard block |
||
| 2764 | 2764 | $args['success_opt'] = $opt; |
| 2765 | 2765 | $args['ajax'] = ! empty( $frm_vars['ajax'] ); |
| 2766 | 2766 | |
| 2767 | - if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
| 2767 | + if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
| 2768 | 2768 | self::load_page_after_submit( $args ); |
| 2769 | 2769 | } elseif ( $args['conf_method'] === 'redirect' ) { |
| 2770 | 2770 | self::redirect_after_submit( $args ); |
@@ -2789,7 +2789,7 @@ discard block |
||
| 2789 | 2789 | } |
| 2790 | 2790 | |
| 2791 | 2791 | // If a redirect action has already opened the URL in a new tab, we show the default message in the current tab. |
| 2792 | - if ( ! empty( self::$redirected_in_new_tab[ $args['form']->id ] ) ) { |
|
| 2792 | + if ( ! empty( self::$redirected_in_new_tab[$args['form']->id] ) ) { |
|
| 2793 | 2793 | return array( FrmOnSubmitHelper::get_fallback_action_after_open_in_new_tab( $event ) ); |
| 2794 | 2794 | } |
| 2795 | 2795 | |
@@ -2982,7 +2982,7 @@ discard block |
||
| 2982 | 2982 | |
| 2983 | 2983 | $opt = 'update' === $args['action'] ? 'edit_' : 'success_'; |
| 2984 | 2984 | |
| 2985 | - $new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ]; |
|
| 2985 | + $new_args['conf_method'] = $new_args['form']->options[$opt . 'action']; |
|
| 2986 | 2986 | |
| 2987 | 2987 | /** |
| 2988 | 2988 | * Filters the run success action args. |
@@ -3007,8 +3007,8 @@ discard block |
||
| 3007 | 3007 | global $post; |
| 3008 | 3008 | $opt = $args['success_opt']; |
| 3009 | 3009 | |
| 3010 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
| 3011 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
| 3010 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
| 3011 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
| 3012 | 3012 | $old_post = $post; |
| 3013 | 3013 | $post = $page; |
| 3014 | 3014 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -3039,7 +3039,7 @@ discard block |
||
| 3039 | 3039 | add_filter( 'frm_use_wpautop', '__return_false' ); |
| 3040 | 3040 | |
| 3041 | 3041 | $opt = $args['success_opt']; |
| 3042 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
| 3042 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
| 3043 | 3043 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
| 3044 | 3044 | $success_url = do_shortcode( $success_url ); |
| 3045 | 3045 | |
@@ -3061,7 +3061,7 @@ discard block |
||
| 3061 | 3061 | // Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
| 3062 | 3062 | if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) { |
| 3063 | 3063 | self::print_open_in_new_tab_js_with_fallback_handler( $success_url, $args ); |
| 3064 | - self::$redirected_in_new_tab[ $args['form']->id ] = 1; |
|
| 3064 | + self::$redirected_in_new_tab[$args['form']->id] = 1; |
|
| 3065 | 3065 | return; |
| 3066 | 3066 | } |
| 3067 | 3067 | |
@@ -3371,7 +3371,7 @@ discard block |
||
| 3371 | 3371 | 'description' => false, |
| 3372 | 3372 | 'reset' => false, |
| 3373 | 3373 | ); |
| 3374 | - $args = wp_parse_args( $args, $defaults ); |
|
| 3374 | + $args = wp_parse_args( $args, $defaults ); |
|
| 3375 | 3375 | } |
| 3376 | 3376 | |
| 3377 | 3377 | /** |
@@ -3414,7 +3414,7 @@ discard block |
||
| 3414 | 3414 | $opt = $args['success_opt'] ?? 'success'; |
| 3415 | 3415 | |
| 3416 | 3416 | if ( $entry_id && is_numeric( $entry_id ) ) { |
| 3417 | - $message = $form->options[ $opt . '_msg' ] ?? $frm_settings->success_msg; |
|
| 3417 | + $message = $form->options[$opt . '_msg'] ?? $frm_settings->success_msg; |
|
| 3418 | 3418 | $class = 'frm_message'; |
| 3419 | 3419 | } else { |
| 3420 | 3420 | $message = $frm_settings->failed_msg; |
@@ -3672,8 +3672,8 @@ discard block |
||
| 3672 | 3672 | |
| 3673 | 3673 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 3674 | 3674 | |
| 3675 | - $html = FrmAppHelper::clip( |
|
| 3676 | - function () { |
|
| 3675 | + $html = FrmAppHelper::clip( |
|
| 3676 | + function() { |
|
| 3677 | 3677 | FrmAppHelper::maybe_autocomplete_pages_options( |
| 3678 | 3678 | array( |
| 3679 | 3679 | 'field_name' => 'frm_page_dropdown', |
@@ -145,7 +145,8 @@ |
||
| 145 | 145 | |
| 146 | 146 | if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) { |
| 147 | 147 | $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' ); |
| 148 | - } elseif ( ! isset( $_POST['item_name'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 148 | + } elseif ( ! isset( $_POST['item_name'] ) ) { |
|
| 149 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 149 | 150 | self::maybe_add_item_name( $value, $posted_field ); |
| 150 | 151 | } |
| 151 | 152 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | return $errors; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values[ 'frm_submit_entry_' . $values['form_id'] ] ) || ! wp_verify_nonce( $values[ 'frm_submit_entry_' . $values['form_id'] ], 'frm_submit_entry_nonce' ) ) ) { |
|
| 31 | + if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values['frm_submit_entry_' . $values['form_id']] ) || ! wp_verify_nonce( $values['frm_submit_entry_' . $values['form_id']], 'frm_submit_entry_nonce' ) ) ) { |
|
| 32 | 32 | $frm_settings = FrmAppHelper::get_settings(); |
| 33 | 33 | $errors['form'] = $frm_settings->admin_permission; |
| 34 | 34 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | ); |
| 150 | 150 | $args = wp_parse_args( $args, $defaults ); |
| 151 | 151 | |
| 152 | - $value = empty( $args['parent_field_id'] ) ? ( $values['item_meta'][ $args['id'] ] ?? '' ) : $values; |
|
| 152 | + $value = empty( $args['parent_field_id'] ) ? ( $values['item_meta'][$args['id']] ?? '' ) : $values; |
|
| 153 | 153 | |
| 154 | 154 | // Check for values in "Other" fields |
| 155 | 155 | FrmEntriesHelper::maybe_set_other_validation( $posted_field, $value, $args ); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) { |
| 170 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' ); |
|
| 170 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' ); |
|
| 171 | 171 | } elseif ( ! isset( $_POST['item_name'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 172 | 172 | self::maybe_add_item_name( $value, $posted_field ); |
| 173 | 173 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $option_is_valid = (bool) apply_filters( 'frm_option_is_valid', $option_is_valid, $value, $posted_field ); |
| 221 | 221 | |
| 222 | 222 | if ( ! $option_is_valid ) { |
| 223 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'invalid' ); |
|
| 223 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $posted_field, 'invalid' ); |
|
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | FrmFieldsHelper::prepare_new_front_field( $values, $field_object ); |
| 358 | 358 | |
| 359 | 359 | $separate_value = FrmField::get_option( $field_object, 'separate_value' ); |
| 360 | - $map_callback = function ( $option ) use ( $separate_value ) { |
|
| 360 | + $map_callback = function( $option ) use ( $separate_value ) { |
|
| 361 | 361 | if ( is_array( $option ) ) { |
| 362 | 362 | $option_value = $separate_value ? $option['value'] : $option['label']; |
| 363 | 363 | } else { |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $pattern = self::phone_format( $field ); |
| 454 | 454 | |
| 455 | 455 | if ( ! preg_match( $pattern, $value ) ) { |
| 456 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' ); |
|
| 456 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $field, 'invalid' ); |
|
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | } |
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | */ |
| 586 | 586 | private static function form_is_in_progress( $values ) { |
| 587 | 587 | return FrmAppHelper::pro_is_installed() && |
| 588 | - ( isset( $values[ 'frm_page_order_' . $values['form_id'] ] ) || FrmAppHelper::get_post_param( 'frm_next_page' ) ) && |
|
| 588 | + ( isset( $values['frm_page_order_' . $values['form_id']] ) || FrmAppHelper::get_post_param( 'frm_next_page' ) ) && |
|
| 589 | 589 | FrmField::get_all_types_in_form( $values['form_id'], 'break' ); |
| 590 | 590 | } |
| 591 | 591 | |
@@ -822,9 +822,9 @@ discard block |
||
| 822 | 822 | $found = self::is_akismet_guest_info_value( $key, $value, $field_id, $datas['name_field_ids'], $values ); |
| 823 | 823 | |
| 824 | 824 | if ( $found ) { |
| 825 | - $datas[ $key ] = $value; |
|
| 825 | + $datas[$key] = $value; |
|
| 826 | 826 | $datas['frm_duplicated'][] = $field_id; |
| 827 | - unset( $datas['missing_keys'][ $key_index ] ); |
|
| 827 | + unset( $datas['missing_keys'][$key_index] ); |
|
| 828 | 828 | } |
| 829 | 829 | } |
| 830 | 830 | }//end foreach |
@@ -869,12 +869,12 @@ discard block |
||
| 869 | 869 | continue; |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | - if ( isset( $fields[ $index + 1 ] ) && 'Last' === $fields[ $index + 1 ]->name ) { |
|
| 873 | - if ( empty( $values[ absint( $fields[ $index + 1 ]->id ) ] ) ) { |
|
| 872 | + if ( isset( $fields[$index + 1] ) && 'Last' === $fields[$index + 1]->name ) { |
|
| 873 | + if ( empty( $values[absint( $fields[$index + 1]->id )] ) ) { |
|
| 874 | 874 | continue; |
| 875 | 875 | } |
| 876 | 876 | |
| 877 | - $value .= ' ' . $values[ $fields[ $index + 1 ]->id ]; |
|
| 877 | + $value .= ' ' . $values[$fields[$index + 1]->id]; |
|
| 878 | 878 | return true; |
| 879 | 879 | } |
| 880 | 880 | } |
@@ -895,14 +895,14 @@ discard block |
||
| 895 | 895 | private static function get_name_text_fields( $form_id ) { |
| 896 | 896 | $name_text_fields_is_initialized = is_array( self::$name_text_fields ); |
| 897 | 897 | |
| 898 | - if ( $name_text_fields_is_initialized && isset( self::$name_text_fields[ $form_id ] ) ) { |
|
| 899 | - return self::$name_text_fields[ $form_id ]; |
|
| 898 | + if ( $name_text_fields_is_initialized && isset( self::$name_text_fields[$form_id] ) ) { |
|
| 899 | + return self::$name_text_fields[$form_id]; |
|
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | if ( ! $name_text_fields_is_initialized ) { |
| 903 | 903 | self::$name_text_fields = array(); |
| 904 | 904 | } |
| 905 | - self::$name_text_fields[ $form_id ] = FrmDb::get_results( |
|
| 905 | + self::$name_text_fields[$form_id] = FrmDb::get_results( |
|
| 906 | 906 | 'frm_fields', |
| 907 | 907 | array( |
| 908 | 908 | 'form_id' => $form_id, |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | array( 'order_by' => 'field_order ASC' ) |
| 914 | 914 | ); |
| 915 | 915 | |
| 916 | - return self::$name_text_fields[ $form_id ]; |
|
| 916 | + return self::$name_text_fields[$form_id]; |
|
| 917 | 917 | } |
| 918 | 918 | |
| 919 | 919 | /** |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | |
| 928 | 928 | // Send any potentially useful $_SERVER vars, but avoid sending junk we don't need. |
| 929 | 929 | if ( $include_value ) { |
| 930 | - $datas[ $key ] = $value; |
|
| 930 | + $datas[$key] = $value; |
|
| 931 | 931 | } |
| 932 | 932 | unset( $key, $value ); |
| 933 | 933 | } |
@@ -946,10 +946,10 @@ discard block |
||
| 946 | 946 | private static function add_comment_content_to_akismet( &$datas, $values ) { |
| 947 | 947 | if ( isset( $datas['frm_duplicated'] ) ) { |
| 948 | 948 | foreach ( $datas['frm_duplicated'] as $index ) { |
| 949 | - if ( isset( $values['item_meta'][ $index ] ) ) { |
|
| 950 | - unset( $values['item_meta'][ $index ] ); |
|
| 949 | + if ( isset( $values['item_meta'][$index] ) ) { |
|
| 950 | + unset( $values['item_meta'][$index] ); |
|
| 951 | 951 | } else { |
| 952 | - unset( $values[ $index ] ); |
|
| 952 | + unset( $values[$index] ); |
|
| 953 | 953 | } |
| 954 | 954 | } |
| 955 | 955 | unset( $datas['frm_duplicated'] ); |
@@ -971,15 +971,15 @@ discard block |
||
| 971 | 971 | $skipped_fields = self::get_akismet_skipped_field_ids( $values ); |
| 972 | 972 | |
| 973 | 973 | foreach ( $skipped_fields as $skipped_field ) { |
| 974 | - if ( ! isset( $values['item_meta'][ $skipped_field->id ] ) ) { |
|
| 974 | + if ( ! isset( $values['item_meta'][$skipped_field->id] ) ) { |
|
| 975 | 975 | continue; |
| 976 | 976 | } |
| 977 | 977 | |
| 978 | 978 | if ( self::should_really_skip_field( $skipped_field, $values ) ) { |
| 979 | - unset( $values['item_meta'][ $skipped_field->id ] ); |
|
| 979 | + unset( $values['item_meta'][$skipped_field->id] ); |
|
| 980 | 980 | |
| 981 | - if ( isset( $values['item_meta']['other'][ $skipped_field->id ] ) ) { |
|
| 982 | - unset( $values['item_meta']['other'][ $skipped_field->id ] ); |
|
| 981 | + if ( isset( $values['item_meta']['other'][$skipped_field->id] ) ) { |
|
| 982 | + unset( $values['item_meta']['other'][$skipped_field->id] ); |
|
| 983 | 983 | } |
| 984 | 984 | } |
| 985 | 985 | } |
@@ -1017,7 +1017,7 @@ discard block |
||
| 1017 | 1017 | } |
| 1018 | 1018 | |
| 1019 | 1019 | // If a choice field has Other option, but Other is not selected. |
| 1020 | - if ( empty( $values['item_meta']['other'][ $field_data->id ] ) ) { |
|
| 1020 | + if ( empty( $values['item_meta']['other'][$field_data->id] ) ) { |
|
| 1021 | 1021 | return true; |
| 1022 | 1022 | } |
| 1023 | 1023 | |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | foreach ( $field_data->options as $option ) { |
| 1026 | 1026 | $option_value = ! is_array( $option ) ? $option : ( $option['value'] ?? '' ); |
| 1027 | 1027 | |
| 1028 | - if ( $values['item_meta']['other'][ $field_data->id ] === $option_value ) { |
|
| 1028 | + if ( $values['item_meta']['other'][$field_data->id] === $option_value ) { |
|
| 1029 | 1029 | return true; |
| 1030 | 1030 | } |
| 1031 | 1031 | } |
@@ -1102,7 +1102,7 @@ discard block |
||
| 1102 | 1102 | |
| 1103 | 1103 | // Convert name array to string. |
| 1104 | 1104 | if ( isset( $value['first'] ) && isset( $value['last'] ) ) { |
| 1105 | - $values['item_meta'][ $field_id ] = trim( implode( ' ', $value ) ); |
|
| 1105 | + $values['item_meta'][$field_id] = trim( implode( ' ', $value ) ); |
|
| 1106 | 1106 | $values['name_field_ids'][] = $field_id; |
| 1107 | 1107 | continue; |
| 1108 | 1108 | } |
@@ -1123,8 +1123,8 @@ discard block |
||
| 1123 | 1123 | continue; |
| 1124 | 1124 | } |
| 1125 | 1125 | |
| 1126 | - if ( ! isset( $values['item_meta'][ $subsubindex ] ) ) { |
|
| 1127 | - $values['item_meta'][ $subsubindex ] = array(); |
|
| 1126 | + if ( ! isset( $values['item_meta'][$subsubindex] ) ) { |
|
| 1127 | + $values['item_meta'][$subsubindex] = array(); |
|
| 1128 | 1128 | } |
| 1129 | 1129 | |
| 1130 | 1130 | // Convert name array to string. |
@@ -1134,13 +1134,13 @@ discard block |
||
| 1134 | 1134 | $values['name_field_ids'][] = $subsubindex; |
| 1135 | 1135 | } |
| 1136 | 1136 | |
| 1137 | - if ( is_array( $values['item_meta'][ $subsubindex ] ) ) { |
|
| 1138 | - $values['item_meta'][ $subsubindex ][] = $subsubvalue; |
|
| 1137 | + if ( is_array( $values['item_meta'][$subsubindex] ) ) { |
|
| 1138 | + $values['item_meta'][$subsubindex][] = $subsubvalue; |
|
| 1139 | 1139 | } |
| 1140 | 1140 | } |
| 1141 | 1141 | }//end foreach |
| 1142 | 1142 | |
| 1143 | - unset( $values['item_meta'][ $field_id ] ); |
|
| 1143 | + unset( $values['item_meta'][$field_id] ); |
|
| 1144 | 1144 | }//end foreach |
| 1145 | 1145 | |
| 1146 | 1146 | return $form_ids; |
@@ -33,10 +33,10 @@ |
||
| 33 | 33 | 'turnstile' => 'FrmTurnstileSettings', |
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | - if ( ! isset( $settings_classes[ $active_captcha ] ) ) { |
|
| 36 | + if ( ! isset( $settings_classes[$active_captcha] ) ) { |
|
| 37 | 37 | $active_captcha = 'recaptcha'; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - return $settings_classes[ $active_captcha ]; |
|
| 40 | + return $settings_classes[$active_captcha]; |
|
| 41 | 41 | } |
| 42 | 42 | } |
@@ -138,7 +138,8 @@ |
||
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | // Only do this for single site installs. |
| 141 | - if ( is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 141 | + if ( is_network_admin() ) { |
|
| 142 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 142 | 143 | self::mark_onboarding_as_skipped(); |
| 143 | 144 | return; |
| 144 | 145 | } |
@@ -368,8 +368,8 @@ discard block |
||
| 368 | 368 | ); |
| 369 | 369 | |
| 370 | 370 | foreach ( $fields_to_update as $field => $sanitize_callback ) { |
| 371 | - if ( isset( $_POST[ $field ] ) ) { |
|
| 372 | - $usage_data[ $field ] = FrmAppHelper::get_post_param( $field, '', $sanitize_callback ); |
|
| 371 | + if ( isset( $_POST[$field] ) ) { |
|
| 372 | + $usage_data[$field] = FrmAppHelper::get_post_param( $field, '', $sanitize_callback ); |
|
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | 'is-disabled' => true, |
| 589 | 589 | 'help-text' => esc_html__( 'Customize form appearance with an intuitive styling interface.', 'formidable' ), |
| 590 | 590 | ); |
| 591 | - self::$available_addons['save-entries'] = array( |
|
| 591 | + self::$available_addons['save-entries'] = array( |
|
| 592 | 592 | 'title' => esc_html__( 'Save Entries', 'formidable' ), |
| 593 | 593 | 'is-checked' => true, |
| 594 | 594 | 'is-disabled' => true, |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | if ( ! is_plugin_active( $plugin_file ) && isset( $addon['url'] ) ) { |
| 658 | 658 | $is_installed = array_key_exists( $plugin_file, $plugins ); |
| 659 | 659 | |
| 660 | - self::$available_addons[ $key ] = array( |
|
| 660 | + self::$available_addons[$key] = array( |
|
| 661 | 661 | 'title' => $data['title'], |
| 662 | 662 | 'rel' => $is_installed ? $plugin_file : $addon['url'], |
| 663 | 663 | 'is-checked' => false, |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | foreach ( $errors as $field => $error ) { |
| 89 | 89 | $field_id = str_replace( 'field', '', $field ); |
| 90 | 90 | $error = self::maybe_modify_ajax_error( $error, $field_id, $form, $errors ); |
| 91 | - $obj[ $field_id ] = $error; |
|
| 91 | + $obj[$field_id] = $error; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | $response['errors'] = $obj; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | private static function fix_woocommerce_conflict() { |
| 120 | 120 | add_action( |
| 121 | 121 | 'wp_print_footer_scripts', |
| 122 | - function () { |
|
| 122 | + function() { |
|
| 123 | 123 | if ( ! function_exists( 'get_current_screen' ) ) { |
| 124 | 124 | require_once ABSPATH . 'wp-admin/includes/screen.php'; |
| 125 | 125 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | if ( is_admin() ) { |
| 19 | 19 | add_action( |
| 20 | 20 | 'elementor/editor/after_enqueue_styles', |
| 21 | - function () { |
|
| 21 | + function() { |
|
| 22 | 22 | wp_enqueue_style( 'font_icons', FrmAppHelper::plugin_url() . '/css/font_icons.css', array(), FrmAppHelper::plugin_version() ); |
| 23 | 23 | } |
| 24 | 24 | ); |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | private static function sort_templates( $applications ) { |
| 155 | 155 | usort( |
| 156 | 156 | $applications, |
| 157 | - function ( $a, $b ) { |
|
| 157 | + function( $a, $b ) { |
|
| 158 | 158 | return strcmp( $a['name'], $b['name'] ); |
| 159 | 159 | } |
| 160 | 160 | ); |
@@ -18,17 +18,17 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | foreach ( $type as $tb_type ) { |
| 20 | 20 | |
| 21 | - if ( ! isset( $tables[ $tb_type ] ) ) { |
|
| 21 | + if ( ! isset( $tables[$tb_type] ) ) { |
|
| 22 | 22 | do_action( 'frm_xml_import_' . $tb_type, $args ); |
| 23 | 23 | continue; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - if ( ! isset( $records[ $tb_type ] ) ) { |
|
| 26 | + if ( ! isset( $records[$tb_type] ) ) { |
|
| 27 | 27 | // No records. |
| 28 | 28 | continue; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - $item_ids = $records[ $tb_type ]; |
|
| 31 | + $item_ids = $records[$tb_type]; |
|
| 32 | 32 | |
| 33 | 33 | if ( in_array( $tb_type, array( 'styles', 'actions' ), true ) ) { |
| 34 | 34 | include __DIR__ . '/posts_xml.php'; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | include FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php'; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - unset( $item_ids, $records[ $tb_type ], $tb_type ); |
|
| 41 | + unset( $item_ids, $records[$tb_type], $tb_type ); |
|
| 42 | 42 | }//end foreach |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -148,7 +148,7 @@ |
||
| 148 | 148 | |
| 149 | 149 | register_deactivation_hook( |
| 150 | 150 | __FILE__, |
| 151 | - function () { |
|
| 151 | + function() { |
|
| 152 | 152 | if ( ! class_exists( 'FrmCronController', false ) ) { |
| 153 | 153 | require_once __DIR__ . '/classes/controllers/FrmCronController.php'; |
| 154 | 154 | } |