Passed
Push — master ( bfa27f...c48fac )
by Brian
05:18
created
templates/payment-forms/cart-item.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -7,80 +7,80 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-do_action( 'getpaid_before_payment_form_cart_item', $form, $item );
12
+do_action('getpaid_before_payment_form_cart_item', $form, $item);
13 13
 
14 14
 $currency = $form->get_currency();
15 15
 
16 16
 ?>
17
-<div class='getpaid-payment-form-items-cart-item px-3 py-2 getpaid-<?php echo $item->is_required() ? 'required'  : 'selectable'; ?> item-<?php echo $item->get_id(); ?>'>
17
+<div class='getpaid-payment-form-items-cart-item px-3 py-2 getpaid-<?php echo $item->is_required() ? 'required' : 'selectable'; ?> item-<?php echo $item->get_id(); ?>'>
18 18
     <div class="form-row">
19
-        <?php foreach ( $columns as $key => $label ) : ?>
20
-            <div class="<?php echo 'name' == $key ? 'col-12 col-sm-5' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?>-<?php echo $item->get_id(); ?>">
19
+        <?php foreach ($columns as $key => $label) : ?>
20
+            <div class="<?php echo 'name' == $key ? 'col-12 col-sm-5' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?>-<?php echo $item->get_id(); ?>">
21 21
                 <?php
22 22
 
23 23
                     // Item name.
