Passed
Push — master ( 651b7e...bf7bd5 )
by Brian
06:27
created
includes/admin/register-settings.php 1 patch
Spacing   +390 added lines, -390 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @since   1.0.0
7 7
  */
8 8
 
9
-defined( 'ABSPATH' ) || exit;
9
+defined('ABSPATH') || exit;
10 10
 
11 11
 /**
12 12
  * Retrieves all default settings.
@@ -16,13 +16,13 @@  discard block
 block discarded – undo
16 16
 function wpinv_get_settings() {
17 17
     $defaults = array();
18 18
 
19
-    foreach ( array_values( wpinv_get_registered_settings() ) as $tab_settings ) {
19
+    foreach (array_values(wpinv_get_registered_settings()) as $tab_settings) {
20 20
 
21
-        foreach ( array_values( $tab_settings ) as $section_settings ) {
21
+        foreach (array_values($tab_settings) as $section_settings) {
22 22
 
23
-            foreach ( $section_settings as $key => $setting ) {
24
-                if ( isset( $setting['std'] ) ) {
25
-                    $defaults[ $key ] = $setting['std'];
23
+            foreach ($section_settings as $key => $setting) {
24
+                if (isset($setting['std'])) {
25
+                    $defaults[$key] = $setting['std'];
26 26
                 }
27 27
             }
28 28
 
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
     global $wpinv_options;
44 44
 
45 45
     // Try fetching the saved options.
46
-    if ( ! is_array( $wpinv_options ) ) {
47
-        $wpinv_options = get_option( 'wpinv_settings' );
46
+    if (!is_array($wpinv_options)) {
47
+        $wpinv_options = get_option('wpinv_settings');
48 48
     }
49 49
 
50 50
     // If that fails, don't fetch the default settings to prevent a loop.
51
-    if ( ! is_array( $wpinv_options ) ) {
51
+    if (!is_array($wpinv_options)) {
52 52
         $wpinv_options = array();
53 53
     }
54 54
 
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
  * @param mixed $default The default value to use if the setting has not been set.
63 63
  * @return array
64 64
  */
