Passed
Push — master ( 82bd21...0587d7 )
by Brian
05:01
created
templates/invoice/invoice-meta.php 1 patch
Spacing   +15 added lines, -15 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
-$class = ! is_singular( 'page' ) ? 'px-1' : '';
12
+$class = !is_singular('page') ? 'px-1' : '';
13 13
 ?>
14 14
 
15
-        <?php do_action( 'getpaid_before_invoice_meta', $invoice ); ?>
15
+        <?php do_action('getpaid_before_invoice_meta', $invoice); ?>
16 16
         <div class="getpaid-invoice-meta-data">
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 class="<?php echo $class; ?> font-weight-bold">
32
-                                    <?php echo sanitize_text_field( $data['label'] ); ?>
32
+                                    <?php echo sanitize_text_field($data['label']); ?>
33 33
                                 </th>
34 34
 
35 35
                                 <td class="<?php echo $class; ?> <?php echo $key == 'invoice_total' ? 'font-weight-bold' : 'font-weight-normal'; ?> text-break w-75">
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.
templates/frontend-head.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 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
 
Please login to merge, or discard this patch.
templates/frontend-footer.php 1 patch
Spacing   +2 added lines, -2 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
 
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 		<div class="modal-dialog modal-dialog-centered modal-lg" role="checkout" style="max-width: 650px;">
17 17
 			<div class="modal-content">
18 18
 				<div class="modal-body">
19
-					<button type="button" class="close p-2 getpaid-payment-modal-close d-sm-none" data-dismiss="modal" aria-label="<?php esc_attr__( 'Close', 'invoicing' ); ?>">
19
+					<button type="button" class="close p-2 getpaid-payment-modal-close d-sm-none" data-dismiss="modal" aria-label="<?php esc_attr__('Close', 'invoicing'); ?>">
20 20
 						<i class="fa fa-times" aria-hidden="true"></i>
21 21
 					</button>
22 22
 					<div class="modal-body-wrapper"></div>
Please login to merge, or discard this patch.
includes/wpinv-general-functions.php 1 patch
Spacing   +139 added lines, -139 removed lines patch added patch discarded remove patch
@@ -7,40 +7,40 @@  discard block
 block discarded – undo
7 7
  */
8 8
  
9 9
 // MUST have WordPress.
10
-if ( !defined( 'WPINC' ) ) {
11
-    exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) );
10
+if (!defined('WPINC')) {
11
+    exit('Do NOT access this file directly: ' . basename(__FILE__));
12 12
 }
13 13
 
