@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $intent_is_processing = 'processing' === $intent->status; |
| 58 | 58 | if ( $intent_is_processing ) { |
| 59 | 59 | // Append an additional processing message to the end of the success message. |
| 60 | - $filter = function ( $message ) { |
|
| 60 | + $filter = function( $message ) { |
|
| 61 | 61 | $stripe_settings = FrmStrpLiteAppHelper::get_settings(); |
| 62 | 62 | $message .= '<p>' . esc_html( $stripe_settings->settings->processing_message ) . '</p>'; |
| 63 | 63 | return $message; |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $atts['form'] = FrmForm::getOne( $atts['entry']->form_id ); |
| 162 | 162 | $atts['entry_id'] = $atts['entry']->id; |
| 163 | 163 | $opt = 'success_action'; |
| 164 | - $atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 164 | + $atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
| 165 | 165 | |
| 166 | 166 | $actions = FrmFormsController::get_met_on_submit_actions( $atts, 'create' ); |
| 167 | 167 | if ( $actions ) { |
@@ -246,10 +246,10 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | public static function get_payment_intents( $name ) { |
| 248 | 248 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 249 | - if ( ! isset( $_POST[ $name ] ) ) { |
|
| 249 | + if ( ! isset( $_POST[$name] ) ) { |
|
| 250 | 250 | return array(); |
| 251 | 251 | } |
| 252 | - $intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 252 | + $intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 253 | 253 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents ); |
| 254 | 254 | return $intents; |
| 255 | 255 | } |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | self::format_form_data( $form ); |
| 277 | 277 | |
| 278 | 278 | $form_id = absint( $form['form_id'] ); |
| 279 | - $intents = $form[ 'frmintent' . $form_id ] ?? array(); |
|
| 279 | + $intents = $form['frmintent' . $form_id] ?? array(); |
|
| 280 | 280 | |
| 281 | 281 | if ( empty( $intents ) ) { |
| 282 | 282 | wp_die(); |
@@ -286,8 +286,8 @@ discard block |
||
| 286 | 286 | $intents = array( $intents ); |
| 287 | 287 | } else { |
| 288 | 288 | foreach ( $intents as $k => $intent ) { |
| 289 | - if ( is_array( $intent ) && isset( $intent[ $k ] ) ) { |
|
| 290 | - $intents[ $k ] = $intent[ $k ]; |
|
| 289 | + if ( is_array( $intent ) && isset( $intent[$k] ) ) { |
|
| 290 | + $intents[$k] = $intent[$k]; |
|
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | 293 | } |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | if ( $saved->metadata->action != $action->ID ) { |
| 345 | 345 | continue; |
| 346 | 346 | } |
| 347 | - $intents[ $k ] = array( |
|
| 347 | + $intents[$k] = array( |
|
| 348 | 348 | 'id' => $intent, |
| 349 | 349 | 'action' => $action->ID, |
| 350 | 350 | ); |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | if ( $k === 'item_meta' ) { |
| 388 | 388 | foreach ( $v as $f => $value ) { |
| 389 | 389 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 390 | - $entry->metas[ absint( $f ) ] = $value; |
|
| 390 | + $entry->metas[absint( $f )] = $value; |
|
| 391 | 391 | } |
| 392 | 392 | } else { |
| 393 | 393 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -411,14 +411,14 @@ discard block |
||
| 411 | 411 | |
| 412 | 412 | foreach ( $form as $input ) { |
| 413 | 413 | $key = $input['name']; |
| 414 | - if ( isset( $formatted[ $key ] ) ) { |
|
| 415 | - if ( is_array( $formatted[ $key ] ) ) { |
|
| 416 | - $formatted[ $key ][] = $input['value']; |
|
| 414 | + if ( isset( $formatted[$key] ) ) { |
|
| 415 | + if ( is_array( $formatted[$key] ) ) { |
|
| 416 | + $formatted[$key][] = $input['value']; |
|
| 417 | 417 | } else { |
| 418 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
| 418 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
| 419 | 419 | } |
| 420 | 420 | } else { |
| 421 | - $formatted[ $key ] = $input['value']; |
|
| 421 | + $formatted[$key] = $input['value']; |
|
| 422 | 422 | } |
| 423 | 423 | } |
| 424 | 424 | |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | |
| 659 | 659 | foreach ( $actions as $k => $action ) { |
| 660 | 660 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
| 661 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
| 661 | + $actions[$k]->post_content['amount'] = $amount; |
|
| 662 | 662 | } |
| 663 | 663 | } |
| 664 | 664 | |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | * @return array|false |
| 27 | 27 | */ |
| 28 | 28 | public static function get_details_for_form( $form_id ) { |
| 29 | - if ( ! isset( self::$details_by_form_id[ $form_id ] ) ) { |
|
| 29 | + if ( ! isset( self::$details_by_form_id[$form_id] ) ) { |
|
| 30 | 30 | self::set_details_for_form( (int) $form_id ); |
| 31 | 31 | } |
| 32 | - return self::$details_by_form_id[ $form_id ] ?? false; |
|
| 32 | + return self::$details_by_form_id[$form_id] ?? false; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - self::$details_by_form_id[ $form_id ] = array( |
|
| 93 | + self::$details_by_form_id[$form_id] = array( |
|
| 94 | 94 | 'entry' => $entry, |
| 95 | 95 | 'intent' => $intent, |
| 96 | 96 | 'payment' => $payment, |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public static function show_status( $status ) { |
| 68 | 68 | $statuses = array_merge( self::get_payment_statuses(), self::get_subscription_statuses() ); |
| 69 | - return $statuses[ $status ] ?? $status; |
|
| 69 | + return $statuses[$status] ?? $status; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public static function get_action_setting( $option, $atts ) { |
| 154 | 154 | $settings = self::get_action_settings( $atts ); |
| 155 | - $value = $settings[ $option ] ?? ''; |
|
| 155 | + $value = $settings[$option] ?? ''; |
|
| 156 | 156 | return $value; |
| 157 | 157 | } |
| 158 | 158 | |
@@ -255,8 +255,8 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | public static function get_repeat_label_from_value( $value, $number ) { |
| 257 | 257 | $times = self::get_plural_repeat_times( $number ); |
| 258 | - if ( isset( $times[ $value ] ) ) { |
|
| 259 | - $value = $times[ $value ]; |
|
| 258 | + if ( isset( $times[$value] ) ) { |
|
| 259 | + $value = $times[$value]; |
|
| 260 | 260 | } |
| 261 | 261 | return $value; |
| 262 | 262 | } |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | $count = 0; |
| 505 | 505 | foreach ( $payments as $payment ) { |
| 506 | 506 | if ( $payment->status === 'complete' ) { |
| 507 | - $count++; |
|
| 507 | + $count ++; |
|
| 508 | 508 | } |
| 509 | 509 | } |
| 510 | 510 | |
@@ -526,8 +526,8 @@ discard block |
||
| 526 | 526 | if ( is_array( $gateway ) ) { |
| 527 | 527 | $gateway = reset( $gateway ); |
| 528 | 528 | } |
| 529 | - if ( isset( $gateways[ $gateway ] ) ) { |
|
| 530 | - $value = $gateways[ $gateway ][ $setting ]; |
|
| 529 | + if ( isset( $gateways[$gateway] ) ) { |
|
| 530 | + $value = $gateways[$gateway][$setting]; |
|
| 531 | 531 | } |
| 532 | 532 | return $value; |
| 533 | 533 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $event_labels = FrmFormAction::trigger_labels(); |
| 44 | 44 | foreach ( $action_control->action_options['event'] as $event ) { |
| 45 | 45 | ?> |
| 46 | - <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[ $event ] ?? $event ); ?></option> |
|
| 46 | + <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[$event] ?? $event ); ?></option> |
|
| 47 | 47 | <?php } ?> |
| 48 | 48 | </select> |
| 49 | 49 | </p> |
@@ -40,14 +40,14 @@ discard block |
||
| 40 | 40 | ?> |
| 41 | 41 | <p class="frm6 frm_form_field"> |
| 42 | 42 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
| 43 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
| 43 | + <?php echo esc_html( $labels[$option] ); ?> |
|
| 44 | 44 | </label> |
| 45 | 45 | <span class="frm-with-right-icon"> |
| 46 | 46 | <input |
| 47 | 47 | type="text" |
| 48 | 48 | name="<?php echo esc_attr( $input_name ); ?>" |
| 49 | 49 | id="<?php echo esc_attr( $input_id ); ?>" |
| 50 | - value="<?php echo esc_attr( $default_value[ $sub_field['name'] ] ?? '' ); ?>" |
|
| 50 | + value="<?php echo esc_attr( $default_value[$sub_field['name']] ?? '' ); ?>" |
|
| 51 | 51 | data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>" |
| 52 | 52 | data-changeatt="value" |
| 53 | 53 | /> |
@@ -73,13 +73,13 @@ discard block |
||
| 73 | 73 | ?> |
| 74 | 74 | <p class="frm6 frm_form_field"> |
| 75 | 75 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
| 76 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
| 76 | + <?php echo esc_html( $labels[$option] ); ?> |
|
| 77 | 77 | </label> |
| 78 | 78 | <input |
| 79 | 79 | type="text" |
| 80 | 80 | name="<?php echo esc_attr( $input_name ); ?>" |
| 81 | 81 | id="<?php echo esc_attr( $input_id ); ?>" |
| 82 | - value="<?php echo esc_attr( $input_value[ $sub_field['name'] ] ?? '' ); ?>" |
|
| 82 | + value="<?php echo esc_attr( $input_value[$sub_field['name']] ?? '' ); ?>" |
|
| 83 | 83 | data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>" |
| 84 | 84 | data-changeatt="<?php echo esc_attr( $option ); ?>" |
| 85 | 85 | /> |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | ?> |
| 96 | 96 | <p class="frm_form_field frm-flex-col"> |
| 97 | 97 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
| 98 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
| 98 | + <?php echo esc_html( $labels[$option] ); ?> |
|
| 99 | 99 | </label> |
| 100 | 100 | <textarea |
| 101 | 101 | name="<?php echo esc_attr( $input_name ); ?>" |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $sub_field_class = "frm_form_field form-field frm_form_subfield-{$name} {$sub_field['wrapper_classes']}"; |
| 42 | 42 | $sub_field_desc = FrmField::get_option( $field, $name . '_desc' ); |
| 43 | 43 | |
| 44 | - if ( isset( $errors[ 'field' . $field_id . '-' . $name ] ) ) { |
|
| 44 | + if ( isset( $errors['field' . $field_id . '-' . $name] ) ) { |
|
| 45 | 45 | $sub_field_class .= ' frm_blank_field'; |
| 46 | 46 | } |
| 47 | 47 | ?> |
@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | $attrs = array( |
| 61 | 61 | 'type' => $sub_field['type'], |
| 62 | 62 | 'id' => $html_id . '_' . $name, |
| 63 | - 'value' => $field_value[ $name ] ?? '', |
|
| 63 | + 'value' => $field_value[$name] ?? '', |
|
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | - if ( ! empty( $field_value[ $name ] ) ) { |
|
| 67 | - $attrs['data-frmval'] = $field_value[ $name ]; |
|
| 66 | + if ( ! empty( $field_value[$name] ) ) { |
|
| 67 | + $attrs['data-frmval'] = $field_value[$name]; |
|
| 68 | 68 | } |
| 69 | 69 | if ( empty( $args['remove_names'] ) ) { |
| 70 | 70 | $attrs['name'] = $field_name . '[' . $name . ']'; |
@@ -81,9 +81,9 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // Don't show individual field errors when there is a combo field error. |
| 84 | - if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) { |
|
| 84 | + if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) { |
|
| 85 | 85 | ?> |
| 86 | - <div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div> |
|
| 86 | + <div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div> |
|
| 87 | 87 | <?php } ?> |
| 88 | 88 | </div> |
| 89 | 89 | <?php |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | $info['url'] = $xml; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - $disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : ''; |
|
| 14 | + $disabled = isset( $imported[$info['form']] ) ? ' disabled' : ''; |
|
| 15 | 15 | $url = $info['url'] ?? ''; |
| 16 | 16 | $value = $importing === 'form' ? $info['form'] : $info['key']; |
| 17 | 17 | if ( ! isset( $info['img'] ) ) { |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | continue; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) ); |
|
| 24 | + $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) ); |
|
| 25 | 25 | ?> |
| 26 | 26 | <div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>"> |
| 27 | 27 | <?php if ( $importing === 'form' ) { ?> |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | if ( $importing === 'form' && $disabled ) { |
| 57 | - FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) ); |
|
| 57 | + FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) ); |
|
| 58 | 58 | } else { |
| 59 | 59 | echo esc_html( $info['name'] ); |
| 60 | 60 | } |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | FrmFieldGdprHelper::FIELD_TYPE => FrmFieldGdprHelper::get_gdpr_field_class( $field_type ), |
| 113 | 113 | ); |
| 114 | 114 | |
| 115 | - $class = $type_classes[ $field_type ] ?? ''; |
|
| 115 | + $class = $type_classes[$field_type] ?? ''; |
|
| 116 | 116 | |
| 117 | 117 | return apply_filters( 'frm_get_field_type_class', $class, $field_type ); |
| 118 | 118 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | protected function get_field_value( $args ) { |
| 59 | 59 | $user_ID = get_current_user_id(); |
| 60 | 60 | $user_ID = ( $user_ID ? $user_ID : '' ); |
| 61 | - $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 61 | + $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 62 | 62 | $action = ( $args['action'] ?? $args['form_action'] ?? '' ); |
| 63 | 63 | $updating = $action === 'update'; |
| 64 | 64 | return is_numeric( $this->field['value'] ) || $posted_value || $updating ? $this->field['value'] : $user_ID; |