@@ -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 | |
@@ -147,20 +147,20 @@ discard block |
||
| 147 | 147 | global $frm_vars; |
| 148 | 148 | $form_id = FrmForm::get_current_form_id(); |
| 149 | 149 | |
| 150 | - $columns[ $form_id . '_id' ] = 'ID'; |
|
| 151 | - $columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 150 | + $columns[$form_id . '_id'] = 'ID'; |
|
| 151 | + $columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 152 | 152 | |
| 153 | 153 | if ( $form_id ) { |
| 154 | 154 | self::get_columns_for_form( $form_id, $columns ); |
| 155 | 155 | } else { |
| 156 | - $columns[ $form_id . '_form_id' ] = esc_html__( 'Form', 'formidable' ); |
|
| 157 | - $columns[ $form_id . '_name' ] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 158 | - $columns[ $form_id . '_user_id' ] = esc_html__( 'Created By', 'formidable' ); |
|
| 156 | + $columns[$form_id . '_form_id'] = esc_html__( 'Form', 'formidable' ); |
|
| 157 | + $columns[$form_id . '_name'] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 158 | + $columns[$form_id . '_user_id'] = esc_html__( 'Created By', 'formidable' ); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - $columns[ $form_id . '_is_draft' ] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 162 | - $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' ); |
|
| 163 | - $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' ); |
|
| 161 | + $columns[$form_id . '_is_draft'] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 162 | + $columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' ); |
|
| 163 | + $columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' ); |
|
| 164 | 164 | self::maybe_add_ip_col( $form_id, $columns ); |
| 165 | 165 | |
| 166 | 166 | $frm_vars['cols'] = $columns; |
@@ -218,10 +218,10 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | foreach ( $sub_form_cols as $k => $sub_form_col ) { |
| 220 | 220 | if ( FrmField::is_no_save_field( $sub_form_col->type ) ) { |
| 221 | - unset( $sub_form_cols[ $k ] ); |
|
| 221 | + unset( $sub_form_cols[$k] ); |
|
| 222 | 222 | continue; |
| 223 | 223 | } |
| 224 | - $columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 224 | + $columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 225 | 225 | unset( $sub_form_col ); |
| 226 | 226 | } |
| 227 | 227 | } |
@@ -239,10 +239,10 @@ discard block |
||
| 239 | 239 | $is_post_status = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] === 'post_status'; |
| 240 | 240 | $include_column_for_sep_val = $has_separate_value && ! $is_post_status; |
| 241 | 241 | if ( $include_column_for_sep_val ) { |
| 242 | - $columns[ $form_id . '_frmsep_' . $col_id ] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val ); |
|
| 242 | + $columns[$form_id . '_frmsep_' . $col_id] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val ); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - $columns[ $form_id . '_' . $col_id ] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val, false ); |
|
| 245 | + $columns[$form_id . '_' . $col_id] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val, false ); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | /** |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | private static function maybe_add_ip_col( $form_id, &$columns ) { |
| 270 | 270 | if ( FrmAppHelper::ips_saved() ) { |
| 271 | - $columns[ $form_id . '_ip' ] = 'IP'; |
|
| 271 | + $columns[$form_id . '_ip'] = 'IP'; |
|
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | foreach ( $meta_value as $mk => $mv ) { |
| 308 | 308 | // Remove blank values. |
| 309 | 309 | if ( empty( $mv ) ) { |
| 310 | - unset( $meta_value[ $mk ] ); |
|
| 310 | + unset( $meta_value[$mk] ); |
|
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
@@ -384,14 +384,14 @@ discard block |
||
| 384 | 384 | ); |
| 385 | 385 | |
| 386 | 386 | if ( ! $form_id ) { |
| 387 | - $columns[ $form_id . '_user_id' ] = 'user_id'; |
|
| 388 | - $columns[ $form_id . '_name' ] = 'name'; |
|
| 389 | - $columns[ $form_id . '_form_id' ] = 'form_id'; |
|
| 387 | + $columns[$form_id . '_user_id'] = 'user_id'; |
|
| 388 | + $columns[$form_id . '_name'] = 'name'; |
|
| 389 | + $columns[$form_id . '_form_id'] = 'form_id'; |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | foreach ( $fields as $field ) { |
| 393 | 393 | if ( self::field_supports_sorting( $field ) ) { |
| 394 | - $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id; |
|
| 394 | + $columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id; |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | $atts['form_id'] . '_item_key' => '', |
| 479 | 479 | $atts['form_id'] . '_id' => '', |
| 480 | 480 | ); |
| 481 | - $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 481 | + $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 482 | 482 | |
| 483 | 483 | $i = $atts['i']; |
| 484 | 484 | |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | |
| 490 | 490 | if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) { |
| 491 | 491 | $result[] = $col_key; |
| 492 | - --$i; |
|
| 492 | + -- $i; |
|
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | unset( $col_key, $col ); |
@@ -637,9 +637,9 @@ discard block |
||
| 637 | 637 | if ( ! isset( $frm_vars['form_params'] ) ) { |
| 638 | 638 | $frm_vars['form_params'] = array(); |
| 639 | 639 | } |
| 640 | - $frm_vars['form_params'][ $form->id ] = $params; |
|
| 640 | + $frm_vars['form_params'][$form->id] = $params; |
|
| 641 | 641 | |
| 642 | - if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) { |
|
| 642 | + if ( isset( $frm_vars['created_entries'][$form_id] ) ) { |
|
| 643 | 643 | return; |
| 644 | 644 | } |
| 645 | 645 | |
@@ -655,16 +655,16 @@ discard block |
||
| 655 | 655 | */ |
| 656 | 656 | $errors = apply_filters( 'frm_entries_before_create', $errors, $form ); |
| 657 | 657 | |
| 658 | - $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors ); |
|
| 658 | + $frm_vars['created_entries'][$form_id] = array( 'errors' => $errors ); |
|
| 659 | 659 | |
| 660 | 660 | if ( empty( $errors ) ) { |
| 661 | 661 | $_POST['frm_skip_cookie'] = 1; |
| 662 | 662 | $do_success = false; |
| 663 | 663 | if ( $params['action'] === 'create' ) { |
| 664 | - if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) { |
|
| 665 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 664 | + if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) { |
|
| 665 | + $frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 666 | 666 | |
| 667 | - $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id']; |
|
| 667 | + $params['id'] = $frm_vars['created_entries'][$form_id]['entry_id']; |
|
| 668 | 668 | $do_success = true; |
| 669 | 669 | } |
| 670 | 670 | } |
@@ -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 | |