Passed
Push — master ( 23c074...2114e2 )
by Brian
05:15
created
templates/geolocation.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  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
 
13 13
 ?><!DOCTYPE html>
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 
17 17
     <head>
18 18
 
19
-		<meta charset="<?php bloginfo( 'charset' ); ?>">
19
+		<meta charset="<?php bloginfo('charset'); ?>">
20 20
         <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" >
21 21
 
22 22
         <meta name="robots" content="noindex,nofollow">
23 23
 
24 24
 		<link rel="profile" href="https://gmpg.org/xfn/11">
25 25
 
26
-        <title><?php _e( 'GetPaid GeoLocation', 'invoicing' ); ?></title>
26
+        <title><?php _e('GetPaid GeoLocation', 'invoicing'); ?></title>
27 27
 
28 28
         <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
29 29
         <script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
70 70
                 osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
71 71
                 osm = L.tileLayer( osmUrl, { maxZoom: 18, attribution: osmAttrib } ),
72
-                latlng = new L.LatLng( <?php echo sanitize_text_field( $latitude );?>, <?php echo sanitize_text_field( $longitude );?> );
72
+                latlng = new L.LatLng( <?php echo sanitize_text_field($latitude); ?>, <?php echo sanitize_text_field($longitude); ?> );
73 73
 
74 74
             var map = new L.Map( 'map', {center: latlng, zoom: 18, layers: [osm]});
75 75
 
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
             map.addLayer(marker);
78 78
 
79 79
             marker
80
-                .bindPopup("<p><?php echo esc_attr( $address );?></p>")
80
+                .bindPopup("<p><?php echo esc_attr($address); ?></p>")
81 81
                 .openPopup();
82 82
         </script>
83 83
 
84
-        <div style="height:100px"><?php echo wp_kses_post( $content ); ?></div>
84
+        <div style="height:100px"><?php echo wp_kses_post($content); ?></div>
85 85
 
86 86
     </body>
87 87
 
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-items.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if (!defined('ABSPATH')) {
11 11
 	exit; // Exit if accessed directly
12 12
 }
13 13
 
@@ -21,51 +21,51 @@  discard block
 block discarded – undo
21 21
 	 *
22 22
 	 * @param WP_Post $post
23 23
 	 */
