@@ -160,7 +160,7 @@ |
||
160 | 160 | * @return object|string |
161 | 161 | */ |
162 | 162 | private static function post_to_connect_server( $action, $additional_body = array() ) { |
163 | - $body = array( |
|
163 | + $body = array( |
|
164 | 164 | 'frm_square_api_action' => $action, |
165 | 165 | 'frm_square_api_mode' => FrmSquareLiteAppHelper::active_mode(), |
166 | 166 | ); |
@@ -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 isset( $statuses[ $status ] ) ? $statuses[ $status ] : $status; |
|
69 | + return isset( $statuses[$status] ) ? $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 = isset( $settings[ $option ] ) ? $settings[ $option ] : ''; |
|
155 | + $value = isset( $settings[$option] ) ? $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 | } |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | $address_setting = $action->post_content['billing_address']; |
108 | 108 | |
109 | 109 | $entry = self::generate_false_entry(); |
110 | - $first_name = $first_name_setting && isset( $entry->metas[ $first_name_setting ] ) ? $entry->metas[ $first_name_setting ] : ''; |
|
111 | - $last_name = $last_name_setting && isset( $entry->metas[ $last_name_setting ] ) ? $entry->metas[ $last_name_setting ] : ''; |
|
112 | - $address = $address_setting && isset( $entry->metas[ $address_setting ] ) ? $entry->metas[ $address_setting ] : ''; |
|
110 | + $first_name = $first_name_setting && isset( $entry->metas[$first_name_setting] ) ? $entry->metas[$first_name_setting] : ''; |
|
111 | + $last_name = $last_name_setting && isset( $entry->metas[$last_name_setting] ) ? $entry->metas[$last_name_setting] : ''; |
|
112 | + $address = $address_setting && isset( $entry->metas[$address_setting] ) ? $entry->metas[$address_setting] : ''; |
|
113 | 113 | |
114 | 114 | if ( is_array( $first_name ) && isset( $first_name['first'] ) ) { |
115 | 115 | $first_name = $first_name['first']; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | if ( $k === 'item_meta' ) { |
164 | 164 | foreach ( $v as $f => $value ) { |
165 | 165 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
166 | - $entry->metas[ absint( $f ) ] = $value; |
|
166 | + $entry->metas[absint( $f )] = $value; |
|
167 | 167 | } |
168 | 168 | } else { |
169 | 169 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | 'page' => '', |
46 | 46 | 'class' => 'frm-mt-0', |
47 | 47 | ); |
48 | - $tip = array_merge( $defaults, $tip ); |
|
48 | + $tip = array_merge( $defaults, $tip ); |
|
49 | 49 | |
50 | 50 | if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) { |
51 | 51 | $tip['link']['medium'] = 'tip'; |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | public static function get_random_tip( $tips ) { |
368 | 368 | $random = rand( 0, count( $tips ) - 1 ); |
369 | 369 | |
370 | - return $tips[ $random ]; |
|
370 | + return $tips[$random]; |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | 'default' => 'id', |
97 | 97 | ) |
98 | 98 | ); |
99 | - $order = self::get_param( |
|
99 | + $order = self::get_param( |
|
100 | 100 | array( |
101 | 101 | 'param' => 'order', |
102 | 102 | 'default' => 'DESC', |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $form_ids = $this->get_form_ids( $form_id ); |
149 | 149 | $s_query['it.form_id'] = count( $form_ids ) > 1 ? $form_ids : $form_ids[0]; |
150 | 150 | } else { |
151 | - $s_query[] = array( |
|
151 | + $s_query[] = array( |
|
152 | 152 | 'or' => 1, |
153 | 153 | 'parent_form_id' => null, |
154 | 154 | 'parent_form_id <' => 1, |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | |
316 | 316 | $r = "<tr id='item-action-{$item->id}'$style>"; |
317 | 317 | |
318 | - list( $columns, $hidden, , $primary ) = $this->get_column_info(); |
|
318 | + list( $columns, $hidden,, $primary ) = $this->get_column_info(); |
|
319 | 319 | $action_col = false; |
320 | 320 | $action_columns = $this->get_action_columns(); |
321 | 321 |
@@ -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 = isset( $form[ 'frmintent' . $form_id ] ) ? $form[ 'frmintent' . $form_id ] : array(); |
|
279 | + $intents = isset( $form['frmintent' . $form_id] ) ? $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 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | if ( $saved->metadata->action != $action->ID ) { |
341 | 341 | continue; |
342 | 342 | } |
343 | - $intents[ $k ] = array( |
|
343 | + $intents[$k] = array( |
|
344 | 344 | 'id' => $intent, |
345 | 345 | 'action' => $action->ID, |
346 | 346 | ); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | if ( $k === 'item_meta' ) { |
384 | 384 | foreach ( $v as $f => $value ) { |
385 | 385 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
386 | - $entry->metas[ absint( $f ) ] = $value; |
|
386 | + $entry->metas[absint( $f )] = $value; |
|
387 | 387 | } |
388 | 388 | } else { |
389 | 389 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -407,14 +407,14 @@ discard block |
||
407 | 407 | |
408 | 408 | foreach ( $form as $input ) { |
409 | 409 | $key = $input['name']; |
410 | - if ( isset( $formatted[ $key ] ) ) { |
|
411 | - if ( is_array( $formatted[ $key ] ) ) { |
|
412 | - $formatted[ $key ][] = $input['value']; |
|
410 | + if ( isset( $formatted[$key] ) ) { |
|
411 | + if ( is_array( $formatted[$key] ) ) { |
|
412 | + $formatted[$key][] = $input['value']; |
|
413 | 413 | } else { |
414 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
414 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
415 | 415 | } |
416 | 416 | } else { |
417 | - $formatted[ $key ] = $input['value']; |
|
417 | + $formatted[$key] = $input['value']; |
|
418 | 418 | } |
419 | 419 | } |
420 | 420 | |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | |
560 | 560 | foreach ( $actions as $k => $action ) { |
561 | 561 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
562 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
562 | + $actions[$k]->post_content['amount'] = $amount; |
|
563 | 563 | } |
564 | 564 | } |
565 | 565 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $gateway = $payment_action->post_content['gateway']; |
49 | 49 | $is_square = $gateway === 'square' || ( is_array( $gateway ) && in_array( 'square', $gateway, true ) ); |
50 | 50 | if ( ! $is_square || empty( $payment_action->post_content['amount'] ) ) { |
51 | - unset( $payment_actions[ $k ] ); |
|
51 | + unset( $payment_actions[$k] ); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | return $payment_actions; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | 'run_triggers' => false, |
70 | 70 | 'show_errors' => true, |
71 | 71 | ); |
72 | - $atts = compact( 'action', 'entry', 'form' ); |
|
72 | + $atts = compact( 'action', 'entry', 'form' ); |
|
73 | 73 | |
74 | 74 | $amount = self::prepare_amount( $action->post_content['amount'], $atts ); |
75 | 75 | if ( empty( $amount ) || $amount == 000 ) { |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | // 1. Call the API with the customer and catalog info. |
181 | 181 | // 2. Add the database rows. |
182 | 182 | |
183 | - $action = $atts['action'];; |
|
183 | + $action = $atts['action']; ; |
|
184 | 184 | $billing_contact = FrmSquareLiteAppController::get_billing_contact( $action ); |
185 | 185 | |
186 | 186 | $info = array( |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | $disallowed = array( ';', ':', '!important' ); |
503 | 503 | foreach ( $settings as $k => $s ) { |
504 | 504 | if ( is_string( $s ) ) { |
505 | - $settings[ $k ] = str_replace( $disallowed, '', $s ); |
|
505 | + $settings[$k] = str_replace( $disallowed, '', $s ); |
|
506 | 506 | } |
507 | 507 | } |
508 | 508 | |
@@ -521,18 +521,18 @@ discard block |
||
521 | 521 | * @return array |
522 | 522 | */ |
523 | 523 | public static function remove_cc_validation( $errors, $field, $values ) { |
524 | - $has_processed = isset( $_POST[ 'frmintent' . $field->form_id ] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
524 | + $has_processed = isset( $_POST['frmintent' . $field->form_id] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
525 | 525 | if ( ! $has_processed ) { |
526 | 526 | return $errors; |
527 | 527 | } |
528 | 528 | |
529 | 529 | $field_id = isset( $field->temp_id ) ? $field->temp_id : $field->id; |
530 | 530 | |
531 | - if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) { |
|
532 | - unset( $errors[ 'field' . $field_id . '-cc' ] ); |
|
531 | + if ( isset( $errors['field' . $field_id . '-cc'] ) ) { |
|
532 | + unset( $errors['field' . $field_id . '-cc'] ); |
|
533 | 533 | } |
534 | - if ( isset( $errors[ 'field' . $field_id ] ) ) { |
|
535 | - unset( $errors[ 'field' . $field_id ] ); |
|
534 | + if ( isset( $errors['field' . $field_id] ) ) { |
|
535 | + unset( $errors['field' . $field_id] ); |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | return $errors; |
@@ -29,10 +29,10 @@ |
||
29 | 29 | // This filter hides gateway fields from the entries list. |
30 | 30 | add_filter( |
31 | 31 | 'frm_fields_in_entries_list_table', |
32 | - function ( $form_cols ) { |
|
32 | + function( $form_cols ) { |
|
33 | 33 | return array_filter( |
34 | 34 | $form_cols, |
35 | - function ( $form_col ) { |
|
35 | + function( $form_col ) { |
|
36 | 36 | return 'gateway' !== $form_col->type; |
37 | 37 | } |
38 | 38 | ); |