Passed
Push — master ( 76d72b...5348ec )
by Brian
03:57
created
templates/payment-forms/elements/ip_address.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-if ( empty( $text ) ) {
13
-    $text = __( 'Your IP address is:', 'invoicing' );
12
+if (empty($text)) {
13
+    $text = __('Your IP address is:', 'invoicing');
14 14
 }
15 15
 
16
-$ip_address = esc_html( wpinv_get_ip() );
16
+$ip_address = esc_html(wpinv_get_ip());
17 17
 
18 18
 ?>
19 19
 <div class="form-group getpaid-ip-info">
20
-    <span><?php echo wp_kses_post( $text ); ?></span>
20
+    <span><?php echo wp_kses_post($text); ?></span>
21 21
     <strong><?php echo $ip_address; ?></strong>
22 22
 </div>
Please login to merge, or discard this patch.
templates/payment-forms/elements/discount.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,24 +8,24 @@
 block discarded – undo
8 8
  * @var GetPaid_Payment_Form $form The current payment form
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13
-if ( ! getpaid_has_published_discount() ) {
13
+if (!getpaid_has_published_discount()) {
14 14
     return;
15 15
 }
16 16
 
17
-$placeholder = esc_attr( $input_label );
18
-$label       = esc_html( $button_label );
17
+$placeholder = esc_attr($input_label);
18
+$label       = esc_html($button_label);
19 19
 
20
-if ( ! empty( $description ) ) {
20
+if (!empty($description)) {
21 21
     $description = "<small class='form-text text-muted'>$description</small>";
22 22
 } else {
23 23
     $description = '';
24 24
 }
25 25
 
26 26
 $discount_code = '';
27
-if ( ! empty( $form->invoice ) ) {
28
-    $discount_code = esc_attr( $form->invoice->get_discount_code() );
27
+if (!empty($form->invoice)) {
28
+    $discount_code = esc_attr($form->invoice->get_discount_code());
29 29
 }
30 30
 
31 31
 ?>
Please login to merge, or discard this patch.
templates/payment-forms/elements/price_input.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -7,32 +7,32 @@
 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
 // Set the currency position.
13 13
 $position = wpinv_currency_position();
14 14
 
15
-if ( $position == 'left_space' ) {
15
+if ($position == 'left_space') {
16 16
     $position = 'left';
17 17
 }
18 18
 
19
-if ( $position == 'right_space' ) {
19
+if ($position == 'right_space') {
20 20
     $position = 'right';
21 21
 }
22
-$label       = empty( $label ) ? '' : esc_html( $label );
23
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
22
+$label       = empty($label) ? '' : esc_html($label);
23
+$label_class = sanitize_key(preg_replace('/[^A-Za-z0-9_-]/', '-', $label));
24 24
 
25 25
 echo aui()->input(
26 26
     array(
27
-        'name'              => esc_attr( $id ),
28
-        'id'                => esc_attr( $id ) . uniqid( '_' ),
29
-        'placeholder'       => empty( $placeholder ) ? wpinv_format_amount(0) : wpinv_format_amount( $placeholder ),
30
-        'value'             => empty( $value ) ? wpinv_format_amount(0) : wpinv_format_amount( $value ),
31
-        'label'             => empty( $label ) ? '' : wp_kses_post( $label ),
27
+        'name'              => esc_attr($id),
28
+        'id'                => esc_attr($id) . uniqid('_'),
29
+        'placeholder'       => empty($placeholder) ? wpinv_format_amount(0) : wpinv_format_amount($placeholder),
30
+        'value'             => empty($value) ? wpinv_format_amount(0) : wpinv_format_amount($value),
31
+        'label'             => empty($label) ? '' : wp_kses_post($label),
32 32
         'label_type'        => 'vertical',
33
-        'help_text'         => empty( $description ) ? '' : wp_kses_post( $description ),
34
-        'input_group_right' => $position == 'right' ? wpinv_currency_symbol( $form->get_currency() ) : '',
35
-        'input_group_left'  => $position == 'left' ? wpinv_currency_symbol( $form->get_currency() ) : '',
33
+        'help_text'         => empty($description) ? '' : wp_kses_post($description),
34
+        'input_group_right' => $position == 'right' ? wpinv_currency_symbol($form->get_currency()) : '',
35
+        'input_group_left'  => $position == 'left' ? wpinv_currency_symbol($form->get_currency()) : '',
36 36
         'class'             => 'getpaid-refresh-on-change ' . $label_class,
37 37
     )
38 38
 );
Please login to merge, or discard this patch.
templates/payment-forms/elements/total_payable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-if ( empty( $text ) ) {
13
-    $text = __( 'Total to pay:', 'invoicing' );
12
+if (empty($text)) {
13
+    $text = __('Total to pay:', 'invoicing');
14 14
 }
15 15
 ?>
16 16
 <div class="form-group mt-4">
17
-    <strong><?php echo esc_html( $text ); ?></strong>
17
+    <strong><?php echo esc_html($text); ?></strong>
18 18
     <span class="getpaid-checkout-total-payable"></span>
19 19
 </div>
Please login to merge, or discard this patch.
templates/payment-forms/elements/address-fields.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -12,62 +12,62 @@  discard block
 block discarded – undo
12 12
  * @var GetPaid_Payment_Form $form
13 13
  */
14 14
 
15
-defined( 'ABSPATH' ) || exit;
15
+defined('ABSPATH') || exit;
16 16
 
17
-$field_type = sanitize_key( $field_type );
17
+$field_type = sanitize_key($field_type);
18 18
 
19 19
 echo "<div class='row $field_type'>";
20 20
 
21
-foreach ( $fields as $address_field ) {
21
+foreach ($fields as $address_field) {
22 22
 
23 23
     // Skip if it is hidden.
24
-    if ( empty( $address_field['visible'] ) ) {
24
+    if (empty($address_field['visible'])) {
25 25
         continue;
26 26
     }
27 27
 
28
-    do_action( 'getpaid_payment_form_address_field_before_' . $address_field['name'], $field_type, $address_field );
28
+    do_action('getpaid_payment_form_address_field_before_' . $address_field['name'], $field_type, $address_field);
29 29
 
30 30
     // Prepare variables.
31
-    if ( ! empty( $form->invoice ) ) {
31
+    if (!empty($form->invoice)) {
32 32
         $user_id = $form->invoice->get_user_id();
33 33
     }
34 34
 
35
-    if ( empty( $user_id ) && is_user_logged_in() ) {
35
+    if (empty($user_id) && is_user_logged_in()) {
36 36
         $user_id = get_current_user_id();
37 37
     }
38 38
 
39 39
     $field_name  = $address_field['name'];
40 40
     $field_name  = "{$field_type}[$field_name]";
41
-    $wrap_class  = getpaid_get_form_element_grid_class( $address_field );
42
-    $wrap_class  = esc_attr( "$wrap_class getpaid-address-field-wrapper" );
43
-    $placeholder = empty( $address_field['placeholder'] ) ? '' : esc_attr( $address_field['placeholder'] );
44
-    $description = empty( $address_field['description'] ) ? '' : wp_kses_post( $address_field['description'] );
45
-    $value       = ! empty( $user_id ) ? get_user_meta( $user_id, '_' . $address_field['name'], true ) : '';
46
-    $label       = empty( $address_field['label'] ) ? '' : wp_kses_post( $address_field['label'] );
47
-
48
-    $method_name = 'get_' . str_replace( 'wpinv_', '', $address_field['name'] );
49
-    if ( ! empty( $form->invoice ) && is_callable( array( $form->invoice, $method_name ) ) ) {
50
-        $value = call_user_func( array( $form->invoice, $method_name ) );
41
+    $wrap_class  = getpaid_get_form_element_grid_class($address_field);
42
+    $wrap_class  = esc_attr("$wrap_class getpaid-address-field-wrapper");
43
+    $placeholder = empty($address_field['placeholder']) ? '' : esc_attr($address_field['placeholder']);
44
+    $description = empty($address_field['description']) ? '' : wp_kses_post($address_field['description']);
45
+    $value       = !empty($user_id) ? get_user_meta($user_id, '_' . $address_field['name'], true) : '';
46
+    $label       = empty($address_field['label']) ? '' : wp_kses_post($address_field['label']);
47
+
48
+    $method_name = 'get_' . str_replace('wpinv_', '', $address_field['name']);
49
+    if (!empty($form->invoice) && is_callable(array($form->invoice, $method_name))) {
50
+        $value = call_user_func(array($form->invoice, $method_name));
51 51
     }
52 52
 
53
-    if ( ! empty( $address_field['required'] ) ) {
53
+    if (!empty($address_field['required'])) {
54 54
         $label .= "<span class='text-danger'> *</span>";
55 55
     }
56 56
 
57 57
     // Display the country.
58
-    if ( 'wpinv_country' == $address_field['name'] ) {
58
+    if ('wpinv_country' == $address_field['name']) {
59 59
 
60 60
         echo "<div class='form-group $wrap_class getpaid-address-field-wrapper__country'";
61 61
 
62 62
         echo aui()->select(
63 63
             array(
64 64
                 'options'     => wpinv_get_country_list(),
65
-                'name'        => esc_attr( $field_name ),
66
-                'id'          => sanitize_html_class( $field_name ) . $uniqid,
67
-                'value'       => esc_attr( $country ),
65
+                'name'        => esc_attr($field_name),
66
+                'id'          => sanitize_html_class($field_name) . $uniqid,
67
+                'value'       => esc_attr($country),
68 68
                 'placeholder' => $placeholder,
69
-                'required'    => ! empty( $address_field['required'] ),
70
-                'label'       => wp_kses_post( $label ),
69
+                'required'    => !empty($address_field['required']),
70
+                'label'       => wp_kses_post($label),
71 71
                 'label_type'  => 'vertical',
72 72
                 'help_text'   => $description,
73 73
                 'class'       => 'getpaid-address-field wpinv_country',
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             )
81 81
         );
82 82
 
83
-        if ( wpinv_should_validate_vat_number() ) {
83
+        if (wpinv_should_validate_vat_number()) {
84 84
 
85 85
             echo aui()->input(
86 86
                 array(
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                     'id'         => "shipping-toggle$uniqid",
90 90
                     'wrap_class' => "getpaid-address-field-wrapper__address-confirm mt-1 d-none",
91 91
                     'required'   => false,
92
-                    'label'      => __( 'I certify that I live in the country selected above', 'invoicing' ) . "<span class='text-danger'> *</span>",
92
+                    'label'      => __('I certify that I live in the country selected above', 'invoicing') . "<span class='text-danger'> *</span>",
93 93
                     'value'      => 1,
94 94
                     'checked'    => true,
95 95
                     'class'      => 'w-auto',
@@ -103,27 +103,27 @@  discard block
 block discarded – undo
103 103
     }
104 104
 
105 105
     // Display the state.
106
-    else if ( 'wpinv_state' == $address_field['name'] ) {
106
+    else if ('wpinv_state' == $address_field['name']) {
107 107
 
108
-        if ( empty( $value ) ) {
108
+        if (empty($value)) {
109 109
             $value = wpinv_get_default_state();
110 110
         }
111 111
 
112
-        echo getpaid_get_states_select_markup (
112
+        echo getpaid_get_states_select_markup(
113 113
             $country,
114 114
             $value,
115 115
             $placeholder,
116 116
             $label,
117 117
             $description,
118
-            ! empty( $address_field['required'] ),
118
+            !empty($address_field['required']),
119 119
             $wrap_class,
120 120
             $field_name
121 121
         );
122 122
 
123 123
     } else {
124 124
 
125
-        $key      = str_replace( 'wpinv_', '', $address_field['name'] );
126
-        $key      = esc_attr( str_replace( '_', '-', $key ) );
125
+        $key      = str_replace('wpinv_', '', $address_field['name']);
126
+        $key      = esc_attr(str_replace('_', '-', $key));
127 127
         $autocomplete = '';
128 128
         $replacements = array(
129 129
             'zip'        => 'postal-code',
@@ -136,37 +136,37 @@  discard block
 block discarded – undo
136 136
         );
137 137
 
138 138
 
139
-        if ( isset( $replacements[ $key ] ) ) {
139
+        if (isset($replacements[$key])) {
140 140
             $autocomplete = array(
141
-                'autocomplete' => "$field_type {$replacements[ $key ]}",
141
+                'autocomplete' => "$field_type {$replacements[$key]}",
142 142
             );
143 143
         }
144 144
 
145 145
         $append = '';
146 146
 
147
-        if ( 'billing' === $field_type && wpinv_should_validate_vat_number() && 'vat-number' === $key ) {
148
-            $valid    = esc_attr__( 'Valid', 'invoicing' );
149
-            $invalid  = esc_attr__( 'Invalid', 'invoicing' );
150
-            $validate = esc_attr__( 'Validate', 'invoicing' );
147
+        if ('billing' === $field_type && wpinv_should_validate_vat_number() && 'vat-number' === $key) {
148
+            $valid    = esc_attr__('Valid', 'invoicing');
149
+            $invalid  = esc_attr__('Invalid', 'invoicing');
150
+            $validate = esc_attr__('Validate', 'invoicing');
151 151
             $append   = "<span class='btn btn-primary getpaid-vat-number-validate' data-valid='$valid' data-invalid='$invalid' data-validate='$validate'>$validate</span>";
152 152
         }
153 153
 
154
-        if ( 'billing' === $field_type ) {
155
-            $description .= '<div class="getpaid-error-' . sanitize_html_class( $field_name ) . ' getpaid-custom-payment-form-errors alert alert-danger d-none"></div>';
154
+        if ('billing' === $field_type) {
155
+            $description .= '<div class="getpaid-error-' . sanitize_html_class($field_name) . ' getpaid-custom-payment-form-errors alert alert-danger d-none"></div>';
156 156
         }
157 157
 
158 158
         echo aui()->input(
159 159
             array(
160
-                'name'        => esc_attr( $field_name ),
161
-                'id'          => sanitize_html_class( $field_name ) . $uniqid,
162
-                'required'    => ! empty( $address_field['required'] ),
160
+                'name'        => esc_attr($field_name),
161
+                'id'          => sanitize_html_class($field_name) . $uniqid,
162
+                'required'    => !empty($address_field['required']),
163 163
                 'placeholder' => $placeholder,
164
-                'label'       => wp_kses_post( $label ),
164
+                'label'       => wp_kses_post($label),
165 165
                 'label_type'  => 'vertical',
166 166
                 'help_text'   => $description,
167 167
                 'type'        => 'text',
168
-                'value'       => esc_attr( $value ),
169
-                'class'       => 'getpaid-address-field ' . esc_attr( $address_field['name'] ),
168
+                'value'       => esc_attr($value),
169
+                'class'       => 'getpaid-address-field ' . esc_attr($address_field['name']),
170 170
                 'wrap_class'  => "$wrap_class getpaid-address-field-wrapper__$key",
171 171
                 'label_class' => 'getpaid-address-field-label getpaid-address-field-label__' . $key,
172 172
                 'extra_attributes'  => $autocomplete,
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
     }
178 178
 
179
-    do_action( 'getpaid_payment_form_address_field_after_' . $address_field['name'], $field_type, $address_field );
179
+    do_action('getpaid_payment_form_address_field_after_' . $address_field['name'], $field_type, $address_field);
180 180
 }
181 181
 
182 182
 echo "</div>";
Please login to merge, or discard this patch.
templates/payment-forms/elements/gateway_select.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -7,45 +7,45 @@  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
 }
28 28
 
29 29
 ?>
30 30
 
31
-    <?php do_action( 'getpaid_before_payment_form_gateway_select', $form ); ?>
31
+    <?php do_action('getpaid_before_payment_form_gateway_select', $form); ?>
32 32
     <div class="mt-4 mb-4 getpaid-gateways">
33 33
 
34
-        <?php do_action( 'wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
34
+        <?php do_action('wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form); ?>
35 35
 
36 36
         <div class="getpaid-select-gateway-title-div">
37
-            <h6><?php echo esc_html( $text ); ?></h6>
37
+            <h6><?php echo esc_html($text); ?></h6>
38 38
         </div>
39 39
 
40 40
         <div class="getpaid-available-gateways-div">
41 41
 
42
-            <?php foreach ( array_keys( $gateways ) as $gateway ) : ?>
42
+            <?php foreach (array_keys($gateways) as $gateway) : ?>
43 43
 
44
-                <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
+                <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", '')); ?>'>
45 45
 
46 46
                     <label class="d-block w-100 getpaid-gateway-radio">
47
-                        <input type="radio" value="<?php echo esc_attr( $gateway ) ;?>" <?php checked( $gateway, $chosen_gateway ) ;?> name="wpi-gateway">
48
-                        <span><?php echo esc_html( wpinv_get_gateway_checkout_label( $gateway ) ); ?></span>
47
+                        <input type="radio" value="<?php echo esc_attr($gateway); ?>" <?php checked($gateway, $chosen_gateway); ?> name="wpi-gateway">
48
+                        <span><?php echo esc_html(wpinv_get_gateway_checkout_label($gateway)); ?></span>
49 49
                     </label>
50 50
 
51 51
                 </div>
@@ -56,22 +56,22 @@  discard block
 block discarded – undo
56 56
 
57 57
         <div class="getpaid-gateway-descriptions-div">
58 58
 
59
-            <?php foreach ( array_keys( $gateways ) as $gateway ) : ?>
59
+            <?php foreach (array_keys($gateways) as $gateway) : ?>
60 60
 
61
-                <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo sanitize_html_class( $gateway ) ;?>" style="display: none;">
61
+                <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo sanitize_html_class($gateway); ?>" style="display: none;">
62 62
                     <?php
63 63
 
64
-                        $description = wpinv_get_gateway_description( $gateway );
64
+                        $description = wpinv_get_gateway_description($gateway);
65 65
 
66
-                        if ( wpinv_is_test_mode( $gateway ) ) {
67
-                            $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) );
66
+                        if (wpinv_is_test_mode($gateway)) {
67
+                            $sandbox_notice = apply_filters("getpaid_{$gateway}_sandbox_notice", __('SANDBOX ENABLED: No real payments will occur.', 'invoicing'));
68 68
                             $description = "$description $sandbox_notice";
69 69
                         }
70 70
 
71
-                        echo wpautop( wp_kses_post( $description ) );
71
+                        echo wpautop(wp_kses_post($description));
72 72
 
73
-                        do_action( 'wpinv_' . $gateway . '_checkout_fields', $invoice_id ) ;
74
-                        do_action( 'wpinv_' . $gateway . '_cc_form', $invoice_id, $form ) ;
73
+                        do_action('wpinv_' . $gateway . '_checkout_fields', $invoice_id);
74
+                        do_action('wpinv_' . $gateway . '_cc_form', $invoice_id, $form);
75 75
 
76 76
                     ?>
77 77
                 </div>
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             <?php
85 85
                 echo aui()->alert(
86 86
                     array(
87
-                        'content'     => __( 'None of the available payment gateways support purchasing recurring items.', 'invoicing' ),
87
+                        'content'     => __('None of the available payment gateways support purchasing recurring items.', 'invoicing'),
88 88
                         'type'        => 'danger',
89 89
                     )
90 90
                 );
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             <?php
96 96
                 echo aui()->alert(
97 97
                     array(
98
-                        'content'     => __( 'None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing' ),
98
+                        'content'     => __('None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing'),
99 99
                         'type'        => 'danger',
100 100
                     )
101 101
                 );
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             <?php
107 107
                 echo aui()->alert(
108 108
                     array(
109
-                        'content'     => __( 'None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing' ),
109
+                        'content'     => __('None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing'),
110 110
                         'type'        => 'danger',
111 111
                     )
112 112
                 );
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
             <?php
118 118
                 echo aui()->alert(
119 119
                     array(
120
-                        'content'     => __( 'There is no active payment gateway available to process your request.', 'invoicing' ),
120
+                        'content'     => __('There is no active payment gateway available to process your request.', 'invoicing'),
121 121
                         'type'        => 'danger',
122 122
                     )
123 123
                 );
124 124
             ?>
125 125
         </div>
126 126
 
127
-        <?php do_action( 'wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
127
+        <?php do_action('wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form); ?>
128 128
 
129 129
     </div>
130
-    <?php do_action( 'getpaid_after_payment_form_gateway_select', $form ); ?>
130
+    <?php do_action('getpaid_after_payment_form_gateway_select', $form); ?>
Please login to merge, or discard this patch.
templates/emails/invoice-totals.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -8,22 +8,22 @@  discard block
 block discarded – undo
8 8
  * @var WPInv_Invoice $invoice
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 // Totals rows.
14
-$totals = getpaid_invoice_totals_rows( $invoice );
14
+$totals = getpaid_invoice_totals_rows($invoice);
15 15
 
16
-do_action( 'getpaid_before_email_line_totals', $invoice, $totals );
16
+do_action('getpaid_before_email_line_totals', $invoice, $totals);
17 17
 
18 18
 ?>
19 19
 
20 20
 
21
-<?php if ( has_action( 'wpinv_email_footer_buttons' ) ) : ?>
21
+<?php if (has_action('wpinv_email_footer_buttons')) : ?>
22 22
 
23 23
     <tr class="wpinv_cart_footer_row">
24 24
 
25
-        <td colspan="<?php echo ( (int) $column_count ); ?>">
26
-            <?php do_action( 'wpinv_email_footer_buttons' ); ?>
25
+        <td colspan="<?php echo ((int) $column_count); ?>">
26
+            <?php do_action('wpinv_email_footer_buttons'); ?>
27 27
         </td>
28 28
 
29 29
     </tr>
@@ -31,44 +31,44 @@  discard block
 block discarded – undo
31 31
 <?php endif; ?>
32 32
 
33 33
 
34
-<?php foreach ( $totals as $key => $label ) : ?>
34
+<?php foreach ($totals as $key => $label) : ?>
35 35
 
36
-    <tr class="wpinv_cart_footer_row wpinv_cart_<?php echo sanitize_html_class( $key ); ?>_row">
36
+    <tr class="wpinv_cart_footer_row wpinv_cart_<?php echo sanitize_html_class($key); ?>_row">
37 37
 
38
-        <td colspan="<?php echo ( $column_count - 1 ); ?>" class="wpinv_cart_<?php echo sanitize_html_class( $key ); ?>_label text-right">
39
-            <strong><?php echo esc_html( $label ); ?>:</strong>
38
+        <td colspan="<?php echo ($column_count - 1); ?>" class="wpinv_cart_<?php echo sanitize_html_class($key); ?>_label text-right">
39
+            <strong><?php echo esc_html($label); ?>:</strong>
40 40
         </td>
41 41
 
42
-        <td class="wpinv_cart_<?php echo sanitize_html_class( $key ); ?> text-right">
42
+        <td class="wpinv_cart_<?php echo sanitize_html_class($key); ?> text-right">
43 43
 
44 44
             <?php
45 45
 
46 46
                 // Total tax.
47
-                if ( 'tax' == $key ) {
48
-                    echo wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() );
47
+                if ('tax' == $key) {
48
+                    echo wpinv_price($invoice->get_total_tax(), $invoice->get_currency());
49 49
                 }
50 50
 
51
-                if ( 'fee' == $key ) {
52
-                    echo wpinv_price( $invoice->get_total_fees(), $invoice->get_currency() );
51
+                if ('fee' == $key) {
52
+                    echo wpinv_price($invoice->get_total_fees(), $invoice->get_currency());
53 53
                 }
54 54
 
55 55
                 // Total discount.
56
-                if ( 'discount' == $key ) {
57
-                    echo wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() );
56
+                if ('discount' == $key) {
57
+                    echo wpinv_price($invoice->get_total_discount(), $invoice->get_currency());
58 58
                 }
59 59
 
60 60
                 // Sub total.
61
-                if ( 'subtotal' == $key ) {
62
-                    echo wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() );
61
+                if ('subtotal' == $key) {
62
+                    echo wpinv_price($invoice->get_subtotal(), $invoice->get_currency());
63 63
                 }
64 64
 
65 65
                 // Total.
66
-                if ( 'total' == $key ) {
67
-                    echo wpinv_price( $invoice->get_total(), $invoice->get_currency() );
66
+                if ('total' == $key) {
67
+                    echo wpinv_price($invoice->get_total(), $invoice->get_currency());
68 68
                 }
69 69
 
70 70
                 // Fires when printing a cart total in an email.
71
-                do_action( "getpaid_email_cart_totals_$key", $invoice );
71
+                do_action("getpaid_email_cart_totals_$key", $invoice);
72 72
 
73 73
             ?>
74 74
 
@@ -80,4 +80,4 @@  discard block
 block discarded – undo
80 80
 
81 81
 <?php
82 82
 
83
-    do_action( 'getpaid_after_email_line_totals', $invoice, $totals );
83
+    do_action('getpaid_after_email_line_totals', $invoice, $totals);
Please login to merge, or discard this patch.
templates/emails/invoice-details.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,45 +8,45 @@  discard block
 block discarded – undo
8 8
  * @var WPInv_Invoice $invoice
9 9
  * @var array $columns
10 10
  */
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13
-$meta_data = getpaid_get_invoice_meta( $invoice );
13
+$meta_data = getpaid_get_invoice_meta($invoice);
14 14
 
15
-if ( isset( $meta_data['status'] ) ) {
15
+if (isset($meta_data['status'])) {
16 16
     $meta_data['status']['value'] = $invoice->get_status_nicename();
17 17
 }
18 18
 
19
-do_action( 'wpinv_email_before_invoice_details', $invoice, $sent_to_admin );
19
+do_action('wpinv_email_before_invoice_details', $invoice, $sent_to_admin);
20 20
 
21 21
 ?>
22 22
 
23 23
 <div id="wpinv-email-details">
24 24
 
25 25
     <h3 class="invoice-details-title">
26
-        <?php echo sprintf( esc_html__( '%s Details', 'invoicing' ), ucfirst( $invoice->get_invoice_quote_type() )); ?>
26
+        <?php echo sprintf(esc_html__('%s Details', 'invoicing'), ucfirst($invoice->get_invoice_quote_type())); ?>
27 27
     </h3>
28 28
 
29 29
     <table class="table table-bordered table-sm">
30 30
 
31
-        <?php foreach ( $meta_data as $key => $data ) : ?>
31
+        <?php foreach ($meta_data as $key => $data) : ?>
32 32
 
33
-            <?php if ( ! empty( $data['value'] ) ) : ?>
33
+            <?php if (!empty($data['value'])) : ?>
34 34
 
35
-                <?php do_action( "getpaid_before_email_details_$key", $invoice, $data ); ?>
35
+                <?php do_action("getpaid_before_email_details_$key", $invoice, $data); ?>
36 36
 
37
-                <tr class="getpaid-email-details-<?php echo sanitize_html_class( $key ); ?>">
37
+                <tr class="getpaid-email-details-<?php echo sanitize_html_class($key); ?>">
38 38
 
39 39
                     <td class="getpaid-lable-td">
40
-                        <?php echo esc_html( $data['label'] ); ?>
40
+                        <?php echo esc_html($data['label']); ?>
41 41
                     </td>
42 42
 
43 43
                     <td class="getpaid-value-td">
44
-                        <span class="getpaid-invoice-meta-<?php echo sanitize_html_class( $key ); ?>-value"><?php echo wp_kses_post( $data['value'] ); ?></span>
44
+                        <span class="getpaid-invoice-meta-<?php echo sanitize_html_class($key); ?>-value"><?php echo wp_kses_post($data['value']); ?></span>
45 45
                     </td>
46 46
 
47 47
                 </tr>
48 48
 
49
-                <?php do_action( "getpaid_after_email_details_$key", $invoice, $data ); ?>
49
+                <?php do_action("getpaid_after_email_details_$key", $invoice, $data); ?>
50 50
 
51 51
             <?php endif; ?>
52 52
 
@@ -56,4 +56,4 @@  discard block
 block discarded – undo
56 56
 
57 57
 </div>
58 58
 
59
-<?php do_action( 'wpinv_email_after_invoice_details', $invoice, $sent_to_admin ); ?>
59
+<?php do_action('wpinv_email_after_invoice_details', $invoice, $sent_to_admin); ?>
Please login to merge, or discard this patch.
templates/emails/invoice-item.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -10,66 +10,66 @@  discard block
 block discarded – undo
10 10
  * @var array $columns
11 11
  */
12 12
 
13
-defined( 'ABSPATH' ) || exit;
13
+defined('ABSPATH') || exit;
14 14
 
15 15
 ?>
16 16
 
17
-<?php do_action( 'getpaid_before_email_line_item', $invoice, $item ); ?>
17
+<?php do_action('getpaid_before_email_line_item', $invoice, $item); ?>
18 18
 
19
-<tr class="wpinv_cart_item item-type-<?php echo sanitize_html_class( $item->get_type() ); ?>">
19
+<tr class="wpinv_cart_item item-type-<?php echo sanitize_html_class($item->get_type()); ?>">
20 20
 
21
-    <?php foreach ( array_keys( $columns ) as $column ): ?>
21
+    <?php foreach (array_keys($columns) as $column): ?>
22 22
 
23
-        <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class( $column ); ?>">
23
+        <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class($column); ?>">
24 24
             
25 25
             <?php
26 26
 
27 27
                 // Fires before printing a line item column.
28
-                do_action( "getpaid_email_line_item_before_$column", $item, $invoice );
28
+                do_action("getpaid_email_line_item_before_$column", $item, $invoice);
29 29
 
30 30
                 // Item name.
31
-                if ( 'name' == $column ) {
31
+                if ('name' == $column) {
32 32
 
33 33
                     // Display the name.
34
-                    echo '<div class="wpinv_email_cart_item_title">' . esc_html( $item->get_name() ) . '</div>';
34
+                    echo '<div class="wpinv_email_cart_item_title">' . esc_html($item->get_name()) . '</div>';
35 35
 
36 36
                     // And an optional description.
37 37
                     $description = $item->get_description();
38 38
 
39
-                    if ( ! empty( $description ) ) {
40
-                        $description = wp_kses_post( $description );
39
+                    if (!empty($description)) {
40
+                        $description = wp_kses_post($description);
41 41
                         echo "<p class='small'>$description</p>";
42 42
                     }
43 43
 
44 44
                 }
45 45
 
46 46
                 // Item price.
47
-                if ( 'price' == $column ) {
47
+                if ('price' == $column) {
48 48
 
49 49
                     // Display the item price (or recurring price if this is a renewal invoice)
50 50
                     $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price();
51
-                    echo wpinv_price( $price, $invoice->get_currency() );
51
+                    echo wpinv_price($price, $invoice->get_currency());
52 52
 
53 53
                 }
54 54
 
55 55
                 // Item quantity.
56
-                if ( 'quantity' == $column ) {
56
+                if ('quantity' == $column) {
57 57
                     echo (float) $item->get_quantity();
58 58
                 }
59 59
 
60 60
                 // Tax rate.
61
-                if ( 'tax_rate' == $column ) {
62
-                    echo round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) . '%';
61
+                if ('tax_rate' == $column) {
62
+                    echo round(getpaid_get_invoice_tax_rate($invoice, $item), 2) . '%';
63 63
                 }
64 64
 
65 65
                 // Item sub total.
66
-                if ( 'subtotal' == $column ) {
66
+                if ('subtotal' == $column) {
67 67
                     $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total();
68
-                    echo wpinv_price( $subtotal, $invoice->get_currency() );
68
+                    echo wpinv_price($subtotal, $invoice->get_currency());
69 69
                 }
70 70
 
71 71
                 // Fires when printing a line item column.
72
-                do_action( "getpaid_email_line_item_$column", $item, $invoice );
72
+                do_action("getpaid_email_line_item_$column", $item, $invoice);
73 73
 
74 74
             ?>
75 75
 
@@ -79,4 +79,4 @@  discard block
 block discarded – undo
79 79
 
80 80
 </tr>
81 81
 
82
-<?php do_action( 'getpaid_after_email_line_item', $invoice, $item ); ?>
82
+<?php do_action('getpaid_after_email_line_item', $invoice, $item); ?>
Please login to merge, or discard this patch.