24
-                    if ( 'name' == $key ) {
25
-                        echo sanitize_text_field( $item->get_name() );
24
+                    if ('name' == $key) {
25
+                        echo sanitize_text_field($item->get_name());
26 26
                         $description = $item->get_description();
27 27
 
28
-                        if ( ! empty( $description ) ) {
29
-                            $description = wp_kses_post( $description );
28
+                        if (!empty($description)) {
29
+                            $description = wp_kses_post($description);
30 30
                             echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
31 31
                         }
32 32
 
33
-                        $description = getpaid_item_recurring_price_help_text( $item, $currency );
33
+                        $description = getpaid_item_recurring_price_help_text($item, $currency);
34 34
 
35
-                        if ( $description ) {
35
+                        if ($description) {
36 36
                             echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
37 37
                         }
38 38
                     }
39 39
 
40 40
                     // Item price.
41
-                    if ( 'price' == $key ) {
41
+                    if ('price' == $key) {
42 42
 
43 43
                         // Set the currency position.
44 44
                         $position = wpinv_currency_position();
45 45
 
46
-                        if ( $position == 'left_space' ) {
46
+                        if ($position == 'left_space') {
47 47
                             $position = 'left';
48 48
                         }
49 49
 
50
-                        if ( $position == 'right_space' ) {
50
+                        if ($position == 'right_space') {
51 51
                             $position = 'right';
52 52
                         }
53 53
 
54
-                        if ( $item->user_can_set_their_price() ) {
55
-                            $price = max( (float) $item->get_price(), (float) $item->get_minimum_price() );
54
+                        if ($item->user_can_set_their_price()) {
55
+                            $price = max((float) $item->get_price(), (float) $item->get_minimum_price());
56 56
                             ?>
57 57
                                 <div class="input-group input-group-sm">
58
-                                    <?php if( 'left' == $position ) : ?>
58
+                                    <?php if ('left' == $position) : ?>
59 59
                                         <div class="input-group-prepend">
60
-                                            <span class="input-group-text"><?php echo wpinv_currency_symbol( $currency ); ?></span>
60
+                                            <span class="input-group-text"><?php echo wpinv_currency_symbol($currency); ?></span>
61 61
                                         </div>
62 62
                                     <?php endif; ?>
63
-                                    <input type="text" name="getpaid-items[<?php echo (int) $item->get_id(); ?>][price]" value="<?php echo $price; ?>" placeholder="<?php echo esc_attr( $item->get_minimum_price() ); ?>" class="getpaid-item-price-input p-1 align-middle font-weight-normal shadow-none m-0 rounded-0 text-center border border">
63
+                                    <input type="text" name="getpaid-items[<?php echo (int) $item->get_id(); ?>][price]" value="<?php echo $price; ?>" placeholder="<?php echo esc_attr($item->get_minimum_price()); ?>" class="getpaid-item-price-input p-1 align-middle font-weight-normal shadow-none m-0 rounded-0 text-center border border">
64 64
 
65
-                                    <?php if( 'left' != $position ) : ?>
65
+                                    <?php if ('left' != $position) : ?>
66 66
                                         <div class="input-group-append">
67
-                                            <span class="input-group-text"><?php echo wpinv_currency_symbol( $currency ); ?></span>
67
+                                            <span class="input-group-text"><?php echo wpinv_currency_symbol($currency); ?></span>
68 68
                                         </div>
69 69
                                     <?php endif; ?>
70 70
                                 </div>
71 71
                             <?php
72 72
                         } else {
73
-                            echo wpinv_price( wpinv_format_amount( $item->get_price() ), $currency );
73
+                            echo wpinv_price(wpinv_format_amount($item->get_price()), $currency);
74 74
                             ?>
75
-                                <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][price]' type='hidden' class='getpaid-item-price-input' value='<?php echo esc_attr( $item->get_price() ); ?>'>
75
+                                <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][price]' type='hidden' class='getpaid-item-price-input' value='<?php echo esc_attr($item->get_price()); ?>'>
76 76
                             <?php
77 77
                         }
78 78
                     }
79 79
 
80 80
                     // Item quantity.
81
-                    if ( 'quantity' == $key ) {
81
+                    if ('quantity' == $key) {
82 82
 
83
-                        if ( $item->allows_quantities() ) {
83
+                        if ($item->allows_quantities()) {
84 84
                             ?>
85 85
                                 <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][quantity]' type='number' class='getpaid-item-quantity-input p-1 align-middle font-weight-normal shadow-none m-0 rounded-0 text-center border' value='<?php echo (int) $item->get_qantity(); ?>' min='1' required>
86 86
                             <?php
@@ -94,15 +94,15 @@  discard block
 block discarded – undo
94 94
                     }
95 95
 
96 96
                     // Item sub total.
97
-                    if ( 'subtotal' == $key ) {
98
-                        echo wpinv_price( wpinv_format_amount( $item->get_sub_total() ), $currency );
97
+                    if ('subtotal' == $key) {
98
+                        echo wpinv_price(wpinv_format_amount($item->get_sub_total()), $currency);
99 99
                     }
100 100
 
101
-                    do_action( "getpaid_payment_form_cart_item_$key", $item, $form );
101
+                    do_action("getpaid_payment_form_cart_item_$key", $item, $form);
102 102
                 ?>
103 103
             </div>
104 104
         <?php endforeach; ?>
105 105
     </div>
106 106
 </div>
107 107
 <?php
108
-do_action(  'getpaid_payment_form_cart_item', $form, $item );
108
+do_action('getpaid_payment_form_cart_item', $form, $item);
Please login to merge, or discard this patch.
templates/payment-forms/elements/gateway_select.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 // The payment methods select title.
13
-if ( empty( $text ) ) {
14
-    $text = __( 'Select Payment Method', 'invoicing' );
13
+if (empty($text)) {
14
+    $text = __('Select Payment Method', 'invoicing');
15 15
 }
16 16
 
17 17
 // An array of active payment methods.
18
-$gateways = wpinv_get_enabled_payment_gateways( true );
18
+$gateways = wpinv_get_enabled_payment_gateways(true);
19 19
 
20 20
 // The current invoice id.
21 21
 $invoice_id     = 0;
22 22
 $chosen_gateway = wpinv_get_default_gateway();
23 23
 
24
-if ( ! empty( $form->invoice ) ) {
24
+if (!empty($form->invoice)) {
25 25
     $invoice_id = $form->invoice->get_id();
26 26
     $chosen_gateway = $form->invoice->get_gateway();
27 27
 }
@@ -30,21 +30,21 @@  discard block
 block discarded – undo
30 30
 
31 31
     <div class="mt-4 mb-4 getpaid-gateways">
32 32
 
33
-        <?php do_action( 'wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
33
+        <?php do_action('wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form); ?>
34 34
 
35 35
         <div class="getpaid-select-gateway-title-div">
36
-            <h6><?php echo sanitize_text_field( $text ); ?></h6>
36
+            <h6><?php echo sanitize_text_field($text); ?></h6>
37 37
         </div>
38 38
 
39 39
         <div class="getpaid-available-gateways-div">
40 40
 
41
-            <?php foreach ( array_keys( $gateways ) as $gateway ) : ?>
41
+            <?php foreach (array_keys($gateways) as $gateway) : ?>
42 42
 
43
-                <div class="pt-1 pb-1 getpaid-gateway getpaid-gateway-<?php echo sanitize_html_class( $gateway ) ;?>" data-checkout-label='<?php echo esc_attr( apply_filters( "getpaid_gateway_{$gateway}_checkout_button_label", '' ) ); ?>'>
43
+                <div class="pt-1 pb-1 getpaid-gateway getpaid-gateway-<?php echo sanitize_html_class($gateway); ?>" data-checkout-label='<?php echo esc_attr(apply_filters("getpaid_gateway_{$gateway}_checkout_button_label", '')); ?>'>
44 44
 
45 45
                     <label class="d-block w-100 getpaid-gateway-radio">
46
-                        <input type="radio" value="<?php echo esc_attr( $gateway ) ;?>" <?php checked( $gateway, $chosen_gateway ) ;?> name="wpi-gateway">
47
-                        <span><?php echo sanitize_text_field( wpinv_get_gateway_checkout_label( $gateway ) ); ?></span>
46
+                        <input type="radio" value="<?php echo esc_attr($gateway); ?>" <?php checked($gateway, $chosen_gateway); ?> name="wpi-gateway">
47
+                        <span><?php echo sanitize_text_field(wpinv_get_gateway_checkout_label($gateway)); ?></span>
48 48
                     </label>
49 49
 
50 50
                 </div>
@@ -55,22 +55,22 @@  discard block
 block discarded – undo
55 55
 
56 56
         <div class="getpaid-gateway-descriptions-div">
57 57
 
58
-            <?php foreach ( array_keys( $gateways ) as $gateway ) : ?>
58
+            <?php foreach (array_keys($gateways) as $gateway) : ?>
59 59
 
60
-                <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo sanitize_html_class( $gateway ) ;?>" style="display: none;">
60
+                <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo sanitize_html_class($gateway); ?>" style="display: none;">
61 61
                     <?php
62 62
 
63
-                        $description = wpinv_get_gateway_description( $gateway );
63
+                        $description = wpinv_get_gateway_description($gateway);
64 64
 
65
-                        if ( wpinv_is_test_mode( $gateway ) ) {
66
-                            $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) );
65
+                        if (wpinv_is_test_mode($gateway)) {
66
+                            $sandbox_notice = apply_filters("getpaid_{$gateway}_sandbox_notice", __('SANDBOX ENABLED: No real payments will occur.', 'invoicing'));
67 67
                             $description = "$description $sandbox_notice";
68 68
                         }
69 69
 
70
-                        echo wpautop( wp_kses_post( $description ) );
70
+                        echo wpautop(wp_kses_post($description));
71 71
 
72
-                        do_action( 'wpinv_' . $gateway . '_checkout_fields', $invoice_id ) ;
73
-                        do_action( 'wpinv_' . $gateway . '_cc_form', $invoice_id, $form ) ;
72
+                        do_action('wpinv_' . $gateway . '_checkout_fields', $invoice_id);
73
+                        do_action('wpinv_' . $gateway . '_cc_form', $invoice_id, $form);
74 74
 
75 75
                     ?>
76 76
                 </div>
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             <?php
84 84
                 echo aui()->alert(
85 85
                     array(
86
-                        'content'     => __( 'None of the available payment gateways support subscriptions.', 'invoicing' ),
86
+                        'content'     => __('None of the available payment gateways support subscriptions.', 'invoicing'),
87 87
                         'type'        => 'danger',
88 88
                     )
89 89
                 );
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
             <?php
95 95
                 echo aui()->alert(
96 96
                     array(
97
-                        'content'     => __( 'There is no active payment gateway available to process your request.', 'invoicing' ),
97
+                        'content'     => __('There is no active payment gateway available to process your request.', 'invoicing'),
98 98
                         'type'        => 'danger',
99 99
                     )
100 100
                 );
101 101
             ?>
102 102
         </div>
103 103
 
104
-        <?php do_action( 'wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
104
+        <?php do_action('wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form); ?>
105 105
 
106 106
     </div>
107 107
 
Please login to merge, or discard this patch.
templates/payment-forms/cart.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -7,31 +7,31 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 // Cart table columns.
13 13
 $columns = array(
14
-    'name'     => __( 'Item', 'invoicing' ),
15
-    'price'    => __( 'Price', 'invoicing' ),
16
-    'quantity' => __( 'Quantity', 'invoicing' ),
17
-    'subtotal' => __( 'Subtotal', 'invoicing' ),
14
+    'name'     => __('Item', 'invoicing'),
15
+    'price'    => __('Price', 'invoicing'),
16
+    'quantity' => __('Quantity', 'invoicing'),
17
+    'subtotal' => __('Subtotal', 'invoicing'),
18 18
 );
19 19
 
20
-if ( ! empty( $form->invoice ) ) {
21
-    $columns = getpaid_invoice_item_columns( $form->invoice );
20
+if (!empty($form->invoice)) {
21
+    $columns = getpaid_invoice_item_columns($form->invoice);
22 22
 }
23 23
 
24
-$columns = apply_filters( 'getpaid_payment_form_cart_table_columns', $columns, $form );
24
+$columns = apply_filters('getpaid_payment_form_cart_table_columns', $columns, $form);
25 25
 
26
-do_action( 'getpaid_before_payment_form_cart', $form );
26
+do_action('getpaid_before_payment_form_cart', $form);
27 27
 
28 28
 ?>
29 29
     <div class="getpaid-payment-form-items-cart border form-group">
30 30
         <div class="getpaid-payment-form-items-cart-header border-bottom py-2 px-3 font-weight-bold bg-light">
31 31
             <div class="form-row">
32
-            <?php foreach ( $columns as $key => $label ) : ?>
33
-                <div class="<?php echo 'name' == $key ? 'col-12 col-sm-5' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?>">
34
-                    <?php echo sanitize_text_field( $label ); ?>
32
+            <?php foreach ($columns as $key => $label) : ?>
33
+                <div class="<?php echo 'name' == $key ? 'col-12 col-sm-5' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?>">
34
+                    <?php echo sanitize_text_field($label); ?>
35 35
                 </div>
36 36
             <?php endforeach; ?>
37 37
             </div>
@@ -39,16 +39,16 @@  discard block
 block discarded – undo
39 39
         <?php
40 40
 
41 41
             // Display the item totals.
42
-            foreach ( $form->get_items() as $item ) {
43
-                wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) );
42
+            foreach ($form->get_items() as $item) {
43
+                wpinv_get_template('payment-forms/cart-item.php', compact('form', 'item', 'columns'));
44 44
             }
45 45
 
46 46
             // Display the cart totals.
47
-            wpinv_get_template( 'payment-forms/cart-totals.php', compact( 'form' ) );
47
+            wpinv_get_template('payment-forms/cart-totals.php', compact('form'));
48 48
 
49 49
         ?>
50 50
     </div>
51 51
 
52 52
 <?php 
53 53
 
54
-do_action( 'getpaid_after_payment_form_cart', $form );
54
+do_action('getpaid_after_payment_form_cart', $form);
Please login to merge, or discard this patch.