@@ -119,7 +119,8 @@ |
||
119 | 119 | * @return void |
120 | 120 | */ |
121 | 121 | private static function maybe_hook_into_global_settings_save() { |
122 | - if ( empty( $_POST ) || ! isset( $_POST['style'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
122 | + if ( empty( $_POST ) || ! isset( $_POST['style'] ) ) { |
|
123 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
123 | 124 | // Avoid changing any style data if the style array is not sent in the request. |
124 | 125 | return; |
125 | 126 | } |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | } |
652 | 652 | |
653 | 653 | parse_str( $query, $parsed_query ); |
654 | - $form_id = ! empty( $parsed_query['form'] ) ? absint( $parsed_query['form'] ) : 0; |
|
654 | + $form_id = ! empty( $parsed_query['form'] ) ? absint( $parsed_query['form'] ) : 0; |
|
655 | 655 | |
656 | 656 | $style = new stdClass(); |
657 | 657 | $style->ID = end( $ids ); |
@@ -689,8 +689,8 @@ discard block |
||
689 | 689 | |
690 | 690 | $forms = FrmForm::get_published_forms(); |
691 | 691 | foreach ( $forms as $form ) { |
692 | - $new_style = ( isset( $_POST['style'] ) && isset( $_POST['style'][ $form->id ] ) ) ? sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
693 | - $previous_style = ( isset( $_POST['prev_style'] ) && isset( $_POST['prev_style'][ $form->id ] ) ) ? sanitize_text_field( wp_unslash( $_POST['prev_style'][ $form->id ] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
692 | + $new_style = ( isset( $_POST['style'] ) && isset( $_POST['style'][$form->id] ) ) ? sanitize_text_field( wp_unslash( $_POST['style'][$form->id] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
693 | + $previous_style = ( isset( $_POST['prev_style'] ) && isset( $_POST['prev_style'][$form->id] ) ) ? sanitize_text_field( wp_unslash( $_POST['prev_style'][$form->id] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
694 | 694 | if ( $new_style == $previous_style ) { |
695 | 695 | continue; |
696 | 696 | } |
@@ -1064,8 +1064,8 @@ discard block |
||
1064 | 1064 | */ |
1065 | 1065 | public static function get_style_val( $val, $form = 'default' ) { |
1066 | 1066 | $style = self::get_form_style( $form ); |
1067 | - if ( $style && isset( $style->post_content[ $val ] ) ) { |
|
1068 | - return $style->post_content[ $val ]; |
|
1067 | + if ( $style && isset( $style->post_content[$val] ) ) { |
|
1068 | + return $style->post_content[$val]; |
|
1069 | 1069 | } |
1070 | 1070 | } |
1071 | 1071 | |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | } elseif ( 'alt_bg_color' == $name ) { |
1085 | 1085 | $setting = 'bg_color_active'; |
1086 | 1086 | } |
1087 | - $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
1087 | + $default_styles[$name] = $style->post_content[$setting]; |
|
1088 | 1088 | unset( $name, $val ); |
1089 | 1089 | } |
1090 | 1090 |
@@ -84,21 +84,21 @@ discard block |
||
84 | 84 | $default_settings = $this->get_defaults(); |
85 | 85 | |
86 | 86 | foreach ( $default_settings as $setting => $default ) { |
87 | - if ( ! isset( $new_instance['post_content'][ $setting ] ) ) { |
|
88 | - $new_instance['post_content'][ $setting ] = $default; |
|
87 | + if ( ! isset( $new_instance['post_content'][$setting] ) ) { |
|
88 | + $new_instance['post_content'][$setting] = $default; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | if ( $this->is_color( $setting ) ) { |
92 | - $color_val = $new_instance['post_content'][ $setting ]; |
|
92 | + $color_val = $new_instance['post_content'][$setting]; |
|
93 | 93 | if ( $color_val !== '' && 0 === strpos( $color_val, 'rgb' ) ) { |
94 | 94 | // maybe sanitize if invalid rgba value is entered |
95 | 95 | $this->maybe_sanitize_rgba_value( $color_val ); |
96 | 96 | } |
97 | - $new_instance['post_content'][ $setting ] = str_replace( '#', '', $color_val ); |
|
98 | - } elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ), true ) && ! isset( $new_instance['post_content'][ $setting ] ) ) { |
|
99 | - $new_instance['post_content'][ $setting ] = 0; |
|
97 | + $new_instance['post_content'][$setting] = str_replace( '#', '', $color_val ); |
|
98 | + } elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ), true ) && ! isset( $new_instance['post_content'][$setting] ) ) { |
|
99 | + $new_instance['post_content'][$setting] = 0; |
|
100 | 100 | } elseif ( $setting === 'font' ) { |
101 | - $new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] ); |
|
101 | + $new_instance['post_content'][$setting] = $this->force_balanced_quotation( $new_instance['post_content'][$setting] ); |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
@@ -211,10 +211,10 @@ discard block |
||
211 | 211 | $valid_keys = array_keys( $defaults ); |
212 | 212 | $sanitized_settings = array(); |
213 | 213 | foreach ( $valid_keys as $key ) { |
214 | - if ( isset( $settings[ $key ] ) ) { |
|
215 | - $sanitized_settings[ $key ] = sanitize_textarea_field( $settings[ $key ] ); |
|
214 | + if ( isset( $settings[$key] ) ) { |
|
215 | + $sanitized_settings[$key] = sanitize_textarea_field( $settings[$key] ); |
|
216 | 216 | } else { |
217 | - $sanitized_settings[ $key ] = $defaults[ $key ]; |
|
217 | + $sanitized_settings[$key] = $defaults[$key]; |
|
218 | 218 | } |
219 | 219 | } |
220 | 220 | return $sanitized_settings; |
@@ -381,13 +381,13 @@ discard block |
||
381 | 381 | $style->post_content = $this->override_defaults( $style->post_content ); |
382 | 382 | $style->post_content = wp_parse_args( $style->post_content, $default_values ); |
383 | 383 | |
384 | - $styles[ $style->ID ] = $style; |
|
384 | + $styles[$style->ID] = $style; |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | if ( ! $default_style ) { |
388 | 388 | $default_style = reset( $styles ); |
389 | 389 | |
390 | - $styles[ $default_style->ID ]->menu_order = 1; |
|
390 | + $styles[$default_style->ID]->menu_order = 1; |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | return $styles; |
@@ -67,7 +67,8 @@ |
||
67 | 67 | $new_instance = (array) $new_instance; |
68 | 68 | $this->id = $new_instance['ID']; |
69 | 69 | |
70 | - if ( $id != $this->id || ! $_POST || ! isset( $_POST['frm_style_setting'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
70 | + if ( $id != $this->id || ! $_POST || ! isset( $_POST['frm_style_setting'] ) ) { |
|
71 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
71 | 72 | // Don't continue if not saving this style. |
72 | 73 | continue; |
73 | 74 | } |
@@ -285,7 +285,8 @@ |
||
285 | 285 | public static function get_settings_for_output( $style ) { |
286 | 286 | if ( self::previewing_style() ) { |
287 | 287 | $frm_style = new FrmStyle(); |
288 | - if ( isset( $_POST['frm_style_setting'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
288 | + if ( isset( $_POST['frm_style_setting'] ) ) { |
|
289 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
289 | 290 | |
290 | 291 | // Sanitizing is done later. |
291 | 292 | $posted = wp_unslash( $_POST['frm_style_setting'] ); //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | '-' => 'down', |
136 | 136 | '+' => 'up', |
137 | 137 | ); |
138 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
138 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
139 | 139 | } else { |
140 | 140 | //frm_minus1_icon |
141 | 141 | $key = str_replace( 'p', '', $key ); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | '-' => 'minus', |
144 | 144 | '+' => 'plus', |
145 | 145 | ); |
146 | - $class = 'frm_' . $plus[ $icon ]; |
|
146 | + $class = 'frm_' . $plus[$icon]; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | if ( $key ) { |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | ?> |
170 | 170 | <div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select"> |
171 | 171 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
172 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?> |
|
173 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?> |
|
172 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?> |
|
173 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?> |
|
174 | 174 | <b class="caret"></b> |
175 | 175 | </button> |
176 | 176 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | <li <?php echo ( $style->post_content['collapse_icon'] == $key ) ? 'class="active"' : ''; ?>> |
179 | 179 | <a href="javascript:void(0);"> |
180 | 180 | <label> |
181 | - <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?> /> |
|
181 | + <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?> /> |
|
182 | 182 | <span> |
183 | 183 | <?php |
184 | 184 | FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); |
@@ -271,15 +271,15 @@ discard block |
||
271 | 271 | $vars = array_diff( $vars, $remove ); |
272 | 272 | |
273 | 273 | foreach ( $vars as $var ) { |
274 | - if ( ! isset( $settings[ $var ] ) ) { |
|
274 | + if ( ! isset( $settings[$var] ) ) { |
|
275 | 275 | continue; |
276 | 276 | } |
277 | - if ( ! isset( $defaults[ $var ] ) ) { |
|
278 | - $defaults[ $var ] = ''; |
|
277 | + if ( ! isset( $defaults[$var] ) ) { |
|
278 | + $defaults[$var] = ''; |
|
279 | 279 | } |
280 | - $show = empty( $defaults ) || ( $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] ); |
|
280 | + $show = empty( $defaults ) || ( $settings[$var] !== '' && $settings[$var] !== $defaults[$var] ); |
|
281 | 281 | if ( $show ) { |
282 | - echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[ $var ] ) : esc_html( $settings[ $var ] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
282 | + echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[$var] ) : esc_html( $settings[$var] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | } |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | |
329 | 329 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
330 | 330 | foreach ( $checkbox_opts as $opt ) { |
331 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
332 | - $settings[ $opt ] = 0; |
|
331 | + if ( ! isset( $settings[$opt] ) ) { |
|
332 | + $settings[$opt] = 0; |
|
333 | 333 | } |
334 | 334 | } |
335 | 335 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $css = ''; |
358 | 358 | } |
359 | 359 | foreach ( $opts as $opt ) { |
360 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
360 | + self::get_color_output( $css, $settings[$opt] ); |
|
361 | 361 | } |
362 | 362 | } |
363 | 363 | } |
@@ -485,11 +485,11 @@ discard block |
||
485 | 485 | ), |
486 | 486 | ); |
487 | 487 | |
488 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
488 | + if ( ! isset( $available_status[$status] ) ) { |
|
489 | 489 | return; |
490 | 490 | } |
491 | 491 | |
492 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
492 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
493 | 493 | |
494 | 494 | $params = FrmForm::list_page_params(); |
495 | 495 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | check_admin_referer( $status . '_form_' . $params['id'] ); |
498 | 498 | |
499 | 499 | $count = 0; |
500 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
500 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
501 | 501 | $count ++; |
502 | 502 | } |
503 | 503 | |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
515 | 515 | $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>' ); |
516 | 516 | |
517 | - $message = $available_status[ $status ]['message']; |
|
517 | + $message = $available_status[$status]['message']; |
|
518 | 518 | |
519 | 519 | self::display_forms_list( $params, $message ); |
520 | 520 | } |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | 'type' => 'request', |
536 | 536 | ) |
537 | 537 | ); |
538 | - $message = sprintf( |
|
538 | + $message = sprintf( |
|
539 | 539 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
540 | 540 | _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' ), |
541 | 541 | $count, |
@@ -975,11 +975,11 @@ discard block |
||
975 | 975 | } |
976 | 976 | |
977 | 977 | foreach ( $template['categories'] as $category ) { |
978 | - if ( ! isset( $templates_by_category[ $category ] ) ) { |
|
979 | - $templates_by_category[ $category ] = array(); |
|
978 | + if ( ! isset( $templates_by_category[$category] ) ) { |
|
979 | + $templates_by_category[$category] = array(); |
|
980 | 980 | } |
981 | 981 | |
982 | - $templates_by_category[ $category ][] = $template; |
|
982 | + $templates_by_category[$category][] = $template; |
|
983 | 983 | } |
984 | 984 | } |
985 | 985 | unset( $template ); |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | $forms = FrmForm::get_published_forms( $where ); |
1009 | 1009 | $view_path = FrmAppHelper::plugin_path() . '/classes/views/frm-forms/'; |
1010 | 1010 | |
1011 | - $templates_by_category[ $my_templates_translation ] = $custom_templates; |
|
1011 | + $templates_by_category[$my_templates_translation] = $custom_templates; |
|
1012 | 1012 | |
1013 | 1013 | unset( $pricing, $license_type, $where ); |
1014 | 1014 | wp_enqueue_script( 'accordion' ); // register accordion for template groups |
@@ -1251,7 +1251,7 @@ discard block |
||
1251 | 1251 | |
1252 | 1252 | foreach ( array( 'landing', 'chat' ) as $feature ) { |
1253 | 1253 | if ( ! FrmAppHelper::show_new_feature( $feature ) ) { |
1254 | - unset( $sections[ $feature ] ); |
|
1254 | + unset( $sections[$feature] ); |
|
1255 | 1255 | } |
1256 | 1256 | } |
1257 | 1257 | |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | $section['id'] = $section['anchor']; |
1285 | 1285 | } |
1286 | 1286 | |
1287 | - $sections[ $key ] = $section; |
|
1287 | + $sections[$key] = $section; |
|
1288 | 1288 | } |
1289 | 1289 | |
1290 | 1290 | return $sections; |
@@ -1402,7 +1402,7 @@ discard block |
||
1402 | 1402 | if ( ! empty( $user_fields ) ) { |
1403 | 1403 | $user_helpers = array(); |
1404 | 1404 | foreach ( $user_fields as $uk => $uf ) { |
1405 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
1405 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
1406 | 1406 | unset( $uk, $uf ); |
1407 | 1407 | } |
1408 | 1408 | |
@@ -1534,7 +1534,7 @@ discard block |
||
1534 | 1534 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
1535 | 1535 | $frm_vars['js_validate_forms'] = array(); |
1536 | 1536 | } |
1537 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
1537 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
1538 | 1538 | } |
1539 | 1539 | |
1540 | 1540 | public static function get_email_html() { |
@@ -1689,7 +1689,7 @@ discard block |
||
1689 | 1689 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
1690 | 1690 | } else { |
1691 | 1691 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
1692 | - $action = $vars[ $action ]; |
|
1692 | + $action = $vars[$action]; |
|
1693 | 1693 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1694 | 1694 | $_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1695 | 1695 | $_POST = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -1823,7 +1823,7 @@ discard block |
||
1823 | 1823 | $actions = array(); |
1824 | 1824 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
1825 | 1825 | if ( is_object( $form ) ) { |
1826 | - $actions[ $form->id ] = $form->name; |
|
1826 | + $actions[$form->id] = $form->name; |
|
1827 | 1827 | } |
1828 | 1828 | unset( $form ); |
1829 | 1829 | } |
@@ -2065,8 +2065,8 @@ discard block |
||
2065 | 2065 | private static function get_saved_errors( $form, $params ) { |
2066 | 2066 | global $frm_vars; |
2067 | 2067 | |
2068 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2069 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
2068 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2069 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
2070 | 2070 | } else { |
2071 | 2071 | $errors = array(); |
2072 | 2072 | } |
@@ -2088,7 +2088,7 @@ discard block |
||
2088 | 2088 | public static function just_created_entry( $form_id ) { |
2089 | 2089 | global $frm_vars; |
2090 | 2090 | |
2091 | - 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; |
|
2091 | + 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; |
|
2092 | 2092 | } |
2093 | 2093 | |
2094 | 2094 | /** |
@@ -2112,7 +2112,7 @@ discard block |
||
2112 | 2112 | } |
2113 | 2113 | |
2114 | 2114 | $opt = 'success_action'; |
2115 | - $method = ( isset( $atts['form']->options[ $opt ] ) && ! empty( $atts['form']->options[ $opt ] ) ) ? $atts['form']->options[ $opt ] : 'message'; |
|
2115 | + $method = ( isset( $atts['form']->options[$opt] ) && ! empty( $atts['form']->options[$opt] ) ) ? $atts['form']->options[$opt] : 'message'; |
|
2116 | 2116 | $method = apply_filters( 'frm_success_filter', $method, $atts['form'], 'create' ); |
2117 | 2117 | |
2118 | 2118 | if ( $method != 'message' && ( ! $atts['entry_id'] || ! is_numeric( $atts['entry_id'] ) ) ) { |
@@ -2125,7 +2125,7 @@ discard block |
||
2125 | 2125 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
2126 | 2126 | if ( ! isset( $params['id'] ) ) { |
2127 | 2127 | global $frm_vars; |
2128 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
2128 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
2129 | 2129 | } |
2130 | 2130 | |
2131 | 2131 | $conf_method = self::get_confirmation_method( |
@@ -2184,7 +2184,7 @@ discard block |
||
2184 | 2184 | $args['success_opt'] = $opt; |
2185 | 2185 | $args['ajax'] = ! empty( $frm_vars['ajax'] ); |
2186 | 2186 | |
2187 | - if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
2187 | + if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
2188 | 2188 | self::load_page_after_submit( $args ); |
2189 | 2189 | } elseif ( $args['conf_method'] === 'redirect' ) { |
2190 | 2190 | self::redirect_after_submit( $args ); |
@@ -2329,7 +2329,7 @@ discard block |
||
2329 | 2329 | |
2330 | 2330 | $opt = 'update' === $args['action'] ? 'edit_' : 'success_'; |
2331 | 2331 | |
2332 | - $new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ]; |
|
2332 | + $new_args['conf_method'] = $new_args['form']->options[$opt . 'action']; |
|
2333 | 2333 | |
2334 | 2334 | /** |
2335 | 2335 | * Filters the run success action args. |
@@ -2349,8 +2349,8 @@ discard block |
||
2349 | 2349 | private static function load_page_after_submit( $args ) { |
2350 | 2350 | global $post; |
2351 | 2351 | $opt = $args['success_opt']; |
2352 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
2353 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
2352 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
2353 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
2354 | 2354 | $old_post = $post; |
2355 | 2355 | $post = $page; |
2356 | 2356 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -2366,7 +2366,7 @@ discard block |
||
2366 | 2366 | add_filter( 'frm_use_wpautop', '__return_false' ); |
2367 | 2367 | |
2368 | 2368 | $opt = $args['success_opt']; |
2369 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
2369 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
2370 | 2370 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
2371 | 2371 | $success_url = do_shortcode( $success_url ); |
2372 | 2372 | |
@@ -2397,7 +2397,7 @@ discard block |
||
2397 | 2397 | * @param array $args See {@see FrmFormsController::redirect_after_submit()}. |
2398 | 2398 | */ |
2399 | 2399 | private static function redirect_after_submit_using_js( $args ) { |
2400 | - $success_msg = isset( $args['form']->options[ $args['success_opt'] . '_msg' ] ) ? $args['form']->options[ $args['success_opt'] . '_msg' ] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
2400 | + $success_msg = isset( $args['form']->options[$args['success_opt'] . '_msg'] ) ? $args['form']->options[$args['success_opt'] . '_msg'] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
2401 | 2401 | $redirect_msg = self::get_redirect_message( $args['success_url'], $success_msg, $args ); |
2402 | 2402 | $delay_time = isset( $args['force_delay_redirect'] ) ? ( 1000 * $args['force_delay_redirect'] ) : 8000; |
2403 | 2403 | |
@@ -2527,7 +2527,7 @@ discard block |
||
2527 | 2527 | 'description' => false, |
2528 | 2528 | 'reset' => false, |
2529 | 2529 | ); |
2530 | - $args = wp_parse_args( $args, $defaults ); |
|
2530 | + $args = wp_parse_args( $args, $defaults ); |
|
2531 | 2531 | } |
2532 | 2532 | |
2533 | 2533 | /** |
@@ -2779,7 +2779,7 @@ discard block |
||
2779 | 2779 | |
2780 | 2780 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
2781 | 2781 | |
2782 | - $html = FrmAppHelper::clip( |
|
2782 | + $html = FrmAppHelper::clip( |
|
2783 | 2783 | function() { |
2784 | 2784 | FrmAppHelper::maybe_autocomplete_pages_options( |
2785 | 2785 | array( |
@@ -2850,27 +2850,27 @@ discard block |
||
2850 | 2850 | public static function populate_on_submit_data( &$form_options, $action = null, $event = 'create' ) { |
2851 | 2851 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
2852 | 2852 | if ( ! $action || ! is_object( $action ) ) { |
2853 | - $form_options[ $opt . 'action' ] = FrmOnSubmitHelper::get_default_action_type(); |
|
2854 | - $form_options[ $opt . 'msg' ] = FrmOnSubmitHelper::get_default_msg(); |
|
2853 | + $form_options[$opt . 'action'] = FrmOnSubmitHelper::get_default_action_type(); |
|
2854 | + $form_options[$opt . 'msg'] = FrmOnSubmitHelper::get_default_msg(); |
|
2855 | 2855 | return; |
2856 | 2856 | } |
2857 | 2857 | |
2858 | - $form_options[ $opt . 'action' ] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
2858 | + $form_options[$opt . 'action'] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
2859 | 2859 | |
2860 | - switch ( $form_options[ $opt . 'action' ] ) { |
|
2860 | + switch ( $form_options[$opt . 'action'] ) { |
|
2861 | 2861 | case 'redirect': |
2862 | - $form_options[ $opt . 'url' ] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
2862 | + $form_options[$opt . 'url'] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
2863 | 2863 | $form_options['redirect_msg'] = isset( $action->post_content['redirect_msg'] ) ? $action->post_content['redirect_msg'] : FrmOnSubmitHelper::get_default_redirect_msg(); |
2864 | - $form_options[ $opt . 'msg' ] = $form_options['redirect_msg']; |
|
2864 | + $form_options[$opt . 'msg'] = $form_options['redirect_msg']; |
|
2865 | 2865 | break; |
2866 | 2866 | |
2867 | 2867 | case 'page': |
2868 | - $form_options[ $opt . 'page_id' ] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
2868 | + $form_options[$opt . 'page_id'] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
2869 | 2869 | break; |
2870 | 2870 | |
2871 | 2871 | default: |
2872 | - $form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : FrmOnSubmitHelper::get_default_msg(); |
|
2873 | - $form_options['show_form'] = ! empty( $action->post_content['show_form'] ); |
|
2872 | + $form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : FrmOnSubmitHelper::get_default_msg(); |
|
2873 | + $form_options['show_form'] = ! empty( $action->post_content['show_form'] ); |
|
2874 | 2874 | } |
2875 | 2875 | } |
2876 | 2876 | |
@@ -2948,21 +2948,21 @@ discard block |
||
2948 | 2948 | private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) { |
2949 | 2949 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
2950 | 2950 | $data = array( |
2951 | - 'success_action' => $form_options[ $opt . 'action' ], |
|
2951 | + 'success_action' => $form_options[$opt . 'action'], |
|
2952 | 2952 | ); |
2953 | 2953 | |
2954 | - switch ( $form_options[ $opt . 'action' ] ) { |
|
2954 | + switch ( $form_options[$opt . 'action'] ) { |
|
2955 | 2955 | case 'redirect': |
2956 | - $data['success_url'] = isset( $form_options[ $opt . 'url' ] ) ? $form_options[ $opt . 'url' ] : ''; |
|
2957 | - $data['redirect_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : FrmOnSubmitHelper::get_default_redirect_msg(); |
|
2956 | + $data['success_url'] = isset( $form_options[$opt . 'url'] ) ? $form_options[$opt . 'url'] : ''; |
|
2957 | + $data['redirect_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : FrmOnSubmitHelper::get_default_redirect_msg(); |
|
2958 | 2958 | break; |
2959 | 2959 | |
2960 | 2960 | case 'page': |
2961 | - $data['success_page_id'] = isset( $form_options[ $opt . 'page_id' ] ) ? $form_options[ $opt . 'page_id' ] : ''; |
|
2961 | + $data['success_page_id'] = isset( $form_options[$opt . 'page_id'] ) ? $form_options[$opt . 'page_id'] : ''; |
|
2962 | 2962 | break; |
2963 | 2963 | |
2964 | 2964 | default: |
2965 | - $data['success_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : FrmOnSubmitHelper::get_default_msg(); |
|
2965 | + $data['success_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : FrmOnSubmitHelper::get_default_msg(); |
|
2966 | 2966 | $data['show_form'] = ! empty( $form_options['show_form'] ); |
2967 | 2967 | } |
2968 | 2968 | |
@@ -2997,8 +2997,8 @@ discard block |
||
2997 | 2997 | } |
2998 | 2998 | |
2999 | 2999 | foreach ( $options as $name ) { |
3000 | - if ( isset( $form->options[ $name ] ) ) { |
|
3001 | - unset( $form->options[ $name ] ); |
|
3000 | + if ( isset( $form->options[$name] ) ) { |
|
3001 | + unset( $form->options[$name] ); |
|
3002 | 3002 | } |
3003 | 3003 | } |
3004 | 3004 |
@@ -1672,7 +1672,8 @@ discard block |
||
1672 | 1672 | $vars = array(); |
1673 | 1673 | FrmAppHelper::include_svg(); |
1674 | 1674 | |
1675 | - if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1675 | + if ( isset( $_POST['frm_compact_fields'] ) ) { |
|
1676 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1676 | 1677 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
1677 | 1678 | |
1678 | 1679 | // Javascript needs to be allowed in some field settings. |
@@ -1982,7 +1983,8 @@ discard block |
||
1982 | 1983 | private static function maybe_get_form_to_show( $id ) { |
1983 | 1984 | $form = false; |
1984 | 1985 | |
1985 | - if ( ! empty( $id ) ) { // form id or key is set |
|
1986 | + if ( ! empty( $id ) ) { |
|
1987 | +// form id or key is set |
|
1986 | 1988 | $form = FrmForm::getOne( $id ); |
1987 | 1989 | if ( ! $form || $form->parent_form_id || $form->status === 'trash' ) { |
1988 | 1990 | $form = false; |
@@ -2065,7 +2067,8 @@ discard block |
||
2065 | 2067 | private static function get_saved_errors( $form, $params ) { |
2066 | 2068 | global $frm_vars; |
2067 | 2069 | |
2068 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2070 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
2071 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2069 | 2072 | $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
2070 | 2073 | } else { |
2071 | 2074 | $errors = array(); |
@@ -2218,7 +2221,8 @@ discard block |
||
2218 | 2221 | } |
2219 | 2222 | |
2220 | 2223 | if ( 'redirect' === FrmOnSubmitHelper::get_action_type( $action ) ) { |
2221 | - if ( $has_redirect ) { // Do not process because we run the first redirect action only. |
|
2224 | + if ( $has_redirect ) { |
|
2225 | +// Do not process because we run the first redirect action only. |
|
2222 | 2226 | continue; |
2223 | 2227 | } |
2224 | 2228 | |
@@ -2381,7 +2385,8 @@ discard block |
||
2381 | 2385 | if ( isset( $args['ajax'] ) && $args['ajax'] && $doing_ajax && empty( $args['force_delay_redirect'] ) ) { |
2382 | 2386 | echo json_encode( array( 'redirect' => $success_url ) ); |
2383 | 2387 | wp_die(); |
2384 | - } elseif ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) { // Not AJAX submit and there is just one On Submit action runs. |
|
2388 | + } elseif ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) { |
|
2389 | +// Not AJAX submit and there is just one On Submit action runs. |
|
2385 | 2390 | wp_redirect( esc_url_raw( $success_url ) ); |
2386 | 2391 | die(); // do not use wp_die or redirect fails |
2387 | 2392 | } else { |
@@ -2405,7 +2410,8 @@ discard block |
||
2405 | 2410 | |
2406 | 2411 | echo FrmAppHelper::maybe_kses( $redirect_msg ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
2407 | 2412 | echo '<script type="text/javascript">'; |
2408 | - if ( empty( $args['doing_ajax'] ) ) { // Not AJAX submit, delay JS until window.load. |
|
2413 | + if ( empty( $args['doing_ajax'] ) ) { |
|
2414 | +// Not AJAX submit, delay JS until window.load. |
|
2409 | 2415 | echo 'window.onload=function(){'; |
2410 | 2416 | } |
2411 | 2417 | echo 'setTimeout(function(){window.location="' . esc_url_raw( $args['success_url'] ) . '";}, ' . intval( $delay_time ) . ');'; |
@@ -203,7 +203,7 @@ |
||
203 | 203 | continue; |
204 | 204 | } |
205 | 205 | |
206 | - $value = $style->post_content[ $key ]; |
|
206 | + $value = $style->post_content[$key]; |
|
207 | 207 | |
208 | 208 | if ( in_array( $key, $color_settings, true ) && $value && '#' !== $value[0] && false === strpos( $value, 'rgb' ) ) { |
209 | 209 | $value = '#' . $value; |
@@ -168,7 +168,7 @@ |
||
168 | 168 | return; |
169 | 169 | } |
170 | 170 | |
171 | - unset( $dependencies[ $index ] ); |
|
171 | + unset( $dependencies[$index] ); |
|
172 | 172 | $dependencies = array_values( $dependencies ); |
173 | 173 | |
174 | 174 | $styles->registered['wp-admin']->deps = $dependencies; |
@@ -97,7 +97,8 @@ |
||
97 | 97 | array_walk( |
98 | 98 | $info, |
99 | 99 | function( $style, $key ) use ( $card_helper ) { |
100 | - if ( is_numeric( $key ) ) { // Skip active_sub/expires keys. |
|
100 | + if ( is_numeric( $key ) ) { |
|
101 | +// Skip active_sub/expires keys. |
|
101 | 102 | $card_helper->echo_card_template( $style ); |
102 | 103 | } |
103 | 104 | } |