@@ -285,7 +285,7 @@ |
||
| 285 | 285 | 'type' => $field->type, |
| 286 | 286 | ); |
| 287 | 287 | |
| 288 | - $this->array_content[ $field->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
| 288 | + $this->array_content[$field->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | continue; |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - $this->maybe_convert_migrated_size( $widgets[ $k ]['size'] ); |
|
| 329 | + $this->maybe_convert_migrated_size( $widgets[$k]['size'] ); |
|
| 330 | 330 | } |
| 331 | 331 | update_option( 'widget_frm_show_form', $widgets ); |
| 332 | 332 | } |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) { |
| 423 | 423 | continue; |
| 424 | 424 | } |
| 425 | - $this->convert_character_to_px( $widgets[ $k ]['size'] ); |
|
| 425 | + $this->convert_character_to_px( $widgets[$k]['size'] ); |
|
| 426 | 426 | } |
| 427 | 427 | update_option( 'widget_frm_show_form', $widgets ); |
| 428 | 428 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function set_upgrader( &$upgrader ) { |
| 23 | 23 | if ( is_object( $upgrader ) ) { |
| 24 | - $this->upgrader =& $upgrader; |
|
| 24 | + $this->upgrader = & $upgrader; |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | 'sep' => ', ', |
| 40 | 40 | 'html' => false, |
| 41 | 41 | ); |
| 42 | - $atts = wp_parse_args( $atts, $defaults ); |
|
| 42 | + $atts = wp_parse_args( $atts, $defaults ); |
|
| 43 | 43 | |
| 44 | 44 | if ( $atts['html'] ) { |
| 45 | 45 | $atts['sep'] = ' '; |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | // validate the url format |
| 63 | 63 | if ( ! empty( $value ) && ! preg_match( '/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value ) ) { |
| 64 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 64 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 65 | 65 | } elseif ( $this->field->required == '1' && empty( $value ) ) { |
| 66 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' ); |
|
| 66 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' ); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | return $errors; |
@@ -59,8 +59,8 @@ |
||
| 59 | 59 | protected function init_saved_value( $entry ) { |
| 60 | 60 | if ( $this->field->type === 'html' ) { |
| 61 | 61 | $this->saved_value = $this->field->description; |
| 62 | - } elseif ( isset( $entry->metas[ $this->field->id ] ) ) { |
|
| 63 | - $this->saved_value = $entry->metas[ $this->field->id ]; |
|
| 62 | + } elseif ( isset( $entry->metas[$this->field->id] ) ) { |
|
| 63 | + $this->saved_value = $entry->metas[$this->field->id]; |
|
| 64 | 64 | } else { |
| 65 | 65 | $this->saved_value = ''; |
| 66 | 66 | } |
@@ -235,7 +235,7 @@ |
||
| 235 | 235 | if ( is_array( $upsell ) ) { |
| 236 | 236 | foreach ( $upsell as $k => $plugin ) { |
| 237 | 237 | if ( strpos( $plugin['slug'], 'wpforms' ) !== false ) { |
| 238 | - unset( $upsell[ $k ] ); |
|
| 238 | + unset( $upsell[$k] ); |
|
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | } |
@@ -491,7 +491,8 @@ |
||
| 491 | 491 | |
| 492 | 492 | public static function process_entry( $errors = '', $ajax = false ) { |
| 493 | 493 | $form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' ); |
| 494 | - if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 494 | + if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { |
|
| 495 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 495 | 496 | return; |
| 496 | 497 | } |
| 497 | 498 | |
@@ -77,20 +77,20 @@ discard block |
||
| 77 | 77 | global $frm_vars; |
| 78 | 78 | $form_id = FrmForm::get_current_form_id(); |
| 79 | 79 | |
| 80 | - $columns[ $form_id . '_id' ] = 'ID'; |
|
| 81 | - $columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 80 | + $columns[$form_id . '_id'] = 'ID'; |
|
| 81 | + $columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 82 | 82 | |
| 83 | 83 | if ( $form_id ) { |
| 84 | 84 | self::get_columns_for_form( $form_id, $columns ); |
| 85 | 85 | } else { |
| 86 | - $columns[ $form_id . '_form_id' ] = esc_html__( 'Form', 'formidable' ); |
|
| 87 | - $columns[ $form_id . '_name' ] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 88 | - $columns[ $form_id . '_user_id' ] = esc_html__( 'Created By', 'formidable' ); |
|
| 86 | + $columns[$form_id . '_form_id'] = esc_html__( 'Form', 'formidable' ); |
|
| 87 | + $columns[$form_id . '_name'] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 88 | + $columns[$form_id . '_user_id'] = esc_html__( 'Created By', 'formidable' ); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $columns[ $form_id . '_is_draft' ] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 92 | - $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' ); |
|
| 93 | - $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' ); |
|
| 91 | + $columns[$form_id . '_is_draft'] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 92 | + $columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' ); |
|
| 93 | + $columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' ); |
|
| 94 | 94 | self::maybe_add_ip_col( $form_id, $columns ); |
| 95 | 95 | |
| 96 | 96 | $frm_vars['cols'] = $columns; |
@@ -148,10 +148,10 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | foreach ( $sub_form_cols as $k => $sub_form_col ) { |
| 150 | 150 | if ( FrmField::is_no_save_field( $sub_form_col->type ) ) { |
| 151 | - unset( $sub_form_cols[ $k ] ); |
|
| 151 | + unset( $sub_form_cols[$k] ); |
|
| 152 | 152 | continue; |
| 153 | 153 | } |
| 154 | - $columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 154 | + $columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 155 | 155 | unset( $sub_form_col ); |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -168,15 +168,15 @@ discard block |
||
| 168 | 168 | $has_separate_value = ! FrmField::is_option_empty( $field, 'separate_value' ); |
| 169 | 169 | $is_post_status = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] === 'post_status'; |
| 170 | 170 | if ( $has_separate_value && ! $is_post_status ) { |
| 171 | - $columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 171 | + $columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - $columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 174 | + $columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | private static function maybe_add_ip_col( $form_id, &$columns ) { |
| 178 | 178 | if ( FrmAppHelper::ips_saved() ) { |
| 179 | - $columns[ $form_id . '_ip' ] = 'IP'; |
|
| 179 | + $columns[$form_id . '_ip'] = 'IP'; |
|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | foreach ( $meta_value as $mk => $mv ) { |
| 216 | 216 | // Remove blank values. |
| 217 | 217 | if ( empty( $mv ) ) { |
| 218 | - unset( $meta_value[ $mk ] ); |
|
| 218 | + unset( $meta_value[$mk] ); |
|
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | |
@@ -290,14 +290,14 @@ discard block |
||
| 290 | 290 | ); |
| 291 | 291 | |
| 292 | 292 | if ( ! $form_id ) { |
| 293 | - $columns[ $form_id . '_user_id' ] = 'user_id'; |
|
| 294 | - $columns[ $form_id . '_name' ] = 'name'; |
|
| 295 | - $columns[ $form_id . '_form_id' ] = 'form_id'; |
|
| 293 | + $columns[$form_id . '_user_id'] = 'user_id'; |
|
| 294 | + $columns[$form_id . '_name'] = 'name'; |
|
| 295 | + $columns[$form_id . '_form_id'] = 'form_id'; |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | foreach ( $fields as $field ) { |
| 299 | 299 | if ( self::field_supports_sorting( $field ) ) { |
| 300 | - $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id; |
|
| 300 | + $columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id; |
|
| 301 | 301 | } |
| 302 | 302 | } |
| 303 | 303 | |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $atts['form_id'] . '_item_key' => '', |
| 385 | 385 | $atts['form_id'] . '_id' => '', |
| 386 | 386 | ); |
| 387 | - $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 387 | + $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 388 | 388 | |
| 389 | 389 | $i = $atts['i']; |
| 390 | 390 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | |
| 396 | 396 | if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) { |
| 397 | 397 | $result[] = $col_key; |
| 398 | - --$i; |
|
| 398 | + -- $i; |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | unset( $col_key, $col ); |
@@ -545,9 +545,9 @@ discard block |
||
| 545 | 545 | if ( ! isset( $frm_vars['form_params'] ) ) { |
| 546 | 546 | $frm_vars['form_params'] = array(); |
| 547 | 547 | } |
| 548 | - $frm_vars['form_params'][ $form->id ] = $params; |
|
| 548 | + $frm_vars['form_params'][$form->id] = $params; |
|
| 549 | 549 | |
| 550 | - if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) { |
|
| 550 | + if ( isset( $frm_vars['created_entries'][$form_id] ) ) { |
|
| 551 | 551 | return; |
| 552 | 552 | } |
| 553 | 553 | |
@@ -563,16 +563,16 @@ discard block |
||
| 563 | 563 | */ |
| 564 | 564 | $errors = apply_filters( 'frm_entries_before_create', $errors, $form ); |
| 565 | 565 | |
| 566 | - $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors ); |
|
| 566 | + $frm_vars['created_entries'][$form_id] = array( 'errors' => $errors ); |
|
| 567 | 567 | |
| 568 | 568 | if ( empty( $errors ) ) { |
| 569 | 569 | $_POST['frm_skip_cookie'] = 1; |
| 570 | 570 | $do_success = false; |
| 571 | 571 | if ( $params['action'] === 'create' ) { |
| 572 | - if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) { |
|
| 573 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 572 | + if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) { |
|
| 573 | + $frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 574 | 574 | |
| 575 | - $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id']; |
|
| 575 | + $params['id'] = $frm_vars['created_entries'][$form_id]['entry_id']; |
|
| 576 | 576 | $do_success = true; |
| 577 | 577 | } |
| 578 | 578 | } |
@@ -114,13 +114,16 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public static function value_is_posted( $field, $args ) { |
| 116 | 116 | $value_is_posted = false; |
| 117 | - if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 117 | + if ( $_POST ) { |
|
| 118 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 118 | 119 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
| 119 | 120 | if ( $repeating ) { |
| 120 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 121 | + if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { |
|
| 122 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 121 | 123 | $value_is_posted = true; |
| 122 | 124 | } |
| 123 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 125 | + } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { |
|
| 126 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 124 | 127 | $value_is_posted = true; |
| 125 | 128 | } |
| 126 | 129 | } |
@@ -322,8 +325,10 @@ discard block |
||
| 322 | 325 | * @since 4.01 |
| 323 | 326 | */ |
| 324 | 327 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
| 325 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 326 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 328 | + if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { |
|
| 329 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 330 | + if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { |
|
| 331 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 327 | 332 | $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 328 | 333 | } |
| 329 | 334 | } else { |
@@ -395,7 +400,8 @@ discard block |
||
| 395 | 400 | self::set_other_repeating_vals( $field, $value, $args ); |
| 396 | 401 | |
| 397 | 402 | // Check if there are any posted "Other" values. |
| 398 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 403 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { |
|
| 404 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 399 | 405 | |
| 400 | 406 | // Save original value. |
| 401 | 407 | $args['temp_value'] = $value; |
@@ -425,7 +431,8 @@ discard block |
||
| 425 | 431 | } |
| 426 | 432 | |
| 427 | 433 | // Check if there are any other posted "other" values for this field. |
| 428 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 434 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { |
|
| 435 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 429 | 436 | // Save original value |
| 430 | 437 | $args['temp_value'] = $value; |
| 431 | 438 | $args['other'] = true; |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 138 | 138 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
| 139 | 139 | if ( $repeating ) { |
| 140 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 140 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 141 | 141 | $value_is_posted = true; |
| 142 | 142 | } |
| 143 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 143 | + } elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 144 | 144 | $value_is_posted = true; |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER ); |
| 173 | 173 | |
| 174 | 174 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 175 | - $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 175 | + $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 176 | 176 | if ( ! empty( $add_atts ) ) { |
| 177 | 177 | $this_atts = array_merge( $atts, $add_atts ); |
| 178 | 178 | } else { |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $default = FrmEntriesController::show_entry_shortcode( $this_atts ); |
| 183 | 183 | |
| 184 | 184 | // Add the default message. |
| 185 | - $message = str_replace( $shortcodes[0][ $short_key ], $default, $message ); |
|
| 185 | + $message = str_replace( $shortcodes[0][$short_key], $default, $message ); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | return $message; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @return string |
| 196 | 196 | */ |
| 197 | 197 | public static function prepare_display_value( $entry, $field, $atts ) { |
| 198 | - $field_value = $entry->metas[ $field->id ] ?? false; |
|
| 198 | + $field_value = $entry->metas[$field->id] ?? false; |
|
| 199 | 199 | |
| 200 | 200 | if ( FrmAppHelper::pro_is_installed() ) { |
| 201 | 201 | $empty = empty( $field_value ); |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true ); |
| 224 | 224 | } else { |
| 225 | 225 | // Get all values for this field. |
| 226 | - $child_values = $entry->metas[ $atts['embedded_field_id'] ] ?? false; |
|
| 226 | + $child_values = $entry->metas[$atts['embedded_field_id']] ?? false; |
|
| 227 | 227 | |
| 228 | 228 | if ( $child_values ) { |
| 229 | 229 | $child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) ); |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | $value = $args['temp_value']; |
| 346 | 346 | } |
| 347 | 347 | if ( empty( $args['parent_field_id'] ) ) { |
| 348 | - $_POST['item_meta'][ $field->id ] = $value; |
|
| 348 | + $_POST['item_meta'][$field->id] = $value; |
|
| 349 | 349 | } else { |
| 350 | 350 | self::set_parent_field_posted_value( $field, $value, $args ); |
| 351 | 351 | } |
@@ -357,17 +357,17 @@ discard block |
||
| 357 | 357 | * @since 4.01 |
| 358 | 358 | */ |
| 359 | 359 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
| 360 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 361 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 362 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 360 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 361 | + if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 362 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 363 | 363 | } |
| 364 | 364 | } else { |
| 365 | 365 | // All of the section was probably removed. |
| 366 | - $_POST['item_meta'][ $args['parent_field_id'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 367 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 366 | + $_POST['item_meta'][$args['parent_field_id']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 367 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 370 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | public static function get_posted_value( $field, &$value, $args ) { |
@@ -397,9 +397,9 @@ discard block |
||
| 397 | 397 | private static function get_posted_meta( $field_id, $args ) { |
| 398 | 398 | if ( empty( $args['parent_field_id'] ) ) { |
| 399 | 399 | // Sanitizing is done next. |
| 400 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 400 | + $value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 401 | 401 | } else { |
| 402 | - $value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 402 | + $value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 403 | 403 | } |
| 404 | 404 | return $value; |
| 405 | 405 | } |
@@ -430,14 +430,14 @@ discard block |
||
| 430 | 430 | self::set_other_repeating_vals( $field, $value, $args ); |
| 431 | 431 | |
| 432 | 432 | // Check if there are any posted "Other" values. |
| 433 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 433 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 434 | 434 | |
| 435 | 435 | // Save original value. |
| 436 | 436 | $args['temp_value'] = $value; |
| 437 | 437 | $args['other'] = true; |
| 438 | 438 | |
| 439 | 439 | // Sanitizing is done next. |
| 440 | - $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 440 | + $other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 441 | 441 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 442 | 442 | |
| 443 | 443 | // Set the validation value now |
@@ -460,12 +460,12 @@ discard block |
||
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | // Check if there are any other posted "other" values for this field. |
| 463 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 463 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 464 | 464 | // Save original value |
| 465 | 465 | $args['temp_value'] = $value; |
| 466 | 466 | $args['other'] = true; |
| 467 | 467 | |
| 468 | - $other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 468 | + $other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 469 | 469 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 470 | 470 | |
| 471 | 471 | // Set the validation value now. |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
| 493 | 493 | // Combine "Other" values with checked values. "Other" values will override checked box values. |
| 494 | 494 | foreach ( $other_vals as $k => $v ) { |
| 495 | - if ( isset( $value[ $k ] ) && trim( $v ) === '' ) { |
|
| 495 | + if ( isset( $value[$k] ) && trim( $v ) === '' ) { |
|
| 496 | 496 | // If the other box is checked, but doesn't have a value. |
| 497 | 497 | $value = ''; |
| 498 | 498 | break; |
@@ -509,25 +509,25 @@ discard block |
||
| 509 | 509 | |
| 510 | 510 | // Multi-select dropdown. |
| 511 | 511 | if ( is_array( $value ) ) { |
| 512 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
| 512 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
| 513 | 513 | |
| 514 | 514 | if ( $o_key !== false ) { |
| 515 | 515 | // Modify the original value so other key will be preserved. |
| 516 | - $value[ $other_key ] = $value[ $o_key ]; |
|
| 516 | + $value[$other_key] = $value[$o_key]; |
|
| 517 | 517 | |
| 518 | 518 | // By default, the array keys will be numeric for multi-select dropdowns. |
| 519 | 519 | // If going backwards and forwards between pages, the array key will match the other key. |
| 520 | 520 | if ( $o_key !== $other_key ) { |
| 521 | - unset( $value[ $o_key ] ); |
|
| 521 | + unset( $value[$o_key] ); |
|
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | $args['temp_value'] = $value; |
| 525 | - $value[ $other_key ] = reset( $other_vals ); |
|
| 526 | - if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) { |
|
| 527 | - unset( $value[ $other_key ] ); |
|
| 525 | + $value[$other_key] = reset( $other_vals ); |
|
| 526 | + if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) { |
|
| 527 | + unset( $value[$other_key] ); |
|
| 528 | 528 | } |
| 529 | 529 | } |
| 530 | - } elseif ( $field->options[ $other_key ] == $value ) { |
|
| 530 | + } elseif ( $field->options[$other_key] == $value ) { |
|
| 531 | 531 | $value = $other_vals; |
| 532 | 532 | }//end if |
| 533 | 533 | }//end if |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | * @return void |
| 775 | 775 | */ |
| 776 | 776 | public static function maybe_render_captcha_score( $entry_id ) { |
| 777 | - $query = array( |
|
| 777 | + $query = array( |
|
| 778 | 778 | 'item_id' => (int) $entry_id, |
| 779 | 779 | 'field_id' => 0, |
| 780 | 780 | ); |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | public static function get_entry_status_label( $status ) { |
| 829 | 829 | $statuses = self::get_entry_statuses(); |
| 830 | 830 | |
| 831 | - return $statuses[ self::get_entry_status( $status ) ]; |
|
| 831 | + return $statuses[self::get_entry_status( $status )]; |
|
| 832 | 832 | } |
| 833 | 833 | |
| 834 | 834 | /** |
@@ -42,7 +42,8 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Only do this for single site installs. |
| 45 | - if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 45 | + if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { |
|
| 46 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 46 | 47 | return; |
| 47 | 48 | } |
| 48 | 49 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function add_settings( $sections ) { |
| 185 | 185 | wp_enqueue_style( 'formidable-pro-fields' ); |
| 186 | - $sections[ $this->plugin_slug ] = array( |
|
| 186 | + $sections[$this->plugin_slug] = array( |
|
| 187 | 187 | 'class' => $this, |
| 188 | 188 | 'function' => 'settings_page', |
| 189 | 189 | 'name' => $this->plugin_name(), |
@@ -349,9 +349,9 @@ discard block |
||
| 349 | 349 | // Set the current step. |
| 350 | 350 | if ( ! isset( $step['current'] ) ) { |
| 351 | 351 | if ( $step['complete'] ) { |
| 352 | - $steps[ $k ]['current'] = false; |
|
| 352 | + $steps[$k]['current'] = false; |
|
| 353 | 353 | } else { |
| 354 | - $steps[ $k ]['current'] = ! $has_current; |
|
| 354 | + $steps[$k]['current'] = ! $has_current; |
|
| 355 | 355 | $has_current = true; |
| 356 | 356 | } |
| 357 | 357 | } elseif ( $step['current'] ) { |
@@ -361,10 +361,10 @@ discard block |
||
| 361 | 361 | // Set disabled buttons. |
| 362 | 362 | $class = $step['button_class'] ?? ''; |
| 363 | 363 | $class .= ' button-primary frm-button-primary'; |
| 364 | - if ( ! $steps[ $k ]['current'] ) { |
|
| 364 | + if ( ! $steps[$k]['current'] ) { |
|
| 365 | 365 | $class .= ' frm_grey disabled'; |
| 366 | 366 | } |
| 367 | - $steps[ $k ]['button_class'] = $class; |
|
| 367 | + $steps[$k]['button_class'] = $class; |
|
| 368 | 368 | }//end foreach |
| 369 | 369 | |
| 370 | 370 | return $steps; |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | $addons = $api->get_api_info(); |
| 520 | 520 | |
| 521 | 521 | $id = $this->download_id(); |
| 522 | - $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] ); |
|
| 522 | + $has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] ); |
|
| 523 | 523 | |
| 524 | 524 | if ( ! $step['current'] ) { |
| 525 | 525 | ?> |
@@ -534,10 +534,10 @@ discard block |
||
| 534 | 534 | |
| 535 | 535 | if ( ! $has_file ) { |
| 536 | 536 | echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>'; |
| 537 | - } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) { |
|
| 537 | + } elseif ( ! isset( $addons[$id]['beta']['package'] ) ) { |
|
| 538 | 538 | echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>'; |
| 539 | 539 | } else { |
| 540 | - $xml = $addons[ $id ]['beta']['package']; |
|
| 540 | + $xml = $addons[$id]['beta']['package']; |
|
| 541 | 541 | if ( is_array( $xml ) ) { |
| 542 | 542 | $xml = reset( $xml ); |
| 543 | 543 | } |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | foreach ( $options as $info ) { |
| 615 | 615 | // Count the number of options displayed for css. |
| 616 | 616 | if ( $count > 1 && ! isset( $info['img'] ) ) { |
| 617 | - --$count; |
|
| 617 | + -- $count; |
|
| 618 | 618 | } |
| 619 | 619 | } |
| 620 | 620 | $width = floor( ( 533 - ( ( $count - 1 ) * 20 ) ) / $count ); |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | foreach ( $forms as $form ) { |
| 705 | 705 | $was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false; |
| 706 | 706 | if ( $was_imported ) { |
| 707 | - $imported[ $form['form'] ] = $was_imported; |
|
| 707 | + $imported[$form['form']] = $was_imported; |
|
| 708 | 708 | } |
| 709 | 709 | } |
| 710 | 710 | |