24
-    public static function output( $post ) {
24
+    public static function output($post) {
25 25
 
26 26
         // Prepare the invoice.
27
-        $invoice = new WPInv_Invoice( $post );
27
+        $invoice = new WPInv_Invoice($post);
28 28
 
29 29
         // Invoice items.
30 30
         $items = $invoice->get_items();
31 31
 
32 32
         // New item url.
33
-        $new_item = admin_url( 'post-new.php?post_type=wpi_item' );
33
+        $new_item = admin_url('post-new.php?post_type=wpi_item');
34 34
 
35 35
         // Totals.
36
-        $total = wpinv_price( wpinv_format_amount( $invoice->get_total() ), $invoice->get_currency() );
36
+        $total = wpinv_price(wpinv_format_amount($invoice->get_total()), $invoice->get_currency());
37 37
 
38
-        if ( $invoice->is_recurring() && $invoice->is_parent() && $invoice->get_total() != $invoice->get_recurring_total() ) {
39
-            $recurring_total = wpinv_price( wpinv_format_amount( $invoice->get_recurring_total() ), $invoice->get_currency() );
40
-            $total          .= '<small class="form-text text-muted">' . sprintf( __( 'Recurring Price: %s', 'invoicing' ), $recurring_total ) . '</small>';
38
+        if ($invoice->is_recurring() && $invoice->is_parent() && $invoice->get_total() != $invoice->get_recurring_total()) {
39
+            $recurring_total = wpinv_price(wpinv_format_amount($invoice->get_recurring_total()), $invoice->get_currency());
40
+            $total          .= '<small class="form-text text-muted">' . sprintf(__('Recurring Price: %s', 'invoicing'), $recurring_total) . '</small>';
41 41
         }
42 42
 
43 43
         $totals = array(
44 44
 
45 45
             'subtotal'  => array(
46
-                'label' => __( 'Items Subtotal', 'invoicing' ),
47
-                'value' => wpinv_price( wpinv_format_amount( $invoice->get_subtotal() ), $invoice->get_currency() ),
46
+                'label' => __('Items Subtotal', 'invoicing'),
47
+                'value' => wpinv_price(wpinv_format_amount($invoice->get_subtotal()), $invoice->get_currency()),
48 48
             ),
49 49
 
50 50
             'discount'  => array(
51
-                'label' => __( 'Total Discount', 'invoicing' ),
52
-                'value' => wpinv_price( wpinv_format_amount( $invoice->get_total_discount() ), $invoice->get_currency() ),
51
+                'label' => __('Total Discount', 'invoicing'),
52
+                'value' => wpinv_price(wpinv_format_amount($invoice->get_total_discount()), $invoice->get_currency()),
53 53
             ),
54 54
 
55 55
             'tax'       => array(
56
-                'label' => __( 'Total Tax', 'invoicing' ),
57
-                'value' => wpinv_price( wpinv_format_amount( $invoice->get_total_tax() ), $invoice->get_currency() ),
56
+                'label' => __('Total Tax', 'invoicing'),
57
+                'value' => wpinv_price(wpinv_format_amount($invoice->get_total_tax()), $invoice->get_currency()),
58 58
             ),
59 59
 
60 60
             'total'     => array(
61
-                'label' => __( 'Invoice Total', 'invoicing' ),
61
+                'label' => __('Invoice Total', 'invoicing'),
62 62
                 'value' => $total,
63 63
             )
64 64
         );
65 65
 
66 66
 
67
-        if ( ! wpinv_use_taxes() ) {
68
-            unset( $totals['tax'] );
67
+        if (!wpinv_use_taxes()) {
68
+            unset($totals['tax']);
69 69
         }
70 70
         ?>
71 71
 
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
             }
82 82
         </style>
83 83
 
84
-                <div class="bsui getpaid-invoice-items-inner <?php echo sanitize_html_class( $invoice->get_template( 'edit' ) ); ?> <?php echo empty( $items ) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem">
84
+                <div class="bsui getpaid-invoice-items-inner <?php echo sanitize_html_class($invoice->get_template('edit')); ?> <?php echo empty($items) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem">
85 85
 
86
-                    <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?>
87
-                        <?php do_action( 'wpinv_meta_box_before_invoice_template_row', $invoice->get_id() ); ?>
86
+                    <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?>
87
+                        <?php do_action('wpinv_meta_box_before_invoice_template_row', $invoice->get_id()); ?>
88 88
 
89 89
                         <div class="row">
90 90
                             <div class="col-12 col-sm-6">
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
                                         array(
94 94
                                             'id'          => 'wpinv_template',
95 95
                                             'name'        => 'wpinv_template',
96
-                                            'label'       => __( 'Template', 'invoicing' ),
96
+                                            'label'       => __('Template', 'invoicing'),
97 97
                                             'label_type'  => 'vertical',
98
-                                            'placeholder' => __( 'Choose a template', 'invoicing' ),
98
+                                            'placeholder' => __('Choose a template', 'invoicing'),
99 99
                                             'class'       => 'form-control-sm',
100
-                                            'value'       => $invoice->get_template( 'edit' ),
100
+                                            'value'       => $invoice->get_template('edit'),
101 101
                                             'options'     => array(
102
-                                                'quantity' => __( 'Quantity', 'invoicing' ),
103
-                                                'hours'    => __( 'Hours', 'invoicing' ),
104
-                                                'amount'   => __( 'Amount Only', 'invoicing' ),
102
+                                                'quantity' => __('Quantity', 'invoicing'),
103
+                                                'hours'    => __('Hours', 'invoicing'),
104
+                                                'amount'   => __('Amount Only', 'invoicing'),
105 105
                                             ),
106 106
                                             'data-allow-clear' => 'false',
107 107
                                             'select2'          => true,
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
                                         array(
118 118
                                             'id'          => 'wpinv_currency',
119 119
                                             'name'        => 'wpinv_currency',
120
-                                            'label'       => __( 'Currency', 'invoicing' ),
120
+                                            'label'       => __('Currency', 'invoicing'),
121 121
                                             'label_type'  => 'vertical',
122
-                                            'placeholder' => __( 'Select Invoice Currency', 'invoicing' ),
122
+                                            'placeholder' => __('Select Invoice Currency', 'invoicing'),
123 123
                                             'class'       => 'form-control-sm',
124
-                                            'value'       => $invoice->get_currency( 'edit' ),
124
+                                            'value'       => $invoice->get_currency('edit'),
125 125
                                             'required'    => false,
126 126
                                             'data-allow-clear' => 'false',
127 127
                                             'select2'          => true,
@@ -133,24 +133,24 @@  discard block
 block discarded – undo
133 133
                             </div>
134 134
                         </div>
135 135
 
136
-                        <?php do_action( 'wpinv_meta_box_invoice_template_row', $invoice->get_id() ); ?>
136
+                        <?php do_action('wpinv_meta_box_invoice_template_row', $invoice->get_id()); ?>
137 137
                     <?php endif; ?>
138 138
 
139 139
                     <table cellpadding="0" cellspacing="0" class="getpaid_invoice_items">
140 140
                         <thead>
141 141
                             <tr>
142
-                                <th class="getpaid-item" colspan="2"><?php _e( 'Item', 'invoicing' ) ?></th>
142
+                                <th class="getpaid-item" colspan="2"><?php _e('Item', 'invoicing') ?></th>
143 143
                                 <th class="getpaid-quantity hide-if-amount text-right">
144
-                                    <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span>
145
-                                    <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span>
144
+                                    <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span>
145
+                                    <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span>
146 146
                                 </th>
147 147
                                 <th class="getpaid-price hide-if-amount text-right">
148
-                                    <span class="getpaid-hide-if-hours"><?php _e( 'Price', 'invoicing' ) ?></span>
149
-                                    <span class="getpaid-hide-if-quantity"><?php _e( 'Rate', 'invoicing' ) ?></span>
148
+                                    <span class="getpaid-hide-if-hours"><?php _e('Price', 'invoicing') ?></span>
149
+                                    <span class="getpaid-hide-if-quantity"><?php _e('Rate', 'invoicing') ?></span>
150 150
                                 </th>
151 151
                                 <th class="getpaid-item-subtotal text-right">
152
-                                    <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e( 'Amount', 'invoicing' ) ?></span>
153
-                                    <span class="hide-if-amount"><?php _e( 'Total', 'invoicing' ) ?></span>
152
+                                    <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e('Amount', 'invoicing') ?></span>
153
+                                    <span class="hide-if-amount"><?php _e('Total', 'invoicing') ?></span>
154 154
                                 </th>
155 155
                                 <th class="getpaid-item-actions hide-if-not-editable" width="70px">&nbsp;</th>
156 156
                             </tr>
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 		                <tbody class="getpaid_invoice_line_items">
159 159
                             <tr class="hide-if-has-items hide-if-not-editable">
160 160
                                 <td colspan="2" class="pt-4 pb-4">
161
-                                    <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Items', 'invoicing' ) ?></button>
162
-	                                <a href="<?php echo esc_url( $new_item ); ?>" target="_blank" class="button button-secondary"><?php _e( 'Create New Item', 'invoicing' ) ?></a>
161
+                                    <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Items', 'invoicing') ?></button>
162
+	                                <a href="<?php echo esc_url($new_item); ?>" target="_blank" class="button button-secondary"><?php _e('Create New Item', 'invoicing') ?></a>
163 163
                                 </td>
164 164
                                 <td class="hide-if-amount">&nbsp;</th>
165 165
                                 <td class="hide-if-amount">&nbsp;</th>
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
                             <div class="col-12 col-sm-6 offset-sm-6">
192 192
                                 <table class="getpaid-invoice-totals text-right w-100">
193 193
                                     <tbody>
194
-                                        <?php foreach ( apply_filters( 'getpaid_invoice_subtotal_rows', $totals, $invoice ) as $key => $data ) : ?>
195
-                                            <tr class="getpaid-totals-<?php echo sanitize_html_class( $key ); ?>">
196
-                                                <td class="label"><?php echo sanitize_text_field( $data['label'] ) ?>:</td>
194
+                                        <?php foreach (apply_filters('getpaid_invoice_subtotal_rows', $totals, $invoice) as $key => $data) : ?>
195
+                                            <tr class="getpaid-totals-<?php echo sanitize_html_class($key); ?>">
196
+                                                <td class="label"><?php echo sanitize_text_field($data['label']) ?>:</td>
197 197
                                                 <td width="1%"></td>
198
-                                                <td class="value"><?php echo wp_kses_post( $data['value'] ) ?></td>
198
+                                                <td class="value"><?php echo wp_kses_post($data['value']) ?></td>
199 199
                                             </tr>
200 200
                                         <?php endforeach; ?>
201 201
                                     </tbody>
@@ -208,18 +208,18 @@  discard block
 block discarded – undo
208 208
                     <div class="getpaid-invoice-item-actions hide-if-no-items hide-if-not-editable">
209 209
                         <div class="row">
210 210
                             <div class="text-left col-12 col-sm-8">
211
-                                <button type="button" class="button add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Item', 'invoicing' ) ?></button>
212
-                                <a href="<?php echo esc_url( $new_item ); ?>" target="_blank" class="button button-secondary"><?php _e( 'Create New Item', 'invoicing' ) ?></a>
213
-                                <?php do_action( 'getpaid-invoice-items-actions', $invoice ); ?>
211
+                                <button type="button" class="button add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Item', 'invoicing') ?></button>
212
+                                <a href="<?php echo esc_url($new_item); ?>" target="_blank" class="button button-secondary"><?php _e('Create New Item', 'invoicing') ?></a>
213
+                                <?php do_action('getpaid-invoice-items-actions', $invoice); ?>
214 214
                             </div>
215 215
                             <div class="text-right col-12 col-sm-4">
216
-                                <button type="button" class="button button-primary recalculate-totals-button"><?php _e( 'Recalculate Totals', 'invoicing' ) ?></button>
216
+                                <button type="button" class="button button-primary recalculate-totals-button"><?php _e('Recalculate Totals', 'invoicing') ?></button>
217 217
                             </div>
218 218
                         </div>
219 219
                     </div>
220 220
 
221 221
                     <div class="getpaid-invoice-item-actions hide-if-editable">
222
-                        <p class="description m-2 text-right text-muted"><?php _e( 'This invoice is no longer editable', 'invoicing' ); ?></p>
222
+                        <p class="description m-2 text-right text-muted"><?php _e('This invoice is no longer editable', 'invoicing'); ?></p>
223 223
                     </div>
224 224
 
225 225
                     <!-- Add items to an invoice -->
@@ -227,8 +227,8 @@  discard block
 block discarded – undo
227 227
                         <div class="modal-dialog modal-dialog-centered" role="document">
228 228
                             <div class="modal-content">
229 229
                                 <div class="modal-header">
230
-                                    <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e( "Add Item(s)", 'invoicing' ); ?></h5>
231
-                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>">
230
+                                    <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e("Add Item(s)", 'invoicing'); ?></h5>
231
+                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>">
232 232
                                         <span aria-hidden="true">&times;</span>
233 233
                                     </button>
234 234
                                 </div>
@@ -236,17 +236,17 @@  discard block
 block discarded – undo
236 236
                                     <table class="widefat">
237 237
                                         <thead>
238 238
                                             <tr>
239
-                                                <th class="pl-0 text-left"><?php _e( 'Item', 'invoicing' ) ?></th>
239
+                                                <th class="pl-0 text-left"><?php _e('Item', 'invoicing') ?></th>
240 240
                                                 <th class="pr-0 text-right hide-if-amount">
241
-                                                    <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span>
242
-                                                    <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span>
241
+                                                    <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span>
242
+                                                    <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span>
243 243
                                                 </th>
244 244
                                             </tr>
245 245
                                         </thead>
246 246
 										<tbody>
247 247
 								            <tr>
248 248
 									            <td class="pl-0 text-left">
249
-                                                    <select class="getpaid-item-search regular-text" data-placeholder="<?php esc_attr_e( 'Search for an item…', 'invoicing' ); ?>"></select>
249
+                                                    <select class="getpaid-item-search regular-text" data-placeholder="<?php esc_attr_e('Search for an item…', 'invoicing'); ?>"></select>
250 250
                                                 </td>
251 251
 									            <td class="pr-0 text-right hide-if-amount">
252 252
                                                     <input type="number" class="w100" step="1" min="1" autocomplete="off" value="1" placeholder="1">
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
 						            </table>
257 257
                                 </div>
258 258
                                 <div class="modal-footer">
259
-                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button>
260
-                                    <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e( 'Add', 'invoicing' ); ?></button>
259
+                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button>
260
+                                    <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e('Add', 'invoicing'); ?></button>
261 261
                                 </div>
262 262
                             </div>
263 263
                         </div>
@@ -268,8 +268,8 @@  discard block
 block discarded – undo
268 268
                         <div class="modal-dialog modal-dialog-centered" role="document">
269 269
                             <div class="modal-content">
270 270
                                 <div class="modal-header">
271
-                                    <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e( "Edit Item", 'invoicing' ); ?></h5>
272
-                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>">
271
+                                    <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e("Edit Item", 'invoicing'); ?></h5>
272
+                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>">
273 273
                                         <span aria-hidden="true">&times;</span>
274 274
                                     </button>
275 275
                                 </div>
@@ -277,27 +277,27 @@  discard block
 block discarded – undo
277 277
                                     <div class="getpaid-edit-item-div">
278 278
                                         <input type="hidden" name="id" class="form-control form-control-sm item-id">
279 279
                                         <label class="form-group w-100">
280
-                                            <span><?php _e( 'Name', 'invoicing' ); ?></span>
281
-                                            <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name">
280
+                                            <span><?php _e('Name', 'invoicing'); ?></span>
281
+                                            <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name">
282 282
                                         </label>
283 283
                                         <label class="form-group w-100">
284
-                                            <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e( 'Amount', 'invoicing' ); ?></span>
285
-                                            <span class="hide-if-amount"><?php _e( 'Price', 'invoicing' ); ?></span>
286
-                                            <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount( 0 ); ?>" class="form-control form-control-sm item-price">
284
+                                            <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e('Amount', 'invoicing'); ?></span>
285
+                                            <span class="hide-if-amount"><?php _e('Price', 'invoicing'); ?></span>
286
+                                            <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount(0); ?>" class="form-control form-control-sm item-price">
287 287
                                         </label>
288 288
                                         <label class="form-group w-100 hide-if-amount">
289
-                                            <span><?php _e( 'Quantity', 'invoicing' ); ?></span>
289
+                                            <span><?php _e('Quantity', 'invoicing'); ?></span>
290 290
                                             <input type="number" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity">
291 291
                                         </label>
292 292
                                         <label class="form-group w-100">
293
-                                            <span><?php _e( 'Item Description', 'invoicing' ); ?></span>
294
-                                            <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea>
293
+                                            <span><?php _e('Item Description', 'invoicing'); ?></span>
294
+                                            <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea>
295 295
                                         </label>
296 296
                                     </div>
297 297
                                 </div>
298 298
                                 <div class="modal-footer">
299
-                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button>
300
-                                    <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e( 'Save', 'invoicing' ); ?></button>
299
+                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button>
300
+                                    <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e('Save', 'invoicing'); ?></button>
301 301
                                 </div>
302 302
                             </div>
303 303
                         </div>
Please login to merge, or discard this patch.
templates/emails/wpinv-email-invoice-items.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,18 +7,18 @@  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
-$column_count = count( $columns );
12
+$column_count = count($columns);
13 13
 ?>
14 14
 
15
-<?php do_action( 'wpinv_before_email_items', $invoice ); ?>
15
+<?php do_action('wpinv_before_email_items', $invoice); ?>
16 16
 
17 17
 
18 18
 <div id="wpinv-email-items">
19 19
 
20 20
     <h3 class="wpinv-items-t">
21
-        <?php echo apply_filters( 'wpinv_email_items_title', __( 'Items', 'invoicing' ) ); ?>
21
+        <?php echo apply_filters('wpinv_email_items_title', __('Items', 'invoicing')); ?>
22 22
     </h3>
23 23
 
24 24
     <table id="wpinv_checkout_cart" class="table table-bordered table-hover">
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 
28 28
             <tr class="wpinv_cart_header_row">
29 29
 
30
-                <?php foreach ( $columns as $key => $label ) : ?>
31
-                    <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class( $key ); ?>">
32
-                        <?php echo sanitize_text_field( $label ); ?>
30
+                <?php foreach ($columns as $key => $label) : ?>
31
+                    <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class($key); ?>">
32
+                        <?php echo sanitize_text_field($label); ?>
33 33
                     </th>
34 34
                 <?php endforeach; ?>
35 35
 
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
             <?php
43 43
 
44 44
                 // Display the item totals.
45
-                foreach ( $invoice->get_items() as $item ) {
46
-                    wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) );
45
+                foreach ($invoice->get_items() as $item) {
46
+                    wpinv_get_template('emails/invoice-item.php', compact('invoice', 'item', 'columns'));
47 47
                 }
48 48
 
49 49
             ?>
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         </tbody>
52 52
 
53 53
         <tfoot>
54
-            <?php wpinv_get_template( 'emails/invoice-totals.php', compact( 'invoice', 'column_count' ) ); ?>
54
+            <?php wpinv_get_template('emails/invoice-totals.php', compact('invoice', 'column_count')); ?>
55 55
         </tfoot>
56 56
     
57 57
     </table>
Please login to merge, or discard this patch.
templates/payment-forms/cart-totals.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@  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
 // Totals rows.
13 13
 $totals = apply_filters(
14 14
     'getpaid_payment_form_cart_table_totals',
15 15
     array(
16
-        'subtotal' => __( 'Subtotal', 'invoicing' ),
17
-        'tax'      => __( 'Tax', 'invoicing' ),
18
-        'discount' => __( 'Discount', 'invoicing' ),
19
-        'total'    => __( 'Total', 'invoicing' ),
16
+        'subtotal' => __('Subtotal', 'invoicing'),
17
+        'tax'      => __('Tax', 'invoicing'),
18
+        'discount' => __('Discount', 'invoicing'),
19
+        'total'    => __('Total', 'invoicing'),
20 20
     ),
21 21
     $form
22 22
 );
@@ -24,15 +24,15 @@  discard block
 block discarded – undo
24 24
 $currency = $form->get_currency();
25 25
 $country  = wpinv_get_default_country();
26 26
 
27
-if ( ! empty( $form->invoice ) ) {
28
-    $country  = $form->invoice->get_country();
27
+if (!empty($form->invoice)) {
28
+    $country = $form->invoice->get_country();
29 29
 }
30 30
 
31
-if ( ! wpinv_use_taxes() && isset( $totals['tax'] ) ) {
32
-    unset( $totals['tax'] );
31
+if (!wpinv_use_taxes() && isset($totals['tax'])) {
32
+    unset($totals['tax']);
33 33
 }
34 34
 
35
-do_action( 'getpaid_before_payment_form_cart_totals', $form, $totals );
35
+do_action('getpaid_before_payment_form_cart_totals', $form, $totals);
36 36
 
37 37
 $tax       = 0;
38 38
 $sub_total = 0;
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 $discount  = 0;
41 41
 
42 42
 // Calculate totals.
43
-foreach ( $form->get_items() as $item ) {
43
+foreach ($form->get_items() as $item) {
44 44
 
45
-    if ( ! empty( $form->invoice ) && 'amount' == $form->invoice->get_template() ) {
45
+    if (!empty($form->invoice) && 'amount' == $form->invoice->get_template()) {
46 46
         $amount = $item->get_price();
47 47
     } else {
48 48
         $amount = $item->get_sub_total();
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 
51 51
 
52 52
     // Include the tax.
53
-    if ( wpinv_use_taxes() ) {
54
-        $rate = wpinv_get_tax_rate( $country, false, $item->get_id() );
53
+    if (wpinv_use_taxes()) {
54
+        $rate = wpinv_get_tax_rate($country, false, $item->get_id());
55 55
 
56
-        if ( wpinv_prices_include_tax() ) {
57
-            $pre_tax  = ( $amount - $amount * $rate * 0.01 );
56
+        if (wpinv_prices_include_tax()) {
57
+            $pre_tax  = ($amount - $amount * $rate * 0.01);
58 58
             $item_tax = $amount - $pre_tax;
59 59
         } else {
60 60
             $pre_tax  = $amount;
@@ -66,41 +66,41 @@  discard block
 block discarded – undo
66 66
         $total     = $sub_total + $tax;
67 67
 
68 68
     } else {
69
-        $total  = $total + $amount;
69
+        $total = $total + $amount;
70 70
     }
71 71
 
72 72
 }
73 73
 
74 74
 ?>
75 75
 <div class='border-top getpaid-payment-form-items-cart-totals'>
76
-    <?php foreach ( $totals as $key => $label ) : ?>
77
-        <div class="getpaid-form-cart-totals-col getpaid-form-cart-totals-<?php echo esc_attr( $key ); ?>">
76
+    <?php foreach ($totals as $key => $label) : ?>
77
+        <div class="getpaid-form-cart-totals-col getpaid-form-cart-totals-<?php echo esc_attr($key); ?>">
78 78
             <div class="row">
79 79
                 <div class="col-12 offset-sm-5 col-sm-4">
80
-                    <?php echo sanitize_text_field( $label ); ?>
80
+                    <?php echo sanitize_text_field($label); ?>
81 81
                 </div>
82
-                <div class="col-12 col-sm-3 getpaid-form-cart-totals-total-<?php echo esc_attr( $key ); ?>">
82
+                <div class="col-12 col-sm-3 getpaid-form-cart-totals-total-<?php echo esc_attr($key); ?>">
83 83
                     <?php
84
-                        do_action( "getpaid_payment_form_cart_totals_$key", $form );
84
+                        do_action("getpaid_payment_form_cart_totals_$key", $form);
85 85
 
86 86
                         // Total tax.
87
-                        if ( 'tax' == $key ) {
88
-                            echo wpinv_price( wpinv_format_amount( $tax ), $currency );
87
+                        if ('tax' == $key) {
88
+                            echo wpinv_price(wpinv_format_amount($tax), $currency);
89 89
                         }
90 90
 
91 91
                         // Total discount.
92
-                        if ( 'discount' == $key ) {
93
-                            echo wpinv_price( wpinv_format_amount( $discount ), $currency );
92
+                        if ('discount' == $key) {
93
+                            echo wpinv_price(wpinv_format_amount($discount), $currency);
94 94
                         }
95 95
 
96 96
                         // Sub total.
97
-                        if ( 'subtotal' == $key ) {
98
-                            echo wpinv_price( wpinv_format_amount( $sub_total ), $currency );
97
+                        if ('subtotal' == $key) {
98
+                            echo wpinv_price(wpinv_format_amount($sub_total), $currency);
99 99
                         }
100 100
 
101 101
                         // Total.
102
-                        if ( 'total' == $key ) {
103
-                            echo wpinv_price( wpinv_format_amount( $total ), $currency );
102
+                        if ('total' == $key) {
103
+                            echo wpinv_price(wpinv_format_amount($total), $currency);
104 104
                         }
105 105
                     ?>
106 106
                 </div>
@@ -110,4 +110,4 @@  discard block
 block discarded – undo
110 110
 </div>
111 111
 
112 112
 <?php
113
-do_action(  'getpaid_payment_form_cart_totals', $form, $totals );
113
+do_action('getpaid_payment_form_cart_totals', $form, $totals);
Please login to merge, or discard this patch.
templates/payment-forms/cart-item.php 1 patch
Spacing   +28 added lines, -28 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 getpaid-<?php echo $item->is_required() ? 'required'  : 'selectable'; ?> item-<?php echo $item->get_id(); ?>'>
17
+<div class='getpaid-payment-form-items-cart-item 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
-                    do_action( "getpaid_payment_form_cart_item_$key", $form, $item );
22
+                    do_action("getpaid_payment_form_cart_item_$key", $form, $item);
23 23
 
24 24
                     // Item name.
25
-                    if ( 'name' == $key ) {
26
-                        echo sanitize_text_field( $item->get_name() );
25
+                    if ('name' == $key) {
26
+                        echo sanitize_text_field($item->get_name());
27 27
                         $description = $item->get_description();
28 28
 
29
-                        if ( ! empty( $description ) ) {
30
-                            $description = wp_kses_post( $description );
29
+                        if (!empty($description)) {
30
+                            $description = wp_kses_post($description);
31 31
                             echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
32 32
                         }
33 33
 
34
-                        $description = getpaid_item_recurring_price_help_text( $item, $currency );
34
+                        $description = getpaid_item_recurring_price_help_text($item, $currency);
35 35
 
36
-                        if ( $description ) {
36
+                        if ($description) {
37 37
                             echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
38 38
                         }
39 39
                     }
40 40
 
41 41
                     // Item price.
42
-                    if ( 'price' == $key ) {
42
+                    if ('price' == $key) {
43 43
 
44 44
                         // Set the currency position.
45 45
                         $position = wpinv_currency_position();
46 46
 
47
-                        if ( $position == 'left_space' ) {
47
+                        if ($position == 'left_space') {
48 48
                             $position = 'left';
49 49
                         }
50 50
 
51
-                        if ( $position == 'right_space' ) {
51
+                        if ($position == 'right_space') {
52 52
                             $position = 'right';
53 53
                         }
54 54
 
55
-                        if ( $item->user_can_set_their_price() ) {
55
+                        if ($item->user_can_set_their_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 esc_attr( $item->get_price() ); ?>" placeholder="<?php echo esc_attr( $item->get_minimum_price() ); ?>" class="getpaid-item-price-input">
63
+                                    <input type="text" name="getpaid-items[<?php echo (int) $item->get_id(); ?>][price]" value="<?php echo esc_attr($item->get_price()); ?>" placeholder="<?php echo esc_attr($item->get_minimum_price()); ?>" class="getpaid-item-price-input">
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 pr-1' value='<?php echo (int) $item->get_qantity(); ?>' min='1' required>
86 86
                             <?php
@@ -94,8 +94,8 @@  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 101
             </div>
@@ -103,4 +103,4 @@  discard block
 block discarded – undo
103 103
     </div>
104 104
 </div>
105 105
 <?php
106
-do_action(  'getpaid_payment_form_cart_item', $form, $item );
106
+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   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -7,27 +7,27 @@  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
 // Make it possible to filter active gateways.
21
-$gateways = apply_filters( 'getpaid_payment_form_gateways', $gateways, $form );
21
+$gateways = apply_filters('getpaid_payment_form_gateways', $gateways, $form);
22 22
 
23 23
 //@deprecated
24
-$gateways = apply_filters( 'wpinv_payment_gateways_on_cart', $gateways );
24
+$gateways = apply_filters('wpinv_payment_gateways_on_cart', $gateways);
25 25
 
26 26
 // The current invoice id.
27 27
 $invoice_id     = 0;
28 28
 $chosen_gateway = wpinv_get_default_gateway();
29 29
 
30
-if ( ! empty( $form->invoice ) ) {
30
+if (!empty($form->invoice)) {
31 31
     $invoice_id = $form->invoice->get_id();
32 32
     $chosen_gateway = $form->invoice->get_gateway();
33 33
 }
@@ -36,36 +36,36 @@  discard block
 block discarded – undo
36 36
 
37 37
     <div class="mt-4 mb-4">
38 38
 
39
-        <?php do_action( 'wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
39
+        <?php do_action('wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form); ?>
40 40
 
41 41
         <div class="getpaid-gateways-select-title-div">
42
-            <h6><?php echo sanitize_text_field( $text ); ?></h6>
42
+            <h6><?php echo sanitize_text_field($text); ?></h6>
43 43
         </div>
44 44
 
45 45
         
46 46
         <div class="getpaid-gateways-select-gateways-div">
47 47
 
48
-            <?php foreach ( array_keys( $gateways ) as $gateway ) : ?>
48
+            <?php foreach (array_keys($gateways) as $gateway) : ?>
49 49
 
50
-                <div class="pt-2 pb-2 getpaid-gateways-select-gateway getpaid-gateways-select-gateway-<?php echo sanitize_html_class( $gateway ) ;?>" data-checkout-label='<?php echo esc_attr( apply_filters( "getpaid_gateway_{$gateway}_checkout_button_label", '' ) ); ?>'>
50
+                <div class="pt-2 pb-2 getpaid-gateways-select-gateway getpaid-gateways-select-gateway-<?php echo sanitize_html_class($gateway); ?>" data-checkout-label='<?php echo esc_attr(apply_filters("getpaid_gateway_{$gateway}_checkout_button_label", '')); ?>'>
51 51
 
52 52
                     <div class="getpaid-gateway-radio-div">
53 53
                         <label>
54
-                            <input type="radio" value="<?php echo esc_attr( $gateway ) ;?>" <?php checked( $gateway, $chosen_gateway ) ;?> name="wpi-gateway">
55
-                            <span><?php echo sanitize_text_field( wpinv_get_gateway_checkout_label( $gateway ) ); ?></span>
54
+                            <input type="radio" value="<?php echo esc_attr($gateway); ?>" <?php checked($gateway, $chosen_gateway); ?> name="wpi-gateway">
55
+                            <span><?php echo sanitize_text_field(wpinv_get_gateway_checkout_label($gateway)); ?></span>
56 56
                         </label>
57 57
                     </div>
58 58
 
59 59
                     <div class="getpaid-gateway-description-div" style="display: none;">
60
-                        <?php do_action( 'wpinv_' . $gateway . '_checkout_fields', $invoice_id ) ;?>
61
-                        <?php if ( wpinv_get_gateway_description( $gateway ) ) : ?>
60
+                        <?php do_action('wpinv_' . $gateway . '_checkout_fields', $invoice_id); ?>
61
+                        <?php if (wpinv_get_gateway_description($gateway)) : ?>
62 62
                             <div class="getpaid-gateway-description">
63
-                                <?php echo wpinv_get_gateway_description( $gateway ); ?>
63
+                                <?php echo wpinv_get_gateway_description($gateway); ?>
64 64
                             </div>
65 65
                         <?php endif; ?>
66 66
 
67
-                        <?php do_action( 'getpaid_after_gateway_description', $invoice_id, $gateway, $form ) ;?>
68
-                        <?php do_action( 'wpinv_' . $gateway . '_cc_form', $invoice_id, $form ) ;?>
67
+                        <?php do_action('getpaid_after_gateway_description', $invoice_id, $gateway, $form); ?>
68
+                        <?php do_action('wpinv_' . $gateway . '_cc_form', $invoice_id, $form); ?>
69 69
 
70 70
                     </div>
71 71
 
@@ -76,16 +76,16 @@  discard block
 block discarded – undo
76 76
             <?php
77 77
 
78 78
 
79
-                if ( empty( $gateways ) ) {
79
+                if (empty($gateways)) {
80 80
 
81
-                    $enabled_gateways = wpinv_get_enabled_payment_gateways( true );
81
+                    $enabled_gateways = wpinv_get_enabled_payment_gateways(true);
82 82
 
83
-                    if ( ! empty( $enabled_gateways ) && $form->is_recurring() ) {
83
+                    if (!empty($enabled_gateways) && $form->is_recurring()) {
84 84
 
85 85
 
86 86
                         echo aui()->alert(
87 87
                             array(
88
-                                'content'     => __( 'Non of the available payment gateways support subscriptions.', 'invoicing' ),
88
+                                'content'     => __('Non of the available payment gateways support subscriptions.', 'invoicing'),
89 89
                                 'type'        => 'danger',
90 90
                             )
91 91
                         );
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
                         echo aui()->alert(
97 97
                             array(
98
-                                'content'     => __( 'No active payment gateway available.', 'invoicing' ),
98
+                                'content'     => __('No active payment gateway available.', 'invoicing'),
99 99
                                 'type'        => 'danger',
100 100
                             )
101 101
                         );
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
         </div>
112 112
 
113
-        <?php do_action( 'wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
113
+        <?php do_action('wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form); ?>
114 114
 
115 115
     </div>
116 116
 
Please login to merge, or discard this patch.
templates/invoice/header-left-actions.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,19 +7,19 @@
 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
 ?>
13 13
 
14 14
         <div class="getpaid-header-left-actions">
15 15
 
16
-            <?php if ( $invoice->is_type( 'invoice' ) && $invoice->needs_payment() && ! $invoice->is_held() ): ?>
17
-                <a class="btn btn-primary invoice-action-pay" href="<?php echo esc_url( $invoice->get_checkout_payment_url() ); ?>">
18
-                    <?php _e( 'Pay For Invoice', 'invoicing' ); ?>
16
+            <?php if ($invoice->is_type('invoice') && $invoice->needs_payment() && !$invoice->is_held()): ?>
17
+                <a class="btn btn-primary invoice-action-pay" href="<?php echo esc_url($invoice->get_checkout_payment_url()); ?>">
18
+                    <?php _e('Pay For Invoice', 'invoicing'); ?>
19 19
                 </a>
20 20
             <?php endif; ?>
21 21
 
22
-            <?php do_action('wpinv_invoice_display_left_actions', $invoice ); ?>
22
+            <?php do_action('wpinv_invoice_display_left_actions', $invoice); ?>
23 23
 
24 24
         </div>
25 25
 
Please login to merge, or discard this patch.
templates/invoice/invoice-meta.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -7,50 +7,50 @@
 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
 ?>
13 13
 
14
-        <?php do_action( 'getpaid_before_invoice_meta', $invoice ); ?>
14
+        <?php do_action('getpaid_before_invoice_meta', $invoice); ?>
15 15
         <div class="getpaid-invoice-meta-data">
16 16
 
17 17
 
18
-            <?php do_action( 'getpaid_before_invoice_meta_table', $invoice ); ?>
18
+            <?php do_action('getpaid_before_invoice_meta_table', $invoice); ?>
19 19
             <table class="table table-bordered">
20 20
                 <tbody>
21 21
 
22
-                    <?php do_action( "getpaid_before_invoice_meta_rows", $invoice ); ?>
23
-                    <?php foreach ( $meta as $key => $data ) : ?>
22
+                    <?php do_action("getpaid_before_invoice_meta_rows", $invoice); ?>
23
+                    <?php foreach ($meta as $key => $data) : ?>
24 24
 
25
-                        <?php if ( ! empty( $data['value'] ) ) : ?>
25
+                        <?php if (!empty($data['value'])) : ?>
26 26
 
27
-                            <?php do_action( "getpaid_before_invoice_meta_$key", $invoice, $data ); ?>
27
+                            <?php do_action("getpaid_before_invoice_meta_$key", $invoice, $data); ?>
28 28
 
29
-                            <tr class="getpaid-invoice-meta-<?php echo sanitize_html_class( $key ); ?>">
29
+                            <tr class="getpaid-invoice-meta-<?php echo sanitize_html_class($key); ?>">
30 30
 
31 31
                                 <th>
32
-                                    <?php echo sanitize_text_field( $data['label'] ); ?>
32
+                                    <?php echo sanitize_text_field($data['label']); ?>
33 33
                                 </th>
34 34
 
35 35
                                 <td>
36
-                                    <span class="getpaid-invoice-meta-<?php echo sanitize_html_class( $key ); ?>-value"><?php echo wp_kses_post( $data['value'] ); ?></span>
36
+                                    <span class="getpaid-invoice-meta-<?php echo sanitize_html_class($key); ?>-value"><?php echo wp_kses_post($data['value']); ?></span>
37 37
                                 </td>
38 38
 
39 39
                             </tr>
40 40
 
41
-                            <?php do_action( "getpaid_after_invoice_meta_$key", $invoice, $data ); ?>
41
+                            <?php do_action("getpaid_after_invoice_meta_$key", $invoice, $data); ?>
42 42
 
43 43
                         <?php endif; ?>
44 44
                     
45 45
                     <?php endforeach; ?>
46
-                    <?php do_action( "getpaid_after_invoice_meta_rows", $invoice ); ?>
46
+                    <?php do_action("getpaid_after_invoice_meta_rows", $invoice); ?>
47 47
 
48 48
                 </tbody>
49 49
             </table>
50
-            <?php do_action( 'getpaid_after_invoice_meta_table', $invoice ); ?>
50
+            <?php do_action('getpaid_after_invoice_meta_table', $invoice); ?>
51 51
 
52 52
 
53 53
         </div>
54
-        <?php do_action( 'getpaid_after_invoice_meta', $invoice ); ?>
54
+        <?php do_action('getpaid_after_invoice_meta', $invoice); ?>
55 55
 
56 56
 <?php
Please login to merge, or discard this patch.
includes/gateways/class-getpaid-bank-transfer-gateway.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  *
5 5
  */
6 6
 
7
-defined( 'ABSPATH' ) || exit;
7
+defined('ABSPATH') || exit;
8 8
 
9 9
 /**
10 10
  * Bank transfer Payment Gateway class.
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 	public function __construct() {
33 33
         parent::__construct();
34 34
 
35
-        $this->title                = __( 'Direct bank transfer', 'invoicing' );
36
-        $this->method_title         = __( 'Bank transfer', 'invoicing' );
37
-        $this->checkout_button_text = __( 'Proceed', 'invoicing' );
38
-        $this->instructions         = apply_filters( 'wpinv_bank_instructions', $this->get_option( 'info' ) );
35
+        $this->title                = __('Direct bank transfer', 'invoicing');
36
+        $this->method_title         = __('Bank transfer', 'invoicing');
37
+        $this->checkout_button_text = __('Proceed', 'invoicing');
38
+        $this->instructions         = apply_filters('wpinv_bank_instructions', $this->get_option('info'));
39 39
 
40
-		add_action( 'wpinv_receipt_end', array( $this, 'thankyou_page' ) );
41
-		add_action( 'getpaid_invoice_line_items', array( $this, 'thankyou_page' ), 40 );
42
-		add_action( 'wpinv_email_invoice_details', array( $this, 'email_instructions' ), 10, 3 );
40
+		add_action('wpinv_receipt_end', array($this, 'thankyou_page'));
41
+		add_action('getpaid_invoice_line_items', array($this, 'thankyou_page'), 40);
42
+		add_action('wpinv_email_invoice_details', array($this, 'email_instructions'), 10, 3);
43 43
 
44 44
     }
45 45
 
@@ -52,23 +52,23 @@  discard block
 block discarded – undo
52 52
 	 * @param GetPaid_Payment_Form_Submission $submission Checkout submission.
53 53
 	 * @return array
54 54
 	 */
55
-	public function process_payment( $invoice, $submission_data, $submission ) {
55
+	public function process_payment($invoice, $submission_data, $submission) {
56 56
 
57 57
         // Add a transaction id.
58
-        $invoice->set_transaction_id( $invoice->generate_key('trans_') );
58
+        $invoice->set_transaction_id($invoice->generate_key('trans_'));
59 59
 
60 60
         // Set it as pending payment.
61
-        if ( ! $invoice->needs_payment() ) {
61
+        if (!$invoice->needs_payment()) {
62 62
             $invoice->mark_paid();
63
-        } else if ( ! $invoice->is_paid() ) {
64
-            $invoice->set_status( 'wpi-onhold' );
63
+        } else if (!$invoice->is_paid()) {
64
+            $invoice->set_status('wpi-onhold');
65 65
         }
66 66
 
67 67
         // Save it.
68 68
         $invoice->save();
69 69
 
70 70
         // Send to the success page.
71
-        wpinv_send_to_success_page( array( 'invoice_key' => $invoice->get_key() ) );
71
+        wpinv_send_to_success_page(array('invoice_key' => $invoice->get_key()));
72 72
 
73 73
     }
74 74
 
@@ -77,17 +77,17 @@  discard block
 block discarded – undo
77 77
 	 *
78 78
 	 * @param WPInv_Invoice $invoice Invoice.
79 79
 	 */
80
-	public function thankyou_page( $invoice ) {
80
+	public function thankyou_page($invoice) {
81 81
 
82
-        if ( 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment() ) {
82
+        if ('bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment()) {
83 83
 
84 84
 			echo '<div class="mt-4 mb-2 getpaid-bank-transfer-details">' . PHP_EOL;
85 85
 
86
-            if ( ! empty( $this->instructions ) ) {
87
-                echo wp_kses_post( wpautop( wptexturize( $this->instructions ) ) );
86
+            if (!empty($this->instructions)) {
87
+                echo wp_kses_post(wpautop(wptexturize($this->instructions)));
88 88
 			}
89 89
 
90
-			$this->bank_details( $invoice );
90
+			$this->bank_details($invoice);
91 91
 			
92 92
 			echo '</div>';
93 93
         
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
 	 * @param string     $email_type Email format: plain text or HTML.
103 103
 	 * @param bool     $sent_to_admin Sent to admin.
104 104
 	 */
105
-	public function email_instructions( $invoice, $email_type, $sent_to_admin ) {
105
+	public function email_instructions($invoice, $email_type, $sent_to_admin) {
106 106
 
107
-		if ( ! $sent_to_admin && 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment() ) {
107
+		if (!$sent_to_admin && 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment()) {
108 108
 
109 109
 			echo '<div class="wpi-email-row getpaid-bank-transfer-details">';
110 110
 
111
-			if ( $this->instructions ) {
112
-				echo wp_kses_post( wpautop( wptexturize( $this->instructions ) ) . PHP_EOL );
111
+			if ($this->instructions) {
112
+				echo wp_kses_post(wpautop(wptexturize($this->instructions)) . PHP_EOL);
113 113
             }
114 114
 
115
-			$this->bank_details( $invoice );
115
+			$this->bank_details($invoice);
116 116
 			
117 117
 			echo '</div>';
118 118
 
@@ -125,51 +125,51 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @param WPInv_Invoice $invoice Invoice.
127 127
 	 */
128
-	protected function bank_details( $invoice ) {
128
+	protected function bank_details($invoice) {
129 129
 
130 130
 		// Get the invoice country and country $locale.
131 131
 		$country = $invoice->get_country();
132 132
 		$locale  = $this->get_country_locale();
133 133
 
134 134
 		// Get sortcode label in the $locale array and use appropriate one.
135
-		$sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'invoicing' );
135
+		$sortcode = isset($locale[$country]['sortcode']['label']) ? $locale[$country]['sortcode']['label'] : __('Sort code', 'invoicing');
136 136
 
137 137
         $bank_fields = array(
138
-            'ac_name'     => __( 'Account Name', 'invoicing' ),
139
-            'ac_no'       => __( 'Account Number', 'invoicing' ),
140
-            'bank_name'   => __( 'Bank Name', 'invoicing' ),
141
-            'ifsc'        => __( 'IFSC code', 'invoicing' ),
142
-            'iban'        => __( 'IBAN', 'invoicing' ),
143
-            'bic'         => __( 'BIC/Swift code', 'invoicing' ),
138
+            'ac_name'     => __('Account Name', 'invoicing'),
139
+            'ac_no'       => __('Account Number', 'invoicing'),
140
+            'bank_name'   => __('Bank Name', 'invoicing'),
141
+            'ifsc'        => __('IFSC code', 'invoicing'),
142
+            'iban'        => __('IBAN', 'invoicing'),
143
+            'bic'         => __('BIC/Swift code', 'invoicing'),
144 144
             'sort_code'   => $sortcode,
145 145
         );
146 146
 
147 147
         $bank_info = array();
148 148
 
149
-        foreach ( $bank_fields as $field => $label ) {
150
-            $value = $this->get_option( $field );
149
+        foreach ($bank_fields as $field => $label) {
150
+            $value = $this->get_option($field);
151 151
 
152
-            if ( ! empty( $value ) ) {
153
-                $bank_info[$field] = array( 'label' => $label, 'value' => $value );
152
+            if (!empty($value)) {
153
+                $bank_info[$field] = array('label' => $label, 'value' => $value);
154 154
             }
155 155
 
156 156
         }
157 157
 
158
-        $bank_info = apply_filters( 'wpinv_bank_info', $bank_info );
158
+        $bank_info = apply_filters('wpinv_bank_info', $bank_info);
159 159
 
160
-        if ( empty( $bank_info ) ) {
160
+        if (empty($bank_info)) {
161 161
             return;
162 162
         }
163 163
 
164
-		echo '<h3 class="getpaid-bank-transfer-title"> ' . apply_filters( 'wpinv_receipt_bank_details_title', __( 'Bank Details', 'invoicing' ) ) . '</h3>' . PHP_EOL;
164
+		echo '<h3 class="getpaid-bank-transfer-title"> ' . apply_filters('wpinv_receipt_bank_details_title', __('Bank Details', 'invoicing')) . '</h3>' . PHP_EOL;
165 165
 
166 166
 		echo '<table class="table table-bordered getpaid-bank-transfer-details">' . PHP_EOL;
167 167
 
168
-		foreach ( $bank_info as $key => $data ) {
168
+		foreach ($bank_info as $key => $data) {
169 169
 
170
-			$key   = sanitize_html_class( $key );
171
-			$label = wp_kses_post( $data['label'] );
172
-			$value = wp_kses_post( wptexturize( $data['value'] ) );
170
+			$key   = sanitize_html_class($key);
171
+			$label = wp_kses_post($data['label']);
172
+			$value = wp_kses_post(wptexturize($data['value']));
173 173
 
174 174
 			echo "<tr class='getpaid-bank-transfer-$key'><th>$label</th><td>$value</td></tr>" . PHP_EOL;
175 175
 		}
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	 */
186 186
 	public function get_country_locale() {
187 187
 
188
-		if ( empty( $this->locale ) ) {
188
+		if (empty($this->locale)) {
189 189
 
190 190
 			// Locale information to be used - only those that are not 'Sort Code'.
191 191
 			$this->locale = apply_filters(
@@ -193,42 +193,42 @@  discard block
 block discarded – undo
193 193
 				array(
194 194
 					'AU' => array(
195 195
 						'sortcode' => array(
196
-							'label' => __( 'BSB', 'invoicing' ),
196
+							'label' => __('BSB', 'invoicing'),
197 197
 						),
198 198
 					),
199 199
 					'CA' => array(
200 200
 						'sortcode' => array(
201
-							'label' => __( 'Bank transit number', 'invoicing' ),
201
+							'label' => __('Bank transit number', 'invoicing'),
202 202
 						),
203 203
 					),
204 204
 					'IN' => array(
205 205
 						'sortcode' => array(
206
-							'label' => __( 'IFSC', 'invoicing' ),
206
+							'label' => __('IFSC', 'invoicing'),
207 207
 						),
208 208
 					),
209 209
 					'IT' => array(
210 210
 						'sortcode' => array(
211
-							'label' => __( 'Branch sort', 'invoicing' ),
211
+							'label' => __('Branch sort', 'invoicing'),
212 212
 						),
213 213
 					),
214 214
 					'NZ' => array(
215 215
 						'sortcode' => array(
216
-							'label' => __( 'Bank code', 'invoicing' ),
216
+							'label' => __('Bank code', 'invoicing'),
217 217
 						),
218 218
 					),
219 219
 					'SE' => array(
220 220
 						'sortcode' => array(
221
-							'label' => __( 'Bank code', 'invoicing' ),
221
+							'label' => __('Bank code', 'invoicing'),
222 222
 						),
223 223
 					),
224 224
 					'US' => array(
225 225
 						'sortcode' => array(
226
-							'label' => __( 'Routing number', 'invoicing' ),
226
+							'label' => __('Routing number', 'invoicing'),
227 227
 						),
228 228
 					),
229 229
 					'ZA' => array(
230 230
 						'sortcode' => array(
231
-							'label' => __( 'Branch code', 'invoicing' ),
231
+							'label' => __('Branch code', 'invoicing'),
232 232
 						),
233 233
 					),
234 234
 				)
@@ -245,51 +245,51 @@  discard block
 block discarded – undo
245 245
 	 * 
246 246
 	 * @param array $admin_settings
247 247
 	 */
248
-	public function admin_settings( $admin_settings ) {
248
+	public function admin_settings($admin_settings) {
249 249
 
250
-        $admin_settings['worldpay_desc']['std']    = __( "Make your payment directly into our bank account. Please use your Invoice Number as the payment reference. Your invoice won't be processed until the funds have cleared in our account.", 'invoicing' );
251
-		$admin_settings['worldpay_active']['desc'] = __( 'Enable bank transfer', 'invoicing' );
250
+        $admin_settings['worldpay_desc']['std'] = __("Make your payment directly into our bank account. Please use your Invoice Number as the payment reference. Your invoice won't be processed until the funds have cleared in our account.", 'invoicing');
251
+		$admin_settings['worldpay_active']['desc'] = __('Enable bank transfer', 'invoicing');
252 252
 
253
-		$locale  = $this->get_country_locale();
253
+		$locale = $this->get_country_locale();
254 254
 
255 255
 		// Get sortcode label in the $locale array and use appropriate one.
256 256
 		$country  = wpinv_default_billing_country();
257
-		$sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'invoicing' );
257
+		$sortcode = isset($locale[$country]['sortcode']['label']) ? $locale[$country]['sortcode']['label'] : __('Sort code', 'invoicing');
258 258
 
259 259
 		$admin_settings['bank_transfer_ac_name'] = array(
260 260
             'type' => 'text',
261 261
             'id'   => 'bank_transfer_ac_name',
262
-            'name' => __( 'Account Name', 'invoicing' ),
262
+            'name' => __('Account Name', 'invoicing'),
263 263
 		);
264 264
 		
265 265
 		$admin_settings['bank_transfer_ac_no'] = array(
266 266
             'type' => 'text',
267 267
             'id'   => 'bank_transfer_ac_no',
268
-            'name' => __( 'Account Number', 'invoicing' ),
268
+            'name' => __('Account Number', 'invoicing'),
269 269
 		);
270 270
 		
271 271
 		$admin_settings['bank_transfer_bank_name'] = array(
272 272
             'type' => 'text',
273 273
             'id'   => 'bank_transfer_bank_name',
274
-            'name' => __( 'Bank Name', 'invoicing' ),
274
+            'name' => __('Bank Name', 'invoicing'),
275 275
 		);
276 276
 
277 277
 		$admin_settings['bank_transfer_ifsc'] = array(
278 278
             'type' => 'text',
279 279
             'id'   => 'bank_transfer_ifsc',
280
-            'name' => __( 'IFSC Code', 'invoicing' ),
280
+            'name' => __('IFSC Code', 'invoicing'),
281 281
 		);
282 282
 
283 283
 		$admin_settings['bank_transfer_iban'] = array(
284 284
             'type' => 'text',
285 285
             'id'   => 'bank_transfer_iban',
286
-            'name' => __( 'IBAN', 'invoicing' ),
286
+            'name' => __('IBAN', 'invoicing'),
287 287
 		);
288 288
 
289 289
 		$admin_settings['bank_transfer_bic'] = array(
290 290
             'type' => 'text',
291 291
             'id'   => 'bank_transfer_bic',
292
-            'name' => __( 'BIC/Swift Code', 'invoicing' ),
292
+            'name' => __('BIC/Swift Code', 'invoicing'),
293 293
 		);
294 294
 		
295 295
 		$admin_settings['bank_transfer_sort_code'] = array(
@@ -300,10 +300,10 @@  discard block
 block discarded – undo
300 300
 
301 301
 		$admin_settings['bank_transfer_info'] = array(
302 302
             'id'   => 'bank_transfer_info',
303
-            'name' => __( 'Instructions', 'invoicing' ),
304
-            'desc' => __( 'Instructions that will be added to the thank you page and emails.', 'invoicing' ),
303
+            'name' => __('Instructions', 'invoicing'),
304
+            'desc' => __('Instructions that will be added to the thank you page and emails.', 'invoicing'),
305 305
             'type' => 'textarea',
306
-            'std'  => __( "Make your payment directly into our bank account. Please use your Invoice Number as the payment reference. Your invoice won't be processed until the funds have cleared in our account.", 'invoicing' ),
306
+            'std'  => __("Make your payment directly into our bank account. Please use your Invoice Number as the payment reference. Your invoice won't be processed until the funds have cleared in our account.", 'invoicing'),
307 307
             'cols' => 50,
308 308
             'rows' => 5
309 309
         );
Please login to merge, or discard this patch.