14 14
 function wpinv_is_checkout() {
15 15
     global $wp_query;
16 16
 
17
-    $is_object_set    = isset( $wp_query->queried_object );
18
-    $is_object_id_set = isset( $wp_query->queried_object_id );
19
-    $checkout_page    = wpinv_get_option( 'checkout_page' );
20
-    $is_checkout      = ! empty( $checkout_page ) && is_page( $checkout_page );
17
+    $is_object_set    = isset($wp_query->queried_object);
18
+    $is_object_id_set = isset($wp_query->queried_object_id);
19
+    $checkout_page    = wpinv_get_option('checkout_page');
20
+    $is_checkout      = !empty($checkout_page) && is_page($checkout_page);
21 21
 
22
-    if ( !$is_object_set ) {
23
-        unset( $wp_query->queried_object );
22
+    if (!$is_object_set) {
23
+        unset($wp_query->queried_object);
24 24
     }
25 25
 
26
-    if ( !$is_object_id_set ) {
27
-        unset( $wp_query->queried_object_id );
26
+    if (!$is_object_id_set) {
27
+        unset($wp_query->queried_object_id);
28 28
     }
29 29
 
30
-    return apply_filters( 'wpinv_is_checkout', $is_checkout );
30
+    return apply_filters('wpinv_is_checkout', $is_checkout);
31 31
 }
32 32
 
33 33
 function wpinv_can_checkout() {
34 34
 	$can_checkout = true; // Always true for now
35 35
 
36
-	return (bool) apply_filters( 'wpinv_can_checkout', $can_checkout );
36
+	return (bool) apply_filters('wpinv_can_checkout', $can_checkout);
37 37
 }
38 38
 
39 39
 function wpinv_get_success_page_uri() {
40
-	$page_id = wpinv_get_option( 'success_page', 0 );
41
-	$page_id = absint( $page_id );
40
+	$page_id = wpinv_get_option('success_page', 0);
41
+	$page_id = absint($page_id);
42 42
 
43
-	return apply_filters( 'wpinv_get_success_page_uri', get_permalink( $page_id ) );
43
+	return apply_filters('wpinv_get_success_page_uri', get_permalink($page_id));
44 44
 }
45 45
 
46 46
 /**
@@ -49,139 +49,139 @@  discard block
 block discarded – undo
49 49
  * @param string $post_type The post type or invoice type.
50 50
  * @return string The history page URL.
51 51
  */
52
-function wpinv_get_history_page_uri( $post_type = 'wpi_invoice' ) {
53
-    $post_type = sanitize_key( str_replace( 'wpi_', '', $post_type ) );
54
-	$page_id   = wpinv_get_option( "{$post_type}_history_page", 0 );
55
-	$page_id   = absint( $page_id );
56
-	return apply_filters( 'wpinv_get_history_page_uri', get_permalink( $page_id ), $post_type );
52
+function wpinv_get_history_page_uri($post_type = 'wpi_invoice') {
53
+    $post_type = sanitize_key(str_replace('wpi_', '', $post_type));
54
+	$page_id   = wpinv_get_option("{$post_type}_history_page", 0);
55
+	$page_id   = absint($page_id);
56
+	return apply_filters('wpinv_get_history_page_uri', get_permalink($page_id), $post_type);
57 57
 }
58 58
 
59 59
 function wpinv_is_success_page() {
60
-	$is_success_page = wpinv_get_option( 'success_page', false );
61
-	$is_success_page = ! empty( $is_success_page ) ? is_page( $is_success_page ) : false;
60
+	$is_success_page = wpinv_get_option('success_page', false);
61
+	$is_success_page = !empty($is_success_page) ? is_page($is_success_page) : false;
62 62
 
63
-	return apply_filters( 'wpinv_is_success_page', $is_success_page );
63
+	return apply_filters('wpinv_is_success_page', $is_success_page);
64 64
 }
65 65
 
66 66
 function wpinv_is_invoice_history_page() {
67
-	$ret = wpinv_get_option( 'invoice_history_page', false );
68
-	$ret = $ret ? is_page( $ret ) : false;
69
-	return apply_filters( 'wpinv_is_invoice_history_page', $ret );
67
+	$ret = wpinv_get_option('invoice_history_page', false);
68
+	$ret = $ret ? is_page($ret) : false;
69
+	return apply_filters('wpinv_is_invoice_history_page', $ret);
70 70
 }
71 71
 
72 72
 function wpinv_is_subscriptions_history_page() {
73
-    $ret = wpinv_get_option( 'invoice_subscription_page', false );
74
-    $ret = $ret ? is_page( $ret ) : false;
75
-    return apply_filters( 'wpinv_is_subscriptions_history_page', $ret );
73
+    $ret = wpinv_get_option('invoice_subscription_page', false);
74
+    $ret = $ret ? is_page($ret) : false;
75
+    return apply_filters('wpinv_is_subscriptions_history_page', $ret);
76 76
 }
77 77
 
78 78
 /**
79 79
  * Redirects a user the success page.
80 80
  */
81
-function wpinv_send_to_success_page( $args = array() ) {
81
+function wpinv_send_to_success_page($args = array()) {
82 82
 
83 83
     $redirect = add_query_arg(
84
-        wp_parse_args( $args ),
84
+        wp_parse_args($args),
85 85
         wpinv_get_success_page_uri()
86 86
     );
87 87
 
88
-    $redirect = apply_filters( 'wpinv_send_to_success_page_url', $redirect, $args );
88
+    $redirect = apply_filters('wpinv_send_to_success_page_url', $redirect, $args);
89 89
 
90
-    wp_redirect( $redirect );
90
+    wp_redirect($redirect);
91 91
     exit;
92 92
 }
93 93
 
94
-function wpinv_send_to_failed_page( $args = null ) {
94
+function wpinv_send_to_failed_page($args = null) {
95 95
 	$redirect = wpinv_get_failed_transaction_uri();
96 96
     
97
-    if ( !empty( $args ) ) {
97
+    if (!empty($args)) {
98 98
         // Check for backward compatibility
99
-        if ( is_string( $args ) )
100
-            $args = str_replace( '?', '', $args );
99
+        if (is_string($args))
100
+            $args = str_replace('?', '', $args);
101 101
 
102
-        $args = wp_parse_args( $args );
102
+        $args = wp_parse_args($args);
103 103
 
104
-        $redirect = add_query_arg( $args, $redirect );
104
+        $redirect = add_query_arg($args, $redirect);
105 105
     }
106 106
 
107
-    $gateway = isset( $_REQUEST['wpi-gateway'] ) ? $_REQUEST['wpi-gateway'] : '';
107
+    $gateway = isset($_REQUEST['wpi-gateway']) ? $_REQUEST['wpi-gateway'] : '';
108 108
     
109
-    $redirect = apply_filters( 'wpinv_failed_page_redirect', $redirect, $gateway, $args );
110
-    wp_redirect( $redirect );
109
+    $redirect = apply_filters('wpinv_failed_page_redirect', $redirect, $gateway, $args);
110
+    wp_redirect($redirect);
111 111
     exit;
112 112
 }
113 113
 
114
-function wpinv_get_checkout_uri( $args = array() ) {
115
-	$uri = wpinv_get_option( 'checkout_page', false );
116
-	$uri = isset( $uri ) ? get_permalink( $uri ) : NULL;
114
+function wpinv_get_checkout_uri($args = array()) {
115
+	$uri = wpinv_get_option('checkout_page', false);
116
+	$uri = isset($uri) ? get_permalink($uri) : NULL;
117 117
 
118
-	if ( !empty( $args ) ) {
118
+	if (!empty($args)) {
119 119
 		// Check for backward compatibility
120
-		if ( is_string( $args ) )
121
-			$args = str_replace( '?', '', $args );
120
+		if (is_string($args))
121
+			$args = str_replace('?', '', $args);
122 122
 
123
-		$args = wp_parse_args( $args );
123
+		$args = wp_parse_args($args);
124 124
 
125
-		$uri = add_query_arg( $args, $uri );
125
+		$uri = add_query_arg($args, $uri);
126 126
 	}
127 127
 
128
-	$scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin';
128
+	$scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin';
129 129
 
130
-	$ajax_url = admin_url( 'admin-ajax.php', $scheme );
130
+	$ajax_url = admin_url('admin-ajax.php', $scheme);
131 131
 
132
-	if ( ( ! preg_match( '/^https/', $uri ) && preg_match( '/^https/', $ajax_url ) ) || wpinv_is_ssl_enforced() ) {
133
-		$uri = preg_replace( '/^http:/', 'https:', $uri );
132
+	if ((!preg_match('/^https/', $uri) && preg_match('/^https/', $ajax_url)) || wpinv_is_ssl_enforced()) {
133
+		$uri = preg_replace('/^http:/', 'https:', $uri);
134 134
 	}
135 135
 
136
-	return apply_filters( 'wpinv_get_checkout_uri', $uri );
136
+	return apply_filters('wpinv_get_checkout_uri', $uri);
137 137
 }
138 138
 
139
-function wpinv_get_success_page_url( $query_string = null ) {
140
-	$success_page = wpinv_get_option( 'success_page', 0 );
141
-	$success_page = get_permalink( $success_page );
139
+function wpinv_get_success_page_url($query_string = null) {
140
+	$success_page = wpinv_get_option('success_page', 0);
141
+	$success_page = get_permalink($success_page);
142 142
 
143
-	if ( $query_string )
143
+	if ($query_string)
144 144
 		$success_page .= $query_string;
145 145
 
146
-	return apply_filters( 'wpinv_success_page_url', $success_page );
146
+	return apply_filters('wpinv_success_page_url', $success_page);
147 147
 }
148 148
 
149
-function wpinv_get_failed_transaction_uri( $extras = false ) {
150
-	$uri = wpinv_get_option( 'failure_page', '' );
151
-	$uri = ! empty( $uri ) ? trailingslashit( get_permalink( $uri ) ) : home_url();
149
+function wpinv_get_failed_transaction_uri($extras = false) {
150
+	$uri = wpinv_get_option('failure_page', '');
151
+	$uri = !empty($uri) ? trailingslashit(get_permalink($uri)) : home_url();
152 152
 
153
-	if ( $extras )
153
+	if ($extras)
154 154
 		$uri .= $extras;
155 155
 
156
-	return apply_filters( 'wpinv_get_failed_transaction_uri', $uri );
156
+	return apply_filters('wpinv_get_failed_transaction_uri', $uri);
157 157
 }
158 158
 
159 159
 function wpinv_is_failed_transaction_page() {
160
-	$ret = wpinv_get_option( 'failure_page', false );
161
-	$ret = isset( $ret ) ? is_page( $ret ) : false;
160
+	$ret = wpinv_get_option('failure_page', false);
161
+	$ret = isset($ret) ? is_page($ret) : false;
162 162
 
163
-	return apply_filters( 'wpinv_is_failure_page', $ret );
163
+	return apply_filters('wpinv_is_failure_page', $ret);
164 164
 }
165 165
 
166
-function wpinv_transaction_query( $type = 'start' ) {
166
+function wpinv_transaction_query($type = 'start') {
167 167
     global $wpdb;
168 168
 
169 169
     $wpdb->hide_errors();
170 170
 
171
-    if ( ! defined( 'WPINV_USE_TRANSACTIONS' ) ) {
172
-        define( 'WPINV_USE_TRANSACTIONS', true );
171
+    if (!defined('WPINV_USE_TRANSACTIONS')) {
172
+        define('WPINV_USE_TRANSACTIONS', true);
173 173
     }
174 174
 
175
-    if ( WPINV_USE_TRANSACTIONS ) {
176
-        switch ( $type ) {
175
+    if (WPINV_USE_TRANSACTIONS) {
176
+        switch ($type) {
177 177
             case 'commit' :
178
-                $wpdb->query( 'COMMIT' );
178
+                $wpdb->query('COMMIT');
179 179
                 break;
180 180
             case 'rollback' :
181
-                $wpdb->query( 'ROLLBACK' );
181
+                $wpdb->query('ROLLBACK');
182 182
                 break;
183 183
             default :
184
-                $wpdb->query( 'START TRANSACTION' );
184
+                $wpdb->query('START TRANSACTION');
185 185
             break;
186 186
         }
187 187
     }
@@ -190,146 +190,146 @@  discard block
 block discarded – undo
190 190
 function wpinv_get_prefix() {
191 191
     $invoice_prefix = 'INV-';
192 192
     
193
-    return apply_filters( 'wpinv_get_prefix', $invoice_prefix );
193
+    return apply_filters('wpinv_get_prefix', $invoice_prefix);
194 194
 }
195 195
 
196 196
 function wpinv_get_business_logo() {
197
-    $business_logo = wpinv_get_option( 'logo' );
198
-    return apply_filters( 'wpinv_get_business_logo', $business_logo );
197
+    $business_logo = wpinv_get_option('logo');
198
+    return apply_filters('wpinv_get_business_logo', $business_logo);
199 199
 }
200 200
 
201 201
 function wpinv_get_business_name() {
202
-    $name = wpinv_get_option( 'store_name', wpinv_get_blogname() );
202
+    $name = wpinv_get_option('store_name', wpinv_get_blogname());
203 203
 
204
-    if ( empty( $name ) ) {
204
+    if (empty($name)) {
205 205
         $name = wpinv_get_blogname();
206 206
     }
207 207
 
208
-    return apply_filters( 'wpinv_get_business_name', $name );
208
+    return apply_filters('wpinv_get_business_name', $name);
209 209
 }
210 210
 
211 211
 function wpinv_get_blogname() {
212
-    return wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
212
+    return wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
213 213
 }
214 214
 
215 215
 function wpinv_get_admin_email() {
216
-    $admin_email = wpinv_get_option( 'admin_email', get_option( 'admin_email' ) );
217
-    return apply_filters( 'wpinv_admin_email', $admin_email );
216
+    $admin_email = wpinv_get_option('admin_email', get_option('admin_email'));
217
+    return apply_filters('wpinv_admin_email', $admin_email);
218 218
 }
219 219
 
220 220
 function wpinv_get_business_website() {
221
-    $business_website = home_url( '/' );
222
-    return apply_filters( 'wpinv_get_business_website', $business_website );
221
+    $business_website = home_url('/');
222
+    return apply_filters('wpinv_get_business_website', $business_website);
223 223
 }
224 224
 
225
-function wpinv_get_terms_text( $invoice_id = 0 ) {
225
+function wpinv_get_terms_text($invoice_id = 0) {
226 226
     $terms_text = '';
227
-    return apply_filters( 'wpinv_get_terms_text', $terms_text, $invoice_id );
227
+    return apply_filters('wpinv_get_terms_text', $terms_text, $invoice_id);
228 228
 }
229 229
 
230 230
 function wpinv_get_business_footer() {
231
-    $site_link = '<a target="_blank" href="' . esc_url( wpinv_get_business_website() ) . '">' . esc_html( wpinv_get_business_name() ) . '</a>';
232
-    $business_footer = wp_sprintf( __( 'Thanks for using %s', 'invoicing' ), $site_link );
233
-    return apply_filters( 'wpinv_get_business_footer', $business_footer );
231
+    $site_link = '<a target="_blank" href="' . esc_url(wpinv_get_business_website()) . '">' . esc_html(wpinv_get_business_name()) . '</a>';
232
+    $business_footer = wp_sprintf(__('Thanks for using %s', 'invoicing'), $site_link);
233
+    return apply_filters('wpinv_get_business_footer', $business_footer);
234 234
 }
235 235
 
236 236
 function wpinv_checkout_required_fields() {
237 237
     $required_fields = array();
238 238
     
239 239
     // Let payment gateways and other extensions determine if address fields should be required
240
-    $require_billing_details = apply_filters( 'wpinv_checkout_required_billing_details', wpinv_use_taxes() );
240
+    $require_billing_details = apply_filters('wpinv_checkout_required_billing_details', wpinv_use_taxes());
241 241
     
242
-    if ( $require_billing_details ) {
243
-		if ( (bool)wpinv_get_option( 'fname_mandatory' ) ) {
242
+    if ($require_billing_details) {
243
+		if ((bool) wpinv_get_option('fname_mandatory')) {
244 244
 			$required_fields['first_name'] = array(
245 245
 				'error_id' => 'invalid_first_name',
246
-				'error_message' => __( 'Please enter your first name', 'invoicing' )
246
+				'error_message' => __('Please enter your first name', 'invoicing')
247 247
 			);
248 248
 		}
249
-		if ( (bool)wpinv_get_option( 'address_mandatory' ) ) {
249
+		if ((bool) wpinv_get_option('address_mandatory')) {
250 250
 			$required_fields['address'] = array(
251 251
 				'error_id' => 'invalid_address',
252
-				'error_message' => __( 'Please enter your address', 'invoicing' )
252
+				'error_message' => __('Please enter your address', 'invoicing')
253 253
 			);
254 254
 		}
255
-		if ( (bool)wpinv_get_option( 'city_mandatory' ) ) {
255
+		if ((bool) wpinv_get_option('city_mandatory')) {
256 256
 			$required_fields['city'] = array(
257 257
 				'error_id' => 'invalid_city',
258
-				'error_message' => __( 'Please enter your billing city', 'invoicing' )
258
+				'error_message' => __('Please enter your billing city', 'invoicing')
259 259
 			);
260 260
 		}
261
-		if ( (bool)wpinv_get_option( 'state_mandatory' ) ) {
261
+		if ((bool) wpinv_get_option('state_mandatory')) {
262 262
 			$required_fields['state'] = array(
263 263
 				'error_id' => 'invalid_state',
264
-				'error_message' => __( 'Please enter billing state / province', 'invoicing' )
264
+				'error_message' => __('Please enter billing state / province', 'invoicing')
265 265
 			);
266 266
 		}
267
-		if ( (bool)wpinv_get_option( 'country_mandatory' ) ) {
267
+		if ((bool) wpinv_get_option('country_mandatory')) {
268 268
 			$required_fields['country'] = array(
269 269
 				'error_id' => 'invalid_country',
270
-				'error_message' => __( 'Please select your billing country', 'invoicing' )
270
+				'error_message' => __('Please select your billing country', 'invoicing')
271 271
 			);
272 272
 		}
273 273
     }
274 274
 
275
-    return apply_filters( 'wpinv_checkout_required_fields', $required_fields );
275
+    return apply_filters('wpinv_checkout_required_fields', $required_fields);
276 276
 }
277 277
 
278 278
 function wpinv_is_ssl_enforced() {
279
-    $ssl_enforced = wpinv_get_option( 'enforce_ssl', false );
280
-    return (bool) apply_filters( 'wpinv_is_ssl_enforced', $ssl_enforced );
279
+    $ssl_enforced = wpinv_get_option('enforce_ssl', false);
280
+    return (bool) apply_filters('wpinv_is_ssl_enforced', $ssl_enforced);
281 281
 }
282 282
 
283 283
 function wpinv_schedule_event_twicedaily() {
284 284
     wpinv_email_payment_reminders();
285 285
 }
286
-add_action( 'wpinv_register_schedule_event_daily', 'wpinv_schedule_event_twicedaily' );
286
+add_action('wpinv_register_schedule_event_daily', 'wpinv_schedule_event_twicedaily');
287 287
 
288 288
 function wpinv_require_login_to_checkout() {
289
-    $return = wpinv_get_option( 'login_to_checkout', false );
290
-    return (bool) apply_filters( 'wpinv_require_login_to_checkout', $return );
289
+    $return = wpinv_get_option('login_to_checkout', false);
290
+    return (bool) apply_filters('wpinv_require_login_to_checkout', $return);
291 291
 }
292 292
 
293
-function wpinv_sequential_number_active( $type = '' ) {
294
-    $check = apply_filters( 'wpinv_pre_check_sequential_number_active', null, $type );
295
-    if ( null !== $check ) {
293
+function wpinv_sequential_number_active($type = '') {
294
+    $check = apply_filters('wpinv_pre_check_sequential_number_active', null, $type);
295
+    if (null !== $check) {
296 296
         return $check;
297 297
     }
298 298
     
299
-    return wpinv_get_option( 'sequential_invoice_number' );
299
+    return wpinv_get_option('sequential_invoice_number');
300 300
 }
301 301
 
302
-function wpinv_switch_to_locale( $locale = NULL ) {
302
+function wpinv_switch_to_locale($locale = NULL) {
303 303
     global $invoicing, $wpi_switch_locale;
304 304
 
305
-    if ( ! empty( $invoicing ) && function_exists( 'switch_to_locale' ) ) {
306
-        $locale = empty( $locale ) ? get_locale() : $locale;
305
+    if (!empty($invoicing) && function_exists('switch_to_locale')) {
306
+        $locale = empty($locale) ? get_locale() : $locale;
307 307
 
308
-        switch_to_locale( $locale );
308
+        switch_to_locale($locale);
309 309
 
310 310
         $wpi_switch_locale = $locale;
311 311
 
312
-        add_filter( 'plugin_locale', 'get_locale' );
312
+        add_filter('plugin_locale', 'get_locale');
313 313
 
314 314
         $invoicing->load_textdomain();
315 315
 
316
-        do_action( 'wpinv_switch_to_locale', $locale );
316
+        do_action('wpinv_switch_to_locale', $locale);
317 317
     }
318 318
 }
319 319
 
320 320
 function wpinv_restore_locale() {
321 321
     global $invoicing, $wpi_switch_locale;
322 322
     
323
-    if ( ! empty( $invoicing ) && function_exists( 'restore_previous_locale' ) && $wpi_switch_locale ) {
323
+    if (!empty($invoicing) && function_exists('restore_previous_locale') && $wpi_switch_locale) {
324 324
         restore_previous_locale();
325 325
 
326 326
         $wpi_switch_locale = NULL;
327 327
 
328
-        remove_filter( 'plugin_locale', 'get_locale' );
328
+        remove_filter('plugin_locale', 'get_locale');
329 329
 
330 330
         $invoicing->load_textdomain();
331 331
 
332
-        do_action( 'wpinv_restore_locale' );
332
+        do_action('wpinv_restore_locale');
333 333
     }
334 334
 }
335 335
 
@@ -337,26 +337,26 @@  discard block
 block discarded – undo
337 337
  * Returns the default form's id.
338 338
  */
339 339
 function wpinv_get_default_payment_form() {
340
-    $form = get_option( 'wpinv_default_payment_form' );
340
+    $form = get_option('wpinv_default_payment_form');
341 341
 
342
-    if ( empty( $form ) || 'publish' != get_post_status( $form ) ) {
342
+    if (empty($form) || 'publish' != get_post_status($form)) {
343 343
         $form = wp_insert_post(
344 344
             array(
345 345
                 'post_type'   => 'wpi_payment_form',
346
-                'post_title'  => __( 'Checkout (default)', 'invoicing' ),
346
+                'post_title'  => __('Checkout (default)', 'invoicing'),
347 347
                 'post_status' => 'publish',
348 348
                 'meta_input'  => array(
349
-                    'wpinv_form_elements' => wpinv_get_data( 'default-payment-form' ),
349
+                    'wpinv_form_elements' => wpinv_get_data('default-payment-form'),
350 350
                     'wpinv_form_items'    => array(),
351 351
                 )
352 352
             )
353 353
         );
354 354
 
355
-        update_option( 'wpinv_default_payment_form', $form );
355
+        update_option('wpinv_default_payment_form', $form);
356 356
     }
357 357
 
358 358
     // WPML support.
359
-    $form = apply_filters( 'wpml_object_id', $form, 'wpi_payment_form', TRUE  );
359
+    $form = apply_filters('wpml_object_id', $form, 'wpi_payment_form', TRUE);
360 360
     return $form;
361 361
 }
362 362
 
@@ -365,19 +365,19 @@  discard block
 block discarded – undo
365 365
  * 
366 366
  * @param int $payment_form
367 367
  */
368
-function getpaid_get_payment_form_elements( $payment_form ) {
368
+function getpaid_get_payment_form_elements($payment_form) {
369 369
 
370
-    if ( empty( $payment_form ) ) {
371
-        return wpinv_get_data( 'sample-payment-form' );
370
+    if (empty($payment_form)) {
371
+        return wpinv_get_data('sample-payment-form');
372 372
     }
373 373
 
374
-    $form_elements = get_post_meta( $payment_form, 'wpinv_form_elements', true );
374
+    $form_elements = get_post_meta($payment_form, 'wpinv_form_elements', true);
375 375
 
376
-    if ( is_array( $form_elements ) ) {
376
+    if (is_array($form_elements)) {
377 377
         return $form_elements;
378 378
     }
379 379
 
380
-    return wpinv_get_data( 'sample-payment-form' );
380
+    return wpinv_get_data('sample-payment-form');
381 381
 
382 382
 }
383 383
 
@@ -386,13 +386,13 @@  discard block
 block discarded – undo
386 386
  * 
387 387
  * @param int $payment_form
388 388
  */
389
-function gepaid_get_form_items( $id ) {
390
-    $form = new GetPaid_Payment_Form( $id );
389
+function gepaid_get_form_items($id) {
390
+    $form = new GetPaid_Payment_Form($id);
391 391
 
392 392
     // Is this a default form?
393
-    if ( $form->is_default() ) {
393
+    if ($form->is_default()) {
394 394
         return array();
395 395
     }
396 396
 
397
-    return $form->get_items( 'view', 'arrays' );
397
+    return $form->get_items('view', 'arrays');
398 398
 }
Please login to merge, or discard this patch.
templates/invoice/company-address.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  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
 // Prepare the company name.
13
-$company_name = wpinv_get_option( 'vat_company_name' );
13
+$company_name = wpinv_get_option('vat_company_name');
14 14
 
15
-if ( empty( $company_name ) ) {
15
+if (empty($company_name)) {
16 16
     $company_name = wpinv_get_business_name();
17 17
 }
18 18
 
19 19
 // Prepare the VAT number.
20
-$vat_number = wpinv_get_option( 'vat_number' );
20
+$vat_number = wpinv_get_option('vat_number');
21 21
 
22 22
 ?>
23 23
     <div class="getpaid-company-address form-group">
@@ -25,36 +25,36 @@  discard block
 block discarded – undo
25 25
         <div class="row">
26 26
 
27 27
             <div class="invoice-company-address-label col-2">
28
-                <strong><?php _e( 'From:', 'invoicing' ) ?></strong>
28
+                <strong><?php _e('From:', 'invoicing') ?></strong>
29 29
             </div>
30 30
 
31 31
             <div class="invoice-company-address-value col-10">
32 32
 
33
-                <?php do_action( 'getpaid_company_address_top' ); ?>
33
+                <?php do_action('getpaid_company_address_top'); ?>
34 34
 
35 35
                 <div class="name">
36
-                    <a target="_blank" class="text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>">
37
-                        <?php echo esc_html( $company_name ); ?>
36
+                    <a target="_blank" class="text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>">
37
+                        <?php echo esc_html($company_name); ?>
38 38
                     </a>
39 39
                 </div>
40 40
 
41
-                <?php if ( $address = wpinv_get_business_address() ) { ?>
42
-                    <?php echo $address;?>
41
+                <?php if ($address = wpinv_get_business_address()) { ?>
42
+                    <?php echo $address; ?>
43 43
                 <?php } ?>
44 44
 
45
-                <?php if ( $email_from = wpinv_mail_get_from_address() ) { ?>
45
+                <?php if ($email_from = wpinv_mail_get_from_address()) { ?>
46 46
                     <div class="email_from">
47
-                        <?php echo wp_sprintf( __( 'Email: %s', 'invoicing' ), $email_from );?>
47
+                        <?php echo wp_sprintf(__('Email: %s', 'invoicing'), $email_from); ?>
48 48
                     </div>
49 49
                 <?php } ?>
50 50
 
51
-                <?php if ( ! empty( $vat_number ) ) { ?>
51
+                <?php if (!empty($vat_number)) { ?>
52 52
                     <div class="email_from">
53
-                        <?php echo wp_sprintf( __( 'VAT Number: %s', 'invoicing' ), sanitize_text_field( $vat_number ) );?>
53
+                        <?php echo wp_sprintf(__('VAT Number: %s', 'invoicing'), sanitize_text_field($vat_number)); ?>
54 54
                     </div>
55 55
                 <?php } ?>
56 56
 
57
-                <?php do_action( 'getpaid_company_address_bottom' ); ?>
57
+                <?php do_action('getpaid_company_address_bottom'); ?>
58 58
 
59 59
             </div>
60 60
 
Please login to merge, or discard this patch.
templates/invoice/billing-address.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  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
-$invoice     = new WPInv_Invoice( $invoice );
13
-$address_row = wpinv_get_invoice_address_markup( $invoice->get_user_info() );
12
+$invoice     = new WPInv_Invoice($invoice);
13
+$address_row = wpinv_get_invoice_address_markup($invoice->get_user_info());
14 14
 $phone       = $invoice->get_phone();
15 15
 $email       = $invoice->get_email();
16 16
 $vat_number  = $invoice->get_vat_number();
@@ -21,41 +21,41 @@  discard block
 block discarded – undo
21 21
 
22 22
 
23 23
             <div class="invoice-billing-address-label col-2">
24
-                <strong><?php _e( 'To:', 'invoicing' ) ?></strong>
24
+                <strong><?php _e('To:', 'invoicing') ?></strong>
25 25
             </div>
26 26
 
27 27
 
28 28
             <div class="invoice-billing-address-value col-10">
29 29
 
30
-                <?php do_action( 'getpaid_billing_address_top' ); ?>
30
+                <?php do_action('getpaid_billing_address_top'); ?>
31 31
 
32
-                <?php if ( ! empty( $address_row ) ) : ?>
32
+                <?php if (!empty($address_row)) : ?>
33 33
                     <div class="billing-address">
34 34
                         <?php echo $address_row; ?>
35 35
                     </div>
36 36
                 <?php endif; ?>
37 37
 
38 38
 
39
-                <?php if ( ! empty( $phone ) ) : ?>
39
+                <?php if (!empty($phone)) : ?>
40 40
                     <div class="billing-phone">
41
-                        <?php echo wp_sprintf( __( 'Phone: %s', 'invoicing' ), esc_html( $phone ) ); ?>
41
+                        <?php echo wp_sprintf(__('Phone: %s', 'invoicing'), esc_html($phone)); ?>
42 42
                     </div>
43 43
                 <?php endif; ?>
44 44
 
45 45
 
46
-                <?php if ( ! empty( $email ) ) : ?>
46
+                <?php if (!empty($email)) : ?>
47 47
                     <div class="billing-email">
48
-                        <?php echo wp_sprintf( __( 'Email: %s', 'invoicing' ), sanitize_email( $email ) ); ?>
48
+                        <?php echo wp_sprintf(__('Email: %s', 'invoicing'), sanitize_email($email)); ?>
49 49
                     </div>
50 50
                 <?php endif; ?>
51 51
 
52
-                <?php if ( ! empty( $vat_number ) ) : ?>
52
+                <?php if (!empty($vat_number)) : ?>
53 53
                     <div class="vat-number">
54
-                        <?php echo wp_sprintf( __( 'Vat Number: %s', 'invoicing' ), sanitize_text_field( $vat_number ) ); ?>
54
+                        <?php echo wp_sprintf(__('Vat Number: %s', 'invoicing'), sanitize_text_field($vat_number)); ?>
55 55
                     </div>
56 56
                 <?php endif; ?>
57 57
 
58
-                <?php do_action( 'getpaid_billing_address_bottom' ); ?>
58
+                <?php do_action('getpaid_billing_address_bottom'); ?>
59 59
 
60 60
             </div>
61 61
 
Please login to merge, or discard this patch.
templates/invoice/line-totals.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -9,26 +9,26 @@  discard block
 block discarded – undo
9 9
  * @var WPInv_Invoice $invoice
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) || exit;
12
+defined('ABSPATH') || exit;
13 13
 
14 14
 // Totals rows.
15
-$totals = getpaid_invoice_totals_rows( $invoice );
15
+$totals = getpaid_invoice_totals_rows($invoice);
16 16
 
17
-do_action( 'getpaid_before_invoice_line_totals', $invoice, $totals );
17
+do_action('getpaid_before_invoice_line_totals', $invoice, $totals);
18 18
 
19 19
 ?>
20 20
 <div class='getpaid-invoice-line-totals'>
21 21
     <div class="row">
22 22
         <div class="col-12 offset-sm-6 col-sm-6 border-sm-left pl-sm-0">
23 23
 
24
-            <?php foreach ( $totals as $key => $label ) : ?>
24
+            <?php foreach ($totals as $key => $label) : ?>
25 25
 
26
-                <div class="getpaid-invoice-line-totals-col <?php echo sanitize_html_class( $key ); ?>">
26
+                <div class="getpaid-invoice-line-totals-col <?php echo sanitize_html_class($key); ?>">
27 27
 
28 28
                     <div class="form-row">
29 29
 
30 30
                         <div class="col-8 getpaid-invoice-line-totals-label">
31
-                            <?php echo sanitize_text_field( $label ); ?>
31
+                            <?php echo sanitize_text_field($label); ?>
32 32
                         </div>
33 33
 
34 34
                         <div class="col-4 getpaid-invoice-line-totals-value pl-0">
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
                             <?php
37 37
 
38 38
                                 // Total tax.
39
-                                if ( 'tax' == $key ) {
40
-                                    echo wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() );
39
+                                if ('tax' == $key) {
40
+                                    echo wpinv_price($invoice->get_total_tax(), $invoice->get_currency());
41 41
 
42
-                                    if ( wpinv_use_taxes() && ! $invoice->get_disable_taxes() ) {
42
+                                    if (wpinv_use_taxes() && !$invoice->get_disable_taxes()) {
43 43
 
44 44
                                         $taxes = $invoice->get_total_tax();
45
-                                        if ( empty( $taxes ) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction( $invoice->get_country() ) ) {
45
+                                        if (empty($taxes) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction($invoice->get_country())) {
46 46
                                             echo ' <em class="text-muted small">';
47
-                                            _e( '(Reverse charged)', 'invoicing' );
47
+                                            _e('(Reverse charged)', 'invoicing');
48 48
                                             echo '</em>';
49 49
                                         }
50 50
 
@@ -53,27 +53,27 @@  discard block
 block discarded – undo
53 53
                                 }
54 54
 
55 55
                                 // Total Fee.
56
-                                if ( 'fee' == $key ) {
57
-                                    echo wpinv_price( $invoice->get_total_fees(), $invoice->get_currency() );
56
+                                if ('fee' == $key) {
57
+                                    echo wpinv_price($invoice->get_total_fees(), $invoice->get_currency());
58 58
                                 }
59 59
 
60 60
                                 // Total discount.
61
-                                if ( 'discount' == $key ) {
62
-                                    echo wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() );
61
+                                if ('discount' == $key) {
62
+                                    echo wpinv_price($invoice->get_total_discount(), $invoice->get_currency());
63 63
                                 }
64 64
 
65 65
                                 // Sub total.
66
-                                if ( 'subtotal' == $key ) {
67
-                                    echo wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() );
66
+                                if ('subtotal' == $key) {
67
+                                    echo wpinv_price($invoice->get_subtotal(), $invoice->get_currency());
68 68
                                 }
69 69
 
70 70
                                 // Total.
71
-                                if ( 'total' == $key ) {
72
-                                    echo wpinv_price( $invoice->get_total(), $invoice->get_currency() );
71
+                                if ('total' == $key) {
72
+                                    echo wpinv_price($invoice->get_total(), $invoice->get_currency());
73 73
                                 }
74 74
  
75 75
                                 // Fires when printing a cart total.
76
-                                do_action( "getpaid_invoice_cart_totals_$key", $invoice );
76
+                                do_action("getpaid_invoice_cart_totals_$key", $invoice);
77 77
 
78 78
                             ?>
79 79
 
@@ -87,4 +87,4 @@  discard block
 block discarded – undo
87 87
     </div>
88 88
 </div> <!-- end .getpaid-invoice-line-totals -->
89 89
 
90
-<?php do_action(  'getpaid_after_invoice_line_totals', $invoice, $totals ); ?>
90
+<?php do_action('getpaid_after_invoice_line_totals', $invoice, $totals); ?>
Please login to merge, or discard this patch.
includes/wpinv-tax-functions.php 1 patch
Spacing   +124 added lines, -124 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
  * Returns an array of eu states.
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  * @return array
13 13
  */
14 14
 function getpaid_get_eu_states() {
15
-    return wpinv_get_data( 'eu-states' );
15
+    return wpinv_get_data('eu-states');
16 16
 }
17 17
 
18 18
 /**
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
  * 
21 21
  * @return bool
22 22
  */
23
-function getpaid_is_eu_state( $country ) {
24
-    return ! empty( $country ) && in_array( strtoupper( $country ), getpaid_get_eu_states() ) ? true : false;
23
+function getpaid_is_eu_state($country) {
24
+    return !empty($country) && in_array(strtoupper($country), getpaid_get_eu_states()) ? true : false;
25 25
 }
26 26
 
27 27
 /**
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  * @return array
31 31
  */
32 32
 function getpaid_get_gst_states() {
33
-    return array( 'AU', 'NZ', 'CA', 'CN' );
33
+    return array('AU', 'NZ', 'CA', 'CN');
34 34
 }
35 35
 
36 36
 /**
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
  * 
39 39
  * @return bool
40 40
  */
41
-function getpaid_is_gst_country( $country ) {
42
-    return ! empty( $country ) && in_array( strtoupper( $country ), getpaid_get_gst_states() ) ? true : false;
41
+function getpaid_is_gst_country($country) {
42
+    return !empty($country) && in_array(strtoupper($country), getpaid_get_gst_states()) ? true : false;
43 43
 }
44 44
 
45 45
 /**
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
  */
50 50
 function wpinv_use_taxes() {
51 51
 
52
-    $ret = wpinv_get_option( 'enable_taxes', false );
53
-    return (bool) apply_filters( 'wpinv_use_taxes', ! empty( $ret ) );
52
+    $ret = wpinv_get_option('enable_taxes', false);
53
+    return (bool) apply_filters('wpinv_use_taxes', !empty($ret));
54 54
 
55 55
 }
56 56
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
  * @param WPInv_Invoice $invoice
61 61
  * @return bool
62 62
  */
63
-function wpinv_is_invoice_taxable( $invoice ) {
63
+function wpinv_is_invoice_taxable($invoice) {
64 64
     return $invoice->is_taxable();
65 65
 }
66 66
 
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
  * @param string $country
71 71
  * @return bool
72 72
  */
73
-function wpinv_is_country_taxable( $country ) {
74
-    $is_eu     = getpaid_is_eu_state( $country );
75
-    $is_exempt = $is_eu && $country == wpinv_is_base_country( $country ) && wpinv_same_country_exempt_vat();
73
+function wpinv_is_country_taxable($country) {
74
+    $is_eu     = getpaid_is_eu_state($country);
75
+    $is_exempt = $is_eu && $country == wpinv_is_base_country($country) && wpinv_same_country_exempt_vat();
76 76
 
77
-    return (bool) apply_filters( 'wpinv_is_country_taxable', ! $is_exempt, $country ); 
77
+    return (bool) apply_filters('wpinv_is_country_taxable', !$is_exempt, $country); 
78 78
 
79 79
 }
80 80
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
  * @param WPInv_Item|GetPaid_Form_Item $item
85 85
  * @return bool
86 86
  */
87
-function wpinv_is_item_taxable( $item ) {
87
+function wpinv_is_item_taxable($item) {
88 88
     return '_exempt' != $item->get_vat_rule();
89 89
 }
90 90
 
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
  * @return bool
95 95
  */
96 96
 function wpinv_use_store_address_as_tax_base() {
97
-    $use_base = wpinv_get_option( 'tax_base', 'billing' ) == 'base';
98
-    return (bool) apply_filters( 'wpinv_use_store_address_as_tax_base', $use_base );
97
+    $use_base = wpinv_get_option('tax_base', 'billing') == 'base';
98
+    return (bool) apply_filters('wpinv_use_store_address_as_tax_base', $use_base);
99 99
 }
100 100
 
101 101
 /**
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
  * @return bool
105 105
  */
106 106
 function wpinv_prices_include_tax() {
107
-    $is_inclusive = wpinv_get_option( 'prices_include_tax', 'no' ) == 'yes';
108
-    return (bool) apply_filters( 'wpinv_prices_include_tax', $is_inclusive );
107
+    $is_inclusive = wpinv_get_option('prices_include_tax', 'no') == 'yes';
108
+    return (bool) apply_filters('wpinv_prices_include_tax', $is_inclusive);
109 109
 }
110 110
 
111 111
 /**
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
  * @return bool
115 115
  */
116 116
 function wpinv_round_tax_per_tax_rate() {
117
-    $subtotal_rounding = wpinv_get_option( 'tax_subtotal_rounding', 1 );
118
-    return (bool) apply_filters( 'wpinv_round_tax_per_tax_rate', empty( $subtotal_rounding ) );
117
+    $subtotal_rounding = wpinv_get_option('tax_subtotal_rounding', 1);
118
+    return (bool) apply_filters('wpinv_round_tax_per_tax_rate', empty($subtotal_rounding));
119 119
 }
120 120
 
121 121
 /**
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
  * @return bool
125 125
  */
126 126
 function wpinv_display_individual_tax_rates() {
127
-    $individual = wpinv_get_option( 'tax_display_totals', 'single' ) == 'individual';
128
-    return (bool) apply_filters( 'wpinv_display_individual_tax_rates', $individual );
127
+    $individual = wpinv_get_option('tax_display_totals', 'single') == 'individual';
128
+    return (bool) apply_filters('wpinv_display_individual_tax_rates', $individual);
129 129
 }
130 130
 
131 131
 /**
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
  * @return float
135 135
  */
136 136
 function wpinv_get_default_tax_rate() {
137
-    $rate = wpinv_get_option( 'tax_rate', 20 );
138
-    return (float) apply_filters( 'wpinv_get_default_tax_rate', floatval( $rate ) );
137
+    $rate = wpinv_get_option('tax_rate', 20);
138
+    return (float) apply_filters('wpinv_get_default_tax_rate', floatval($rate));
139 139
 }
140 140
 
141 141
 /**
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
  * @return bool
145 145
  */
146 146
 function wpinv_same_country_exempt_vat() {
147
-    return 'no' == wpinv_get_option( 'vat_same_country_rule', 'vat_too' );
147
+    return 'no' == wpinv_get_option('vat_same_country_rule', 'vat_too');
148 148
 }
149 149
 
150 150
 /**
@@ -164,28 +164,28 @@  discard block
 block discarded – undo
164 164
  * @param string $state
165 165
  * @return array
166 166
  */
167
-function getpaid_get_item_tax_rates( $item, $country = '', $state = '' ) {
167
+function getpaid_get_item_tax_rates($item, $country = '', $state = '') {
168 168
 
169 169
     // Abort if the item is not taxable.
170
-    if ( ! wpinv_is_item_taxable( $item ) ) {
170
+    if (!wpinv_is_item_taxable($item)) {
171 171
         return array();
172 172
     }
173 173
 
174 174
     // Maybe use the store address.
175
-    if ( wpinv_use_store_address_as_tax_base() ) {
175
+    if (wpinv_use_store_address_as_tax_base()) {
176 176
         $country = wpinv_get_default_country();
177 177
         $state   = wpinv_get_default_state();
178 178
     }
179 179
 
180 180
     // Retrieve tax rates.
181
-    $tax_rates = GetPaid_Tax::get_address_tax_rates( $country, $state );
181
+    $tax_rates = GetPaid_Tax::get_address_tax_rates($country, $state);
182 182
 
183 183
     // Fallback to the default tax rates if non were found.
184
-    if ( empty( $tax_rates ) ) {
184
+    if (empty($tax_rates)) {
185 185
         $tax_rates = GetPaid_Tax::get_default_tax_rates();
186 186
     }
187 187
 
188
-    return apply_filters( 'getpaid_get_item_tax_rates', $tax_rates, $item, $country, $state );
188
+    return apply_filters('getpaid_get_item_tax_rates', $tax_rates, $item, $country, $state);
189 189
 }
190 190
 
191 191
 /**
@@ -195,23 +195,23 @@  discard block
 block discarded – undo
195 195
  * @param array $rates
196 196
  * @return array
197 197
  */
198
-function getpaid_filter_item_tax_rates( $item, $rates ) {
198
+function getpaid_filter_item_tax_rates($item, $rates) {
199 199
 
200 200
     $tax_class = $item->get_vat_class();
201 201
 
202
-    foreach ( $rates as $i => $rate ) {
202
+    foreach ($rates as $i => $rate) {
203 203
 
204
-        if ( $tax_class == '_reduced' ) {
205
-            $rates[ $i ]['rate'] = empty( $rate['reduced_rate'] ) ? 0 : $rate['reduced_rate'];
204
+        if ($tax_class == '_reduced') {
205
+            $rates[$i]['rate'] = empty($rate['reduced_rate']) ? 0 : $rate['reduced_rate'];
206 206
         }
207 207
 
208
-        if ( $tax_class == '_exempt' ) {
209
-            $rates[ $i ]['rate'] = 0;
208
+        if ($tax_class == '_exempt') {
209
+            $rates[$i]['rate'] = 0;
210 210
         }
211 211
 
212 212
     }
213 213
 
214
-    return apply_filters( 'getpaid_filter_item_tax_rates', $rates, $item );
214
+    return apply_filters('getpaid_filter_item_tax_rates', $rates, $item);
215 215
 }
216 216
 
217 217
 /**
@@ -221,12 +221,12 @@  discard block
 block discarded – undo
221 221
  * @param array $rates
222 222
  * @return array
223 223
  */
224
-function getpaid_calculate_item_taxes( $amount, $rates ) {
224
+function getpaid_calculate_item_taxes($amount, $rates) {
225 225
 
226 226
     $is_inclusive = wpinv_prices_include_tax();
227
-    $taxes        = GetPaid_Tax::calc_tax( $amount, $rates, $is_inclusive );
227
+    $taxes        = GetPaid_Tax::calc_tax($amount, $rates, $is_inclusive);
228 228
 
229
-    return apply_filters( 'getpaid_calculate_taxes', $taxes, $amount, $rates );
229
+    return apply_filters('getpaid_calculate_taxes', $taxes, $amount, $rates);
230 230
 }
231 231
 
232 232
 /**
@@ -238,17 +238,17 @@  discard block
 block discarded – undo
238 238
  * @param float $recurring_tax_amount
239 239
  * @return array
240 240
  */
241
-function getpaid_prepare_item_tax( $item, $tax_name, $tax_amount, $recurring_tax_amount ) {
241
+function getpaid_prepare_item_tax($item, $tax_name, $tax_amount, $recurring_tax_amount) {
242 242
 
243
-    $initial_tax   = $tax_amount;
243
+    $initial_tax = $tax_amount;
244 244
 	$recurring_tax = 0;
245 245
 
246
-    if ( $item->is_recurring() ) {
246
+    if ($item->is_recurring()) {
247 247
 		$recurring_tax = $recurring_tax_amount;
248 248
 	}
249 249
 
250 250
 	return array(
251
-		'name'          => sanitize_text_field( $tax_name ),
251
+		'name'          => sanitize_text_field($tax_name),
252 252
 		'initial_tax'   => $initial_tax,
253 253
 		'recurring_tax' => $recurring_tax,
254 254
     );
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
  * @param string $vat_number
262 262
  * @return string
263 263
  */
264
-function wpinv_sanitize_vat_number( $vat_number ) {
265
-    return str_replace( array(' ', '.', '-', '_', ',' ), '', strtoupper( trim( $vat_number ) ) );
264
+function wpinv_sanitize_vat_number($vat_number) {
265
+    return str_replace(array(' ', '.', '-', '_', ','), '', strtoupper(trim($vat_number)));
266 266
 }
267 267
 
268 268
 /**
@@ -271,22 +271,22 @@  discard block
 block discarded – undo
271 271
  * @param string $vat_number
272 272
  * @return bool
273 273
  */
274
-function wpinv_regex_validate_vat_number( $vat_number ) {
274
+function wpinv_regex_validate_vat_number($vat_number) {
275 275
 
276
-    $country    = substr( $vat_number, 0, 2 );
277
-    $vatin      = substr( $vat_number, 2 );
278
-    $regexes    = wpinv_get_data( 'vat-number-regexes' );
276
+    $country    = substr($vat_number, 0, 2);
277
+    $vatin      = substr($vat_number, 2);
278
+    $regexes    = wpinv_get_data('vat-number-regexes');
279 279
 
280
-    if ( isset( $regexes[ $country ] ) ) {
280
+    if (isset($regexes[$country])) {
281 281
 
282
-        $regex = $regexes[ $country ];
282
+        $regex = $regexes[$country];
283 283
         $regex = '/^(?:' . $regex . ')$/';
284
-        return 1 === preg_match( $regex, $vatin );
284
+        return 1 === preg_match($regex, $vatin);
285 285
 
286 286
     }
287 287
 
288 288
     // Not an EU state, use filters to validate the number.
289
-    return apply_filters( 'wpinv_regex_validate_vat_number', true, $vat_number );
289
+    return apply_filters('wpinv_regex_validate_vat_number', true, $vat_number);
290 290
 }
291 291
 
292 292
 /**
@@ -295,29 +295,29 @@  discard block
 block discarded – undo
295 295
  * @param string $vat_number
296 296
  * @return bool
297 297
  */
298
-function wpinv_vies_validate_vat_number( $vat_number ) {
298
+function wpinv_vies_validate_vat_number($vat_number) {
299 299
 
300
-    $country    = substr( $vat_number, 0, 2 );
301
-    $vatin      = substr( $vat_number, 2 );
300
+    $country    = substr($vat_number, 0, 2);
301
+    $vatin      = substr($vat_number, 2);
302 302
 
303 303
     $url        = add_query_arg(
304 304
         array(
305
-            'ms'  => urlencode( $country ),
306
-            'iso' => urlencode( $country ),
307
-            'vat' => urlencode( $vatin ),
305
+            'ms'  => urlencode($country),
306
+            'iso' => urlencode($country),
307
+            'vat' => urlencode($vatin),
308 308
         ),
309 309
         'http://ec.europa.eu/taxation_customs/vies/viesquer.do'
310 310
     );
311 311
 
312
-    $response   = wp_remote_get( $url );
313
-    $response   = wp_remote_retrieve_body( $response );
312
+    $response   = wp_remote_get($url);
313
+    $response   = wp_remote_retrieve_body($response);
314 314
 
315 315
     // Fallback gracefully if the VIES website is down.
316
-    if ( empty( $response ) ) {
316
+    if (empty($response)) {
317 317
         return true;
318 318
     }
319 319
 
320
-    return 1 !== preg_match( '/invalid VAT number/i', $response );
320
+    return 1 !== preg_match('/invalid VAT number/i', $response);
321 321
 
322 322
 }
323 323
 
@@ -328,18 +328,18 @@  discard block
 block discarded – undo
328 328
  * @param string $country
329 329
  * @return bool
330 330
  */
331
-function wpinv_validate_vat_number( $vat_number, $country ) {
331
+function wpinv_validate_vat_number($vat_number, $country) {
332 332
 
333 333
     // In case the vat number does not have a country code...
334
-    $vat_number = wpinv_sanitize_vat_number( $vat_number );
335
-    $_country   = substr( $vat_number, 0, 2 );
336
-    $_country   = $_country == wpinv_country_name( $_country );
334
+    $vat_number = wpinv_sanitize_vat_number($vat_number);
335
+    $_country   = substr($vat_number, 0, 2);
336
+    $_country   = $_country == wpinv_country_name($_country);
337 337
 
338
-    if ( $_country ) {
339
-        $vat_number = strtoupper( $country ) . $vat_number;
338
+    if ($_country) {
339
+        $vat_number = strtoupper($country) . $vat_number;
340 340
     }
341 341
 
342
-    return wpinv_regex_validate_vat_number( $vat_number ) && wpinv_vies_validate_vat_number( $vat_number );
342
+    return wpinv_regex_validate_vat_number($vat_number) && wpinv_vies_validate_vat_number($vat_number);
343 343
 }
344 344
 
345 345
 /**
@@ -348,40 +348,40 @@  discard block
 block discarded – undo
348 348
  * @return bool
349 349
  */
350 350
 function wpinv_should_validate_vat_number() {
351
-    $validate = wpinv_get_option( 'validate_vat_number' );
352
-	return ! empty( $validate );
351
+    $validate = wpinv_get_option('validate_vat_number');
352
+	return !empty($validate);
353 353
 }
354 354
 
355
-function wpinv_sales_tax_for_year( $year = null ) {
356
-    return wpinv_price( wpinv_get_sales_tax_for_year( $year ) );
355
+function wpinv_sales_tax_for_year($year = null) {
356
+    return wpinv_price(wpinv_get_sales_tax_for_year($year));
357 357
 }
358 358
 
359
-function wpinv_get_sales_tax_for_year( $year = null ) {
359
+function wpinv_get_sales_tax_for_year($year = null) {
360 360
     global $wpdb;
361 361
 
362 362
     // Start at zero
363 363
     $tax = 0;
364 364
 
365
-    if ( ! empty( $year ) ) {
365
+    if (!empty($year)) {
366 366
         $args = array(
367 367
             'post_type'      => 'wpi_invoice',
368
-            'post_status'    => array( 'publish' ),
368
+            'post_status'    => array('publish'),
369 369
             'posts_per_page' => -1,
370 370
             'year'           => $year,
371 371
             'fields'         => 'ids'
372 372
         );
373 373
 
374
-        $payments    = get_posts( $args );
375
-        $payment_ids = implode( ',', $payments );
374
+        $payments    = get_posts($args);
375
+        $payment_ids = implode(',', $payments);
376 376
 
377
-        if ( count( $payments ) > 0 ) {
377
+        if (count($payments) > 0) {
378 378
             $sql = "SELECT SUM( meta_value ) FROM $wpdb->postmeta WHERE meta_key = '_wpinv_tax' AND post_id IN( $payment_ids )";
379
-            $tax = $wpdb->get_var( $sql );
379
+            $tax = $wpdb->get_var($sql);
380 380
         }
381 381
 
382 382
     }
383 383
 
384
-    return apply_filters( 'wpinv_get_sales_tax_for_year', $tax, $year );
384
+    return apply_filters('wpinv_get_sales_tax_for_year', $tax, $year);
385 385
 }
386 386
 
387 387
 function wpinv_is_cart_taxed() {
@@ -390,33 +390,33 @@  discard block
 block discarded – undo
390 390
 
391 391
 function wpinv_prices_show_tax_on_checkout() {
392 392
     return false; // TODO
393
-    $ret = ( wpinv_get_option( 'checkout_include_tax', false ) == 'yes' && wpinv_use_taxes() );
393
+    $ret = (wpinv_get_option('checkout_include_tax', false) == 'yes' && wpinv_use_taxes());
394 394
 
395
-    return apply_filters( 'wpinv_taxes_on_prices_on_checkout', $ret );
395
+    return apply_filters('wpinv_taxes_on_prices_on_checkout', $ret);
396 396
 }
397 397
 
398 398
 function wpinv_display_tax_rate() {
399
-    $ret = wpinv_use_taxes() && wpinv_get_option( 'display_tax_rate', false );
399
+    $ret = wpinv_use_taxes() && wpinv_get_option('display_tax_rate', false);
400 400
 
401
-    return apply_filters( 'wpinv_display_tax_rate', $ret );
401
+    return apply_filters('wpinv_display_tax_rate', $ret);
402 402
 }
403 403
 
404 404
 function wpinv_cart_needs_tax_address_fields() {
405
-    if( !wpinv_is_cart_taxed() )
405
+    if (!wpinv_is_cart_taxed())
406 406
         return false;
407 407
 
408
-    return ! did_action( 'wpinv_after_cc_fields', 'wpinv_default_cc_address_fields' );
408
+    return !did_action('wpinv_after_cc_fields', 'wpinv_default_cc_address_fields');
409 409
 }
410 410
 
411
-function wpinv_item_is_tax_exclusive( $item_id = 0 ) {
412
-    $ret = (bool)get_post_meta( $item_id, '_wpinv_tax_exclusive', false );
413
-    return apply_filters( 'wpinv_is_tax_exclusive', $ret, $item_id );
411
+function wpinv_item_is_tax_exclusive($item_id = 0) {
412
+    $ret = (bool) get_post_meta($item_id, '_wpinv_tax_exclusive', false);
413
+    return apply_filters('wpinv_is_tax_exclusive', $ret, $item_id);
414 414
 }
415 415
 
416
-function wpinv_currency_decimal_filter( $decimals = 2 ) {
416
+function wpinv_currency_decimal_filter($decimals = 2) {
417 417
     $currency = wpinv_get_currency();
418 418
 
419
-    switch ( $currency ) {
419
+    switch ($currency) {
420 420
         case 'RIAL' :
421 421
         case 'JPY' :
422 422
         case 'TWD' :
@@ -425,13 +425,13 @@  discard block
 block discarded – undo
425 425
             break;
426 426
     }
427 427
 
428
-    return apply_filters( 'wpinv_currency_decimal_count', $decimals, $currency );
428
+    return apply_filters('wpinv_currency_decimal_count', $decimals, $currency);
429 429
 }
430 430
 
431 431
 function wpinv_tax_amount() {
432 432
     $output = 0.00;
433 433
     
434
-    return apply_filters( 'wpinv_tax_amount', $output );
434
+    return apply_filters('wpinv_tax_amount', $output);
435 435
 }
436 436
 
437 437
 /**
@@ -439,25 +439,25 @@  discard block
 block discarded – undo
439 439
  * 
440 440
  * @param string|bool|null $vat_rule
441 441
  */
442
-function getpaid_filter_vat_rule( $vat_rule ) {
442
+function getpaid_filter_vat_rule($vat_rule) {
443 443
 
444
-    if ( empty( $vat_rule ) ) {        
444
+    if (empty($vat_rule)) {        
445 445
         return 'digital';
446 446
     }
447 447
 
448 448
     return $vat_rule;
449 449
 }
450
-add_filter( 'wpinv_get_item_vat_rule', 'getpaid_filter_vat_rule' );
450
+add_filter('wpinv_get_item_vat_rule', 'getpaid_filter_vat_rule');
451 451
 
452 452
 /**
453 453
  * Filters the VAT class to ensure that each item has a VAT class.
454 454
  * 
455 455
  * @param string|bool|null $vat_rule
456 456
  */
457
-function getpaid_filter_vat_class( $vat_class ) {
458
-    return empty( $vat_class ) ? '_standard' : $vat_class;
457
+function getpaid_filter_vat_class($vat_class) {
458
+    return empty($vat_class) ? '_standard' : $vat_class;
459 459
 }
460
-add_filter( 'wpinv_get_item_vat_class', 'getpaid_filter_vat_class' );
460
+add_filter('wpinv_get_item_vat_class', 'getpaid_filter_vat_class');
461 461
 
462 462
 /**
463 463
  * Returns a list of all tax classes.
@@ -469,9 +469,9 @@  discard block
 block discarded – undo
469 469
     return apply_filters(
470 470
         'getpaid_tax_classes',
471 471
         array(
472
-            '_standard' => __( 'Standard Tax Rate', 'invoicing' ),
473
-            '_reduced'  => __( 'Reduced Tax Rate', 'invoicing' ),
474
-            '_exempt'   => __( 'Tax Exempt', 'invoicing' ),
472
+            '_standard' => __('Standard Tax Rate', 'invoicing'),
473
+            '_reduced'  => __('Reduced Tax Rate', 'invoicing'),
474
+            '_exempt'   => __('Tax Exempt', 'invoicing'),
475 475
         )
476 476
     );
477 477
 
@@ -487,8 +487,8 @@  discard block
 block discarded – undo
487 487
     return apply_filters(
488 488
         'getpaid_tax_rules',
489 489
         array(
490
-            'physical' => __( 'Physical Item', 'invoicing' ),
491
-            'digital'  => __( 'Digital Item', 'invoicing' ),
490
+            'physical' => __('Physical Item', 'invoicing'),
491
+            'digital'  => __('Digital Item', 'invoicing'),
492 492
         )
493 493
     );
494 494
 
@@ -500,15 +500,15 @@  discard block
 block discarded – undo
500 500
  * @param string $tax_class
501 501
  * @return string
502 502
  */
503
-function getpaid_get_tax_class_label( $tax_class ) {
503
+function getpaid_get_tax_class_label($tax_class) {
504 504
 
505 505
     $classes = getpaid_get_tax_classes();
506 506
 
507
-    if ( isset( $classes[ $tax_class ] ) ) {
508
-        return sanitize_text_field( $classes[ $tax_class ] );
507
+    if (isset($classes[$tax_class])) {
508
+        return sanitize_text_field($classes[$tax_class]);
509 509
     }
510 510
 
511
-    return sanitize_text_field( $tax_class );
511
+    return sanitize_text_field($tax_class);
512 512
 
513 513
 }
514 514
 
@@ -518,15 +518,15 @@  discard block
 block discarded – undo
518 518
  * @param string $tax_rule
519 519
  * @return string
520 520
  */
521
-function getpaid_get_tax_rule_label( $tax_rule ) {
521
+function getpaid_get_tax_rule_label($tax_rule) {
522 522
 
523 523
     $rules = getpaid_get_tax_rules();
524 524
 
525
-    if ( isset( $rules[ $tax_rule ] ) ) {
526
-        return sanitize_text_field( $rules[ $tax_rule ] );
525
+    if (isset($rules[$tax_rule])) {
526
+        return sanitize_text_field($rules[$tax_rule]);
527 527
     }
528 528
 
529
-    return sanitize_text_field( $tax_rule );
529
+    return sanitize_text_field($tax_rule);
530 530
 
531 531
 }
532 532
 
@@ -539,21 +539,21 @@  discard block
 block discarded – undo
539 539
  * @param string $recurring
540 540
  * @return string
541 541
  */
542
-function getpaid_get_taxable_amount( $item_id, $item_total, $discount_code, $recurring = false ) {
542
+function getpaid_get_taxable_amount($item_id, $item_total, $discount_code, $recurring = false) {
543 543
 
544 544
     $taxable_amount = $item_total;
545 545
 
546 546
     // Do we have a $discount_code?
547
-    if ( ! empty( $discount_code ) ) {
547
+    if (!empty($discount_code)) {
548 548
 
549
-        $discount = new WPInv_Discount( $discount_code );
549
+        $discount = new WPInv_Discount($discount_code);
550 550
 
551
-        if ( $discount->exists() && $discount->is_valid_for_items( $item_id ) && ( ! $recurring || $discount->is_recurring() ) ) {
552
-            $taxable_amount = $item_total - $discount->get_discounted_amount( $item_total );
551
+        if ($discount->exists() && $discount->is_valid_for_items($item_id) && (!$recurring || $discount->is_recurring())) {
552
+            $taxable_amount = $item_total - $discount->get_discounted_amount($item_total);
553 553
         }
554 554
 
555 555
     }
556 556
 
557
-    $taxable_amount = max( 0, $taxable_amount );
558
-    return apply_filters( 'getpaid_taxable_amount', $taxable_amount, $item_id, $item_total, $discount_code, $recurring );
557
+    $taxable_amount = max(0, $taxable_amount);
558
+    return apply_filters('getpaid_taxable_amount', $taxable_amount, $item_id, $item_total, $discount_code, $recurring);
559 559
 }
Please login to merge, or discard this patch.
includes/data/admin-settings.php 1 patch
Spacing   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -8,197 +8,197 @@  discard block
 block discarded – undo
8 8
  * @version 1.0.19
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13
-$pages = wpinv_get_pages( true );
13
+$pages = wpinv_get_pages(true);
14 14
     
15 15
 $currencies = wpinv_get_currencies();
16 16
     
17 17
 $currency_code_options = array();
18
-foreach ( $currencies as $code => $name ) {
19
-    $currency_code_options[ $code ] = $code . ' - ' . $name . ' (' . wpinv_currency_symbol( $code ) . ')';
18
+foreach ($currencies as $code => $name) {
19
+    $currency_code_options[$code] = $code . ' - ' . $name . ' (' . wpinv_currency_symbol($code) . ')';
20 20
 }
21 21
     
22 22
 $due_payment_options       = array();
23
-$due_payment_options[0]    = __( 'Now', 'invoicing' );
24
-for ( $i = 1; $i <= 30; $i++ ) {
23
+$due_payment_options[0]    = __('Now', 'invoicing');
24
+for ($i = 1; $i <= 30; $i++) {
25 25
     $due_payment_options[$i] = $i;
26 26
 }
27 27
     
28 28
 $invoice_number_padd_options = array();
29
-for ( $i = 0; $i <= 20; $i++ ) {
29
+for ($i = 0; $i <= 20; $i++) {
30 30
     $invoice_number_padd_options[$i] = $i;
31 31
 }
32 32
     
33 33
 $currency_symbol = wpinv_currency_symbol();
34 34
     
35 35
 $last_number = $reset_number = '';
36
-if ( $last_invoice_number = get_option( 'wpinv_last_invoice_number' ) ) {
37
-    $last_invoice_number = preg_replace( '/[^0-9]/', '', $last_invoice_number );
36
+if ($last_invoice_number = get_option('wpinv_last_invoice_number')) {
37
+    $last_invoice_number = preg_replace('/[^0-9]/', '', $last_invoice_number);
38 38
 
39
-    if ( !empty( $last_invoice_number ) ) {
40
-        $last_number = ' ' . wp_sprintf( __( "( Last Invoice's sequential number: <b>%s</b> )", 'invoicing' ), $last_invoice_number );
39
+    if (!empty($last_invoice_number)) {
40
+        $last_number = ' ' . wp_sprintf(__("( Last Invoice's sequential number: <b>%s</b> )", 'invoicing'), $last_invoice_number);
41 41
     }
42 42
 
43 43
     $nonce = wp_create_nonce('reset_invoice_count');
44
-    $reset_number = '<a href="'.add_query_arg(array('reset_invoice_count' => 1, '_nonce' => $nonce)).'" class="btn button">'.__('Force Reset Sequence', 'invoicing' ). '</a>';
44
+    $reset_number = '<a href="' . add_query_arg(array('reset_invoice_count' => 1, '_nonce' => $nonce)) . '" class="btn button">' . __('Force Reset Sequence', 'invoicing') . '</a>';
45 45
 }
46 46
     
47 47
 $alert_wrapper_start = '<p style="color: #F00">';
48 48
 $alert_wrapper_close = '</p>';
49 49
 
50 50
 return array(
51
-    'general' => apply_filters( 'wpinv_settings_general',
51
+    'general' => apply_filters('wpinv_settings_general',
52 52
         array(
53 53
             'main' => array(
54 54
                 'location_settings' => array(
55 55
                     'id'   => 'location_settings',
56
-                    'name' => '<h3>' . __( 'Default Location', 'invoicing' ) . '</h3>',
56
+                    'name' => '<h3>' . __('Default Location', 'invoicing') . '</h3>',
57 57
                     'desc' => '',
58 58
                     'type' => 'header',
59 59
                 ),
60 60
                 'default_country' => array(
61 61
                     'id'      => 'default_country',
62
-                    'name'    => __( 'Default Country', 'invoicing' ),
63
-                    'desc'    => __( 'Where does your store operate from?', 'invoicing' ),
62
+                    'name'    => __('Default Country', 'invoicing'),
63
+                    'desc'    => __('Where does your store operate from?', 'invoicing'),
64 64
                     'type'    => 'select',
65 65
                     'options' => wpinv_get_country_list(),
66 66
                     'std'     => 'GB',
67 67
                     'class'   => 'wpi_select2',
68
-                    'placeholder' => __( 'Select a country', 'invoicing' ),
68
+                    'placeholder' => __('Select a country', 'invoicing'),
69 69
                 ),
70 70
                 'default_state' => array(
71 71
                     'id'      => 'default_state',
72
-                    'name'    => __( 'Default State / Province', 'invoicing' ),
73
-                    'desc'    => __( 'What state / province does your store operate from?', 'invoicing' ),
72
+                    'name'    => __('Default State / Province', 'invoicing'),
73
+                    'desc'    => __('What state / province does your store operate from?', 'invoicing'),
74 74
                     'type'    => 'country_states',
75 75
                     'class'   => 'wpi_select2',
76
-                    'placeholder' => __( 'Select a state', 'invoicing' ),
76
+                    'placeholder' => __('Select a state', 'invoicing'),
77 77
                 ),
78 78
                 'store_name' => array(
79 79
                     'id'   => 'store_name',
80
-                    'name' => __( 'Store Name', 'invoicing' ),
81
-                    'desc' => __( 'Store name to print on invoices.', 'invoicing' ),
80
+                    'name' => __('Store Name', 'invoicing'),
81
+                    'desc' => __('Store name to print on invoices.', 'invoicing'),
82 82
                     'std'     => get_option('blogname'),
83 83
                     'type' => 'text',
84 84
                 ),
85 85
                 'logo' => array(
86 86
                     'id'   => 'logo',
87
-                    'name' => __( 'Logo URL', 'invoicing' ),
88
-                    'desc' => __( 'Store logo to print on invoices.', 'invoicing' ),
87
+                    'name' => __('Logo URL', 'invoicing'),
88
+                    'desc' => __('Store logo to print on invoices.', 'invoicing'),
89 89
                     'type' => 'text',
90 90
                 ),
91 91
                 'store_address' => array(
92 92
                     'id'   => 'store_address',
93
-                    'name' => __( 'Store Address', 'invoicing' ),
94
-                    'desc' => __( 'Enter the store address to display on invoice', 'invoicing' ),
93
+                    'name' => __('Store Address', 'invoicing'),
94
+                    'desc' => __('Enter the store address to display on invoice', 'invoicing'),
95 95
                     'type' => 'textarea',
96 96
                 ),
97 97
                 'page_settings' => array(
98 98
                     'id'   => 'page_settings',
99
-                    'name' => '<h3>' . __( 'Page Settings', 'invoicing' ) . '</h3>',
99
+                    'name' => '<h3>' . __('Page Settings', 'invoicing') . '</h3>',
100 100
                     'desc' => '',
101 101
                     'type' => 'header',
102 102
                 ),
103 103
                 'checkout_page' => array(
104 104
                     'id'          => 'checkout_page',
105
-                    'name'        => __( 'Checkout Page', 'invoicing' ),
106
-                    'desc'        => __( 'This is the checkout page where buyers will complete their payments. The <b>[wpinv_checkout]</b> short code must be on this page.', 'invoicing' ),
105
+                    'name'        => __('Checkout Page', 'invoicing'),
106
+                    'desc'        => __('This is the checkout page where buyers will complete their payments. The <b>[wpinv_checkout]</b> short code must be on this page.', 'invoicing'),
107 107
                     'type'        => 'select',
108 108
                     'options'     => $pages,
109 109
                     'class'       => 'wpi_select2',
110
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
110
+                    'placeholder' => __('Select a page', 'invoicing'),
111 111
                     'help-tip'    => true,
112 112
                 ),
113 113
                 'success_page' => array(
114 114
                     'id'          => 'success_page',
115
-                    'name'        => __( 'Success Page', 'invoicing' ),
116
-                    'desc'        => __( 'This is the page buyers are sent to after completing their payments. The <b>[wpinv_receipt]</b> short code should be on this page.', 'invoicing' ),
115
+                    'name'        => __('Success Page', 'invoicing'),
116
+                    'desc'        => __('This is the page buyers are sent to after completing their payments. The <b>[wpinv_receipt]</b> short code should be on this page.', 'invoicing'),
117 117
                     'type'        => 'select',
118 118
                     'options'     => $pages,
119 119
                     'class'       => 'wpi_select2',
120
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
120
+                    'placeholder' => __('Select a page', 'invoicing'),
121 121
                     'help-tip'    => true,
122 122
                 ),
123 123
                 'failure_page' => array(
124 124
                     'id'          => 'failure_page',
125
-                    'name'        => __( 'Failed Transaction Page', 'invoicing' ),
126
-                    'desc'        => __( 'This is the page buyers are sent to if their transaction is cancelled or fails.', 'invoicing' ),
125
+                    'name'        => __('Failed Transaction Page', 'invoicing'),
126
+                    'desc'        => __('This is the page buyers are sent to if their transaction is cancelled or fails.', 'invoicing'),
127 127
                     'type'        => 'select',
128 128
                     'options'     => $pages,
129 129
                     'class'       => 'wpi_select2',
130
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
130
+                    'placeholder' => __('Select a page', 'invoicing'),
131 131
                     'help-tip'    => true,
132 132
                 ),
133 133
                 'invoice_history_page' => array(
134 134
                     'id'          => 'invoice_history_page',
135
-                    'name'        => __( 'Invoice History Page', 'invoicing' ),
136
-                    'desc'        => __( 'This page shows an invoice history for the current user. The <b>[wpinv_history]</b> short code should be on this page.', 'invoicing' ),
135
+                    'name'        => __('Invoice History Page', 'invoicing'),
136
+                    'desc'        => __('This page shows an invoice history for the current user. The <b>[wpinv_history]</b> short code should be on this page.', 'invoicing'),
137 137
                     'type'        => 'select',
138 138
                     'options'     => $pages,
139 139
                     'class'       => 'wpi_select2',
140
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
140
+                    'placeholder' => __('Select a page', 'invoicing'),
141 141
                     'help-tip'    => true,
142 142
                 ),
143 143
                 'invoice_subscription_page' => array(
144 144
                     'id'          => 'invoice_subscription_page',
145
-                    'name'        => __( 'Invoice Subscriptions Page', 'invoicing' ),
146
-                    'desc'        => __( 'This page shows subscriptions history for the current user. The <b>[wpinv_subscriptions]</b> short code should be on this page.', 'invoicing' ),
145
+                    'name'        => __('Invoice Subscriptions Page', 'invoicing'),
146
+                    'desc'        => __('This page shows subscriptions history for the current user. The <b>[wpinv_subscriptions]</b> short code should be on this page.', 'invoicing'),
147 147
                     'type'        => 'select',
148 148
                     'options'     => $pages,
149 149
                     'class'       => 'wpi_select2',
150
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
150
+                    'placeholder' => __('Select a page', 'invoicing'),
151 151
                     'help-tip'    => true,
152 152
                 ),
153 153
             ),
154 154
             'currency_section' => array(
155 155
                 'currency_settings' => array(
156 156
                     'id'   => 'currency_settings',
157
-                    'name' => '<h3>' . __( 'Currency Settings', 'invoicing' ) . '</h3>',
157
+                    'name' => '<h3>' . __('Currency Settings', 'invoicing') . '</h3>',
158 158
                     'desc' => '',
159 159
                     'type' => 'header',
160 160
                 ),
161 161
                 'currency' => array(
162 162
                     'id'      => 'currency',
163
-                    'name'    => __( 'Currency', 'invoicing' ),
164
-                    'desc'    => __( 'Choose your currency. Note that some payment gateways have currency restrictions.', 'invoicing' ),
163
+                    'name'    => __('Currency', 'invoicing'),
164
+                    'desc'    => __('Choose your currency. Note that some payment gateways have currency restrictions.', 'invoicing'),
165 165
                     'type'    => 'select',
166 166
                     'class'       => 'wpi_select2',
167 167
                     'options' => $currency_code_options,
168 168
                 ),
169 169
                 'currency_position' => array(
170 170
                     'id'      => 'currency_position',
171
-                    'name'    => __( 'Currency Position', 'invoicing' ),
172
-                    'desc'    => __( 'Choose the location of the currency sign.', 'invoicing' ),
171
+                    'name'    => __('Currency Position', 'invoicing'),
172
+                    'desc'    => __('Choose the location of the currency sign.', 'invoicing'),
173 173
                     'type'    => 'select',
174 174
                     'class'   => 'wpi_select2',
175 175
                     'options'  => array(
176
-                        'left'        => __( 'Left', 'invoicing' ) . ' (' . $currency_symbol . wpinv_format_amount( '99.99' ) . ')',
177
-                        'right'       => __( 'Right', 'invoicing' ) . ' ('. wpinv_format_amount( '99.99' ) . $currency_symbol . ')',
178
-                        'left_space'  => __( 'Left with space', 'invoicing' ) . ' (' . $currency_symbol . ' ' . wpinv_format_amount( '99.99' ) . ')',
179
-                        'right_space' => __( 'Right with space', 'invoicing' ) . ' (' . wpinv_format_amount( '99.99' ) . ' ' . $currency_symbol . ')'
176
+                        'left'        => __('Left', 'invoicing') . ' (' . $currency_symbol . wpinv_format_amount('99.99') . ')',
177
+                        'right'       => __('Right', 'invoicing') . ' (' . wpinv_format_amount('99.99') . $currency_symbol . ')',
178
+                        'left_space'  => __('Left with space', 'invoicing') . ' (' . $currency_symbol . ' ' . wpinv_format_amount('99.99') . ')',
179
+                        'right_space' => __('Right with space', 'invoicing') . ' (' . wpinv_format_amount('99.99') . ' ' . $currency_symbol . ')'
180 180
                     )
181 181
                 ),
182 182
                 'thousands_separator' => array(
183 183
                     'id'   => 'thousands_separator',
184
-                    'name' => __( 'Thousands Separator', 'invoicing' ),
185
-                    'desc' => __( 'The symbol (usually , or .) to separate thousands', 'invoicing' ),
184
+                    'name' => __('Thousands Separator', 'invoicing'),
185
+                    'desc' => __('The symbol (usually , or .) to separate thousands', 'invoicing'),
186 186
                     'type' => 'text',
187 187
                     'size' => 'small',
188 188
                     'std'  => ',',
189 189
                 ),
190 190
                 'decimal_separator' => array(
191 191
                     'id'   => 'decimal_separator',
192
-                    'name' => __( 'Decimal Separator', 'invoicing' ),
193
-                    'desc' => __( 'The symbol (usually , or .) to separate decimal points', 'invoicing' ),
192
+                    'name' => __('Decimal Separator', 'invoicing'),
193
+                    'desc' => __('The symbol (usually , or .) to separate decimal points', 'invoicing'),
194 194
                     'type' => 'text',
195 195
                     'size' => 'small',
196 196
                     'std'  => '.',
197 197
                 ),
198 198
                 'decimals' => array(
199 199
                     'id'   => 'decimals',
200
-                    'name' => __( 'Number of Decimals', 'invoicing' ),
201
-                    'desc' => __( 'This sets the number of decimal points shown in displayed prices.', 'invoicing' ),
200
+                    'name' => __('Number of Decimals', 'invoicing'),
201
+                    'desc' => __('This sets the number of decimal points shown in displayed prices.', 'invoicing'),
202 202
                     'type' => 'number',
203 203
                     'size' => 'small',
204 204
                     'std'  => '2',
@@ -210,21 +210,21 @@  discard block
 block discarded – undo
210 210
             'labels' => array(
211 211
                 'labels' => array(
212 212
                     'id'   => 'labels_settings',
213
-                    'name' => '<h3>' . __( 'Invoice Labels', 'invoicing' ) . '</h3>',
213
+                    'name' => '<h3>' . __('Invoice Labels', 'invoicing') . '</h3>',
214 214
                     'desc' => '',
215 215
                     'type' => 'header',
216 216
                 ),
217 217
                 'vat_invoice_notice_label' => array(
218 218
                     'id' => 'vat_invoice_notice_label',
219
-                    'name' => __( 'Invoice Notice Label', 'invoicing' ),
220
-                    'desc' => __( 'Use this to add an invoice notice section (label) to your invoices', 'invoicing' ),
219
+                    'name' => __('Invoice Notice Label', 'invoicing'),
220
+                    'desc' => __('Use this to add an invoice notice section (label) to your invoices', 'invoicing'),
221 221
                     'type' => 'text',
222 222
                     'size' => 'regular',
223 223
                 ),
224 224
                 'vat_invoice_notice' => array(
225 225
                     'id' => 'vat_invoice_notice',
226
-                    'name' => __( 'Invoice notice', 'invoicing' ),
227
-                    'desc' =>   __( 'Use this to add an invoice notice section (description) to your invoices', 'invoicing' ),
226
+                    'name' => __('Invoice notice', 'invoicing'),
227
+                    'desc' =>   __('Use this to add an invoice notice section (description) to your invoices', 'invoicing'),
228 228
                     'type' => 'text',
229 229
                     'size' => 'regular',
230 230
                 ),
@@ -236,22 +236,22 @@  discard block
 block discarded – undo
236 236
             'main' => array(
237 237
                 'gateway_settings' => array(
238 238
                     'id'   => 'api_header',
239
-                    'name' => '<h3>' . __( 'Gateway Settings', 'invoicing' ) . '</h3>',
239
+                    'name' => '<h3>' . __('Gateway Settings', 'invoicing') . '</h3>',
240 240
                     'desc' => '',
241 241
                     'type' => 'header',
242 242
                 ),
243 243
                 'gateways' => array(
244 244
                     'id'      => 'gateways',
245
-                    'name'    => __( 'Payment Gateways', 'invoicing' ),
246
-                    'desc'    => __( 'Choose the payment gateways you want to enable.', 'invoicing' ),
245
+                    'name'    => __('Payment Gateways', 'invoicing'),
246
+                    'desc'    => __('Choose the payment gateways you want to enable.', 'invoicing'),
247 247
                     'type'    => 'gateways',
248
-                    'std'     => array( 'manual'=>1 ),
248
+                    'std'     => array('manual'=>1),
249 249
                     'options' => wpinv_get_payment_gateways(),
250 250
                 ),
251 251
                 'default_gateway' => array(
252 252
                     'id'      => 'default_gateway',
253
-                    'name'    => __( 'Default Gateway', 'invoicing' ),
254
-                    'desc'    => __( 'This gateway will be loaded automatically with the checkout page.', 'invoicing' ),
253
+                    'name'    => __('Default Gateway', 'invoicing'),
254
+                    'desc'    => __('This gateway will be loaded automatically with the checkout page.', 'invoicing'),
255 255
                     'type'    => 'gateway_select',
256 256
                     'std'     => 'manual',
257 257
                     'class'   => 'wpi_select2',
@@ -266,32 +266,32 @@  discard block
 block discarded – undo
266 266
             'main' => array(
267 267
                 'tax_settings' => array(
268 268
                     'id'   => 'tax_settings',
269
-                    'name' => '<h3>' . __( 'Tax Settings', 'invoicing' ) . '</h3>',
269
+                    'name' => '<h3>' . __('Tax Settings', 'invoicing') . '</h3>',
270 270
                     'type' => 'header',
271 271
                 ),
272 272
 
273 273
                 'enable_taxes' => array(
274 274
                     'id'       => 'enable_taxes',
275
-                    'name'     => __( 'Enable Taxes', 'invoicing' ),
276
-                    'desc'     => __( 'Enable tax rates and calculations.', 'invoicing' ),
275
+                    'name'     => __('Enable Taxes', 'invoicing'),
276
+                    'desc'     => __('Enable tax rates and calculations.', 'invoicing'),
277 277
                     'type'     => 'checkbox',
278 278
                     'std'      => 0,
279 279
                 ),
280 280
 
281 281
                 'tax_subtotal_rounding' => array(
282 282
                     'id'                => 'tax_subtotal_rounding',
283
-                    'name'              => __( 'Rounding', 'invoicing' ),
284
-                    'desc'              => __( 'Round tax at subtotal level, instead of rounding per tax rate', 'invoicing' ),
283
+                    'name'              => __('Rounding', 'invoicing'),
284
+                    'desc'              => __('Round tax at subtotal level, instead of rounding per tax rate', 'invoicing'),
285 285
                     'type'              => 'checkbox',
286 286
                     'std'               => 1,
287 287
                 ),
288 288
 
289 289
                 'prices_include_tax' => array(
290 290
                     'id'      => 'prices_include_tax',
291
-                    'name'    => __( 'Prices entered with tax', 'invoicing' ),
291
+                    'name'    => __('Prices entered with tax', 'invoicing'),
292 292
                     'options' => array(
293
-                        'yes' => __( 'Yes, I will enter prices inclusive of tax', 'invoicing' ),
294
-                        'no'  => __( 'No, I will enter prices exclusive of tax', 'invoicing' ),
293
+                        'yes' => __('Yes, I will enter prices inclusive of tax', 'invoicing'),
294
+                        'no'  => __('No, I will enter prices exclusive of tax', 'invoicing'),
295 295
                     ),
296 296
                     'type'    => 'select',
297 297
                     'std'     => 'no',
@@ -299,10 +299,10 @@  discard block
 block discarded – undo
299 299
 
300 300
                 'tax_base'              => array(
301 301
                     'id'                => 'tax_base',
302
-                    'name'              => __( 'Calculate tax based on', 'invoicing' ),
302
+                    'name'              => __('Calculate tax based on', 'invoicing'),
303 303
                     'options'           => array(
304
-                        'billing'       => __( 'Customer billing address', 'invoicing' ),
305
-                        'base'          => __( 'Shop base address', 'invoicing' ),
304
+                        'billing'       => __('Customer billing address', 'invoicing'),
305
+                        'base'          => __('Shop base address', 'invoicing'),
306 306
                     ),
307 307
                     'type'              => 'select',
308 308
                     'std'               => 'billing',
@@ -310,10 +310,10 @@  discard block
 block discarded – undo
310 310
 
311 311
                 'tax_display_totals'    => array(
312 312
                     'id'                => 'tax_display_totals',
313
-                    'name'              => __( 'Display tax totals', 'invoicing' ),
313
+                    'name'              => __('Display tax totals', 'invoicing'),
314 314
                     'options'           => array(
315
-                        'single'        => __( 'As a single total', 'invoicing' ),
316
-                        'individual'    => __( 'As individual tax rates', 'invoicing' ),
315
+                        'single'        => __('As a single total', 'invoicing'),
316
+                        'individual'    => __('As individual tax rates', 'invoicing'),
317 317
                     ),
318 318
                     'type'              => 'select',
319 319
                     'std'               => 'individual',
@@ -321,8 +321,8 @@  discard block
 block discarded – undo
321 321
 
322 322
                 'tax_rate' => array(
323 323
                     'id'   => 'tax_rate',
324
-                    'name' => __( 'Fallback Tax Rate', 'invoicing' ),
325
-                    'desc' => __( 'Enter a percentage, such as 6.5. Customers not in a specific rate will be charged this rate.', 'invoicing' ),
324
+                    'name' => __('Fallback Tax Rate', 'invoicing'),
325
+                    'desc' => __('Enter a percentage, such as 6.5. Customers not in a specific rate will be charged this rate.', 'invoicing'),
326 326
                     'type' => 'number',
327 327
                     'size' => 'small',
328 328
                     'min'  => '0',
@@ -334,8 +334,8 @@  discard block
 block discarded – undo
334 334
             'rates' => array(
335 335
                 'tax_rates' => array(
336 336
                     'id'   => 'tax_rates',
337
-                    'name' => '<h3>' . __( 'Tax Rates', 'invoicing' ) . '</h3>',
338
-                    'desc' => __( 'Enter tax rates for specific regions.', 'invoicing' ),
337
+                    'name' => '<h3>' . __('Tax Rates', 'invoicing') . '</h3>',
338
+                    'desc' => __('Enter tax rates for specific regions.', 'invoicing'),
339 339
                     'type' => 'tax_rates',
340 340
                 ),
341 341
             ),
@@ -344,45 +344,45 @@  discard block
 block discarded – undo
344 344
 
345 345
                 'vat_company_name' => array(
346 346
                     'id' => 'vat_company_name',
347
-                    'name' => __( 'Company Name', 'invoicing' ),
348
-                    'desc' => wp_sprintf(__( 'Verify your company name and  VAT number on the %sEU VIES System.%s', 'invoicing' ), '<a href="http://ec.europa.eu/taxation_customs/vies/" target="_blank">', '</a>' ),
347
+                    'name' => __('Company Name', 'invoicing'),
348
+                    'desc' => wp_sprintf(__('Verify your company name and  VAT number on the %sEU VIES System.%s', 'invoicing'), '<a href="http://ec.europa.eu/taxation_customs/vies/" target="_blank">', '</a>'),
349 349
                     'type' => 'text',
350 350
                     'size' => 'regular',
351 351
                 ),
352 352
 
353 353
                 'vat_number' => array(
354 354
                     'id'   => 'vat_number',
355
-                    'name' => __( 'VAT Number', 'invoicing' ),
356
-                    'desc' => __( 'Enter your VAT number including the country identifier, eg: GB123456789', 'invoicing' ),
355
+                    'name' => __('VAT Number', 'invoicing'),
356
+                    'desc' => __('Enter your VAT number including the country identifier, eg: GB123456789', 'invoicing'),
357 357
                     'type' => 'text',
358 358
                     'size' => 'regular',
359 359
                 ),
360 360
 
361 361
                 'vat_prevent_b2c_purchase' => array(
362 362
                     'id' => 'vat_prevent_b2c_purchase',
363
-                    'name' => __( 'Prevent B2C Sales', 'invoicing' ),
364
-                    'desc' => __( 'Require everyone in the EU to provide a VAT number.', 'invoicing' ),
363
+                    'name' => __('Prevent B2C Sales', 'invoicing'),
364
+                    'desc' => __('Require everyone in the EU to provide a VAT number.', 'invoicing'),
365 365
                     'type' => 'checkbox'
366 366
                 ),
367 367
 
368 368
                 'validate_vat_number' => array(
369 369
                     'id'   => 'validate_vat_number',
370
-                    'name' => __( 'Validate VAT Number', 'invoicing' ),
371
-                    'desc' => __( 'Validate VAT numbers with VIES.', 'invoicing' ),
370
+                    'name' => __('Validate VAT Number', 'invoicing'),
371
+                    'desc' => __('Validate VAT numbers with VIES.', 'invoicing'),
372 372
                     'type' => 'checkbox'
373 373
                 ),
374 374
 
375 375
                 'vat_same_country_rule' => array(
376 376
                     'id'          => 'vat_same_country_rule',
377
-                    'name'        => __( 'Same Country Rule', 'invoicing' ),
378
-                    'desc'        => __( 'What should happen if a customer is from the same country as your business?', 'invoicing' ),
377
+                    'name'        => __('Same Country Rule', 'invoicing'),
378
+                    'desc'        => __('What should happen if a customer is from the same country as your business?', 'invoicing'),
379 379
                     'type'        => 'select',
380 380
                     'options'     => array(
381
-                        'no'        => __( 'Do not charge tax', 'invoicing' ),
382
-                        'always'    => __( 'Charge tax unless vat number is validated', 'invoicing' ),
383
-                        'vat_too'   => __( 'Charge tax even if vat number is validated', 'invoicing' )
381
+                        'no'        => __('Do not charge tax', 'invoicing'),
382
+                        'always'    => __('Charge tax unless vat number is validated', 'invoicing'),
383
+                        'vat_too'   => __('Charge tax even if vat number is validated', 'invoicing')
384 384
                     ),
385
-                    'placeholder' => __( 'Select an option', 'invoicing' ),
385
+                    'placeholder' => __('Select an option', 'invoicing'),
386 386
                     'std'         => 'vat_too',
387 387
                 ),
388 388
 
@@ -396,68 +396,68 @@  discard block
 block discarded – undo
396 396
             'main' => array(
397 397
                 'email_settings_header' => array(
398 398
                     'id'   => 'email_settings_header',
399
-                    'name' => '<h3>' . __( 'Email Sender Options', 'invoicing' ) . '</h3>',
399
+                    'name' => '<h3>' . __('Email Sender Options', 'invoicing') . '</h3>',
400 400
                     'type' => 'header',
401 401
                 ),
402 402
                 'email_from_name' => array(
403 403
                     'id'   => 'email_from_name',
404
-                    'name' => __( 'From Name', 'invoicing' ),
405
-                    'desc' => __( 'Enter the sender\'s name appears in outgoing invoice emails. This should be your site name.', 'invoicing' ),
406
-                    'std' => esc_attr( get_bloginfo( 'name', 'display' ) ),
404
+                    'name' => __('From Name', 'invoicing'),
405
+                    'desc' => __('Enter the sender\'s name appears in outgoing invoice emails. This should be your site name.', 'invoicing'),
406
+                    'std' => esc_attr(get_bloginfo('name', 'display')),
407 407
                     'type' => 'text',
408 408
                 ),
409 409
                 'email_from' => array(
410 410
                     'id'   => 'email_from',
411
-                    'name' => __( 'From Email', 'invoicing' ),
412
-                    'desc' => sprintf (__( 'Email address to send invoice emails from. This will act as the "from" and "reply-to" address. %s If emails are not being sent it may be that your hosting prevents emails being sent if the email domains do not match.%s', 'invoicing' ), $alert_wrapper_start, $alert_wrapper_close),
413
-                    'std' => get_option( 'admin_email' ),
411
+                    'name' => __('From Email', 'invoicing'),
412
+                    'desc' => sprintf(__('Email address to send invoice emails from. This will act as the "from" and "reply-to" address. %s If emails are not being sent it may be that your hosting prevents emails being sent if the email domains do not match.%s', 'invoicing'), $alert_wrapper_start, $alert_wrapper_close),
413
+                    'std' => get_option('admin_email'),
414 414
                     'type' => 'text',
415 415
                 ),
416 416
                 'admin_email' => array(
417 417
                     'id'   => 'admin_email',
418
-                    'name' => __( 'Admin Email', 'invoicing' ),
419
-                    'desc' => __( 'Where should we send admin notifications?', 'invoicing' ),
420
-                    'std' => get_option( 'admin_email' ),
418
+                    'name' => __('Admin Email', 'invoicing'),
419
+                    'desc' => __('Where should we send admin notifications?', 'invoicing'),
420
+                    'std' => get_option('admin_email'),
421 421
                     'type' => 'text',
422 422
                 ),
423 423
                 'overdue_settings_header' => array(
424 424
                     'id'   => 'overdue_settings_header',
425
-                    'name' => '<h3>' . __( 'Due Date Settings', 'invoicing' ) . '</h3>',
425
+                    'name' => '<h3>' . __('Due Date Settings', 'invoicing') . '</h3>',
426 426
                     'type' => 'header',
427 427
                 ),
428 428
                 'overdue_active' => array(
429 429
                     'id'   => 'overdue_active',
430
-                    'name' => __( 'Enable Due Date', 'invoicing' ),
431
-                    'desc' => __( 'Check this to enable due date option for invoices.', 'invoicing' ),
430
+                    'name' => __('Enable Due Date', 'invoicing'),
431
+                    'desc' => __('Check this to enable due date option for invoices.', 'invoicing'),
432 432
                     'type' => 'checkbox',
433 433
                     'std'  => false,
434 434
                 ),
435 435
                 'overdue_days' => array(
436 436
                     'id'          => 'overdue_days',
437
-                    'name'        => __( 'Default Due Date', 'invoicing' ),
438
-                    'desc'        => __( 'Number of days each Invoice is due after the created date. This will automatically set the date in the "Due Date" field. Can be overridden on individual Invoices.', 'invoicing' ),
437
+                    'name'        => __('Default Due Date', 'invoicing'),
438
+                    'desc'        => __('Number of days each Invoice is due after the created date. This will automatically set the date in the "Due Date" field. Can be overridden on individual Invoices.', 'invoicing'),
439 439
                     'type'        => 'select',
440 440
                     'options'     => $due_payment_options,
441 441
                     'std'         => 0,
442
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
442
+                    'placeholder' => __('Select a page', 'invoicing'),
443 443
                 ),
444 444
                 'email_template_header' => array(
445 445
                     'id'   => 'email_template_header',
446
-                    'name' => '<h3>' . __( 'Email Template', 'invoicing' ) . '</h3>',
446
+                    'name' => '<h3>' . __('Email Template', 'invoicing') . '</h3>',
447 447
                     'type' => 'header',
448 448
                 ),
449 449
                 'email_header_image' => array(
450 450
                     'id'   => 'email_header_image',
451
-                    'name' => __( 'Header Image', 'invoicing' ),
452
-                    'desc' => __( 'URL to an image you want to show in the email header. Upload images using the media uploader (Admin > Media).', 'invoicing' ),
451
+                    'name' => __('Header Image', 'invoicing'),
452
+                    'desc' => __('URL to an image you want to show in the email header. Upload images using the media uploader (Admin > Media).', 'invoicing'),
453 453
                     'std' => '',
454 454
                     'type' => 'text',
455 455
                 ),
456 456
                 'email_footer_text' => array(
457 457
                     'id'   => 'email_footer_text',
458
-                    'name' => __( 'Footer Text', 'invoicing' ),
459
-                    'desc' => __( 'The text to appear in the footer of all invoice emails.', 'invoicing' ),
460
-                    'std' => get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by GetPaid', 'invoicing' ),
458
+                    'name' => __('Footer Text', 'invoicing'),
459
+                    'desc' => __('The text to appear in the footer of all invoice emails.', 'invoicing'),
460
+                    'std' => get_bloginfo('name', 'display') . ' - ' . __('Powered by GetPaid', 'invoicing'),
461 461
                     'type' => 'textarea',
462 462
                     'class' => 'regular-text',
463 463
                     'rows' => 2,
@@ -465,29 +465,29 @@  discard block
 block discarded – undo
465 465
                 ),
466 466
                 'email_base_color' => array(
467 467
                     'id'   => 'email_base_color',
468
-                    'name' => __( 'Base Color', 'invoicing' ),
469
-                    'desc' => __( 'The base color for invoice email template. Default <code>#557da2</code>.', 'invoicing' ),
468
+                    'name' => __('Base Color', 'invoicing'),
469
+                    'desc' => __('The base color for invoice email template. Default <code>#557da2</code>.', 'invoicing'),
470 470
                     'std' => '#557da2',
471 471
                     'type' => 'color',
472 472
                 ),
473 473
                 'email_background_color' => array(
474 474
                     'id'   => 'email_background_color',
475
-                    'name' => __( 'Background Color', 'invoicing' ),
476
-                    'desc' => __( 'The background color of email template. Default <code>#f5f5f5</code>.', 'invoicing' ),
475
+                    'name' => __('Background Color', 'invoicing'),
476
+                    'desc' => __('The background color of email template. Default <code>#f5f5f5</code>.', 'invoicing'),
477 477
                     'std' => '#f5f5f5',
478 478
                     'type' => 'color',
479 479
                 ),
480 480
                 'email_body_background_color' => array(
481 481
                     'id'   => 'email_body_background_color',
482
-                    'name' => __( 'Body Background Color', 'invoicing' ),
483
-                    'desc' => __( 'The main body background color of email template. Default <code>#fdfdfd</code>.', 'invoicing' ),
482
+                    'name' => __('Body Background Color', 'invoicing'),
483
+                    'desc' => __('The main body background color of email template. Default <code>#fdfdfd</code>.', 'invoicing'),
484 484
                     'std' => '#fdfdfd',
485 485
                     'type' => 'color',
486 486
                 ),
487 487
                 'email_text_color' => array(
488 488
                     'id'   => 'email_text_color',
489
-                    'name' => __( 'Body Text Color', 'invoicing' ),
490
-                    'desc' => __( 'The main body text color. Default <code>#505050</code>.', 'invoicing' ),
489
+                    'name' => __('Body Text Color', 'invoicing'),
490
+                    'desc' => __('The main body text color. Default <code>#505050</code>.', 'invoicing'),
491 491
                     'std' => '#505050',
492 492
                     'type' => 'color',
493 493
                 ),
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
     ),
503 503
 
504 504
     // Integrations.
505
-    'integrations' => wp_list_pluck( getpaid_get_integration_settings(), 'settings', 'id' ),
505
+    'integrations' => wp_list_pluck(getpaid_get_integration_settings(), 'settings', 'id'),
506 506
 
507 507
     /** Privacy Settings */
508 508
     'privacy' => apply_filters('wpinv_settings_privacy',
@@ -510,17 +510,17 @@  discard block
 block discarded – undo
510 510
             'main' => array(
511 511
                 'invoicing_privacy_policy_settings' => array(
512 512
                     'id'   => 'invoicing_privacy_policy_settings',
513
-                    'name' => '<h3>' . __( 'Privacy Policy', 'invoicing' ) . '</h3>',
513
+                    'name' => '<h3>' . __('Privacy Policy', 'invoicing') . '</h3>',
514 514
                     'type' => 'header',
515 515
                 ),
516 516
                 'privacy_page' => array(
517 517
                     'id'          => 'privacy_page',
518
-                    'name'        => __( 'Privacy Page', 'invoicing' ),
519
-                    'desc'        => __( 'If no privacy policy page set in Settings->Privacy default settings, this page will be used on checkout page.', 'invoicing' ),
518
+                    'name'        => __('Privacy Page', 'invoicing'),
519
+                    'desc'        => __('If no privacy policy page set in Settings->Privacy default settings, this page will be used on checkout page.', 'invoicing'),
520 520
                     'type'        => 'select',
521
-                    'options'     => wpinv_get_pages( true,  __( 'Select a page', 'invoicing' )),
521
+                    'options'     => wpinv_get_pages(true, __('Select a page', 'invoicing')),
522 522
                     'class'       => 'wpi_select2',
523
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
523
+                    'placeholder' => __('Select a page', 'invoicing'),
524 524
                 ),
525 525
             ),
526 526
         )
@@ -531,19 +531,19 @@  discard block
 block discarded – undo
531 531
             'main' => array(
532 532
                 'invoice_number_format_settings' => array(
533 533
                     'id'   => 'invoice_number_format_settings',
534
-                    'name' => '<h3>' . __( 'Invoice Number', 'invoicing' ) . '</h3>',
534
+                    'name' => '<h3>' . __('Invoice Number', 'invoicing') . '</h3>',
535 535
                     'type' => 'header',
536 536
                 ),
537 537
                 'sequential_invoice_number' => array(
538 538
                     'id'   => 'sequential_invoice_number',
539
-                    'name' => __( 'Sequential Invoice Numbers', 'invoicing' ),
540
-                    'desc' => __('Check this box to enable sequential invoice numbers.', 'invoicing' ) . $reset_number,
539
+                    'name' => __('Sequential Invoice Numbers', 'invoicing'),
540
+                    'desc' => __('Check this box to enable sequential invoice numbers.', 'invoicing') . $reset_number,
541 541
                     'type' => 'checkbox',
542 542
                 ),
543 543
                 'invoice_sequence_start' => array(
544 544
                     'id'   => 'invoice_sequence_start',
545
-                    'name' => __( 'Sequential Starting Number', 'invoicing' ),
546
-                    'desc' => __( 'The number at which the invoice number sequence should begin.', 'invoicing' ) . $last_number,
545
+                    'name' => __('Sequential Starting Number', 'invoicing'),
546
+                    'desc' => __('The number at which the invoice number sequence should begin.', 'invoicing') . $last_number,
547 547
                     'type' => 'number',
548 548
                     'size' => 'small',
549 549
                     'std'  => '1',
@@ -551,8 +551,8 @@  discard block
 block discarded – undo
551 551
                 ),
552 552
                 'invoice_number_padd' => array(
553 553
                     'id'      => 'invoice_number_padd',
554
-                    'name'    => __( 'Minimum Digits', 'invoicing' ),
555
-                    'desc'    => __( 'If the invoice number has less digits than this number, it is left padded with 0s. Ex: invoice number 108 will padded to 00108 if digits set to 5. The default 0 means no padding.', 'invoicing' ),
554
+                    'name'    => __('Minimum Digits', 'invoicing'),
555
+                    'desc'    => __('If the invoice number has less digits than this number, it is left padded with 0s. Ex: invoice number 108 will padded to 00108 if digits set to 5. The default 0 means no padding.', 'invoicing'),
556 556
                     'type'    => 'select',
557 557
                     'options' => $invoice_number_padd_options,
558 558
                     'std'     => 5,
@@ -560,8 +560,8 @@  discard block
 block discarded – undo
560 560
                 ),
561 561
                 'invoice_number_prefix' => array(
562 562
                     'id' => 'invoice_number_prefix',
563
-                    'name' => __( 'Invoice Number Prefix', 'invoicing' ),
564
-                    'desc' => __( 'Prefix for all invoice numbers. Ex: INV-', 'invoicing' ),
563
+                    'name' => __('Invoice Number Prefix', 'invoicing'),
564
+                    'desc' => __('Prefix for all invoice numbers. Ex: INV-', 'invoicing'),
565 565
                     'type' => 'text',
566 566
                     'size' => 'regular',
567 567
                     'std' => 'INV-',
@@ -569,41 +569,41 @@  discard block
 block discarded – undo
569 569
                 ),
570 570
                 'invoice_number_postfix' => array(
571 571
                     'id' => 'invoice_number_postfix',
572
-                    'name' => __( 'Invoice Number Postfix', 'invoicing' ),
573
-                    'desc' => __( 'Postfix for all invoice numbers.', 'invoicing' ),
572
+                    'name' => __('Invoice Number Postfix', 'invoicing'),
573
+                    'desc' => __('Postfix for all invoice numbers.', 'invoicing'),
574 574
                     'type' => 'text',
575 575
                     'size' => 'regular',
576 576
                     'std' => ''
577 577
                 ),
578 578
                 'checkout_settings' => array(
579 579
                     'id'   => 'checkout_settings',
580
-                    'name' => '<h3>' . __( 'Checkout Settings', 'invoicing' ) . '</h3>',
580
+                    'name' => '<h3>' . __('Checkout Settings', 'invoicing') . '</h3>',
581 581
                     'type' => 'header',
582 582
                 ),
583 583
                 'login_to_checkout' => array(
584 584
                     'id'   => 'login_to_checkout',
585
-                    'name' => __( 'Require Login To Checkout', 'invoicing' ),
586
-                    'desc' => __( 'If ticked then user needs to be logged in to view or pay invoice, can only view or pay their own invoice. If unticked then anyone can view or pay the invoice.', 'invoicing' ),
585
+                    'name' => __('Require Login To Checkout', 'invoicing'),
586
+                    'desc' => __('If ticked then user needs to be logged in to view or pay invoice, can only view or pay their own invoice. If unticked then anyone can view or pay the invoice.', 'invoicing'),
587 587
                     'type' => 'checkbox',
588 588
                 ),
589 589
 
590 590
                 'maxmind_license_key' => array(
591 591
                     'id'   => 'maxmind_license_key',
592
-                    'name' => __( 'MaxMind License Key', 'invoicing' ),
592
+                    'name' => __('MaxMind License Key', 'invoicing'),
593 593
                     'type' => 'text',
594 594
                     'size' => 'regular',
595
-                    'desc' => __( "Enter you license key if you would like to use MaxMind to automatically detect a customer's country.", 'invoicing' ) . ' <a href="https://support.maxmind.com/account-faq/license-keys/how-do-i-generate-a-license-key/">' . __( 'How to generate a free license key.', 'invoicing' ) . '</a>',
595
+                    'desc' => __("Enter you license key if you would like to use MaxMind to automatically detect a customer's country.", 'invoicing') . ' <a href="https://support.maxmind.com/account-faq/license-keys/how-do-i-generate-a-license-key/">' . __('How to generate a free license key.', 'invoicing') . '</a>',
596 596
                 ),
597 597
 
598 598
                 'uninstall_settings' => array(
599 599
                     'id'   => 'uninstall_settings',
600
-                    'name' => '<h3>' . __( 'Uninstall Settings', 'invoicing' ) . '</h3>',
600
+                    'name' => '<h3>' . __('Uninstall Settings', 'invoicing') . '</h3>',
601 601
                     'type' => 'header',
602 602
                 ),
603 603
                 'remove_data_on_unistall' => array(
604 604
                     'id'   => 'remove_data_on_unistall',
605
-                    'name' => __( 'Remove Data on Uninstall?', 'invoicing' ),
606
-                    'desc' => __( 'Check this box if you would like Invoicing plugin to completely remove all of its data when the plugin is deleted/uninstalled.', 'invoicing' ),
605
+                    'name' => __('Remove Data on Uninstall?', 'invoicing'),
606
+                    'desc' => __('Check this box if you would like Invoicing plugin to completely remove all of its data when the plugin is deleted/uninstalled.', 'invoicing'),
607 607
                     'type' => 'checkbox',
608 608
                     'std'  => ''
609 609
                 ),
@@ -612,13 +612,13 @@  discard block
 block discarded – undo
612 612
             'custom-css' => array(
613 613
                 'css_settings' => array(
614 614
                     'id'   => 'css_settings',
615
-                    'name' => '<h3>' . __( 'Custom CSS', 'invoicing' ) . '</h3>',
615
+                    'name' => '<h3>' . __('Custom CSS', 'invoicing') . '</h3>',
616 616
                     'type' => 'header',
617 617
                 ),
618 618
                 'template_custom_css' => array(
619 619
                     'id' => 'template_custom_css',
620
-                    'name' => __( 'Invoice Template CSS', 'invoicing' ),
621
-                    'desc' => __( 'Add CSS to modify appearance of the print invoice page.', 'invoicing' ),
620
+                    'name' => __('Invoice Template CSS', 'invoicing'),
621
+                    'desc' => __('Add CSS to modify appearance of the print invoice page.', 'invoicing'),
622 622
                     'type' => 'textarea',
623 623
                     'class'=> 'regular-text',
624 624
                     'rows' => 10,
@@ -632,8 +632,8 @@  discard block
 block discarded – undo
632 632
             'main' => array(
633 633
                 'tool_settings' => array(
634 634
                     'id'   => 'tool_settings',
635
-                    'name' => '<h3>' . __( 'Diagnostic Tools', 'invoicing' ) . '</h3>',
636
-                    'desc' => __( 'Invoicing diagnostic tools', 'invoicing' ),
635
+                    'name' => '<h3>' . __('Diagnostic Tools', 'invoicing') . '</h3>',
636
+                    'desc' => __('Invoicing diagnostic tools', 'invoicing'),
637 637
                     'type' => 'tools',
638 638
                 ),
639 639
             ),
Please login to merge, or discard this patch.