@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | 'user_id' => get_current_user_id(), |
109 | 109 | 'frm_strp_connect_mode' => $mode, |
110 | 110 | ); |
111 | - $data = self::post_to_connect_server( 'initialize', $additional_body ); |
|
111 | + $data = self::post_to_connect_server( 'initialize', $additional_body ); |
|
112 | 112 | |
113 | 113 | if ( is_string( $data ) ) { |
114 | 114 | return $data; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @return object|string |
144 | 144 | */ |
145 | 145 | private static function post_to_connect_server( $action, $additional_body = array() ) { |
146 | - $body = array( |
|
146 | + $body = array( |
|
147 | 147 | 'frm_strp_connect_action' => $action, |
148 | 148 | 'frm_strp_connect_mode' => FrmStrpLiteAppHelper::active_mode(), |
149 | 149 | ); |
@@ -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 dirname( __FILE__ ) . '/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 | /** |
@@ -87,6 +87,6 @@ |
||
87 | 87 | |
88 | 88 | ?></div> |
89 | 89 | <?php |
90 | - ++$option_index; |
|
90 | + ++ $option_index; |
|
91 | 91 | }//end foreach |
92 | 92 | }//end if |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $sub_field_class = "frm_form_field form-field frm_form_subfield-{$name} {$sub_field['wrapper_classes']}"; |
42 | 42 | $sub_field_desc = FrmField::get_option( $field, $name . '_desc' ); |
43 | 43 | |
44 | - if ( isset( $errors[ 'field' . $field_id . '-' . $name ] ) ) { |
|
44 | + if ( isset( $errors['field' . $field_id . '-' . $name] ) ) { |
|
45 | 45 | $sub_field_class .= ' frm_blank_field'; |
46 | 46 | } |
47 | 47 | ?> |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | <input |
62 | 62 | type="<?php echo esc_attr( $sub_field['type'] ); ?>" |
63 | 63 | id="<?php echo esc_attr( $html_id . '_' . $name ); ?>" |
64 | - value="<?php echo esc_attr( isset( $field_value[ $name ] ) ? $field_value[ $name ] : '' ); ?>" |
|
64 | + value="<?php echo esc_attr( isset( $field_value[$name] ) ? $field_value[$name] : '' ); ?>" |
|
65 | 65 | <?php |
66 | - if ( ! empty( $field_value[ $name ] ) ) { |
|
67 | - echo 'data-frmval="' . esc_attr( $field_value[ $name ] ) . '" '; |
|
66 | + if ( ! empty( $field_value[$name] ) ) { |
|
67 | + echo 'data-frmval="' . esc_attr( $field_value[$name] ) . '" '; |
|
68 | 68 | } |
69 | 69 | if ( empty( $args['remove_names'] ) ) { |
70 | 70 | echo 'name="' . esc_attr( $field_name ) . '[' . esc_attr( $name ) . ']" '; |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | // Don't show individual field errors when there is a combo field error. |
84 | - if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) { |
|
84 | + if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) { |
|
85 | 85 | ?> |
86 | - <div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div> |
|
86 | + <div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div> |
|
87 | 87 | <?php } ?> |
88 | 88 | </div> |
89 | 89 | <?php |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } else { |
102 | 102 | foreach ( $addons as $k => $addon ) { |
103 | 103 | if ( empty( $addon['excerpt'] ) && $k !== 'error' ) { |
104 | - unset( $addons[ $k ] ); |
|
104 | + unset( $addons[$k] ); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | foreach ( $list as $k => $info ) { |
204 | 204 | $info['slug'] = $k; |
205 | - $list[ $k ] = array_merge( $defaults, $info ); |
|
205 | + $list[$k] = array_merge( $defaults, $info ); |
|
206 | 206 | } |
207 | 207 | return $list; |
208 | 208 | } |
@@ -353,17 +353,17 @@ discard block |
||
353 | 353 | continue; |
354 | 354 | } |
355 | 355 | |
356 | - $wp_plugin = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array(); |
|
356 | + $wp_plugin = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array(); |
|
357 | 357 | $wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0'; |
358 | 358 | $plugin->slug = explode( '/', $folder )[0]; |
359 | 359 | |
360 | 360 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
361 | - $transient->response[ $folder ] = $plugin; |
|
361 | + $transient->response[$folder] = $plugin; |
|
362 | 362 | } else { |
363 | - $transient->no_update[ $folder ] = $plugin; |
|
363 | + $transient->no_update[$folder] = $plugin; |
|
364 | 364 | } |
365 | 365 | |
366 | - $transient->checked[ $folder ] = $wp_version; |
|
366 | + $transient->checked[$folder] = $wp_version; |
|
367 | 367 | |
368 | 368 | }//end foreach |
369 | 369 | |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | */ |
397 | 397 | protected static function is_installed( $plugin ) { |
398 | 398 | $all_plugins = self::get_plugins(); |
399 | - return isset( $all_plugins[ $plugin ] ); |
|
399 | + return isset( $all_plugins[$plugin] ); |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | /** |
@@ -435,13 +435,13 @@ discard block |
||
435 | 435 | } |
436 | 436 | |
437 | 437 | $download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0; |
438 | - if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
|
438 | + if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) { |
|
439 | 439 | // if this addon is using its own license, get the update url |
440 | 440 | $addon_info = $api->get_api_info(); |
441 | 441 | |
442 | - $version_info[ $download_id ] = $addon_info[ $download_id ]; |
|
442 | + $version_info[$download_id] = $addon_info[$download_id]; |
|
443 | 443 | if ( isset( $addon_info['error'] ) ) { |
444 | - $version_info[ $download_id ]['error'] = array( |
|
444 | + $version_info[$download_id]['error'] = array( |
|
445 | 445 | 'message' => $addon_info['error']['message'], |
446 | 446 | 'code' => $addon_info['error']['code'], |
447 | 447 | ); |
@@ -540,8 +540,8 @@ discard block |
||
540 | 540 | return $addon; |
541 | 541 | } |
542 | 542 | } |
543 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
544 | - $plugin = $addons[ $download_id ]; |
|
543 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
544 | + $plugin = $addons[$download_id]; |
|
545 | 545 | } |
546 | 546 | |
547 | 547 | return $plugin; |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | self::prepare_addon_link( $addon['link'] ); |
606 | 606 | |
607 | 607 | self::set_addon_status( $addon ); |
608 | - $addons[ $id ] = $addon; |
|
608 | + $addons[$id] = $addon; |
|
609 | 609 | }//end foreach |
610 | 610 | } |
611 | 611 | |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | 'utm_medium' => 'addons', |
647 | 647 | 'utm_campaign' => 'liteplugin', |
648 | 648 | ); |
649 | - $link = add_query_arg( $query_args, $link ); |
|
649 | + $link = add_query_arg( $query_args, $link ); |
|
650 | 650 | } |
651 | 651 | |
652 | 652 | /** |
@@ -1389,7 +1389,7 @@ discard block |
||
1389 | 1389 | $addons = $api->get_api_info(); |
1390 | 1390 | |
1391 | 1391 | if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) { |
1392 | - $dates = $addons[ $addon_id ]; |
|
1392 | + $dates = $addons[$addon_id]; |
|
1393 | 1393 | $requires = FrmFormsHelper::get_plan_required( $dates ); |
1394 | 1394 | } |
1395 | 1395 |
@@ -108,19 +108,19 @@ discard block |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | foreach ( $action_controls as $action ) { |
111 | - if ( isset( $groups[ $action->id_base ] ) || in_array( $action->id_base, $grouped ) ) { |
|
111 | + if ( isset( $groups[$action->id_base] ) || in_array( $action->id_base, $grouped ) ) { |
|
112 | 112 | continue; |
113 | 113 | } |
114 | 114 | |
115 | 115 | $this_group = $action->action_options['group']; |
116 | - if ( ! isset( $groups[ $this_group ] ) ) { |
|
116 | + if ( ! isset( $groups[$this_group] ) ) { |
|
117 | 117 | $this_group = 'misc'; |
118 | 118 | } |
119 | 119 | |
120 | - if ( ! isset( $groups[ $this_group ]['actions'] ) ) { |
|
121 | - $groups[ $this_group ]['actions'] = array(); |
|
120 | + if ( ! isset( $groups[$this_group]['actions'] ) ) { |
|
121 | + $groups[$this_group]['actions'] = array(); |
|
122 | 122 | } |
123 | - $groups[ $this_group ]['actions'][] = $action->id_base; |
|
123 | + $groups[$this_group]['actions'][] = $action->id_base; |
|
124 | 124 | |
125 | 125 | unset( $action ); |
126 | 126 | } |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | return $a; |
271 | 271 | } |
272 | 272 | |
273 | - $actions[ $a->id_base ] = $a; |
|
273 | + $actions[$a->id_base] = $a; |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | return $actions; |
@@ -301,16 +301,16 @@ discard block |
||
301 | 301 | $action_map = array(); |
302 | 302 | |
303 | 303 | foreach ( $action_controls as $key => $control ) { |
304 | - $action_map[ $control->id_base ] = $key; |
|
304 | + $action_map[$control->id_base] = $key; |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | foreach ( $form_actions as $action ) { |
308 | - if ( ! isset( $action_map[ $action->post_excerpt ] ) ) { |
|
308 | + if ( ! isset( $action_map[$action->post_excerpt] ) ) { |
|
309 | 309 | // don't try and show settings if action no longer exists |
310 | 310 | continue; |
311 | 311 | } |
312 | 312 | |
313 | - self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values ); |
|
313 | + self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values ); |
|
314 | 314 | } |
315 | 315 | } |
316 | 316 | |
@@ -539,8 +539,8 @@ discard block |
||
539 | 539 | } |
540 | 540 | |
541 | 541 | // Store actions so they can be triggered with the correct priority. |
542 | - $stored_actions[ $action->ID ] = $action; |
|
543 | - $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority']; |
|
542 | + $stored_actions[$action->ID] = $action; |
|
543 | + $action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority']; |
|
544 | 544 | |
545 | 545 | unset( $action ); |
546 | 546 | }//end foreach |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | new FrmNotification(); |
553 | 553 | |
554 | 554 | foreach ( $action_priority as $action_id => $priority ) { |
555 | - $action = $stored_actions[ $action_id ]; |
|
555 | + $action = $stored_actions[$action_id]; |
|
556 | 556 | do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event ); |
557 | 557 | do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form ); |
558 | 558 | |
@@ -599,12 +599,12 @@ discard block |
||
599 | 599 | } |
600 | 600 | |
601 | 601 | public function register( $action_class ) { |
602 | - $this->actions[ $action_class ] = new $action_class(); |
|
602 | + $this->actions[$action_class] = new $action_class(); |
|
603 | 603 | } |
604 | 604 | |
605 | 605 | public function unregister( $action_class ) { |
606 | - if ( isset( $this->actions[ $action_class ] ) ) { |
|
607 | - unset( $this->actions[ $action_class ] ); |
|
606 | + if ( isset( $this->actions[$action_class] ) ) { |
|
607 | + unset( $this->actions[$action_class] ); |
|
608 | 608 | } |
609 | 609 | } |
610 | 610 | |
@@ -613,8 +613,8 @@ discard block |
||
613 | 613 | |
614 | 614 | foreach ( $keys as $key ) { |
615 | 615 | // don't register new action if old action with the same id is already registered |
616 | - if ( ! isset( $this->actions[ $key ] ) ) { |
|
617 | - $this->actions[ $key ]->_register(); |
|
616 | + if ( ! isset( $this->actions[$key] ) ) { |
|
617 | + $this->actions[$key]->_register(); |
|
618 | 618 | } |
619 | 619 | } |
620 | 620 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $section['function'] = $original; |
159 | 159 | } |
160 | 160 | |
161 | - $sections[ $key ] = $section; |
|
161 | + $sections[$key] = $section; |
|
162 | 162 | }//end foreach |
163 | 163 | |
164 | 164 | return $sections; |
@@ -170,11 +170,11 @@ discard block |
||
170 | 170 | |
171 | 171 | $section = FrmAppHelper::get_post_param( 'tab', '', 'sanitize_text_field' ); |
172 | 172 | $sections = self::get_settings_tabs(); |
173 | - if ( ! isset( $sections[ $section ] ) ) { |
|
173 | + if ( ! isset( $sections[$section] ) ) { |
|
174 | 174 | wp_die(); |
175 | 175 | } |
176 | 176 | |
177 | - $section = $sections[ $section ]; |
|
177 | + $section = $sections[$section]; |
|
178 | 178 | |
179 | 179 | if ( isset( $section['class'] ) ) { |
180 | 180 | call_user_func( array( $section['class'], $section['function'] ) ); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | return; |
164 | 164 | } |
165 | 165 | |
166 | - $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : ''; |
|
166 | + $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : ''; |
|
167 | 167 | if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) { |
168 | 168 | return; |
169 | 169 | } |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | * @param string $value |
179 | 179 | */ |
180 | 180 | private static function get_selected_in_form( $form, $value = 'form' ) { |
181 | - if ( ! empty( $form ) && isset( $form[ $value ] ) && ! empty( $form[ $value ] ) ) { |
|
182 | - return $form[ $value ]; |
|
181 | + if ( ! empty( $form ) && isset( $form[$value] ) && ! empty( $form[$value] ) ) { |
|
182 | + return $form[$value]; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | return ''; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | } |
209 | 209 | |
210 | 210 | if ( $for === 'view' ) { |
211 | - $item_key = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys; |
|
211 | + $item_key = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys; |
|
212 | 212 | $shortcode = '[display-frm-data id=%1$s filter=limited]'; |
213 | 213 | } elseif ( $for === 'form' ) { |
214 | 214 | $item_key = $form_key; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | continue; |
224 | 224 | } |
225 | 225 | |
226 | - $page_ids[ $for ] = wp_insert_post( |
|
226 | + $page_ids[$for] = wp_insert_post( |
|
227 | 227 | array( |
228 | 228 | 'post_title' => $name, |
229 | 229 | 'post_type' => 'page', |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash |
378 | 378 | $file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] ); |
379 | 379 | $file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) ); |
380 | - if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) { |
|
380 | + if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) { |
|
381 | 381 | // allow other file types to be imported |
382 | 382 | do_action( 'frm_before_import_' . $file_type ); |
383 | 383 | |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | foreach ( $type as $tb_type ) { |
472 | 472 | $where = array(); |
473 | 473 | $join = ''; |
474 | - $table = $tables[ $tb_type ]; |
|
474 | + $table = $tables[$tb_type]; |
|
475 | 475 | |
476 | 476 | $select = $table . '.id'; |
477 | 477 | $query_vars = array(); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $table . '.parent_form_id' => $args['ids'], |
487 | 487 | ); |
488 | 488 | } else { |
489 | - $where[ $table . '.status !' ] = 'draft'; |
|
489 | + $where[$table . '.status !'] = 'draft'; |
|
490 | 490 | } |
491 | 491 | break; |
492 | 492 | case 'actions': |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | case 'items': |
500 | 500 | // $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)"; |
501 | 501 | if ( $args['ids'] ) { |
502 | - $where[ $table . '.form_id' ] = $args['ids']; |
|
502 | + $where[$table . '.form_id'] = $args['ids']; |
|
503 | 503 | } |
504 | 504 | break; |
505 | 505 | case 'styles': |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | } |
541 | 541 | }//end switch |
542 | 542 | |
543 | - $records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select ); |
|
543 | + $records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select ); |
|
544 | 544 | unset( $tb_type ); |
545 | 545 | }//end foreach |
546 | 546 | |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | $no_export_fields = FrmField::no_save_fields(); |
713 | 713 | foreach ( $csv_fields as $k => $f ) { |
714 | 714 | if ( in_array( $f->type, $no_export_fields, true ) ) { |
715 | - unset( $csv_fields[ $k ] ); |
|
715 | + unset( $csv_fields[$k] ); |
|
716 | 716 | } |
717 | 717 | } |
718 | 718 |
@@ -552,11 +552,11 @@ discard block |
||
552 | 552 | ), |
553 | 553 | ); |
554 | 554 | |
555 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
555 | + if ( ! isset( $available_status[$status] ) ) { |
|
556 | 556 | return; |
557 | 557 | } |
558 | 558 | |
559 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
559 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
560 | 560 | |
561 | 561 | $params = FrmForm::list_page_params(); |
562 | 562 | |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | check_admin_referer( $status . '_form_' . $params['id'] ); |
565 | 565 | |
566 | 566 | $count = 0; |
567 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
567 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
568 | 568 | $count ++; |
569 | 569 | } |
570 | 570 | |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
582 | 582 | $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>' ); |
583 | 583 | |
584 | - $message = $available_status[ $status ]['message']; |
|
584 | + $message = $available_status[$status]['message']; |
|
585 | 585 | |
586 | 586 | self::display_forms_list( $params, $message ); |
587 | 587 | } |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | 'type' => 'request', |
603 | 603 | ) |
604 | 604 | ); |
605 | - $message = sprintf( |
|
605 | + $message = sprintf( |
|
606 | 606 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
607 | 607 | _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' ), |
608 | 608 | $count, |
@@ -1184,7 +1184,7 @@ discard block |
||
1184 | 1184 | |
1185 | 1185 | foreach ( array( 'landing', 'chat', 'abandonment' ) as $feature ) { |
1186 | 1186 | if ( ! FrmAppHelper::show_new_feature( $feature ) ) { |
1187 | - unset( $sections[ $feature ] ); |
|
1187 | + unset( $sections[$feature] ); |
|
1188 | 1188 | } |
1189 | 1189 | } |
1190 | 1190 | |
@@ -1217,7 +1217,7 @@ discard block |
||
1217 | 1217 | $section['id'] = $section['anchor']; |
1218 | 1218 | } |
1219 | 1219 | |
1220 | - $sections[ $key ] = $section; |
|
1220 | + $sections[$key] = $section; |
|
1221 | 1221 | }//end foreach |
1222 | 1222 | |
1223 | 1223 | return $sections; |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | if ( ! empty( $user_fields ) ) { |
1336 | 1336 | $user_helpers = array(); |
1337 | 1337 | foreach ( $user_fields as $uk => $uf ) { |
1338 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
1338 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
1339 | 1339 | unset( $uk, $uf ); |
1340 | 1340 | } |
1341 | 1341 | |
@@ -1474,7 +1474,7 @@ discard block |
||
1474 | 1474 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
1475 | 1475 | $frm_vars['js_validate_forms'] = array(); |
1476 | 1476 | } |
1477 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
1477 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
1478 | 1478 | } |
1479 | 1479 | |
1480 | 1480 | public static function get_email_html() { |
@@ -1633,7 +1633,7 @@ discard block |
||
1633 | 1633 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
1634 | 1634 | } else { |
1635 | 1635 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
1636 | - $action = $vars[ $action ]; |
|
1636 | + $action = $vars[$action]; |
|
1637 | 1637 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1638 | 1638 | $_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1639 | 1639 | $_POST = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -1801,7 +1801,7 @@ discard block |
||
1801 | 1801 | $actions = array(); |
1802 | 1802 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
1803 | 1803 | if ( is_object( $form ) ) { |
1804 | - $actions[ $form->id ] = $form->name; |
|
1804 | + $actions[$form->id] = $form->name; |
|
1805 | 1805 | } |
1806 | 1806 | unset( $form ); |
1807 | 1807 | } |
@@ -2046,8 +2046,8 @@ discard block |
||
2046 | 2046 | private static function get_saved_errors( $form, $params ) { |
2047 | 2047 | global $frm_vars; |
2048 | 2048 | |
2049 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2050 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
2049 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2050 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
2051 | 2051 | } else { |
2052 | 2052 | $errors = array(); |
2053 | 2053 | } |
@@ -2069,7 +2069,7 @@ discard block |
||
2069 | 2069 | public static function just_created_entry( $form_id ) { |
2070 | 2070 | global $frm_vars; |
2071 | 2071 | |
2072 | - 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; |
|
2072 | + 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; |
|
2073 | 2073 | } |
2074 | 2074 | |
2075 | 2075 | /** |
@@ -2089,7 +2089,7 @@ discard block |
||
2089 | 2089 | private static function get_confirmation_method( $atts ) { |
2090 | 2090 | $action = FrmOnSubmitHelper::current_event( $atts ); |
2091 | 2091 | $opt = 'update' === $action ? 'edit_action' : 'success_action'; |
2092 | - $method = ( isset( $atts['form']->options[ $opt ] ) && ! empty( $atts['form']->options[ $opt ] ) ) ? $atts['form']->options[ $opt ] : 'message'; |
|
2092 | + $method = ( isset( $atts['form']->options[$opt] ) && ! empty( $atts['form']->options[$opt] ) ) ? $atts['form']->options[$opt] : 'message'; |
|
2093 | 2093 | |
2094 | 2094 | if ( ! empty( $atts['entry_id'] ) ) { |
2095 | 2095 | $met_actions = self::get_met_on_submit_actions( $atts, $action ); |
@@ -2110,7 +2110,7 @@ discard block |
||
2110 | 2110 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
2111 | 2111 | if ( ! isset( $params['id'] ) ) { |
2112 | 2112 | global $frm_vars; |
2113 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
2113 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
2114 | 2114 | } |
2115 | 2115 | |
2116 | 2116 | $conf_method = self::get_confirmation_method( |
@@ -2192,7 +2192,7 @@ discard block |
||
2192 | 2192 | $args['success_opt'] = $opt; |
2193 | 2193 | $args['ajax'] = ! empty( $frm_vars['ajax'] ); |
2194 | 2194 | |
2195 | - if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
2195 | + if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
2196 | 2196 | self::load_page_after_submit( $args ); |
2197 | 2197 | } elseif ( $args['conf_method'] === 'redirect' ) { |
2198 | 2198 | self::redirect_after_submit( $args ); |
@@ -2216,7 +2216,7 @@ discard block |
||
2216 | 2216 | } |
2217 | 2217 | |
2218 | 2218 | // If a redirect action has already opened the URL in a new tab, we show the default message in the currect tab. |
2219 | - if ( ! empty( self::$redirected_in_new_tab[ $args['form']->id ] ) ) { |
|
2219 | + if ( ! empty( self::$redirected_in_new_tab[$args['form']->id] ) ) { |
|
2220 | 2220 | return array( FrmOnSubmitHelper::get_fallback_action_after_open_in_new_tab( $event ) ); |
2221 | 2221 | } |
2222 | 2222 | |
@@ -2404,7 +2404,7 @@ discard block |
||
2404 | 2404 | |
2405 | 2405 | $opt = 'update' === $args['action'] ? 'edit_' : 'success_'; |
2406 | 2406 | |
2407 | - $new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ]; |
|
2407 | + $new_args['conf_method'] = $new_args['form']->options[$opt . 'action']; |
|
2408 | 2408 | |
2409 | 2409 | /** |
2410 | 2410 | * Filters the run success action args. |
@@ -2424,8 +2424,8 @@ discard block |
||
2424 | 2424 | private static function load_page_after_submit( $args ) { |
2425 | 2425 | global $post; |
2426 | 2426 | $opt = $args['success_opt']; |
2427 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
2428 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
2427 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
2428 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
2429 | 2429 | $old_post = $post; |
2430 | 2430 | $post = $page; |
2431 | 2431 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -2455,7 +2455,7 @@ discard block |
||
2455 | 2455 | add_filter( 'frm_use_wpautop', '__return_false' ); |
2456 | 2456 | |
2457 | 2457 | $opt = $args['success_opt']; |
2458 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
2458 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
2459 | 2459 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
2460 | 2460 | $success_url = do_shortcode( $success_url ); |
2461 | 2461 | |
@@ -2477,7 +2477,7 @@ discard block |
||
2477 | 2477 | // Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
2478 | 2478 | if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) { |
2479 | 2479 | self::print_open_in_new_tab_js_with_fallback_handler( $success_url, $args ); |
2480 | - self::$redirected_in_new_tab[ $args['form']->id ] = 1; |
|
2480 | + self::$redirected_in_new_tab[$args['form']->id] = 1; |
|
2481 | 2481 | return; |
2482 | 2482 | } |
2483 | 2483 | |
@@ -2739,7 +2739,7 @@ discard block |
||
2739 | 2739 | 'description' => false, |
2740 | 2740 | 'reset' => false, |
2741 | 2741 | ); |
2742 | - $args = wp_parse_args( $args, $defaults ); |
|
2742 | + $args = wp_parse_args( $args, $defaults ); |
|
2743 | 2743 | } |
2744 | 2744 | |
2745 | 2745 | /** |
@@ -2777,7 +2777,7 @@ discard block |
||
2777 | 2777 | $opt = isset( $args['success_opt'] ) ? $args['success_opt'] : 'success'; |
2778 | 2778 | |
2779 | 2779 | if ( $entry_id && is_numeric( $entry_id ) ) { |
2780 | - $message = isset( $form->options[ $opt . '_msg' ] ) ? $form->options[ $opt . '_msg' ] : $frm_settings->success_msg; |
|
2780 | + $message = isset( $form->options[$opt . '_msg'] ) ? $form->options[$opt . '_msg'] : $frm_settings->success_msg; |
|
2781 | 2781 | $class = 'frm_message'; |
2782 | 2782 | } else { |
2783 | 2783 | $message = $frm_settings->failed_msg; |
@@ -3000,7 +3000,7 @@ discard block |
||
3000 | 3000 | |
3001 | 3001 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
3002 | 3002 | |
3003 | - $html = FrmAppHelper::clip( |
|
3003 | + $html = FrmAppHelper::clip( |
|
3004 | 3004 | function() { |
3005 | 3005 | FrmAppHelper::maybe_autocomplete_pages_options( |
3006 | 3006 | array( |
@@ -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(); |