65
-function wpinv_get_option( $key = '', $default = false ) {
65
+function wpinv_get_option($key = '', $default = false) {
66 66
 
67 67
     $options = wpinv_get_options();
68
-    $value   = isset( $options[ $key ] ) ? $options[ $key ] : $default;
69
-    $value   = apply_filters( 'wpinv_get_option', $value, $key, $default );
68
+    $value   = isset($options[$key]) ? $options[$key] : $default;
69
+    $value   = apply_filters('wpinv_get_option', $value, $key, $default);
70 70
 
71
-    return apply_filters( 'wpinv_get_option_' . $key, $value, $key, $default );
71
+    return apply_filters('wpinv_get_option_' . $key, $value, $key, $default);
72 72
 }
73 73
 
74 74
 /**
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
  * @param array $options the new options.
78 78
  * @return bool
79 79
  */
80
-function wpinv_update_options( $options ) {
80
+function wpinv_update_options($options) {
81 81
     global $wpinv_options;
82 82
 
83 83
     // update the option.
84
-    if ( is_array( $options ) && update_option( 'wpinv_settings', $options ) ) {
84
+    if (is_array($options) && update_option('wpinv_settings', $options)) {
85 85
         $wpinv_options = $options;
86 86
         return true;
87 87
     }
@@ -96,24 +96,24 @@  discard block
 block discarded – undo
96 96
  * @param mixed $value The setting value.
97 97
  * @return bool
98 98
  */
99
-function wpinv_update_option( $key = '', $value = false ) {
99
+function wpinv_update_option($key = '', $value = false) {
100 100
 
101 101
     // If no key, exit.
102
-    if ( empty( $key ) ) {
102
+    if (empty($key)) {
103 103
         return false;
104 104
     }
105 105
 
106 106
     // Maybe delete the option instead.
107
-    if ( is_null( $value ) ) {
108
-        return wpinv_delete_option( $key );
107
+    if (is_null($value)) {
108
+        return wpinv_delete_option($key);
109 109
     }
110 110
 
111 111
     // Prepare the new options.
112 112
     $options         = wpinv_get_options();
113
-    $options[ $key ] = apply_filters( 'wpinv_update_option', $value, $key );
113
+    $options[$key] = apply_filters('wpinv_update_option', $value, $key);
114 114
 
115 115
     // Save the new options.
116
-    return wpinv_update_options( $options );
116
+    return wpinv_update_options($options);
117 117
 
118 118
 }
119 119
 
@@ -123,18 +123,18 @@  discard block
 block discarded – undo
123 123
  * @param string $key the setting key.
124 124
  * @return bool
125 125
  */
126
-function wpinv_delete_option( $key = '' ) {
126
+function wpinv_delete_option($key = '') {
127 127
 
128 128
     // If no key, exit
129
-    if ( empty( $key ) ) {
129
+    if (empty($key)) {
130 130
         return false;
131 131
     }
132 132
 
133 133
     $options = wpinv_get_options();
134 134
 
135
-    if ( isset( $options[ $key ] ) ) {
136
-        unset( $options[ $key ] );
137
-        return wpinv_update_options( $options );
135
+    if (isset($options[$key])) {
136
+        unset($options[$key]);
137
+        return wpinv_update_options($options);
138 138
     }
139 139
 
140 140
     return true;
@@ -148,14 +148,14 @@  discard block
 block discarded – undo
148 148
 function wpinv_register_settings() {
149 149
 
150 150
     // Loop through all tabs.
151
-    foreach ( wpinv_get_registered_settings() as $tab => $sections ) {
151
+    foreach (wpinv_get_registered_settings() as $tab => $sections) {
152 152
 
153 153
         // In each tab, loop through sections.
154
-        foreach ( $sections as $section => $settings ) {
154
+        foreach ($sections as $section => $settings) {
155 155
 
156 156
             // Check for backwards compatibility
157
-            $section_tabs = wpinv_get_settings_tab_sections( $tab );
158
-            if ( ! is_array( $section_tabs ) || ! array_key_exists( $section, $section_tabs ) ) {
157
+            $section_tabs = wpinv_get_settings_tab_sections($tab);
158
+            if (!is_array($section_tabs) || !array_key_exists($section, $section_tabs)) {
159 159
                 $section = 'main';
160 160
                 $settings = $sections;
161 161
             }
@@ -168,9 +168,9 @@  discard block
 block discarded – undo
168 168
                 'wpinv_settings_' . $tab . '_' . $section
169 169
             );
170 170
 
171
-            foreach ( $settings as $option ) {
172
-                if ( ! empty( $option['id'] ) ) {
173
-                    wpinv_register_settings_option( $tab, $section, $option );
171
+            foreach ($settings as $option) {
172
+                if (!empty($option['id'])) {
173
+                    wpinv_register_settings_option($tab, $section, $option);
174 174
                 }
175 175
             }
176 176
 
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
     }
179 179
 
180 180
     // Creates our settings in the options table.
181
-    register_setting( 'wpinv_settings', 'wpinv_settings', 'wpinv_settings_sanitize' );
181
+    register_setting('wpinv_settings', 'wpinv_settings', 'wpinv_settings_sanitize');
182 182
 }
183
-add_action( 'admin_init', 'wpinv_register_settings' );
183
+add_action('admin_init', 'wpinv_register_settings');
184 184
 
185 185
 /**
186 186
  * Register a single settings option.
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
  * @param string $option
191 191
  * 
192 192
  */
193
-function wpinv_register_settings_option( $tab, $section, $option ) {
193
+function wpinv_register_settings_option($tab, $section, $option) {
194 194
 
195
-    $name    = isset( $option['name'] ) ? $option['name'] : '';
195
+    $name    = isset($option['name']) ? $option['name'] : '';
196 196
     $cb      = "wpinv_{$option['type']}_callback";
197 197
     $section = "wpinv_settings_{$tab}_$section";
198 198
 
@@ -200,30 +200,30 @@  discard block
 block discarded – undo
200 200
     add_settings_field(
201 201
         'wpinv_settings[' . $option['id'] . ']',
202 202
         $name,
203
-        function_exists( $cb ) ? $cb : 'wpinv_missing_callback',
203
+        function_exists($cb) ? $cb : 'wpinv_missing_callback',
204 204
         $section,
205 205
         $section,
206 206
         array(
207 207
             'section'     => $section,
208
-            'id'          => isset( $option['id'] )          ? $option['id']          : null,
209
-            'desc'        => isset( $option['desc'] )        ? $option['desc']        : '',
210
-            'name'        => isset( $option['name'] )        ? $option['name']        : null,
211
-            'size'        => isset( $option['size'] )        ? $option['size']        : null,
212
-            'options'     => isset( $option['options'] )     ? $option['options']     : '',
213
-            'selected'    => isset( $option['selected'] )    ? $option['selected']    : null,
214
-            'std'         => isset( $option['std'] )         ? $option['std']         : '',
215
-            'min'         => isset( $option['min'] )         ? $option['min']         : null,
216
-            'max'         => isset( $option['max'] )         ? $option['max']         : null,
217
-            'step'        => isset( $option['step'] )        ? $option['step']        : null,
218
-            'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : null,
219
-            'allow_blank' => isset( $option['allow_blank'] ) ? $option['allow_blank'] : true,
220
-            'readonly'    => isset( $option['readonly'] )    ? $option['readonly']    : false,
221
-            'faux'        => isset( $option['faux'] )        ? $option['faux']        : false,
222
-            'onchange'    => isset( $option['onchange'] )   ? $option['onchange']     : '',
223
-            'custom'      => isset( $option['custom'] )     ? $option['custom']       : '',
224
-            'class'       => isset( $option['class'] )     ? $option['class']         : '',
225
-            'cols'        => isset( $option['cols'] ) && (int) $option['cols'] > 0 ? (int) $option['cols'] : 50,
226
-            'rows'        => isset( $option['rows'] ) && (int) $option['rows'] > 0 ? (int) $option['rows'] : 5,
208
+            'id'          => isset($option['id']) ? $option['id'] : null,
209
+            'desc'        => isset($option['desc']) ? $option['desc'] : '',
210
+            'name'        => isset($option['name']) ? $option['name'] : null,
211
+            'size'        => isset($option['size']) ? $option['size'] : null,
212
+            'options'     => isset($option['options']) ? $option['options'] : '',
213
+            'selected'    => isset($option['selected']) ? $option['selected'] : null,
214
+            'std'         => isset($option['std']) ? $option['std'] : '',
215
+            'min'         => isset($option['min']) ? $option['min'] : null,
216
+            'max'         => isset($option['max']) ? $option['max'] : null,
217
+            'step'        => isset($option['step']) ? $option['step'] : null,
218
+            'placeholder' => isset($option['placeholder']) ? $option['placeholder'] : null,
219
+            'allow_blank' => isset($option['allow_blank']) ? $option['allow_blank'] : true,
220
+            'readonly'    => isset($option['readonly']) ? $option['readonly'] : false,
221
+            'faux'        => isset($option['faux']) ? $option['faux'] : false,
222
+            'onchange'    => isset($option['onchange']) ? $option['onchange'] : '',
223
+            'custom'      => isset($option['custom']) ? $option['custom'] : '',
224
+            'class'       => isset($option['class']) ? $option['class'] : '',
225
+            'cols'        => isset($option['cols']) && (int) $option['cols'] > 0 ? (int) $option['cols'] : 50,
226
+            'rows'        => isset($option['rows']) && (int) $option['rows'] > 0 ? (int) $option['rows'] : 5,
227 227
         )
228 228
     );
229 229
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
  * @return array
236 236
  */
237 237
 function wpinv_get_registered_settings() {
238
-    return apply_filters( 'wpinv_registered_settings', wpinv_get_data( 'admin-settings' ) );
238
+    return apply_filters('wpinv_registered_settings', wpinv_get_data('admin-settings'));
239 239
 }
240 240
 
241 241
 /**
@@ -243,134 +243,134 @@  discard block
 block discarded – undo
243 243
  * 
244 244
  * @return array
245 245
  */
246
-function wpinv_settings_sanitize( $input = array() ) {
246
+function wpinv_settings_sanitize($input = array()) {
247 247
 
248 248
     $wpinv_options = wpinv_get_options();
249 249
 
250
-    if ( empty( wp_get_raw_referer() ) ) {
250
+    if (empty(wp_get_raw_referer())) {
251 251
         return $input;
252 252
     }
253 253
 
254
-    wp_parse_str( wp_get_raw_referer(), $referrer );
254
+    wp_parse_str(wp_get_raw_referer(), $referrer);
255 255
 
256 256
     $settings = wpinv_get_registered_settings();
257
-    $tab      = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';
258
-    $section  = isset( $referrer['section'] ) ? $referrer['section'] : 'main';
257
+    $tab      = isset($referrer['tab']) ? $referrer['tab'] : 'general';
258
+    $section  = isset($referrer['section']) ? $referrer['section'] : 'main';
259 259
 
260 260
     $input = $input ? $input : array();
261
-    $input = apply_filters( 'wpinv_settings_tab_' . $tab . '_sanitize', $input );
262
-    $input = apply_filters( 'wpinv_settings_' . $tab . '-' . $section . '_sanitize', $input );
261
+    $input = apply_filters('wpinv_settings_tab_' . $tab . '_sanitize', $input);
262
+    $input = apply_filters('wpinv_settings_' . $tab . '-' . $section . '_sanitize', $input);
263 263
 
264 264
     // Loop through each setting being saved and pass it through a sanitization filter
265
-    foreach ( $input as $key => $value ) {
265
+    foreach ($input as $key => $value) {
266 266
 
267 267
         // Get the setting type (checkbox, select, etc)
268
-        $type = isset( $settings[ $tab ][$section][ $key ]['type'] ) ? $settings[ $tab ][$section][ $key ]['type'] : false;
268
+        $type = isset($settings[$tab][$section][$key]['type']) ? $settings[$tab][$section][$key]['type'] : false;
269 269
 
270
-        if ( $type ) {
270
+        if ($type) {
271 271
             // Field type specific filter
272
-            $input[$key] = apply_filters( 'wpinv_settings_sanitize_' . $type, $value, $key );
272
+            $input[$key] = apply_filters('wpinv_settings_sanitize_' . $type, $value, $key);
273 273
         }
274 274
 
275 275
         // General filter
276
-        $input[ $key ] = apply_filters( 'wpinv_settings_sanitize', $input[ $key ], $key );
276
+        $input[$key] = apply_filters('wpinv_settings_sanitize', $input[$key], $key);
277 277
     }
278 278
 
279 279
     // Loop through the whitelist and unset any that are empty for the tab being saved
280
-    $main_settings    = $section == 'main' ? $settings[ $tab ] : array(); // Check for extensions that aren't using new sections
281
-    $section_settings = ! empty( $settings[ $tab ][ $section ] ) ? $settings[ $tab ][ $section ] : array();
280
+    $main_settings    = $section == 'main' ? $settings[$tab] : array(); // Check for extensions that aren't using new sections
281
+    $section_settings = !empty($settings[$tab][$section]) ? $settings[$tab][$section] : array();
282 282
 
283
-    $found_settings = array_merge( $main_settings, $section_settings );
283
+    $found_settings = array_merge($main_settings, $section_settings);
284 284
 
285
-    if ( ! empty( $found_settings ) ) {
286
-        foreach ( $found_settings as $key => $value ) {
285
+    if (!empty($found_settings)) {
286
+        foreach ($found_settings as $key => $value) {
287 287
 
288 288
             // settings used to have numeric keys, now they have keys that match the option ID. This ensures both methods work
289
-            if ( is_numeric( $key ) ) {
289
+            if (is_numeric($key)) {
290 290
                 $key = $value['id'];
291 291
             }
292 292
 
293
-            if ( ! isset( $input[ $key ] ) && isset( $wpinv_options[ $key ] ) ) {
294
-                unset( $wpinv_options[ $key ] );
293
+            if (!isset($input[$key]) && isset($wpinv_options[$key])) {
294
+                unset($wpinv_options[$key]);
295 295
             }
296 296
         }
297 297
     }
298 298
 
299 299
     // Merge our new settings with the existing
300
-    $output = array_merge( $wpinv_options, $input );
300
+    $output = array_merge($wpinv_options, $input);
301 301
 
302
-    add_settings_error( 'wpinv-notices', '', __( 'Settings updated.', 'invoicing' ), 'updated' );
302
+    add_settings_error('wpinv-notices', '', __('Settings updated.', 'invoicing'), 'updated');
303 303
 
304 304
     return $output;
305 305
 }
306 306
 
307
-function wpinv_settings_sanitize_misc_accounting( $input ) {
307
+function wpinv_settings_sanitize_misc_accounting($input) {
308 308
 
309
-    if ( ! wpinv_current_user_can_manage_invoicing() ) {
309
+    if (!wpinv_current_user_can_manage_invoicing()) {
310 310
         return $input;
311 311
     }
312 312
 
313
-    if( ! empty( $input['enable_sequential'] ) && !wpinv_get_option( 'enable_sequential' ) ) {
313
+    if (!empty($input['enable_sequential']) && !wpinv_get_option('enable_sequential')) {
314 314
         // Shows an admin notice about upgrading previous order numbers
315
-        getpaid_session()->set( 'upgrade_sequential', '1' );
315
+        getpaid_session()->set('upgrade_sequential', '1');
316 316
     }
317 317
 
318 318
     return $input;
319 319
 }
320
-add_filter( 'wpinv_settings_misc-accounting_sanitize', 'wpinv_settings_sanitize_misc_accounting' );
320
+add_filter('wpinv_settings_misc-accounting_sanitize', 'wpinv_settings_sanitize_misc_accounting');
321 321
 
322
-function wpinv_settings_sanitize_tax_rates( $input ) {
323
-    if( ! wpinv_current_user_can_manage_invoicing() ) {
322
+function wpinv_settings_sanitize_tax_rates($input) {
323
+    if (!wpinv_current_user_can_manage_invoicing()) {
324 324
         return $input;
325 325
     }
326 326
 
327
-    $new_rates = !empty( $_POST['tax_rates'] ) ? array_values( $_POST['tax_rates'] ) : array();
327
+    $new_rates = !empty($_POST['tax_rates']) ? array_values($_POST['tax_rates']) : array();
328 328
 
329 329
     $tax_rates = array();
330 330
 
331
-    if ( !empty( $new_rates ) ) {
332
-        foreach ( $new_rates as $rate ) {
333
-            if ( isset( $rate['country'] ) && empty( $rate['country'] ) && empty( $rate['state'] ) ) {
331
+    if (!empty($new_rates)) {
332
+        foreach ($new_rates as $rate) {
333
+            if (isset($rate['country']) && empty($rate['country']) && empty($rate['state'])) {
334 334
                 continue;
335 335
             }
336 336
             
337
-            $rate['rate'] = wpinv_sanitize_amount( $rate['rate'], 4 );
337
+            $rate['rate'] = wpinv_sanitize_amount($rate['rate'], 4);
338 338
             
339 339
             $tax_rates[] = $rate;
340 340
         }
341 341
     }
342 342
 
343
-    update_option( 'wpinv_tax_rates', $tax_rates );
343
+    update_option('wpinv_tax_rates', $tax_rates);
344 344
 
345 345
     return $input;
346 346
 }
347
-add_filter( 'wpinv_settings_taxes-rates_sanitize', 'wpinv_settings_sanitize_tax_rates' );
347
+add_filter('wpinv_settings_taxes-rates_sanitize', 'wpinv_settings_sanitize_tax_rates');
348 348
 
349
-function wpinv_sanitize_text_field( $input ) {
350
-    return trim( $input );
349
+function wpinv_sanitize_text_field($input) {
350
+    return trim($input);
351 351
 }
352
-add_filter( 'wpinv_settings_sanitize_text', 'wpinv_sanitize_text_field' );
352
+add_filter('wpinv_settings_sanitize_text', 'wpinv_sanitize_text_field');
353 353
 
354 354
 function wpinv_get_settings_tabs() {
355 355
     $tabs             = array();
356
-    $tabs['general']  = __( 'General', 'invoicing' );
357
-    $tabs['gateways'] = __( 'Payment Gateways', 'invoicing' );
358
-    $tabs['taxes']    = __( 'Taxes', 'invoicing' );
359
-    $tabs['emails']   = __( 'Emails', 'invoicing' );
360
-    $tabs['privacy']  = __( 'Privacy', 'invoicing' );
361
-    $tabs['misc']     = __( 'Misc', 'invoicing' );
362
-    $tabs['tools']    = __( 'Tools', 'invoicing' );
363
-
364
-    return apply_filters( 'wpinv_settings_tabs', $tabs );
356
+    $tabs['general']  = __('General', 'invoicing');
357
+    $tabs['gateways'] = __('Payment Gateways', 'invoicing');
358
+    $tabs['taxes']    = __('Taxes', 'invoicing');
359
+    $tabs['emails']   = __('Emails', 'invoicing');
360
+    $tabs['privacy']  = __('Privacy', 'invoicing');
361
+    $tabs['misc']     = __('Misc', 'invoicing');
362
+    $tabs['tools']    = __('Tools', 'invoicing');
363
+
364
+    return apply_filters('wpinv_settings_tabs', $tabs);
365 365
 }
366 366
 
367
-function wpinv_get_settings_tab_sections( $tab = false ) {
367
+function wpinv_get_settings_tab_sections($tab = false) {
368 368
     $tabs     = false;
369 369
     $sections = wpinv_get_registered_settings_sections();
370 370
 
371
-    if( $tab && ! empty( $sections[ $tab ] ) ) {
372
-        $tabs = $sections[ $tab ];
373
-    } else if ( $tab ) {
371
+    if ($tab && !empty($sections[$tab])) {
372
+        $tabs = $sections[$tab];
373
+    } else if ($tab) {
374 374
         $tabs = false;
375 375
     }
376 376
 
@@ -380,143 +380,143 @@  discard block
 block discarded – undo
380 380
 function wpinv_get_registered_settings_sections() {
381 381
     static $sections = false;
382 382
 
383
-    if ( false !== $sections ) {
383
+    if (false !== $sections) {
384 384
         return $sections;
385 385
     }
386 386
 
387 387
     $sections = array(
388
-        'general' => apply_filters( 'wpinv_settings_sections_general', array(
389
-            'main' => __( 'General Settings', 'invoicing' ),
390
-            'currency_section' => __( 'Currency Settings', 'invoicing' ),
391
-            'labels' => __( 'Label Texts', 'invoicing' ),
392
-        ) ),
393
-        'gateways' => apply_filters( 'wpinv_settings_sections_gateways', array(
394
-            'main' => __( 'Gateway Settings', 'invoicing' ),
395
-        ) ),
396
-        'taxes' => apply_filters( 'wpinv_settings_sections_taxes', array(
397
-            'main' => __( 'Tax Settings', 'invoicing' ),
398
-            'rates' => __( 'Tax Rates', 'invoicing' ),
399
-        ) ),
400
-        'emails' => apply_filters( 'wpinv_settings_sections_emails', array(
401
-            'main' => __( 'Email Settings', 'invoicing' ),
402
-        ) ),
403
-        'privacy' => apply_filters( 'wpinv_settings_sections_privacy', array(
404
-            'main' => __( 'Privacy policy', 'invoicing' ),
405
-        ) ),
406
-        'misc' => apply_filters( 'wpinv_settings_sections_misc', array(
407
-            'main' => __( 'Miscellaneous', 'invoicing' ),
408
-            'fields' => __( 'Fields Settings', 'invoicing' ),
409
-            'custom-css' => __( 'Custom CSS', 'invoicing' ),
410
-        ) ),
411
-        'tools' => apply_filters( 'wpinv_settings_sections_tools', array(
412
-            'main' => __( 'Diagnostic Tools', 'invoicing' ),
413
-        ) ),
388
+        'general' => apply_filters('wpinv_settings_sections_general', array(
389
+            'main' => __('General Settings', 'invoicing'),
390
+            'currency_section' => __('Currency Settings', 'invoicing'),
391
+            'labels' => __('Label Texts', 'invoicing'),
392
+        )),
393
+        'gateways' => apply_filters('wpinv_settings_sections_gateways', array(
394
+            'main' => __('Gateway Settings', 'invoicing'),
395
+        )),
396
+        'taxes' => apply_filters('wpinv_settings_sections_taxes', array(
397
+            'main' => __('Tax Settings', 'invoicing'),
398
+            'rates' => __('Tax Rates', 'invoicing'),
399
+        )),
400
+        'emails' => apply_filters('wpinv_settings_sections_emails', array(
401
+            'main' => __('Email Settings', 'invoicing'),
402
+        )),
403
+        'privacy' => apply_filters('wpinv_settings_sections_privacy', array(
404
+            'main' => __('Privacy policy', 'invoicing'),
405
+        )),
406
+        'misc' => apply_filters('wpinv_settings_sections_misc', array(
407
+            'main' => __('Miscellaneous', 'invoicing'),
408
+            'fields' => __('Fields Settings', 'invoicing'),
409
+            'custom-css' => __('Custom CSS', 'invoicing'),
410
+        )),
411
+        'tools' => apply_filters('wpinv_settings_sections_tools', array(
412
+            'main' => __('Diagnostic Tools', 'invoicing'),
413
+        )),
414 414
     );
415 415
 
416
-    $sections = apply_filters( 'wpinv_settings_sections', $sections );
416
+    $sections = apply_filters('wpinv_settings_sections', $sections);
417 417
 
418 418
     return $sections;
419 419
 }
420 420
 
421
-function wpinv_get_pages( $with_slug = false, $default_label = NULL ) {
421
+function wpinv_get_pages($with_slug = false, $default_label = NULL) {
422 422
 	$pages_options = array();
423 423
 
424
-	if( $default_label !== NULL && $default_label !== false ) {
425
-		$pages_options = array( '' => $default_label ); // Blank option
424
+	if ($default_label !== NULL && $default_label !== false) {
425
+		$pages_options = array('' => $default_label); // Blank option
426 426
 	}
427 427
 
428 428
 	$pages = get_pages();
429
-	if ( $pages ) {
430
-		foreach ( $pages as $page ) {
429
+	if ($pages) {
430
+		foreach ($pages as $page) {
431 431
 			$title = $with_slug ? $page->post_title . ' (' . $page->post_name . ')' : $page->post_title;
432
-            $pages_options[ $page->ID ] = $title;
432
+            $pages_options[$page->ID] = $title;
433 433
 		}
434 434
 	}
435 435
 
436 436
 	return $pages_options;
437 437
 }
438 438
 
439
-function wpinv_header_callback( $args ) {
440
-	if ( !empty( $args['desc'] ) ) {
439
+function wpinv_header_callback($args) {
440
+	if (!empty($args['desc'])) {
441 441
         echo $args['desc'];
442 442
     }
443 443
 }
444 444
 
445
-function wpinv_hidden_callback( $args ) {
445
+function wpinv_hidden_callback($args) {
446 446
 	global $wpinv_options;
447 447
 
448
-	if ( isset( $args['set_value'] ) ) {
448
+	if (isset($args['set_value'])) {
449 449
 		$value = $args['set_value'];
450
-	} elseif ( isset( $wpinv_options[ $args['id'] ] ) ) {
451
-		$value = $wpinv_options[ $args['id'] ];
450
+	} elseif (isset($wpinv_options[$args['id']])) {
451
+		$value = $wpinv_options[$args['id']];
452 452
 	} else {
453
-		$value = isset( $args['std'] ) ? $args['std'] : '';
453
+		$value = isset($args['std']) ? $args['std'] : '';
454 454
 	}
455 455
 
456
-	if ( isset( $args['faux'] ) && true === $args['faux'] ) {
456
+	if (isset($args['faux']) && true === $args['faux']) {
457 457
 		$args['readonly'] = true;
458
-		$value = isset( $args['std'] ) ? $args['std'] : '';
458
+		$value = isset($args['std']) ? $args['std'] : '';
459 459
 		$name  = '';
460 460
 	} else {
461
-		$name = 'name="wpinv_settings[' . esc_attr( $args['id'] ) . ']"';
461
+		$name = 'name="wpinv_settings[' . esc_attr($args['id']) . ']"';
462 462
 	}
463 463
 
464
-	$html = '<input type="hidden" id="wpinv_settings[' . wpinv_sanitize_key( $args['id'] ) . ']" ' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '" />';
464
+	$html = '<input type="hidden" id="wpinv_settings[' . wpinv_sanitize_key($args['id']) . ']" ' . $name . ' value="' . esc_attr(stripslashes($value)) . '" />';
465 465
     
466 466
 	echo $html;
467 467
 }
468 468
 
469
-function wpinv_checkbox_callback( $args ) {
469
+function wpinv_checkbox_callback($args) {
470 470
 	global $wpinv_options;
471 471
     
472
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
472
+    $sanitize_id = wpinv_sanitize_key($args['id']);
473 473
 
474
-	if ( isset( $args['faux'] ) && true === $args['faux'] ) {
474
+	if (isset($args['faux']) && true === $args['faux']) {
475 475
 		$name = '';
476 476
 	} else {
477 477
 		$name = 'name="wpinv_settings[' . $sanitize_id . ']"';
478 478
 	}
479 479
 
480
-	$checked = isset( $wpinv_options[ $args['id'] ] ) ? checked( 1, $wpinv_options[ $args['id'] ], false ) : '';
480
+	$checked = isset($wpinv_options[$args['id']]) ? checked(1, $wpinv_options[$args['id']], false) : '';
481 481
 	$html = '<input type="checkbox" id="wpinv_settings[' . $sanitize_id . ']"' . $name . ' value="1" ' . $checked . '/>';
482
-	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> '  . wp_kses_post( $args['desc'] ) . '</label>';
482
+	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
483 483
 
484 484
 	echo $html;
485 485
 }
486 486
 
487
-function wpinv_multicheck_callback( $args ) {
487
+function wpinv_multicheck_callback($args) {
488 488
 	global $wpinv_options;
489 489
 
490
-	$sanitize_id = wpinv_sanitize_key( $args['id'] );
491
-	$class = !empty( $args['class'] ) ? ' ' . esc_attr( $args['class'] ) : '';
490
+	$sanitize_id = wpinv_sanitize_key($args['id']);
491
+	$class = !empty($args['class']) ? ' ' . esc_attr($args['class']) : '';
492 492
 
493
-	if ( ! empty( $args['options'] ) ) {
493
+	if (!empty($args['options'])) {
494 494
 		echo '<div class="wpi-mcheck-rows wpi-mcheck-' . $sanitize_id . $class . '">';
495
-        foreach( $args['options'] as $key => $option ):
496
-			$sanitize_key = wpinv_sanitize_key( $key );
497
-			if ( isset( $wpinv_options[$args['id']][$sanitize_key] ) ) { 
495
+        foreach ($args['options'] as $key => $option):
496
+			$sanitize_key = wpinv_sanitize_key($key);
497
+			if (isset($wpinv_options[$args['id']][$sanitize_key])) { 
498 498
 				$enabled = $sanitize_key;
499 499
 			} else { 
500 500
 				$enabled = NULL; 
501 501
 			}
502
-			echo '<div class="wpi-mcheck-row"><input name="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" id="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" type="checkbox" value="' . esc_attr( $sanitize_key ) . '" ' . checked( $sanitize_key, $enabled, false ) . '/>&nbsp;';
503
-			echo '<label for="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']">' . wp_kses_post( $option ) . '</label></div>';
502
+			echo '<div class="wpi-mcheck-row"><input name="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" id="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" type="checkbox" value="' . esc_attr($sanitize_key) . '" ' . checked($sanitize_key, $enabled, false) . '/>&nbsp;';
503
+			echo '<label for="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']">' . wp_kses_post($option) . '</label></div>';
504 504
 		endforeach;
505 505
 		echo '</div>';
506 506
 		echo '<p class="description">' . $args['desc'] . '</p>';
507 507
 	}
508 508
 }
509 509
 
510
-function wpinv_payment_icons_callback( $args ) {
510
+function wpinv_payment_icons_callback($args) {
511 511
 	global $wpinv_options;
512 512
     
513
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
513
+    $sanitize_id = wpinv_sanitize_key($args['id']);
514 514
 
515
-	if ( ! empty( $args['options'] ) ) {
516
-		foreach( $args['options'] as $key => $option ) {
517
-            $sanitize_key = wpinv_sanitize_key( $key );
515
+	if (!empty($args['options'])) {
516
+		foreach ($args['options'] as $key => $option) {
517
+            $sanitize_key = wpinv_sanitize_key($key);
518 518
             
519
-			if( isset( $wpinv_options[$args['id']][$key] ) ) {
519
+			if (isset($wpinv_options[$args['id']][$key])) {
520 520
 				$enabled = $option;
521 521
 			} else {
522 522
 				$enabled = NULL;
@@ -524,197 +524,197 @@  discard block
 block discarded – undo
524 524
 
525 525
 			echo '<label for="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" style="margin-right:10px;line-height:16px;height:16px;display:inline-block;">';
526 526
 
527
-				echo '<input name="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" id="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" type="checkbox" value="' . esc_attr( $option ) . '" ' . checked( $option, $enabled, false ) . '/>&nbsp;';
527
+				echo '<input name="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" id="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" type="checkbox" value="' . esc_attr($option) . '" ' . checked($option, $enabled, false) . '/>&nbsp;';
528 528
 
529
-				if ( wpinv_string_is_image_url( $key ) ) {
530
-					echo '<img class="payment-icon" src="' . esc_url( $key ) . '" style="width:32px;height:24px;position:relative;top:6px;margin-right:5px;"/>';
529
+				if (wpinv_string_is_image_url($key)) {
530
+					echo '<img class="payment-icon" src="' . esc_url($key) . '" style="width:32px;height:24px;position:relative;top:6px;margin-right:5px;"/>';
531 531
 				} else {
532
-					$card = strtolower( str_replace( ' ', '', $option ) );
532
+					$card = strtolower(str_replace(' ', '', $option));
533 533
 
534
-					if ( has_filter( 'wpinv_accepted_payment_' . $card . '_image' ) ) {
535
-						$image = apply_filters( 'wpinv_accepted_payment_' . $card . '_image', '' );
534
+					if (has_filter('wpinv_accepted_payment_' . $card . '_image')) {
535
+						$image = apply_filters('wpinv_accepted_payment_' . $card . '_image', '');
536 536
 					} else {
537
-						$image       = wpinv_locate_template( 'images' . DIRECTORY_SEPARATOR . 'icons' . DIRECTORY_SEPARATOR . $card . '.gif', false );
537
+						$image       = wpinv_locate_template('images' . DIRECTORY_SEPARATOR . 'icons' . DIRECTORY_SEPARATOR . $card . '.gif', false);
538 538
 						$content_dir = WP_CONTENT_DIR;
539 539
 
540
-						if ( function_exists( 'wp_normalize_path' ) ) {
540
+						if (function_exists('wp_normalize_path')) {
541 541
 							// Replaces backslashes with forward slashes for Windows systems
542
-							$image = wp_normalize_path( $image );
543
-							$content_dir = wp_normalize_path( $content_dir );
542
+							$image = wp_normalize_path($image);
543
+							$content_dir = wp_normalize_path($content_dir);
544 544
 						}
545 545
 
546
-						$image = str_replace( $content_dir, content_url(), $image );
546
+						$image = str_replace($content_dir, content_url(), $image);
547 547
 					}
548 548
 
549
-					echo '<img class="payment-icon" src="' . esc_url( $image ) . '" style="width:32px;height:24px;position:relative;top:6px;margin-right:5px;"/>';
549
+					echo '<img class="payment-icon" src="' . esc_url($image) . '" style="width:32px;height:24px;position:relative;top:6px;margin-right:5px;"/>';
550 550
 				}
551 551
 			echo $option . '</label>';
552 552
 		}
553
-		echo '<p class="description" style="margin-top:16px;">' . wp_kses_post( $args['desc'] ) . '</p>';
553
+		echo '<p class="description" style="margin-top:16px;">' . wp_kses_post($args['desc']) . '</p>';
554 554
 	}
555 555
 }
556 556
 
557
-function wpinv_radio_callback( $args ) {
557
+function wpinv_radio_callback($args) {
558 558
 	global $wpinv_options;
559 559
     
560
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
560
+    $sanitize_id = wpinv_sanitize_key($args['id']);
561 561
     
562
-    foreach ( $args['options'] as $key => $option ) :
563
-		$sanitize_key = wpinv_sanitize_key( $key );
562
+    foreach ($args['options'] as $key => $option) :
563
+		$sanitize_key = wpinv_sanitize_key($key);
564 564
         
565 565
         $checked = false;
566 566
 
567
-		if ( isset( $wpinv_options[ $args['id'] ] ) && $wpinv_options[ $args['id'] ] == $key )
567
+		if (isset($wpinv_options[$args['id']]) && $wpinv_options[$args['id']] == $key)
568 568
 			$checked = true;
569
-		elseif( isset( $args['std'] ) && $args['std'] == $key && ! isset( $wpinv_options[ $args['id'] ] ) )
569
+		elseif (isset($args['std']) && $args['std'] == $key && !isset($wpinv_options[$args['id']]))
570 570
 			$checked = true;
571 571
 
572 572
 		echo '<input name="wpinv_settings[' . $sanitize_id . ']" id="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" type="radio" value="' . $sanitize_key . '" ' . checked(true, $checked, false) . '/>&nbsp;';
573
-		echo '<label for="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']">' . esc_html( $option ) . '</label><br/>';
573
+		echo '<label for="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']">' . esc_html($option) . '</label><br/>';
574 574
 	endforeach;
575 575
 
576
-	echo '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
576
+	echo '<p class="description">' . wp_kses_post($args['desc']) . '</p>';
577 577
 }
578 578
 
579
-function wpinv_gateways_callback( $args ) {
579
+function wpinv_gateways_callback($args) {
580 580
 	global $wpinv_options;
581 581
     
582
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
582
+    $sanitize_id = wpinv_sanitize_key($args['id']);
583 583
 
584
-	foreach ( $args['options'] as $key => $option ) :
585
-		$sanitize_key = wpinv_sanitize_key( $key );
584
+	foreach ($args['options'] as $key => $option) :
585
+		$sanitize_key = wpinv_sanitize_key($key);
586 586
         
587
-        if ( isset( $wpinv_options['gateways'][ $key ] ) )
587
+        if (isset($wpinv_options['gateways'][$key]))
588 588
 			$enabled = '1';
589 589
 		else
590 590
 			$enabled = null;
591 591
 
592
-		echo '<input name="wpinv_settings[' . esc_attr( $args['id'] ) . '][' . $sanitize_key . ']" id="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" type="checkbox" value="1" ' . checked('1', $enabled, false) . '/>&nbsp;';
593
-		echo '<label for="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']">' . esc_html( $option['admin_label'] ) . '</label><br/>';
592
+		echo '<input name="wpinv_settings[' . esc_attr($args['id']) . '][' . $sanitize_key . ']" id="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" type="checkbox" value="1" ' . checked('1', $enabled, false) . '/>&nbsp;';
593
+		echo '<label for="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']">' . esc_html($option['admin_label']) . '</label><br/>';
594 594
 	endforeach;
595 595
 }
596 596
 
597 597
 function wpinv_gateway_select_callback($args) {
598 598
 	global $wpinv_options;
599 599
     
600
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
601
-    $class = !empty( $args['class'] ) ? ' ' . esc_attr( $args['class'] ) : '';
600
+    $sanitize_id = wpinv_sanitize_key($args['id']);
601
+    $class = !empty($args['class']) ? ' ' . esc_attr($args['class']) : '';
602 602
 
603
-	echo '<select name="wpinv_settings[' . $sanitize_id . ']"" id="wpinv_settings[' . $sanitize_id . ']" class="'.$class.'" >';
603
+	echo '<select name="wpinv_settings[' . $sanitize_id . ']"" id="wpinv_settings[' . $sanitize_id . ']" class="' . $class . '" >';
604 604
 
605
-	foreach ( $args['options'] as $key => $option ) :
606
-		if ( isset( $args['selected'] ) && $args['selected'] !== null && $args['selected'] !== false ) {
607
-            $selected = selected( $key, $args['selected'], false );
605
+	foreach ($args['options'] as $key => $option) :
606
+		if (isset($args['selected']) && $args['selected'] !== null && $args['selected'] !== false) {
607
+            $selected = selected($key, $args['selected'], false);
608 608
         } else {
609
-            $selected = isset( $wpinv_options[ $args['id'] ] ) ? selected( $key, $wpinv_options[$args['id']], false ) : '';
609
+            $selected = isset($wpinv_options[$args['id']]) ? selected($key, $wpinv_options[$args['id']], false) : '';
610 610
         }
611
-		echo '<option value="' . wpinv_sanitize_key( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
611
+		echo '<option value="' . wpinv_sanitize_key($key) . '"' . $selected . '>' . esc_html($option['admin_label']) . '</option>';
612 612
 	endforeach;
613 613
 
614 614
 	echo '</select>';
615
-	echo '<label for="wpinv_settings[' . $sanitize_id . ']"> '  . wp_kses_post( $args['desc'] ) . '</label>';
615
+	echo '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
616 616
 }
617 617
 
618
-function wpinv_text_callback( $args ) {
618
+function wpinv_text_callback($args) {
619 619
 	global $wpinv_options;
620 620
     
621
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
621
+    $sanitize_id = wpinv_sanitize_key($args['id']);
622 622
 
623
-	if ( isset( $wpinv_options[ $args['id'] ] ) ) {
624
-		$value = $wpinv_options[ $args['id'] ];
623
+	if (isset($wpinv_options[$args['id']])) {
624
+		$value = $wpinv_options[$args['id']];
625 625
 	} else {
626
-		$value = isset( $args['std'] ) ? $args['std'] : '';
626
+		$value = isset($args['std']) ? $args['std'] : '';
627 627
 	}
628 628
 
629
-	if ( isset( $args['faux'] ) && true === $args['faux'] ) {
629
+	if (isset($args['faux']) && true === $args['faux']) {
630 630
 		$args['readonly'] = true;
631
-		$value = isset( $args['std'] ) ? $args['std'] : '';
631
+		$value = isset($args['std']) ? $args['std'] : '';
632 632
 		$name  = '';
633 633
 	} else {
634
-		$name = 'name="wpinv_settings[' . esc_attr( $args['id'] ) . ']"';
634
+		$name = 'name="wpinv_settings[' . esc_attr($args['id']) . ']"';
635 635
 	}
636
-	$class = !empty( $args['class'] ) ? sanitize_html_class( $args['class'] ) : '';
636
+	$class = !empty($args['class']) ? sanitize_html_class($args['class']) : '';
637 637
 
638 638
 	$readonly = $args['readonly'] === true ? ' readonly="readonly"' : '';
639
-	$size     = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
640
-	$html     = '<input type="text" class="' . sanitize_html_class( $size ) . '-text ' . $class . '" id="wpinv_settings[' . $sanitize_id . ']" ' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"' . $readonly . '/>';
641
-	$html    .= '<label for="wpinv_settings[' . $sanitize_id . ']"> '  . wp_kses_post( $args['desc'] ) . '</label>';
639
+	$size     = (isset($args['size']) && !is_null($args['size'])) ? $args['size'] : 'regular';
640
+	$html     = '<input type="text" class="' . sanitize_html_class($size) . '-text ' . $class . '" id="wpinv_settings[' . $sanitize_id . ']" ' . $name . ' value="' . esc_attr(stripslashes($value)) . '"' . $readonly . '/>';
641
+	$html    .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
642 642
 
643 643
 	echo $html;
644 644
 }
645 645
 
646
-function wpinv_number_callback( $args ) {
646
+function wpinv_number_callback($args) {
647 647
 	global $wpinv_options;
648 648
     
649
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
649
+    $sanitize_id = wpinv_sanitize_key($args['id']);
650 650
 
651
-	if ( isset( $wpinv_options[ $args['id'] ] ) ) {
652
-		$value = $wpinv_options[ $args['id'] ];
651
+	if (isset($wpinv_options[$args['id']])) {
652
+		$value = $wpinv_options[$args['id']];
653 653
 	} else {
654
-		$value = isset( $args['std'] ) ? $args['std'] : '';
654
+		$value = isset($args['std']) ? $args['std'] : '';
655 655
 	}
656 656
 
657
-	if ( isset( $args['faux'] ) && true === $args['faux'] ) {
657
+	if (isset($args['faux']) && true === $args['faux']) {
658 658
 		$args['readonly'] = true;
659
-		$value = isset( $args['std'] ) ? $args['std'] : '';
659
+		$value = isset($args['std']) ? $args['std'] : '';
660 660
 		$name  = '';
661 661
 	} else {
662
-		$name = 'name="wpinv_settings[' . esc_attr( $args['id'] ) . ']"';
662
+		$name = 'name="wpinv_settings[' . esc_attr($args['id']) . ']"';
663 663
 	}
664 664
 
665
-	$max  = isset( $args['max'] ) ? $args['max'] : 999999;
666
-	$min  = isset( $args['min'] ) ? $args['min'] : 0;
667
-	$step = isset( $args['step'] ) ? $args['step'] : 1;
668
-	$class = !empty( $args['class'] ) ? sanitize_html_class( $args['class'] ) : '';
665
+	$max  = isset($args['max']) ? $args['max'] : 999999;
666
+	$min  = isset($args['min']) ? $args['min'] : 0;
667
+	$step = isset($args['step']) ? $args['step'] : 1;
668
+	$class = !empty($args['class']) ? sanitize_html_class($args['class']) : '';
669 669
 
670
-	$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
671
-	$html = '<input type="number" step="' . esc_attr( $step ) . '" max="' . esc_attr( $max ) . '" min="' . esc_attr( $min ) . '" class="' . sanitize_html_class( $size ) . '-text ' . $class . '" id="wpinv_settings[' . $sanitize_id . ']" ' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"/>';
672
-	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> '  . wp_kses_post( $args['desc'] ) . '</label>';
670
+	$size = (isset($args['size']) && !is_null($args['size'])) ? $args['size'] : 'regular';
671
+	$html = '<input type="number" step="' . esc_attr($step) . '" max="' . esc_attr($max) . '" min="' . esc_attr($min) . '" class="' . sanitize_html_class($size) . '-text ' . $class . '" id="wpinv_settings[' . $sanitize_id . ']" ' . $name . ' value="' . esc_attr(stripslashes($value)) . '"/>';
672
+	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
673 673
 
674 674
 	echo $html;
675 675
 }
676 676
 
677
-function wpinv_textarea_callback( $args ) {
677
+function wpinv_textarea_callback($args) {
678 678
 	global $wpinv_options;
679 679
     
680
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
680
+    $sanitize_id = wpinv_sanitize_key($args['id']);
681 681
 
682
-	if ( isset( $wpinv_options[ $args['id'] ] ) ) {
683
-		$value = $wpinv_options[ $args['id'] ];
682
+	if (isset($wpinv_options[$args['id']])) {
683
+		$value = $wpinv_options[$args['id']];
684 684
 	} else {
685
-		$value = isset( $args['std'] ) ? $args['std'] : '';
685
+		$value = isset($args['std']) ? $args['std'] : '';
686 686
 	}
687 687
     
688
-    $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
689
-    $class = ( isset( $args['class'] ) && ! is_null( $args['class'] ) ) ? $args['class'] : 'large-text';
688
+    $size = (isset($args['size']) && !is_null($args['size'])) ? $args['size'] : 'regular';
689
+    $class = (isset($args['class']) && !is_null($args['class'])) ? $args['class'] : 'large-text';
690 690
 
691
-	$html = '<textarea class="' . sanitize_html_class( $class ) . ' txtarea-' . sanitize_html_class( $size ) . ' wpi-' . esc_attr( sanitize_html_class( $sanitize_id ) ) . ' " cols="' . $args['cols'] . '" rows="' . $args['rows'] . '" id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr( $args['id'] ) . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
692
-	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> '  . wp_kses_post( $args['desc'] ) . '</label>';
691
+	$html = '<textarea class="' . sanitize_html_class($class) . ' txtarea-' . sanitize_html_class($size) . ' wpi-' . esc_attr(sanitize_html_class($sanitize_id)) . ' " cols="' . $args['cols'] . '" rows="' . $args['rows'] . '" id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr($args['id']) . ']">' . esc_textarea(stripslashes($value)) . '</textarea>';
692
+	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
693 693
 
694 694
 	echo $html;
695 695
 }
696 696
 
697
-function wpinv_password_callback( $args ) {
697
+function wpinv_password_callback($args) {
698 698
 	global $wpinv_options;
699 699
     
700
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
700
+    $sanitize_id = wpinv_sanitize_key($args['id']);
701 701
 
702
-	if ( isset( $wpinv_options[ $args['id'] ] ) ) {
703
-		$value = $wpinv_options[ $args['id'] ];
702
+	if (isset($wpinv_options[$args['id']])) {
703
+		$value = $wpinv_options[$args['id']];
704 704
 	} else {
705
-		$value = isset( $args['std'] ) ? $args['std'] : '';
705
+		$value = isset($args['std']) ? $args['std'] : '';
706 706
 	}
707 707
 
708
-	$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
709
-	$html = '<input type="password" class="' . sanitize_html_class( $size ) . '-text" id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr( $args['id'] ) . ']" value="' . esc_attr( $value ) . '"/>';
710
-	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post( $args['desc'] ) . '</label>';
708
+	$size = (isset($args['size']) && !is_null($args['size'])) ? $args['size'] : 'regular';
709
+	$html = '<input type="password" class="' . sanitize_html_class($size) . '-text" id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr($args['id']) . ']" value="' . esc_attr($value) . '"/>';
710
+	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
711 711
 
712 712
 	echo $html;
713 713
 }
714 714
 
715 715
 function wpinv_missing_callback($args) {
716 716
 	printf(
717
-		__( 'The callback function used for the %s setting is missing.', 'invoicing' ),
717
+		__('The callback function used for the %s setting is missing.', 'invoicing'),
718 718
 		'<strong>' . $args['id'] . '</strong>'
719 719
 	);
720 720
 }
@@ -722,133 +722,133 @@  discard block
 block discarded – undo
722 722
 function wpinv_select_callback($args) {
723 723
 	global $wpinv_options;
724 724
     
725
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
725
+    $sanitize_id = wpinv_sanitize_key($args['id']);
726 726
 
727
-	if ( isset( $wpinv_options[ $args['id'] ] ) ) {
728
-		$value = $wpinv_options[ $args['id'] ];
727
+	if (isset($wpinv_options[$args['id']])) {
728
+		$value = $wpinv_options[$args['id']];
729 729
 	} else {
730
-		$value = isset( $args['std'] ) ? $args['std'] : '';
730
+		$value = isset($args['std']) ? $args['std'] : '';
731 731
 	}
732 732
     
733
-    if ( isset( $args['selected'] ) && $args['selected'] !== null && $args['selected'] !== false ) {
733
+    if (isset($args['selected']) && $args['selected'] !== null && $args['selected'] !== false) {
734 734
         $value = $args['selected'];
735 735
     }
736 736
 
737
-	if ( isset( $args['placeholder'] ) ) {
737
+	if (isset($args['placeholder'])) {
738 738
 		$placeholder = $args['placeholder'];
739 739
 	} else {
740 740
 		$placeholder = '';
741 741
 	}
742 742
     
743
-    if( !empty( $args['onchange'] ) ) {
744
-        $onchange = ' onchange="' . esc_attr( $args['onchange'] ) . '"';
743
+    if (!empty($args['onchange'])) {
744
+        $onchange = ' onchange="' . esc_attr($args['onchange']) . '"';
745 745
     } else {
746 746
         $onchange = '';
747 747
     }
748 748
 
749
-    $class = !empty( $args['class'] ) ? ' ' . esc_attr( $args['class'] ) : '';
749
+    $class = !empty($args['class']) ? ' ' . esc_attr($args['class']) : '';
750 750
 
751
-	$html = '<select id="wpinv_settings[' . $sanitize_id . ']" class="'.$class.'"  name="wpinv_settings[' . esc_attr( $args['id'] ) . ']" data-placeholder="' . esc_html( $placeholder ) . '"' . $onchange . ' />';
751
+	$html = '<select id="wpinv_settings[' . $sanitize_id . ']" class="' . $class . '"  name="wpinv_settings[' . esc_attr($args['id']) . ']" data-placeholder="' . esc_html($placeholder) . '"' . $onchange . ' />';
752 752
 
753
-	foreach ( $args['options'] as $option => $name ) {
754
-		$selected = selected( $option, $value, false );
755
-		$html .= '<option value="' . esc_attr( $option ) . '" ' . $selected . '>' . esc_html( $name ) . '</option>';
753
+	foreach ($args['options'] as $option => $name) {
754
+		$selected = selected($option, $value, false);
755
+		$html .= '<option value="' . esc_attr($option) . '" ' . $selected . '>' . esc_html($name) . '</option>';
756 756
 	}
757 757
 
758 758
 	$html .= '</select>';
759
-	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post( $args['desc'] ) . '</label>';
759
+	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
760 760
 
761 761
 	echo $html;
762 762
 }
763 763
 
764
-function wpinv_color_select_callback( $args ) {
764
+function wpinv_color_select_callback($args) {
765 765
 	global $wpinv_options;
766 766
     
767
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
767
+    $sanitize_id = wpinv_sanitize_key($args['id']);
768 768
 
769
-	if ( isset( $wpinv_options[ $args['id'] ] ) ) {
770
-		$value = $wpinv_options[ $args['id'] ];
769
+	if (isset($wpinv_options[$args['id']])) {
770
+		$value = $wpinv_options[$args['id']];
771 771
 	} else {
772
-		$value = isset( $args['std'] ) ? $args['std'] : '';
772
+		$value = isset($args['std']) ? $args['std'] : '';
773 773
 	}
774 774
 
775
-	$html = '<select id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr( $args['id'] ) . ']"/>';
775
+	$html = '<select id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr($args['id']) . ']"/>';
776 776
 
777
-	foreach ( $args['options'] as $option => $color ) {
778
-		$selected = selected( $option, $value, false );
779
-		$html .= '<option value="' . esc_attr( $option ) . '" ' . $selected . '>' . esc_html( $color['label'] ) . '</option>';
777
+	foreach ($args['options'] as $option => $color) {
778
+		$selected = selected($option, $value, false);
779
+		$html .= '<option value="' . esc_attr($option) . '" ' . $selected . '>' . esc_html($color['label']) . '</option>';
780 780
 	}
781 781
 
782 782
 	$html .= '</select>';
783
-	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> '  . wp_kses_post( $args['desc'] ) . '</label>';
783
+	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
784 784
 
785 785
 	echo $html;
786 786
 }
787 787
 
788
-function wpinv_rich_editor_callback( $args ) {
788
+function wpinv_rich_editor_callback($args) {
789 789
 	global $wpinv_options, $wp_version;
790 790
     
791
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
791
+    $sanitize_id = wpinv_sanitize_key($args['id']);
792 792
 
793
-	if ( isset( $wpinv_options[ $args['id'] ] ) ) {
794
-		$value = $wpinv_options[ $args['id'] ];
793
+	if (isset($wpinv_options[$args['id']])) {
794
+		$value = $wpinv_options[$args['id']];
795 795
 
796
-		if( empty( $args['allow_blank'] ) && empty( $value ) ) {
797
-			$value = isset( $args['std'] ) ? $args['std'] : '';
796
+		if (empty($args['allow_blank']) && empty($value)) {
797
+			$value = isset($args['std']) ? $args['std'] : '';
798 798
 		}
799 799
 	} else {
800
-		$value = isset( $args['std'] ) ? $args['std'] : '';
800
+		$value = isset($args['std']) ? $args['std'] : '';
801 801
 	}
802 802
 
803
-	$rows = isset( $args['size'] ) ? $args['size'] : 20;
803
+	$rows = isset($args['size']) ? $args['size'] : 20;
804 804
 
805
-	if ( $wp_version >= 3.3 && function_exists( 'wp_editor' ) ) {
805
+	if ($wp_version >= 3.3 && function_exists('wp_editor')) {
806 806
 		ob_start();
807
-		wp_editor( stripslashes( $value ), 'wpinv_settings_' . esc_attr( $args['id'] ), array( 'textarea_name' => 'wpinv_settings[' . esc_attr( $args['id'] ) . ']', 'textarea_rows' => absint( $rows ), 'media_buttons' => false ) );
807
+		wp_editor(stripslashes($value), 'wpinv_settings_' . esc_attr($args['id']), array('textarea_name' => 'wpinv_settings[' . esc_attr($args['id']) . ']', 'textarea_rows' => absint($rows), 'media_buttons' => false));
808 808
 		$html = ob_get_clean();
809 809
 	} else {
810
-		$html = '<textarea class="large-text" rows="10" id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr( $args['id'] ) . ']" class="wpi-' . esc_attr( sanitize_html_class( $args['id'] ) ) . '">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
810
+		$html = '<textarea class="large-text" rows="10" id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr($args['id']) . ']" class="wpi-' . esc_attr(sanitize_html_class($args['id'])) . '">' . esc_textarea(stripslashes($value)) . '</textarea>';
811 811
 	}
812 812
 
813
-	$html .= '<br/><label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post( $args['desc'] ) . '</label>';
813
+	$html .= '<br/><label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
814 814
 
815 815
 	echo $html;
816 816
 }
817 817
 
818
-function wpinv_upload_callback( $args ) {
818
+function wpinv_upload_callback($args) {
819 819
 	global $wpinv_options;
820 820
     
821
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
821
+    $sanitize_id = wpinv_sanitize_key($args['id']);
822 822
 
823
-	if ( isset( $wpinv_options[ $args['id'] ] ) ) {
823
+	if (isset($wpinv_options[$args['id']])) {
824 824
 		$value = $wpinv_options[$args['id']];
825 825
 	} else {
826 826
 		$value = isset($args['std']) ? $args['std'] : '';
827 827
 	}
828 828
 
829
-	$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
830
-	$html = '<input type="text" class="' . sanitize_html_class( $size ) . '-text" id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr( $args['id'] ) . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
831
-	$html .= '<span>&nbsp;<input type="button" class="wpinv_settings_upload_button button-secondary" value="' . __( 'Upload File', 'invoicing' ) . '"/></span>';
832
-	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post( $args['desc'] ) . '</label>';
829
+	$size = (isset($args['size']) && !is_null($args['size'])) ? $args['size'] : 'regular';
830
+	$html = '<input type="text" class="' . sanitize_html_class($size) . '-text" id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr($args['id']) . ']" value="' . esc_attr(stripslashes($value)) . '"/>';
831
+	$html .= '<span>&nbsp;<input type="button" class="wpinv_settings_upload_button button-secondary" value="' . __('Upload File', 'invoicing') . '"/></span>';
832
+	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
833 833
 
834 834
 	echo $html;
835 835
 }
836 836
 
837
-function wpinv_color_callback( $args ) {
837
+function wpinv_color_callback($args) {
838 838
 	global $wpinv_options;
839 839
     
840
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
840
+    $sanitize_id = wpinv_sanitize_key($args['id']);
841 841
 
842
-	if ( isset( $wpinv_options[ $args['id'] ] ) ) {
843
-		$value = $wpinv_options[ $args['id'] ];
842
+	if (isset($wpinv_options[$args['id']])) {
843
+		$value = $wpinv_options[$args['id']];
844 844
 	} else {
845
-		$value = isset( $args['std'] ) ? $args['std'] : '';
845
+		$value = isset($args['std']) ? $args['std'] : '';
846 846
 	}
847 847
 
848
-	$default = isset( $args['std'] ) ? $args['std'] : '';
848
+	$default = isset($args['std']) ? $args['std'] : '';
849 849
 
850
-	$html = '<input type="text" class="wpinv-color-picker" id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr( $args['id'] ) . ']" value="' . esc_attr( $value ) . '" data-default-color="' . esc_attr( $default ) . '" />';
851
-	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> '  . wp_kses_post( $args['desc'] ) . '</label>';
850
+	$html = '<input type="text" class="wpinv-color-picker" id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr($args['id']) . ']" value="' . esc_attr($value) . '" data-default-color="' . esc_attr($default) . '" />';
851
+	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
852 852
 
853 853
 	echo $html;
854 854
 }
@@ -856,9 +856,9 @@  discard block
 block discarded – undo
856 856
 function wpinv_country_states_callback($args) {
857 857
 	global $wpinv_options;
858 858
     
859
-    $sanitize_id = wpinv_sanitize_key( $args['id'] );
859
+    $sanitize_id = wpinv_sanitize_key($args['id']);
860 860
 
861
-	if ( isset( $args['placeholder'] ) ) {
861
+	if (isset($args['placeholder'])) {
862 862
 		$placeholder = $args['placeholder'];
863 863
 	} else {
864 864
 		$placeholder = '';
@@ -866,16 +866,16 @@  discard block
 block discarded – undo
866 866
 
867 867
 	$states = wpinv_get_country_states();
868 868
 
869
-	$class = empty( $states ) ? ' class="wpinv-no-states"' : ' class="wpi_select2"';
870
-	$html = '<select id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr( $args['id'] ) . ']"' . $class . 'data-placeholder="' . esc_html( $placeholder ) . '"/>';
869
+	$class = empty($states) ? ' class="wpinv-no-states"' : ' class="wpi_select2"';
870
+	$html = '<select id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr($args['id']) . ']"' . $class . 'data-placeholder="' . esc_html($placeholder) . '"/>';
871 871
 
872
-	foreach ( $states as $option => $name ) {
873
-		$selected = isset( $wpinv_options[ $args['id'] ] ) ? selected( $option, $wpinv_options[$args['id']], false ) : '';
874
-		$html .= '<option value="' . esc_attr( $option ) . '" ' . $selected . '>' . esc_html( $name ) . '</option>';
872
+	foreach ($states as $option => $name) {
873
+		$selected = isset($wpinv_options[$args['id']]) ? selected($option, $wpinv_options[$args['id']], false) : '';
874
+		$html .= '<option value="' . esc_attr($option) . '" ' . $selected . '>' . esc_html($name) . '</option>';
875 875
 	}
876 876
 
877 877
 	$html .= '</select>';
878
-	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> '  . wp_kses_post( $args['desc'] ) . '</label>';
878
+	$html .= '<label for="wpinv_settings[' . $sanitize_id . ']"> ' . wp_kses_post($args['desc']) . '</label>';
879 879
 
880 880
 	echo $html;
881 881
 }
@@ -890,96 +890,96 @@  discard block
 block discarded – undo
890 890
 	<table id="wpinv_tax_rates" class="wp-list-table widefat fixed posts">
891 891
 		<thead>
892 892
 			<tr>
893
-				<th scope="col" class="wpinv_tax_country"><?php _e( 'Country', 'invoicing' ); ?></th>
894
-				<th scope="col" class="wpinv_tax_state"><?php _e( 'State / Province', 'invoicing' ); ?></th>
895
-                <th scope="col" class="wpinv_tax_global" title="<?php esc_attr_e( 'Apply rate to whole country, regardless of state / province', 'invoicing' ); ?>"><?php _e( 'Country Wide', 'invoicing' ); ?></th>
896
-                <th scope="col" class="wpinv_tax_rate"><?php _e( 'Rate %', 'invoicing' ); ?></th> 
897
-                <th scope="col" class="wpinv_tax_name"><?php _e( 'Tax Name', 'invoicing' ); ?></th>
898
-				<th scope="col" class="wpinv_tax_action"><?php _e( 'Remove', 'invoicing' ); ?></th>
893
+				<th scope="col" class="wpinv_tax_country"><?php _e('Country', 'invoicing'); ?></th>
894
+				<th scope="col" class="wpinv_tax_state"><?php _e('State / Province', 'invoicing'); ?></th>
895
+                <th scope="col" class="wpinv_tax_global" title="<?php esc_attr_e('Apply rate to whole country, regardless of state / province', 'invoicing'); ?>"><?php _e('Country Wide', 'invoicing'); ?></th>
896
+                <th scope="col" class="wpinv_tax_rate"><?php _e('Rate %', 'invoicing'); ?></th> 
897
+                <th scope="col" class="wpinv_tax_name"><?php _e('Tax Name', 'invoicing'); ?></th>
898
+				<th scope="col" class="wpinv_tax_action"><?php _e('Remove', 'invoicing'); ?></th>
899 899
 			</tr>
900 900
 		</thead>
901 901
         <tbody>
902
-		<?php if( !empty( $rates ) ) : ?>
903
-			<?php foreach( $rates as $key => $rate ) : ?>
902
+		<?php if (!empty($rates)) : ?>
903
+			<?php foreach ($rates as $key => $rate) : ?>
904 904
             <?php 
905
-            $sanitized_key = wpinv_sanitize_key( $key );
905
+            $sanitized_key = wpinv_sanitize_key($key);
906 906
             ?>
907 907
 			<tr>
908 908
 				<td class="wpinv_tax_country">
909 909
 					<?php
910
-					echo wpinv_html_select( array(
911
-						'options'          => wpinv_get_country_list( true ),
910
+					echo wpinv_html_select(array(
911
+						'options'          => wpinv_get_country_list(true),
912 912
 						'name'             => 'tax_rates[' . $sanitized_key . '][country]',
913 913
                         'id'               => 'tax_rates[' . $sanitized_key . '][country]',
914 914
 						'selected'         => $rate['country'],
915 915
 						'show_option_all'  => false,
916 916
 						'show_option_none' => false,
917 917
 						'class'            => 'wpinv-tax-country wpi_select2',
918
-						'placeholder'      => __( 'Choose a country', 'invoicing' )
919
-					) );
918
+						'placeholder'      => __('Choose a country', 'invoicing')
919
+					));
920 920
 					?>
921 921
 				</td>
922 922
 				<td class="wpinv_tax_state">
923 923
 					<?php
924
-					$states = wpinv_get_country_states( $rate['country'] );
925
-					if( !empty( $states ) ) {
926
-						echo wpinv_html_select( array(
927
-							'options'          => array_merge( array( '' => '' ), $states ),
924
+					$states = wpinv_get_country_states($rate['country']);
925
+					if (!empty($states)) {
926
+						echo wpinv_html_select(array(
927
+							'options'          => array_merge(array('' => ''), $states),
928 928
 							'name'             => 'tax_rates[' . $sanitized_key . '][state]',
929 929
                             'id'               => 'tax_rates[' . $sanitized_key . '][state]',
930 930
 							'selected'         => $rate['state'],
931 931
 							'show_option_all'  => false,
932 932
 							'show_option_none' => false,
933 933
                             'class'            => 'wpi_select2',
934
-							'placeholder'      => __( 'Choose a state', 'invoicing' )
935
-						) );
934
+							'placeholder'      => __('Choose a state', 'invoicing')
935
+						));
936 936
 					} else {
937
-						echo wpinv_html_text( array(
937
+						echo wpinv_html_text(array(
938 938
 							'name'  => 'tax_rates[' . $sanitized_key . '][state]', $rate['state'],
939
-							'value' => ! empty( $rate['state'] ) ? $rate['state'] : '',
939
+							'value' => !empty($rate['state']) ? $rate['state'] : '',
940 940
                             'id'    => 'tax_rates[' . $sanitized_key . '][state]',
941
-						) );
941
+						));
942 942
 					}
943 943
 					?>
944 944
 				</td>
945 945
 				<td class="wpinv_tax_global">
946
-					<input type="checkbox" name="tax_rates[<?php echo $sanitized_key; ?>][global]" id="tax_rates[<?php echo $sanitized_key; ?>][global]" value="1"<?php checked( true, ! empty( $rate['global'] ) ); ?>/>
947
-					<label for="tax_rates[<?php echo $sanitized_key; ?>][global]"><?php _e( 'Apply to whole country', 'invoicing' ); ?></label>
946
+					<input type="checkbox" name="tax_rates[<?php echo $sanitized_key; ?>][global]" id="tax_rates[<?php echo $sanitized_key; ?>][global]" value="1"<?php checked(true, !empty($rate['global'])); ?>/>
947
+					<label for="tax_rates[<?php echo $sanitized_key; ?>][global]"><?php _e('Apply to whole country', 'invoicing'); ?></label>
948 948
 				</td>
949
-				<td class="wpinv_tax_rate"><input type="number" class="small-text" step="any" min="0" max="99" name="tax_rates[<?php echo $sanitized_key; ?>][rate]" value="<?php echo esc_html( $rate['rate'] ); ?>"/></td>
950
-                <td class="wpinv_tax_name"><input type="text" class="regular-text" name="tax_rates[<?php echo $sanitized_key; ?>][name]" value="<?php echo esc_html( $rate['name'] ); ?>"/></td>
951
-				<td class="wpinv_tax_action"><span class="wpinv_remove_tax_rate button-secondary"><?php _e( 'Remove Rate', 'invoicing' ); ?></span></td>
949
+				<td class="wpinv_tax_rate"><input type="number" class="small-text" step="any" min="0" max="99" name="tax_rates[<?php echo $sanitized_key; ?>][rate]" value="<?php echo esc_html($rate['rate']); ?>"/></td>
950
+                <td class="wpinv_tax_name"><input type="text" class="regular-text" name="tax_rates[<?php echo $sanitized_key; ?>][name]" value="<?php echo esc_html($rate['name']); ?>"/></td>
951
+				<td class="wpinv_tax_action"><span class="wpinv_remove_tax_rate button-secondary"><?php _e('Remove Rate', 'invoicing'); ?></span></td>
952 952
 			</tr>
953 953
 			<?php endforeach; ?>
954 954
 		<?php else : ?>
955 955
 			<tr>
956 956
 				<td class="wpinv_tax_country">
957 957
 					<?php
958
-					echo wpinv_html_select( array(
959
-						'options'          => wpinv_get_country_list( true ),
958
+					echo wpinv_html_select(array(
959
+						'options'          => wpinv_get_country_list(true),
960 960
 						'name'             => 'tax_rates[0][country]',
961 961
 						'show_option_all'  => false,
962 962
 						'show_option_none' => false,
963 963
 						'class'            => 'wpinv-tax-country wpi_select2',
964
-						'placeholder'      => __( 'Choose a country', 'invoicing' )
965
-					) ); ?>
964
+						'placeholder'      => __('Choose a country', 'invoicing')
965
+					)); ?>
966 966
 				</td>
967 967
 				<td class="wpinv_tax_state">
968
-					<?php echo wpinv_html_text( array(
968
+					<?php echo wpinv_html_text(array(
969 969
 						'name' => 'tax_rates[0][state]'
970
-					) ); ?>
970
+					)); ?>
971 971
 				</td>
972 972
 				<td class="wpinv_tax_global">
973 973
 					<input type="checkbox" name="tax_rates[0][global]" id="tax_rates[0][global]" value="1"/>
974
-					<label for="tax_rates[0][global]"><?php _e( 'Apply to whole country', 'invoicing' ); ?></label>
974
+					<label for="tax_rates[0][global]"><?php _e('Apply to whole country', 'invoicing'); ?></label>
975 975
 				</td>
976
-				<td class="wpinv_tax_rate"><input type="number" class="small-text" step="any" min="0" max="99" name="tax_rates[0][rate]" placeholder="<?php echo (float)wpinv_get_option( 'tax_rate', 0 ) ;?>" value="<?php echo (float)wpinv_get_option( 'tax_rate', 0 ) ;?>"/></td>
976
+				<td class="wpinv_tax_rate"><input type="number" class="small-text" step="any" min="0" max="99" name="tax_rates[0][rate]" placeholder="<?php echo (float) wpinv_get_option('tax_rate', 0); ?>" value="<?php echo (float) wpinv_get_option('tax_rate', 0); ?>"/></td>
977 977
                 <td class="wpinv_tax_name"><input type="text" class="regular-text" name="tax_rates[0][name]" /></td>
978
-				<td><span class="wpinv_remove_tax_rate button-secondary"><?php _e( 'Remove Rate', 'invoicing' ); ?></span></td>
978
+				<td><span class="wpinv_remove_tax_rate button-secondary"><?php _e('Remove Rate', 'invoicing'); ?></span></td>
979 979
 			</tr>
980 980
 		<?php endif; ?>
981 981
         </tbody>
982
-        <tfoot><tr><td colspan="5"></td><td class="wpinv_tax_action"><span class="button-secondary" id="wpinv_add_tax_rate"><?php _e( 'Add Tax Rate', 'invoicing' ); ?></span></td></tr></tfoot>
982
+        <tfoot><tr><td colspan="5"></td><td class="wpinv_tax_action"><span class="button-secondary" id="wpinv_add_tax_rate"><?php _e('Add Tax Rate', 'invoicing'); ?></span></td></tr></tfoot>
983 983
 	</table>
984 984
 	<?php
985 985
 	echo ob_get_clean();
@@ -990,76 +990,76 @@  discard block
 block discarded – undo
990 990
     ob_start(); ?>
991 991
     </td><tr>
992 992
     <td colspan="2" class="wpinv_tools_tdbox">
993
-    <?php if ( $args['desc'] ) { ?><p><?php echo $args['desc']; ?></p><?php } ?>
994
-    <?php do_action( 'wpinv_tools_before' ); ?>
993
+    <?php if ($args['desc']) { ?><p><?php echo $args['desc']; ?></p><?php } ?>
994
+    <?php do_action('wpinv_tools_before'); ?>
995 995
     <table id="wpinv_tools_table" class="wp-list-table widefat fixed posts">
996 996
         <thead>
997 997
             <tr>
998
-                <th scope="col" class="wpinv-th-tool"><?php _e( 'Tool', 'invoicing' ); ?></th>
999
-                <th scope="col" class="wpinv-th-desc"><?php _e( 'Description', 'invoicing' ); ?></th>
1000
-                <th scope="col" class="wpinv-th-action"><?php _e( 'Action', 'invoicing' ); ?></th>
998
+                <th scope="col" class="wpinv-th-tool"><?php _e('Tool', 'invoicing'); ?></th>
999
+                <th scope="col" class="wpinv-th-desc"><?php _e('Description', 'invoicing'); ?></th>
1000
+                <th scope="col" class="wpinv-th-action"><?php _e('Action', 'invoicing'); ?></th>
1001 1001
             </tr>
1002 1002
         </thead>
1003
-            <?php do_action( 'wpinv_tools_row' ); ?>
1003
+            <?php do_action('wpinv_tools_row'); ?>
1004 1004
         <tbody>
1005 1005
         </tbody>
1006 1006
     </table>
1007
-    <?php do_action( 'wpinv_tools_after' ); ?>
1007
+    <?php do_action('wpinv_tools_after'); ?>
1008 1008
     <?php
1009 1009
     echo ob_get_clean();
1010 1010
 }
1011 1011
 
1012
-function wpinv_descriptive_text_callback( $args ) {
1013
-	echo wp_kses_post( $args['desc'] );
1012
+function wpinv_descriptive_text_callback($args) {
1013
+	echo wp_kses_post($args['desc']);
1014 1014
 }
1015 1015
 
1016
-function wpinv_hook_callback( $args ) {
1017
-	do_action( 'wpinv_' . $args['id'], $args );
1016
+function wpinv_hook_callback($args) {
1017
+	do_action('wpinv_' . $args['id'], $args);
1018 1018
 }
1019 1019
 
1020 1020
 function wpinv_set_settings_cap() {
1021 1021
 	return wpinv_get_capability();
1022 1022
 }
1023
-add_filter( 'option_page_capability_wpinv_settings', 'wpinv_set_settings_cap' );
1023
+add_filter('option_page_capability_wpinv_settings', 'wpinv_set_settings_cap');
1024 1024
 
1025
-function wpinv_settings_sanitize_input( $value, $key ) {
1026
-    if ( $key == 'tax_rate' || $key == 'eu_fallback_rate' ) {
1027
-        $value = wpinv_sanitize_amount( $value, 4 );
1025
+function wpinv_settings_sanitize_input($value, $key) {
1026
+    if ($key == 'tax_rate' || $key == 'eu_fallback_rate') {
1027
+        $value = wpinv_sanitize_amount($value, 4);
1028 1028
         $value = $value >= 100 ? 99 : $value;
1029 1029
     }
1030 1030
         
1031 1031
     return $value;
1032 1032
 }
1033
-add_filter( 'wpinv_settings_sanitize', 'wpinv_settings_sanitize_input', 10, 2 );
1033
+add_filter('wpinv_settings_sanitize', 'wpinv_settings_sanitize_input', 10, 2);
1034 1034
 
1035
-function wpinv_on_update_settings( $old_value, $value, $option ) {
1036
-    $old = !empty( $old_value['remove_data_on_unistall'] ) ? 1 : '';
1037
-    $new = !empty( $value['remove_data_on_unistall'] ) ? 1 : '';
1035
+function wpinv_on_update_settings($old_value, $value, $option) {
1036
+    $old = !empty($old_value['remove_data_on_unistall']) ? 1 : '';
1037
+    $new = !empty($value['remove_data_on_unistall']) ? 1 : '';
1038 1038
     
1039
-    if ( $old != $new ) {
1040
-        update_option( 'wpinv_remove_data_on_invoice_unistall', $new );
1039
+    if ($old != $new) {
1040
+        update_option('wpinv_remove_data_on_invoice_unistall', $new);
1041 1041
     }
1042 1042
 }
1043
-add_action( 'update_option_wpinv_settings', 'wpinv_on_update_settings', 10, 3 );
1044
-add_action( 'wpinv_settings_tab_bottom_emails_new_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2 );
1045
-add_action( 'wpinv_settings_tab_bottom_emails_cancelled_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2 );
1046
-add_action( 'wpinv_settings_tab_bottom_emails_failed_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2 );
1047
-add_action( 'wpinv_settings_tab_bottom_emails_onhold_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2 );
1048
-add_action( 'wpinv_settings_tab_bottom_emails_processing_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2 );
1049
-add_action( 'wpinv_settings_tab_bottom_emails_completed_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2 );
1050
-add_action( 'wpinv_settings_tab_bottom_emails_refunded_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2 );
1051
-add_action( 'wpinv_settings_tab_bottom_emails_user_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2 );
1052
-add_action( 'wpinv_settings_tab_bottom_emails_user_note', 'wpinv_settings_tab_bottom_emails', 10, 2 );
1053
-add_action( 'wpinv_settings_tab_bottom_emails_overdue', 'wpinv_settings_tab_bottom_emails', 10, 2 );
1054
-
1055
-function wpinv_settings_tab_bottom_emails( $active_tab, $section ) {
1043
+add_action('update_option_wpinv_settings', 'wpinv_on_update_settings', 10, 3);
1044
+add_action('wpinv_settings_tab_bottom_emails_new_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2);
1045
+add_action('wpinv_settings_tab_bottom_emails_cancelled_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2);
1046
+add_action('wpinv_settings_tab_bottom_emails_failed_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2);
1047
+add_action('wpinv_settings_tab_bottom_emails_onhold_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2);
1048
+add_action('wpinv_settings_tab_bottom_emails_processing_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2);
1049
+add_action('wpinv_settings_tab_bottom_emails_completed_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2);
1050
+add_action('wpinv_settings_tab_bottom_emails_refunded_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2);
1051
+add_action('wpinv_settings_tab_bottom_emails_user_invoice', 'wpinv_settings_tab_bottom_emails', 10, 2);
1052
+add_action('wpinv_settings_tab_bottom_emails_user_note', 'wpinv_settings_tab_bottom_emails', 10, 2);
1053
+add_action('wpinv_settings_tab_bottom_emails_overdue', 'wpinv_settings_tab_bottom_emails', 10, 2);
1054
+
1055
+function wpinv_settings_tab_bottom_emails($active_tab, $section) {
1056 1056
     ?>
1057 1057
     <div class="wpinv-email-wc-row ">
1058 1058
         <div class="wpinv-email-wc-td">
1059
-            <h3 class="wpinv-email-wc-title"><?php echo apply_filters( 'wpinv_settings_email_wildcards_title', __( 'Wildcards For Emails', 'invoicing' ) ); ?></h3>
1059
+            <h3 class="wpinv-email-wc-title"><?php echo apply_filters('wpinv_settings_email_wildcards_title', __('Wildcards For Emails', 'invoicing')); ?></h3>
1060 1060
             <p class="wpinv-email-wc-description">
1061 1061
                 <?php
1062
-                $description = __( 'The following wildcards can be used in email subjects, heading and content:<br>
1062
+                $description = __('The following wildcards can be used in email subjects, heading and content:<br>
1063 1063
                     <strong>{site_title} :</strong> Site Title<br>
1064 1064
                     <strong>{name} :</strong> Customer\'s full name<br>
1065 1065
                     <strong>{first_name} :</strong> Customer\'s first name<br>
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
                     <strong>{invoice_due_date} :</strong> The date the invoice is due<br>
1074 1074
                     <strong>{date} :</strong> Today\'s date.<br>
1075 1075
                     <strong>{is_was} :</strong> If due date of invoice is past, displays "was" otherwise displays "is"<br>
1076
-                    <strong>{invoice_label} :</strong> Invoices/quotes singular name. Ex: Invoice/Quote<br>', 'invoicing' );
1076
+                    <strong>{invoice_label} :</strong> Invoices/quotes singular name. Ex: Invoice/Quote<br>', 'invoicing');
1077 1077
                 echo apply_filters('wpinv_settings_email_wildcards_description', $description, $active_tab, $section);
1078 1078
                 ?>
1079 1079
             </p>
Please login to merge, or discard this patch.
includes/data/admin-settings.php 1 patch
Spacing   +143 added lines, -143 removed lines patch added patch discarded remove patch
@@ -8,201 +8,201 @@  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 = is_numeric( $last_invoice_number ) ? $last_invoice_number : wpinv_clean_invoice_number( $last_invoice_number );
36
+if ($last_invoice_number = get_option('wpinv_last_invoice_number')) {
37
+    $last_invoice_number = is_numeric($last_invoice_number) ? $last_invoice_number : wpinv_clean_invoice_number($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
                 ),
112 112
                 'tandc_page' => array(
113 113
                     'id'          => 'tandc_page',
114
-                    'name'        => __( 'Terms & Conditions', 'invoicing' ),
115
-                    'desc'        => __( 'If you select a "Terms & Conditions" page here the customer will be asked to accept them on checkout.', 'invoicing' ),
114
+                    'name'        => __('Terms & Conditions', 'invoicing'),
115
+                    'desc'        => __('If you select a "Terms & Conditions" page here the customer will be asked to accept them on checkout.', 'invoicing'),
116 116
                     'type'        => 'select',
117
-                    'options'     => wpinv_get_pages( true,  __( 'Select a page', 'invoicing' )),
117
+                    'options'     => wpinv_get_pages(true, __('Select a page', 'invoicing')),
118 118
                     'class'       => 'wpi_select2',
119
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
119
+                    'placeholder' => __('Select a page', 'invoicing'),
120 120
                 ),
121 121
                 'success_page' => array(
122 122
                     'id'          => 'success_page',
123
-                    'name'        => __( 'Success Page', 'invoicing' ),
124
-                    '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' ),
123
+                    'name'        => __('Success Page', 'invoicing'),
124
+                    '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'),
125 125
                     'type'        => 'select',
126 126
                     'options'     => $pages,
127 127
                     'class'       => 'wpi_select2',
128
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
128
+                    'placeholder' => __('Select a page', 'invoicing'),
129 129
                 ),
130 130
                 'failure_page' => array(
131 131
                     'id'          => 'failure_page',
132
-                    'name'        => __( 'Failed Transaction Page', 'invoicing' ),
133
-                    'desc'        => __( 'This is the page buyers are sent to if their transaction is cancelled or fails.', 'invoicing' ),
132
+                    'name'        => __('Failed Transaction Page', 'invoicing'),
133
+                    'desc'        => __('This is the page buyers are sent to if their transaction is cancelled or fails.', 'invoicing'),
134 134
                     'type'        => 'select',
135 135
                     'options'     => $pages,
136 136
                     'class'       => 'wpi_select2',
137
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
137
+                    'placeholder' => __('Select a page', 'invoicing'),
138 138
                 ),
139 139
                 'invoice_history_page' => array(
140 140
                     'id'          => 'invoice_history_page',
141
-                    'name'        => __( 'Invoice History Page', 'invoicing' ),
142
-                    'desc'        => __( 'This page shows an invoice history for the current user. The <b>[wpinv_history]</b> short code should be on this page.', 'invoicing' ),
141
+                    'name'        => __('Invoice History Page', 'invoicing'),
142
+                    'desc'        => __('This page shows an invoice history for the current user. The <b>[wpinv_history]</b> short code should be on this page.', 'invoicing'),
143 143
                     'type'        => 'select',
144 144
                     'options'     => $pages,
145 145
                     'class'       => 'wpi_select2',
146
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
146
+                    'placeholder' => __('Select a page', 'invoicing'),
147 147
                 ),
148 148
                 'invoice_subscription_page' => array(
149 149
                     'id'          => 'invoice_subscription_page',
150
-                    'name'        => __( 'Invoice Subscriptions Page', 'invoicing' ),
151
-                    'desc'        => __( 'This page shows subscriptions history for the current user. The <b>[wpinv_subscriptions]</b> short code should be on this page.', 'invoicing' ),
150
+                    'name'        => __('Invoice Subscriptions Page', 'invoicing'),
151
+                    'desc'        => __('This page shows subscriptions history for the current user. The <b>[wpinv_subscriptions]</b> short code should be on this page.', 'invoicing'),
152 152
                     'type'        => 'select',
153 153
                     'options'     => $pages,
154 154
                     'class'       => 'wpi_select2',
155
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
155
+                    'placeholder' => __('Select a page', 'invoicing'),
156 156
                 ),
157 157
             ),
158 158
             'currency_section' => array(
159 159
                 'currency_settings' => array(
160 160
                     'id'   => 'currency_settings',
161
-                    'name' => '<h3>' . __( 'Currency Settings', 'invoicing' ) . '</h3>',
161
+                    'name' => '<h3>' . __('Currency Settings', 'invoicing') . '</h3>',
162 162
                     'desc' => '',
163 163
                     'type' => 'header',
164 164
                 ),
165 165
                 'currency' => array(
166 166
                     'id'      => 'currency',
167
-                    'name'    => __( 'Currency', 'invoicing' ),
168
-                    'desc'    => __( 'Choose your currency. Note that some payment gateways have currency restrictions.', 'invoicing' ),
167
+                    'name'    => __('Currency', 'invoicing'),
168
+                    'desc'    => __('Choose your currency. Note that some payment gateways have currency restrictions.', 'invoicing'),
169 169
                     'type'    => 'select',
170 170
                     'class'       => 'wpi_select2',
171 171
                     'options' => $currency_code_options,
172 172
                 ),
173 173
                 'currency_position' => array(
174 174
                     'id'      => 'currency_position',
175
-                    'name'    => __( 'Currency Position', 'invoicing' ),
176
-                    'desc'    => __( 'Choose the location of the currency sign.', 'invoicing' ),
175
+                    'name'    => __('Currency Position', 'invoicing'),
176
+                    'desc'    => __('Choose the location of the currency sign.', 'invoicing'),
177 177
                     'type'    => 'select',
178 178
                     'class'   => 'wpi_select2',
179 179
                     'options'  => array(
180
-                        'left'        => __( 'Left', 'invoicing' ) . ' (' . $currency_symbol . wpinv_format_amount( '99.99' ) . ')',
181
-                        'right'       => __( 'Right', 'invoicing' ) . ' ('. wpinv_format_amount( '99.99' ) . $currency_symbol . ')',
182
-                        'left_space'  => __( 'Left with space', 'invoicing' ) . ' (' . $currency_symbol . ' ' . wpinv_format_amount( '99.99' ) . ')',
183
-                        'right_space' => __( 'Right with space', 'invoicing' ) . ' (' . wpinv_format_amount( '99.99' ) . ' ' . $currency_symbol . ')'
180
+                        'left'        => __('Left', 'invoicing') . ' (' . $currency_symbol . wpinv_format_amount('99.99') . ')',
181
+                        'right'       => __('Right', 'invoicing') . ' (' . wpinv_format_amount('99.99') . $currency_symbol . ')',
182
+                        'left_space'  => __('Left with space', 'invoicing') . ' (' . $currency_symbol . ' ' . wpinv_format_amount('99.99') . ')',
183
+                        'right_space' => __('Right with space', 'invoicing') . ' (' . wpinv_format_amount('99.99') . ' ' . $currency_symbol . ')'
184 184
                     )
185 185
                 ),
186 186
                 'thousands_separator' => array(
187 187
                     'id'   => 'thousands_separator',
188
-                    'name' => __( 'Thousands Separator', 'invoicing' ),
189
-                    'desc' => __( 'The symbol (usually , or .) to separate thousands', 'invoicing' ),
188
+                    'name' => __('Thousands Separator', 'invoicing'),
189
+                    'desc' => __('The symbol (usually , or .) to separate thousands', 'invoicing'),
190 190
                     'type' => 'text',
191 191
                     'size' => 'small',
192 192
                     'std'  => ',',
193 193
                 ),
194 194
                 'decimal_separator' => array(
195 195
                     'id'   => 'decimal_separator',
196
-                    'name' => __( 'Decimal Separator', 'invoicing' ),
197
-                    'desc' => __( 'The symbol (usually , or .) to separate decimal points', 'invoicing' ),
196
+                    'name' => __('Decimal Separator', 'invoicing'),
197
+                    'desc' => __('The symbol (usually , or .) to separate decimal points', 'invoicing'),
198 198
                     'type' => 'text',
199 199
                     'size' => 'small',
200 200
                     'std'  => '.',
201 201
                 ),
202 202
                 'decimals' => array(
203 203
                     'id'   => 'decimals',
204
-                    'name' => __( 'Number of Decimals', 'invoicing' ),
205
-                    'desc' => __( 'This sets the number of decimal points shown in displayed prices.', 'invoicing' ),
204
+                    'name' => __('Number of Decimals', 'invoicing'),
205
+                    'desc' => __('This sets the number of decimal points shown in displayed prices.', 'invoicing'),
206 206
                     'type' => 'number',
207 207
                     'size' => 'small',
208 208
                     'std'  => '2',
@@ -214,29 +214,29 @@  discard block
 block discarded – undo
214 214
             'labels' => array(
215 215
                 'labels' => array(
216 216
                     'id'   => 'labels_settings',
217
-                    'name' => '<h3>' . __( 'Invoice Labels', 'invoicing' ) . '</h3>',
217
+                    'name' => '<h3>' . __('Invoice Labels', 'invoicing') . '</h3>',
218 218
                     'desc' => '',
219 219
                     'type' => 'header',
220 220
                 ),
221 221
                 'vat_name' => array(
222 222
                     'id' => 'vat_name',
223
-                    'name' => __( 'VAT Name', 'invoicing' ),
224
-                    'desc' => __( 'Enter the VAT name', 'invoicing' ),
223
+                    'name' => __('VAT Name', 'invoicing'),
224
+                    'desc' => __('Enter the VAT name', 'invoicing'),
225 225
                     'type' => 'text',
226 226
                     'size' => 'regular',
227
-                    'std' => __( 'VAT', 'invoicing' ),
227
+                    'std' => __('VAT', 'invoicing'),
228 228
                 ),
229 229
                 'vat_invoice_notice_label' => array(
230 230
                     'id' => 'vat_invoice_notice_label',
231
-                    'name' => __( 'Invoice Notice Label', 'invoicing' ),
232
-                    'desc' => __( 'Use this to add an invoice notice section (label) to your invoices', 'invoicing' ),
231
+                    'name' => __('Invoice Notice Label', 'invoicing'),
232
+                    'desc' => __('Use this to add an invoice notice section (label) to your invoices', 'invoicing'),
233 233
                     'type' => 'text',
234 234
                     'size' => 'regular',
235 235
                 ),
236 236
                 'vat_invoice_notice' => array(
237 237
                     'id' => 'vat_invoice_notice',
238
-                    'name' => __( 'Invoice notice', 'invoicing' ),
239
-                    'desc' =>   __( 'Use this to add an invoice notice section (description) to your invoices', 'invoicing' ),
238
+                    'name' => __('Invoice notice', 'invoicing'),
239
+                    'desc' =>   __('Use this to add an invoice notice section (description) to your invoices', 'invoicing'),
240 240
                     'type' => 'text',
241 241
                     'size' => 'regular',
242 242
                 ),
@@ -248,22 +248,22 @@  discard block
 block discarded – undo
248 248
             'main' => array(
249 249
                 'gateway_settings' => array(
250 250
                     'id'   => 'api_header',
251
-                    'name' => '<h3>' . __( 'Gateway Settings', 'invoicing' ) . '</h3>',
251
+                    'name' => '<h3>' . __('Gateway Settings', 'invoicing') . '</h3>',
252 252
                     'desc' => '',
253 253
                     'type' => 'header',
254 254
                 ),
255 255
                 'gateways' => array(
256 256
                     'id'      => 'gateways',
257
-                    'name'    => __( 'Payment Gateways', 'invoicing' ),
258
-                    'desc'    => __( 'Choose the payment gateways you want to enable.', 'invoicing' ),
257
+                    'name'    => __('Payment Gateways', 'invoicing'),
258
+                    'desc'    => __('Choose the payment gateways you want to enable.', 'invoicing'),
259 259
                     'type'    => 'gateways',
260 260
                     'std'     => array('manual'=>1),
261 261
                     'options' => wpinv_get_payment_gateways(),
262 262
                 ),
263 263
                 'default_gateway' => array(
264 264
                     'id'      => 'default_gateway',
265
-                    'name'    => __( 'Default Gateway', 'invoicing' ),
266
-                    'desc'    => __( 'This gateway will be loaded automatically with the checkout page.', 'invoicing' ),
265
+                    'name'    => __('Default Gateway', 'invoicing'),
266
+                    'desc'    => __('This gateway will be loaded automatically with the checkout page.', 'invoicing'),
267 267
                     'type'    => 'gateway_select',
268 268
                     'std'     => 'manual',
269 269
                     'class'   => 'wpi_select2',
@@ -278,19 +278,19 @@  discard block
 block discarded – undo
278 278
             'main' => array(
279 279
                 'tax_settings' => array(
280 280
                     'id'   => 'tax_settings',
281
-                    'name' => '<h3>' . __( 'Tax Settings', 'invoicing' ) . '</h3>',
281
+                    'name' => '<h3>' . __('Tax Settings', 'invoicing') . '</h3>',
282 282
                     'type' => 'header',
283 283
                 ),
284 284
                 'enable_taxes' => array(
285 285
                     'id'   => 'enable_taxes',
286
-                    'name' => __( 'Enable Taxes', 'invoicing' ),
287
-                    'desc' => __( 'Check this to enable taxes on invoices.', 'invoicing' ),
286
+                    'name' => __('Enable Taxes', 'invoicing'),
287
+                    'desc' => __('Check this to enable taxes on invoices.', 'invoicing'),
288 288
                     'type' => 'checkbox',
289 289
                 ),
290 290
                 'tax_rate' => array(
291 291
                     'id'   => 'tax_rate',
292
-                    'name' => __( 'Fallback Tax Rate', 'invoicing' ),
293
-                    'desc' => __( 'Enter a percentage, such as 6.5. Customers not in a specific rate will be charged this rate.', 'invoicing' ),
292
+                    'name' => __('Fallback Tax Rate', 'invoicing'),
293
+                    'desc' => __('Enter a percentage, such as 6.5. Customers not in a specific rate will be charged this rate.', 'invoicing'),
294 294
                     'type' => 'number',
295 295
                     'size' => 'small',
296 296
                     'min'  => '0',
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
             'rates' => array(
303 303
                 'tax_rates' => array(
304 304
                     'id'   => 'tax_rates',
305
-                    'name' => '<h3>' . __( 'Tax Rates', 'invoicing' ) . '</h3>',
306
-                    'desc' => __( 'Enter tax rates for specific regions.', 'invoicing' ),
305
+                    'name' => '<h3>' . __('Tax Rates', 'invoicing') . '</h3>',
306
+                    'desc' => __('Enter tax rates for specific regions.', 'invoicing'),
307 307
                     'type' => 'tax_rates',
308 308
                 ),
309 309
             )
@@ -315,68 +315,68 @@  discard block
 block discarded – undo
315 315
             'main' => array(
316 316
                 'email_settings_header' => array(
317 317
                     'id'   => 'email_settings_header',
318
-                    'name' => '<h3>' . __( 'Email Sender Options', 'invoicing' ) . '</h3>',
318
+                    'name' => '<h3>' . __('Email Sender Options', 'invoicing') . '</h3>',
319 319
                     'type' => 'header',
320 320
                 ),
321 321
                 'email_from_name' => array(
322 322
                     'id'   => 'email_from_name',
323
-                    'name' => __( 'From Name', 'invoicing' ),
324
-                    'desc' => __( 'Enter the sender\'s name appears in outgoing invoice emails. This should be your site name.', 'invoicing' ),
325
-                    'std' => esc_attr( get_bloginfo( 'name', 'display' ) ),
323
+                    'name' => __('From Name', 'invoicing'),
324
+                    'desc' => __('Enter the sender\'s name appears in outgoing invoice emails. This should be your site name.', 'invoicing'),
325
+                    'std' => esc_attr(get_bloginfo('name', 'display')),
326 326
                     'type' => 'text',
327 327
                 ),
328 328
                 'email_from' => array(
329 329
                     'id'   => 'email_from',
330
-                    'name' => __( 'From Email', 'invoicing' ),
331
-                    '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),
332
-                    'std' => get_option( 'admin_email' ),
330
+                    'name' => __('From Email', 'invoicing'),
331
+                    '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),
332
+                    'std' => get_option('admin_email'),
333 333
                     'type' => 'text',
334 334
                 ),
335 335
                 'admin_email' => array(
336 336
                     'id'   => 'admin_email',
337
-                    'name' => __( 'Admin Email', 'invoicing' ),
338
-                    'desc' => __( 'Where should we send admin notifications?', 'invoicing' ),
339
-                    'std' => get_option( 'admin_email' ),
337
+                    'name' => __('Admin Email', 'invoicing'),
338
+                    'desc' => __('Where should we send admin notifications?', 'invoicing'),
339
+                    'std' => get_option('admin_email'),
340 340
                     'type' => 'text',
341 341
                 ),
342 342
                 'overdue_settings_header' => array(
343 343
                     'id'   => 'overdue_settings_header',
344
-                    'name' => '<h3>' . __( 'Due Date Settings', 'invoicing' ) . '</h3>',
344
+                    'name' => '<h3>' . __('Due Date Settings', 'invoicing') . '</h3>',
345 345
                     'type' => 'header',
346 346
                 ),
347 347
                 'overdue_active' => array(
348 348
                     'id'   => 'overdue_active',
349
-                    'name' => __( 'Enable Due Date', 'invoicing' ),
350
-                    'desc' => __( 'Check this to enable due date option for invoices.', 'invoicing' ),
349
+                    'name' => __('Enable Due Date', 'invoicing'),
350
+                    'desc' => __('Check this to enable due date option for invoices.', 'invoicing'),
351 351
                     'type' => 'checkbox',
352 352
                     'std'  => false,
353 353
                 ),
354 354
                 'overdue_days' => array(
355 355
                     'id'          => 'overdue_days',
356
-                    'name'        => __( 'Default Due Date', 'invoicing' ),
357
-                    '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' ),
356
+                    'name'        => __('Default Due Date', 'invoicing'),
357
+                    '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'),
358 358
                     'type'        => 'select',
359 359
                     'options'     => $due_payment_options,
360 360
                     'std'         => 0,
361
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
361
+                    'placeholder' => __('Select a page', 'invoicing'),
362 362
                 ),
363 363
                 'email_template_header' => array(
364 364
                     'id'   => 'email_template_header',
365
-                    'name' => '<h3>' . __( 'Email Template', 'invoicing' ) . '</h3>',
365
+                    'name' => '<h3>' . __('Email Template', 'invoicing') . '</h3>',
366 366
                     'type' => 'header',
367 367
                 ),
368 368
                 'email_header_image' => array(
369 369
                     'id'   => 'email_header_image',
370
-                    'name' => __( 'Header Image', 'invoicing' ),
371
-                    'desc' => __( 'URL to an image you want to show in the email header. Upload images using the media uploader (Admin > Media).', 'invoicing' ),
370
+                    'name' => __('Header Image', 'invoicing'),
371
+                    'desc' => __('URL to an image you want to show in the email header. Upload images using the media uploader (Admin > Media).', 'invoicing'),
372 372
                     'std' => '',
373 373
                     'type' => 'text',
374 374
                 ),
375 375
                 'email_footer_text' => array(
376 376
                     'id'   => 'email_footer_text',
377
-                    'name' => __( 'Footer Text', 'invoicing' ),
378
-                    'desc' => __( 'The text to appear in the footer of all invoice emails.', 'invoicing' ),
379
-                    'std' => get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by GeoDirectory', 'invoicing' ),
377
+                    'name' => __('Footer Text', 'invoicing'),
378
+                    'desc' => __('The text to appear in the footer of all invoice emails.', 'invoicing'),
379
+                    'std' => get_bloginfo('name', 'display') . ' - ' . __('Powered by GeoDirectory', 'invoicing'),
380 380
                     'type' => 'textarea',
381 381
                     'class' => 'regular-text',
382 382
                     'rows' => 2,
@@ -384,29 +384,29 @@  discard block
 block discarded – undo
384 384
                 ),
385 385
                 'email_base_color' => array(
386 386
                     'id'   => 'email_base_color',
387
-                    'name' => __( 'Base Color', 'invoicing' ),
388
-                    'desc' => __( 'The base color for invoice email template. Default <code>#557da2</code>.', 'invoicing' ),
387
+                    'name' => __('Base Color', 'invoicing'),
388
+                    'desc' => __('The base color for invoice email template. Default <code>#557da2</code>.', 'invoicing'),
389 389
                     'std' => '#557da2',
390 390
                     'type' => 'color',
391 391
                 ),
392 392
                 'email_background_color' => array(
393 393
                     'id'   => 'email_background_color',
394
-                    'name' => __( 'Background Color', 'invoicing' ),
395
-                    'desc' => __( 'The background color of email template. Default <code>#f5f5f5</code>.', 'invoicing' ),
394
+                    'name' => __('Background Color', 'invoicing'),
395
+                    'desc' => __('The background color of email template. Default <code>#f5f5f5</code>.', 'invoicing'),
396 396
                     'std' => '#f5f5f5',
397 397
                     'type' => 'color',
398 398
                 ),
399 399
                 'email_body_background_color' => array(
400 400
                     'id'   => 'email_body_background_color',
401
-                    'name' => __( 'Body Background Color', 'invoicing' ),
402
-                    'desc' => __( 'The main body background color of email template. Default <code>#fdfdfd</code>.', 'invoicing' ),
401
+                    'name' => __('Body Background Color', 'invoicing'),
402
+                    'desc' => __('The main body background color of email template. Default <code>#fdfdfd</code>.', 'invoicing'),
403 403
                     'std' => '#fdfdfd',
404 404
                     'type' => 'color',
405 405
                 ),
406 406
                 'email_text_color' => array(
407 407
                     'id'   => 'email_text_color',
408
-                    'name' => __( 'Body Text Color', 'invoicing' ),
409
-                    'desc' => __( 'The main body text color. Default <code>#505050</code>.', 'invoicing' ),
408
+                    'name' => __('Body Text Color', 'invoicing'),
409
+                    'desc' => __('The main body text color. Default <code>#505050</code>.', 'invoicing'),
410 410
                     'std' => '#505050',
411 411
                     'type' => 'color',
412 412
                 ),
@@ -425,17 +425,17 @@  discard block
 block discarded – undo
425 425
             'main' => array(
426 426
                 'invoicing_privacy_policy_settings' => array(
427 427
                     'id'   => 'invoicing_privacy_policy_settings',
428
-                    'name' => '<h3>' . __( 'Privacy Policy', 'invoicing' ) . '</h3>',
428
+                    'name' => '<h3>' . __('Privacy Policy', 'invoicing') . '</h3>',
429 429
                     'type' => 'header',
430 430
                 ),
431 431
                 'privacy_page' => array(
432 432
                     'id'          => 'privacy_page',
433
-                    'name'        => __( 'Privacy Page', 'invoicing' ),
434
-                    'desc'        => __( 'If no privacy policy page set in Settings->Privacy default settings, this page will be used on checkout page.', 'invoicing' ),
433
+                    'name'        => __('Privacy Page', 'invoicing'),
434
+                    'desc'        => __('If no privacy policy page set in Settings->Privacy default settings, this page will be used on checkout page.', 'invoicing'),
435 435
                     'type'        => 'select',
436
-                    'options'     => wpinv_get_pages( true,  __( 'Select a page', 'invoicing' )),
436
+                    'options'     => wpinv_get_pages(true, __('Select a page', 'invoicing')),
437 437
                     'class'       => 'wpi_select2',
438
-                    'placeholder' => __( 'Select a page', 'invoicing' ),
438
+                    'placeholder' => __('Select a page', 'invoicing'),
439 439
                 ),
440 440
             ),
441 441
         )
@@ -446,19 +446,19 @@  discard block
 block discarded – undo
446 446
             'main' => array(
447 447
                 'invoice_number_format_settings' => array(
448 448
                     'id'   => 'invoice_number_format_settings',
449
-                    'name' => '<h3>' . __( 'Invoice Number', 'invoicing' ) . '</h3>',
449
+                    'name' => '<h3>' . __('Invoice Number', 'invoicing') . '</h3>',
450 450
                     'type' => 'header',
451 451
                 ),
452 452
                 'sequential_invoice_number' => array(
453 453
                     'id'   => 'sequential_invoice_number',
454
-                    'name' => __( 'Sequential Invoice Numbers', 'invoicing' ),
455
-                    'desc' => __('Check this box to enable sequential invoice numbers.', 'invoicing' ) . $reset_number,
454
+                    'name' => __('Sequential Invoice Numbers', 'invoicing'),
455
+                    'desc' => __('Check this box to enable sequential invoice numbers.', 'invoicing') . $reset_number,
456 456
                     'type' => 'checkbox',
457 457
                 ),
458 458
                 'invoice_sequence_start' => array(
459 459
                     'id'   => 'invoice_sequence_start',
460
-                    'name' => __( 'Sequential Starting Number', 'invoicing' ),
461
-                    'desc' => __( 'The number at which the invoice number sequence should begin.', 'invoicing' ) . $last_number,
460
+                    'name' => __('Sequential Starting Number', 'invoicing'),
461
+                    'desc' => __('The number at which the invoice number sequence should begin.', 'invoicing') . $last_number,
462 462
                     'type' => 'number',
463 463
                     'size' => 'small',
464 464
                     'std'  => '1',
@@ -466,8 +466,8 @@  discard block
 block discarded – undo
466 466
                 ),
467 467
                 'invoice_number_padd' => array(
468 468
                     'id'      => 'invoice_number_padd',
469
-                    'name'    => __( 'Minimum Digits', 'invoicing' ),
470
-                    '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' ),
469
+                    'name'    => __('Minimum Digits', 'invoicing'),
470
+                    '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'),
471 471
                     'type'    => 'select',
472 472
                     'options' => $invoice_number_padd_options,
473 473
                     'std'     => 5,
@@ -475,8 +475,8 @@  discard block
 block discarded – undo
475 475
                 ),
476 476
                 'invoice_number_prefix' => array(
477 477
                     'id' => 'invoice_number_prefix',
478
-                    'name' => __( 'Invoice Number Prefix', 'invoicing' ),
479
-                    'desc' => __( 'Prefix for all invoice numbers. Ex: INV-', 'invoicing' ),
478
+                    'name' => __('Invoice Number Prefix', 'invoicing'),
479
+                    'desc' => __('Prefix for all invoice numbers. Ex: INV-', 'invoicing'),
480 480
                     'type' => 'text',
481 481
                     'size' => 'regular',
482 482
                     'std' => 'INV-',
@@ -484,32 +484,32 @@  discard block
 block discarded – undo
484 484
                 ),
485 485
                 'invoice_number_postfix' => array(
486 486
                     'id' => 'invoice_number_postfix',
487
-                    'name' => __( 'Invoice Number Postfix', 'invoicing' ),
488
-                    'desc' => __( 'Postfix for all invoice numbers.', 'invoicing' ),
487
+                    'name' => __('Invoice Number Postfix', 'invoicing'),
488
+                    'desc' => __('Postfix for all invoice numbers.', 'invoicing'),
489 489
                     'type' => 'text',
490 490
                     'size' => 'regular',
491 491
                     'std' => ''
492 492
                 ),
493 493
                 'checkout_settings' => array(
494 494
                     'id'   => 'checkout_settings',
495
-                    'name' => '<h3>' . __( 'Checkout Settings', 'invoicing' ) . '</h3>',
495
+                    'name' => '<h3>' . __('Checkout Settings', 'invoicing') . '</h3>',
496 496
                     'type' => 'header',
497 497
                 ),
498 498
                 'login_to_checkout' => array(
499 499
                     'id'   => 'login_to_checkout',
500
-                    'name' => __( 'Require Login To Checkout', 'invoicing' ),
501
-                    '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' ),
500
+                    'name' => __('Require Login To Checkout', 'invoicing'),
501
+                    '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'),
502 502
                     'type' => 'checkbox',
503 503
                 ),
504 504
                 'uninstall_settings' => array(
505 505
                     'id'   => 'uninstall_settings',
506
-                    'name' => '<h3>' . __( 'Uninstall Settings', 'invoicing' ) . '</h3>',
506
+                    'name' => '<h3>' . __('Uninstall Settings', 'invoicing') . '</h3>',
507 507
                     'type' => 'header',
508 508
                 ),
509 509
                 'remove_data_on_unistall' => array(
510 510
                     'id'   => 'remove_data_on_unistall',
511
-                    'name' => __( 'Remove Data on Uninstall?', 'invoicing' ),
512
-                    'desc' => __( 'Check this box if you would like Invoicing plugin to completely remove all of its data when the plugin is deleted/uninstalled.', 'invoicing' ),
511
+                    'name' => __('Remove Data on Uninstall?', 'invoicing'),
512
+                    'desc' => __('Check this box if you would like Invoicing plugin to completely remove all of its data when the plugin is deleted/uninstalled.', 'invoicing'),
513 513
                     'type' => 'checkbox',
514 514
                     'std'  => ''
515 515
                 ),
@@ -517,20 +517,20 @@  discard block
 block discarded – undo
517 517
             'fields' => array(
518 518
                 'address_autofill_settings' => array(
519 519
                     'id'   => 'address_autofill_settings',
520
-                    'name' => '<h3>' . __( 'Google Address Auto Complete', 'invoicing' ) . '</h3>',
520
+                    'name' => '<h3>' . __('Google Address Auto Complete', 'invoicing') . '</h3>',
521 521
                     'type' => 'header',
522 522
                 ),
523 523
                 'address_autofill_active' => array(
524 524
                     'id'   => 'address_autofill_active',
525
-                    'name' => __( 'Enable/Disable', 'invoicing' ),
526
-                    'desc' => __( 'Enable google address auto complete', 'invoicing' ),
525
+                    'name' => __('Enable/Disable', 'invoicing'),
526
+                    'desc' => __('Enable google address auto complete', 'invoicing'),
527 527
                     'type' => 'checkbox',
528 528
                     'std'  => 0
529 529
                 ),
530 530
                 'address_autofill_api' => array(
531 531
                     'id' => 'address_autofill_api',
532
-                    'name' => __( 'Google Place API Key', 'invoicing' ),
533
-                    'desc' => wp_sprintf(__( 'Enter google place API key. For more information go to google place API %sdocumenation%s', 'invoicing' ), '<a href="https://developers.google.com/maps/documentation/javascript/places-autocomplete" target="_blank">', '</a>' ),
532
+                    'name' => __('Google Place API Key', 'invoicing'),
533
+                    'desc' => wp_sprintf(__('Enter google place API key. For more information go to google place API %sdocumenation%s', 'invoicing'), '<a href="https://developers.google.com/maps/documentation/javascript/places-autocomplete" target="_blank">', '</a>'),
534 534
                     'type' => 'text',
535 535
                     'size' => 'regular',
536 536
                     'std' => ''
@@ -539,13 +539,13 @@  discard block
 block discarded – undo
539 539
             'custom-css' => array(
540 540
                 'css_settings' => array(
541 541
                     'id'   => 'css_settings',
542
-                    'name' => '<h3>' . __( 'Custom CSS', 'invoicing' ) . '</h3>',
542
+                    'name' => '<h3>' . __('Custom CSS', 'invoicing') . '</h3>',
543 543
                     'type' => 'header',
544 544
                 ),
545 545
                 'template_custom_css' => array(
546 546
                     'id' => 'template_custom_css',
547
-                    'name' => __( 'Invoice Template CSS', 'invoicing' ),
548
-                    'desc' => __( 'Add CSS to modify appearance of the print invoice page.', 'invoicing' ),
547
+                    'name' => __('Invoice Template CSS', 'invoicing'),
548
+                    'desc' => __('Add CSS to modify appearance of the print invoice page.', 'invoicing'),
549 549
                     'type' => 'textarea',
550 550
                     'class'=> 'regular-text',
551 551
                     'rows' => 10,
@@ -559,8 +559,8 @@  discard block
 block discarded – undo
559 559
             'main' => array(
560 560
                 'tool_settings' => array(
561 561
                     'id'   => 'tool_settings',
562
-                    'name' => '<h3>' . __( 'Diagnostic Tools', 'invoicing' ) . '</h3>',
563
-                    'desc' => __( 'Invoicing diagnostic tools', 'invoicing' ),
562
+                    'name' => '<h3>' . __('Diagnostic Tools', 'invoicing') . '</h3>',
563
+                    'desc' => __('Invoicing diagnostic tools', 'invoicing'),
564 564
                     'type' => 'tools',
565 565
                 ),
566 566
             ),
Please login to merge, or discard this patch.