@@ -46,19 +46,19 @@ discard block |
||
| 46 | 46 | $result = array(); |
| 47 | 47 | |
| 48 | 48 | foreach ( $names as $name ) { |
| 49 | - if ( empty( $this->sub_fields[ $name ] ) ) { |
|
| 49 | + if ( empty( $this->sub_fields[$name] ) ) { |
|
| 50 | 50 | continue; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if ( ! isset( $this->sub_fields[ $name ]['wrapper_classes'] ) ) { |
|
| 54 | - $this->sub_fields[ $name ]['wrapper_classes'] = $col_class; |
|
| 55 | - } elseif ( is_array( $this->sub_fields[ $name ]['wrapper_classes'] ) ) { |
|
| 56 | - $this->sub_fields[ $name ]['wrapper_classes'] = implode( ' ', $this->sub_fields[ $name ]['wrapper_classes'] ) . ' ' . $col_class; |
|
| 53 | + if ( ! isset( $this->sub_fields[$name]['wrapper_classes'] ) ) { |
|
| 54 | + $this->sub_fields[$name]['wrapper_classes'] = $col_class; |
|
| 55 | + } elseif ( is_array( $this->sub_fields[$name]['wrapper_classes'] ) ) { |
|
| 56 | + $this->sub_fields[$name]['wrapper_classes'] = implode( ' ', $this->sub_fields[$name]['wrapper_classes'] ) . ' ' . $col_class; |
|
| 57 | 57 | } else { |
| 58 | - $this->sub_fields[ $name ]['wrapper_classes'] .= ' ' . $col_class; |
|
| 58 | + $this->sub_fields[$name]['wrapper_classes'] .= ' ' . $col_class; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - $result[ $name ] = $this->sub_fields[ $name ]; |
|
| 61 | + $result[$name] = $this->sub_fields[$name]; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | return $result; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | // Default desc. |
| 91 | 91 | foreach ( $this->sub_fields as $name => $sub_field ) { |
| 92 | - $extra_options[ $name . '_desc' ] = $sub_field['label']; |
|
| 92 | + $extra_options[$name . '_desc'] = $sub_field['label']; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | return $extra_options; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $name_layout = $this->get_name_layout(); |
| 126 | 126 | |
| 127 | 127 | if ( ! empty( $atts['show'] ) ) { |
| 128 | - return isset( $value[ $atts['show'] ] ) ? $value[ $atts['show'] ] : ''; |
|
| 128 | + return isset( $value[$atts['show']] ) ? $value[$atts['show']] : ''; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | $value = wp_parse_args( |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | $args['sub_fields'] = $this->sub_fields; |
| 199 | 199 | |
| 200 | 200 | foreach ( $hidden_fields as $name => $hidden_field ) { |
| 201 | - $args['sub_fields'][ $name ]['wrapper_classes'] .= ' frm_hidden'; |
|
| 201 | + $args['sub_fields'][$name]['wrapper_classes'] .= ' frm_hidden'; |
|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $grid_helper = new FrmFieldGridHelper(); |
| 31 | 31 | $values['count'] = 0; |
| 32 | 32 | foreach ( $values['fields'] as $field ) { |
| 33 | - $values['count']++; |
|
| 33 | + $values['count'] ++; |
|
| 34 | 34 | $grid_helper->set_field( $field ); |
| 35 | 35 | $grid_helper->maybe_begin_field_wrapper(); |
| 36 | 36 | FrmFieldsController::load_single_field( $field, $values ); |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | |
| 87 | 87 | foreach ( $forms as $form ) { |
| 88 | 88 | $form_title = '' === $form->name ? __( '(no title)', 'formidable' ) : FrmAppHelper::truncate( $form->name, 50 ); |
| 89 | - $options[ $form->id ] = esc_html( $form_title ); |
|
| 89 | + $options[$form->id] = esc_html( $form_title ); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | return $options; |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $_GET['page'] = 'formidable'; |
| 20 | 20 | |
| 21 | - $values = array( |
|
| 21 | + $values = array( |
|
| 22 | 22 | 'id' => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ), |
| 23 | 23 | 'doing_ajax' => true, |
| 24 | 24 | ); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | ob_start(); |
| 43 | 43 | self::load_single_field( $field, $values ); |
| 44 | - $field_html[ absint( $field->id ) ] = ob_get_contents(); |
|
| 44 | + $field_html[absint( $field->id )] = ob_get_contents(); |
|
| 45 | 45 | ob_end_clean(); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | foreach ( $opts as $opt_key => $opt ) { |
| 257 | 257 | if ( strpos( $opt, '|' ) !== false ) { |
| 258 | 258 | $vals = explode( '|', $opt ); |
| 259 | - $opts[ $opt_key ] = array( |
|
| 259 | + $opts[$opt_key] = array( |
|
| 260 | 260 | 'label' => trim( $vals[0] ), |
| 261 | 261 | 'value' => trim( $vals[1] ), |
| 262 | 262 | ); |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $other_array = array(); |
| 272 | 272 | foreach ( $field['options'] as $opt_key => $opt ) { |
| 273 | 273 | if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) { |
| 274 | - $other_array[ $opt_key ] = $opt; |
|
| 274 | + $other_array[$opt_key] = $opt; |
|
| 275 | 275 | } |
| 276 | 276 | unset( $opt_key, $opt ); |
| 277 | 277 | } |
@@ -313,18 +313,18 @@ discard block |
||
| 313 | 313 | $disabled_fields = FrmAppHelper::pro_is_installed() ? array() : $pro_field_selection; |
| 314 | 314 | $frm_settings = FrmAppHelper::get_settings(); |
| 315 | 315 | |
| 316 | - if ( ! isset( $all_field_types[ $field['type'] ] ) ) { |
|
| 316 | + if ( ! isset( $all_field_types[$field['type']] ) ) { |
|
| 317 | 317 | // Add fallback for an add-on field type that has been deactivated. |
| 318 | - $all_field_types[ $field['type'] ] = array( |
|
| 318 | + $all_field_types[$field['type']] = array( |
|
| 319 | 319 | 'name' => ucfirst( $field['type'] ), |
| 320 | 320 | 'icon' => 'frm_icon_font frm_pencil_icon', |
| 321 | 321 | ); |
| 322 | - } elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) { |
|
| 322 | + } elseif ( ! is_array( $all_field_types[$field['type']] ) ) { |
|
| 323 | 323 | // Fallback for fields added in a more basic way. |
| 324 | - FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] ); |
|
| 324 | + FrmFormsHelper::prepare_field_type( $all_field_types[$field['type']] ); |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | - $type_name = $all_field_types[ $field['type'] ]['name']; |
|
| 327 | + $type_name = $all_field_types[$field['type']]['name']; |
|
| 328 | 328 | if ( $field['type'] === 'divider' && FrmField::is_option_true( $field, 'repeat' ) ) { |
| 329 | 329 | $type_name = $all_field_types['divider|repeat']['name']; |
| 330 | 330 | } |
@@ -387,13 +387,13 @@ discard block |
||
| 387 | 387 | $active = 'default_value'; |
| 388 | 388 | |
| 389 | 389 | foreach ( $settings as $type ) { |
| 390 | - if ( ! empty( $field[ $type ] ) ) { |
|
| 390 | + if ( ! empty( $field[$type] ) ) { |
|
| 391 | 391 | $active = $type; |
| 392 | 392 | } |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | - $types[ $active ]['class'] .= ' current'; |
|
| 396 | - $types[ $active ]['current'] = true; |
|
| 395 | + $types[$active]['class'] .= ' current'; |
|
| 396 | + $types[$active]['current'] = true; |
|
| 397 | 397 | |
| 398 | 398 | return $types; |
| 399 | 399 | } |
@@ -407,8 +407,8 @@ discard block |
||
| 407 | 407 | 'website' => 'url', |
| 408 | 408 | 'image' => 'url', |
| 409 | 409 | ); |
| 410 | - if ( isset( $type_switch[ $type ] ) ) { |
|
| 411 | - $type = $type_switch[ $type ]; |
|
| 410 | + if ( isset( $type_switch[$type] ) ) { |
|
| 411 | + $type = $type_switch[$type]; |
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | $pro_fields = FrmField::pro_field_selection(); |
@@ -532,11 +532,11 @@ discard block |
||
| 532 | 532 | // include "col" for valid html |
| 533 | 533 | $unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) ); |
| 534 | 534 | |
| 535 | - if ( ! isset( $calc[ $unit ] ) ) { |
|
| 535 | + if ( ! isset( $calc[$unit] ) ) { |
|
| 536 | 536 | return; |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | - $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ]; |
|
| 539 | + $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[$unit]; |
|
| 540 | 540 | |
| 541 | 541 | $add_html['cols'] = 'cols="' . absint( $size ) . '"'; |
| 542 | 542 | } |
@@ -729,11 +729,11 @@ discard block |
||
| 729 | 729 | private static function get_form_for_js_validation( $field ) { |
| 730 | 730 | global $frm_vars; |
| 731 | 731 | if ( ! empty( $frm_vars['js_validate_forms'] ) ) { |
| 732 | - if ( isset( $frm_vars['js_validate_forms'][ $field['form_id'] ] ) ) { |
|
| 733 | - return $frm_vars['js_validate_forms'][ $field['form_id'] ]; |
|
| 732 | + if ( isset( $frm_vars['js_validate_forms'][$field['form_id']] ) ) { |
|
| 733 | + return $frm_vars['js_validate_forms'][$field['form_id']]; |
|
| 734 | 734 | } |
| 735 | - if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][ $field['parent_form_id'] ] ) ) { |
|
| 736 | - return $frm_vars['js_validate_forms'][ $field['parent_form_id'] ]; |
|
| 735 | + if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][$field['parent_form_id']] ) ) { |
|
| 736 | + return $frm_vars['js_validate_forms'][$field['parent_form_id']]; |
|
| 737 | 737 | } |
| 738 | 738 | } |
| 739 | 739 | return false; |
@@ -804,10 +804,10 @@ discard block |
||
| 804 | 804 | |
| 805 | 805 | if ( is_numeric( $k ) && strpos( $v, '=' ) ) { |
| 806 | 806 | $add_html[] = $v; |
| 807 | - } elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) { |
|
| 808 | - $add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] ); |
|
| 807 | + } elseif ( ! empty( $k ) && isset( $add_html[$k] ) ) { |
|
| 808 | + $add_html[$k] = str_replace( $k . '="', $k . '="' . $v, $add_html[$k] ); |
|
| 809 | 809 | } else { |
| 810 | - $add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"'; |
|
| 810 | + $add_html[$k] = $k . '="' . esc_attr( $v ) . '"'; |
|
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | unset( $k, $v ); |
@@ -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 | |
@@ -75,20 +75,20 @@ discard block |
||
| 75 | 75 | global $frm_vars; |
| 76 | 76 | $form_id = FrmForm::get_current_form_id(); |
| 77 | 77 | |
| 78 | - $columns[ $form_id . '_id' ] = 'ID'; |
|
| 79 | - $columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 78 | + $columns[$form_id . '_id'] = 'ID'; |
|
| 79 | + $columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 80 | 80 | |
| 81 | 81 | if ( $form_id ) { |
| 82 | 82 | self::get_columns_for_form( $form_id, $columns ); |
| 83 | 83 | } else { |
| 84 | - $columns[ $form_id . '_form_id' ] = esc_html__( 'Form', 'formidable' ); |
|
| 85 | - $columns[ $form_id . '_name' ] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 86 | - $columns[ $form_id . '_user_id' ] = esc_html__( 'Created By', 'formidable' ); |
|
| 84 | + $columns[$form_id . '_form_id'] = esc_html__( 'Form', 'formidable' ); |
|
| 85 | + $columns[$form_id . '_name'] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 86 | + $columns[$form_id . '_user_id'] = esc_html__( 'Created By', 'formidable' ); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $columns[ $form_id . '_is_draft' ] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 90 | - $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' ); |
|
| 91 | - $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' ); |
|
| 89 | + $columns[$form_id . '_is_draft'] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 90 | + $columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' ); |
|
| 91 | + $columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' ); |
|
| 92 | 92 | self::maybe_add_ip_col( $form_id, $columns ); |
| 93 | 93 | |
| 94 | 94 | $frm_vars['cols'] = $columns; |
@@ -146,10 +146,10 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | foreach ( $sub_form_cols as $k => $sub_form_col ) { |
| 148 | 148 | if ( FrmField::is_no_save_field( $sub_form_col->type ) ) { |
| 149 | - unset( $sub_form_cols[ $k ] ); |
|
| 149 | + unset( $sub_form_cols[$k] ); |
|
| 150 | 150 | continue; |
| 151 | 151 | } |
| 152 | - $columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 152 | + $columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 153 | 153 | unset( $sub_form_col ); |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -166,15 +166,15 @@ discard block |
||
| 166 | 166 | $has_separate_value = ! FrmField::is_option_empty( $field, 'separate_value' ); |
| 167 | 167 | $is_post_status = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] == 'post_status'; |
| 168 | 168 | if ( $has_separate_value && ! $is_post_status ) { |
| 169 | - $columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 169 | + $columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - $columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 172 | + $columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | private static function maybe_add_ip_col( $form_id, &$columns ) { |
| 176 | 176 | if ( FrmAppHelper::ips_saved() ) { |
| 177 | - $columns[ $form_id . '_ip' ] = 'IP'; |
|
| 177 | + $columns[$form_id . '_ip'] = 'IP'; |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | foreach ( $meta_value as $mk => $mv ) { |
| 213 | 213 | // Remove blank values. |
| 214 | 214 | if ( empty( $mv ) ) { |
| 215 | - unset( $meta_value[ $mk ] ); |
|
| 215 | + unset( $meta_value[$mk] ); |
|
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | 218 | |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | |
| 289 | 289 | foreach ( $fields as $field ) { |
| 290 | 290 | if ( self::field_supports_sorting( $field ) ) { |
| 291 | - $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id; |
|
| 291 | + $columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id; |
|
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | 294 | |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | $atts['form_id'] . '_item_key' => '', |
| 376 | 376 | $atts['form_id'] . '_id' => '', |
| 377 | 377 | ); |
| 378 | - $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 378 | + $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 379 | 379 | |
| 380 | 380 | $i = $atts['i']; |
| 381 | 381 | |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | |
| 387 | 387 | if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) { |
| 388 | 388 | $result[] = $col_key; |
| 389 | - $i--; |
|
| 389 | + $i --; |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | unset( $col_key, $col ); |
@@ -528,9 +528,9 @@ discard block |
||
| 528 | 528 | if ( ! isset( $frm_vars['form_params'] ) ) { |
| 529 | 529 | $frm_vars['form_params'] = array(); |
| 530 | 530 | } |
| 531 | - $frm_vars['form_params'][ $form->id ] = $params; |
|
| 531 | + $frm_vars['form_params'][$form->id] = $params; |
|
| 532 | 532 | |
| 533 | - if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) { |
|
| 533 | + if ( isset( $frm_vars['created_entries'][$form_id] ) ) { |
|
| 534 | 534 | return; |
| 535 | 535 | } |
| 536 | 536 | |
@@ -546,16 +546,16 @@ discard block |
||
| 546 | 546 | */ |
| 547 | 547 | $errors = apply_filters( 'frm_entries_before_create', $errors, $form ); |
| 548 | 548 | |
| 549 | - $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors ); |
|
| 549 | + $frm_vars['created_entries'][$form_id] = array( 'errors' => $errors ); |
|
| 550 | 550 | |
| 551 | 551 | if ( empty( $errors ) ) { |
| 552 | 552 | $_POST['frm_skip_cookie'] = 1; |
| 553 | 553 | $do_success = false; |
| 554 | 554 | if ( $params['action'] === 'create' ) { |
| 555 | - if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) { |
|
| 556 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 555 | + if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) { |
|
| 556 | + $frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 557 | 557 | |
| 558 | - $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id']; |
|
| 558 | + $params['id'] = $frm_vars['created_entries'][$form_id]['entry_id']; |
|
| 559 | 559 | $do_success = true; |
| 560 | 560 | } |
| 561 | 561 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | protected function get_field_value( $args ) { |
| 53 | 53 | $user_ID = get_current_user_id(); |
| 54 | 54 | $user_ID = ( $user_ID ? $user_ID : '' ); |
| 55 | - $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 55 | + $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 56 | 56 | $action = ( isset( $args['action'] ) ? $args['action'] : ( isset( $args['form_action'] ) ? $args['form_action'] : '' ) ); |
| 57 | 57 | $updating = $action == 'update'; |
| 58 | 58 | return ( is_numeric( $this->field['value'] ) || $posted_value || $updating ) ? $this->field['value'] : $user_ID; |
@@ -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 = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false; |
|
| 198 | + $field_value = isset( $entry->metas[$field->id] ) ? $entry->metas[$field->id] : false; |
|
| 199 | 199 | |
| 200 | 200 | if ( FrmAppHelper::pro_is_installed() ) { |
| 201 | 201 | $empty = empty( $field_value ); |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true ); |
| 221 | 221 | } else { |
| 222 | 222 | // Get all values for this field. |
| 223 | - $child_values = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false; |
|
| 223 | + $child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $entry->metas[$atts['embedded_field_id']] : false; |
|
| 224 | 224 | |
| 225 | 225 | if ( $child_values ) { |
| 226 | 226 | $child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) ); |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | $value = $args['temp_value']; |
| 339 | 339 | } |
| 340 | 340 | if ( empty( $args['parent_field_id'] ) ) { |
| 341 | - $_POST['item_meta'][ $field->id ] = $value; |
|
| 341 | + $_POST['item_meta'][$field->id] = $value; |
|
| 342 | 342 | } else { |
| 343 | 343 | self::set_parent_field_posted_value( $field, $value, $args ); |
| 344 | 344 | } |
@@ -350,17 +350,17 @@ discard block |
||
| 350 | 350 | * @since 4.01 |
| 351 | 351 | */ |
| 352 | 352 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
| 353 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 354 | - 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 |
|
| 355 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 353 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 354 | + 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 |
|
| 355 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 356 | 356 | } |
| 357 | 357 | } else { |
| 358 | 358 | // All of the section was probably removed. |
| 359 | - $_POST['item_meta'][ $args['parent_field_id'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 360 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 359 | + $_POST['item_meta'][$args['parent_field_id']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 360 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 363 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | public static function get_posted_value( $field, &$value, $args ) { |
@@ -390,9 +390,9 @@ discard block |
||
| 390 | 390 | private static function get_posted_meta( $field_id, $args ) { |
| 391 | 391 | if ( empty( $args['parent_field_id'] ) ) { |
| 392 | 392 | // Sanitizing is done next. |
| 393 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 393 | + $value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 394 | 394 | } else { |
| 395 | - $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 |
|
| 395 | + $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 |
|
| 396 | 396 | } |
| 397 | 397 | return $value; |
| 398 | 398 | } |
@@ -423,14 +423,14 @@ discard block |
||
| 423 | 423 | self::set_other_repeating_vals( $field, $value, $args ); |
| 424 | 424 | |
| 425 | 425 | // Check if there are any posted "Other" values. |
| 426 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 426 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 427 | 427 | |
| 428 | 428 | // Save original value. |
| 429 | 429 | $args['temp_value'] = $value; |
| 430 | 430 | $args['other'] = true; |
| 431 | 431 | |
| 432 | 432 | // Sanitizing is done next. |
| 433 | - $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 433 | + $other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 434 | 434 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 435 | 435 | |
| 436 | 436 | // Set the validation value now |
@@ -453,12 +453,12 @@ discard block |
||
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | // Check if there are any other posted "other" values for this field. |
| 456 | - 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 |
|
| 456 | + 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 |
|
| 457 | 457 | // Save original value |
| 458 | 458 | $args['temp_value'] = $value; |
| 459 | 459 | $args['other'] = true; |
| 460 | 460 | |
| 461 | - $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 |
|
| 461 | + $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 |
|
| 462 | 462 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 463 | 463 | |
| 464 | 464 | // Set the validation value now. |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
| 486 | 486 | // Combine "Other" values with checked values. "Other" values will override checked box values. |
| 487 | 487 | foreach ( $other_vals as $k => $v ) { |
| 488 | - if ( isset( $value[ $k ] ) && trim( $v ) === '' ) { |
|
| 488 | + if ( isset( $value[$k] ) && trim( $v ) === '' ) { |
|
| 489 | 489 | // If the other box is checked, but doesn't have a value. |
| 490 | 490 | $value = ''; |
| 491 | 491 | break; |
@@ -502,25 +502,25 @@ discard block |
||
| 502 | 502 | |
| 503 | 503 | // Multi-select dropdown. |
| 504 | 504 | if ( is_array( $value ) ) { |
| 505 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
| 505 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
| 506 | 506 | |
| 507 | 507 | if ( $o_key !== false ) { |
| 508 | 508 | // Modify the original value so other key will be preserved. |
| 509 | - $value[ $other_key ] = $value[ $o_key ]; |
|
| 509 | + $value[$other_key] = $value[$o_key]; |
|
| 510 | 510 | |
| 511 | 511 | // By default, the array keys will be numeric for multi-select dropdowns. |
| 512 | 512 | // If going backwards and forwards between pages, the array key will match the other key. |
| 513 | 513 | if ( $o_key !== $other_key ) { |
| 514 | - unset( $value[ $o_key ] ); |
|
| 514 | + unset( $value[$o_key] ); |
|
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | $args['temp_value'] = $value; |
| 518 | - $value[ $other_key ] = reset( $other_vals ); |
|
| 519 | - if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) { |
|
| 520 | - unset( $value[ $other_key ] ); |
|
| 518 | + $value[$other_key] = reset( $other_vals ); |
|
| 519 | + if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) { |
|
| 520 | + unset( $value[$other_key] ); |
|
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | - } elseif ( $field->options[ $other_key ] == $value ) { |
|
| 523 | + } elseif ( $field->options[$other_key] == $value ) { |
|
| 524 | 524 | $value = $other_vals; |
| 525 | 525 | }//end if |
| 526 | 526 | }//end if |
@@ -766,7 +766,7 @@ discard block |
||
| 766 | 766 | * @return void |
| 767 | 767 | */ |
| 768 | 768 | public static function maybe_render_captcha_score( $entry_id ) { |
| 769 | - $query = array( |
|
| 769 | + $query = array( |
|
| 770 | 770 | 'item_id' => (int) $entry_id, |
| 771 | 771 | 'field_id' => 0, |
| 772 | 772 | ); |
@@ -820,7 +820,7 @@ discard block |
||
| 820 | 820 | public static function get_entry_status_label( $status ) { |
| 821 | 821 | $statuses = self::get_entry_statuses(); |
| 822 | 822 | |
| 823 | - return $statuses[ self::get_entry_status( $status ) ]; |
|
| 823 | + return $statuses[self::get_entry_status( $status )]; |
|
| 824 | 824 | } |
| 825 | 825 | |
| 826 | 826 | /** |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $this->beta = ! empty( $this->api_data['beta'] ) ? true : false; |
| 45 | 45 | $this->cache_key = md5( serialize( $this->slug . $this->version . $this->api_data['license'] . $this->beta ) ); |
| 46 | 46 | |
| 47 | - $frm_edd_plugin_data[ $this->slug ] = $this->api_data; |
|
| 47 | + $frm_edd_plugin_data[$this->slug] = $this->api_data; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Fires after the $frm_edd_plugin_data is setup. |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $_transient_data = new stdClass(); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) { |
|
| 96 | + if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[$this->name] ) && false === $this->wp_override ) { |
|
| 97 | 97 | return $_transient_data; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -120,12 +120,12 @@ discard block |
||
| 120 | 120 | $version_info->plugin = $this->name; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - $_transient_data->response[ $this->name ] = $version_info; |
|
| 123 | + $_transient_data->response[$this->name] = $version_info; |
|
| 124 | 124 | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $_transient_data->last_checked = time(); |
| 128 | - $_transient_data->checked[ $this->name ] = $this->version; |
|
| 128 | + $_transient_data->checked[$this->name] = $this->version; |
|
| 129 | 129 | |
| 130 | 130 | } |
| 131 | 131 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) { |
| 190 | 190 | $new_sections = array(); |
| 191 | 191 | foreach ( $_data->sections as $key => $value ) { |
| 192 | - $new_sections[ $key ] = $value; |
|
| 192 | + $new_sections[$key] = $value; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | $_data->sections = $new_sections; |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) { |
| 200 | 200 | $new_banners = array(); |
| 201 | 201 | foreach ( $_data->banners as $key => $value ) { |
| 202 | - $new_banners[ $key ] = $value; |
|
| 202 | + $new_banners[$key] = $value; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $_data->banners = $new_banners; |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | $slug = sanitize_text_field( $_REQUEST['slug'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 319 | - $data = $frm_edd_plugin_data[ $slug ]; |
|
| 319 | + $data = $frm_edd_plugin_data[$slug]; |
|
| 320 | 320 | $beta = ! empty( $data['beta'] ) ? true : false; |
| 321 | 321 | $cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 322 | 322 | $version_info = $this->get_cached_version_info( $cache_key ); |
@@ -303,11 +303,13 @@ |
||
| 303 | 303 | |
| 304 | 304 | global $frm_edd_plugin_data; |
| 305 | 305 | |
| 306 | - if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 306 | + if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { |
|
| 307 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 307 | 308 | return; |
| 308 | 309 | } |
| 309 | 310 | |
| 310 | - if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 311 | + if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { |
|
| 312 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 311 | 313 | return; |
| 312 | 314 | } |
| 313 | 315 | |
@@ -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 = isset( $step['button_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; |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if ( $plugin['status'] === 'active' ) { |
| 392 | 392 | continue; |
| 393 | 393 | } |
| 394 | - $links[ $plugin_key ] = $plugin; |
|
| 394 | + $links[$plugin_key] = $plugin; |
|
| 395 | 395 | if ( isset( $plugin['url'] ) ) { |
| 396 | 396 | $rel[] = $plugin['url']; |
| 397 | 397 | } else { |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | $addons = $api->get_api_info(); |
| 521 | 521 | |
| 522 | 522 | $id = $this->download_id(); |
| 523 | - $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] ); |
|
| 523 | + $has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] ); |
|
| 524 | 524 | |
| 525 | 525 | if ( ! $step['current'] ) { |
| 526 | 526 | ?> |
@@ -535,10 +535,10 @@ discard block |
||
| 535 | 535 | |
| 536 | 536 | if ( ! $has_file ) { |
| 537 | 537 | echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>'; |
| 538 | - } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) { |
|
| 538 | + } elseif ( ! isset( $addons[$id]['beta']['package'] ) ) { |
|
| 539 | 539 | 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>'; |
| 540 | 540 | } else { |
| 541 | - $xml = $addons[ $id ]['beta']['package']; |
|
| 541 | + $xml = $addons[$id]['beta']['package']; |
|
| 542 | 542 | if ( is_array( $xml ) ) { |
| 543 | 543 | $xml = reset( $xml ); |
| 544 | 544 | } |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | foreach ( $forms as $form ) { |
| 706 | 706 | $was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false; |
| 707 | 707 | if ( $was_imported ) { |
| 708 | - $imported[ $form['form'] ] = $was_imported; |
|
| 708 | + $imported[$form['form']] = $was_imported; |
|
| 709 | 709 | } |
| 710 | 710 | } |
| 711 | 711 | |