Issues (850)

Security Analysis    4 potential vulnerabilities

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Code Injection (1)
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection (2)
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Cross-Site Scripting (1)
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  Header Injection
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

includes/data/admin-settings.php (3 issues)

1
<?php
2
/**
3
 * Admin settings
4
 *
5
 * Returns an array of admin settings.
6
 *
7
 * @package Invoicing/data
8
 * @version 1.0.19
9
 */
10
11
defined( 'ABSPATH' ) || exit;
12
13
$getpaid_pages = GetPaid_Installer::get_pages();
14
$pages         = wpinv_get_pages( true );
15
16
$currencies = wpinv_get_currencies();
17
18
$currency_code_options = array();
19
foreach ( $currencies as $code => $name ) {
20
    $currency_code_options[ $code ] = $code . ' - ' . $name . ' (' . wpinv_currency_symbol( $code ) . ')';
0 ignored issues
show
Are you sure wpinv_currency_symbol($code) of type array|mixed|string can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

20
    $currency_code_options[ $code ] = $code . ' - ' . $name . ' (' . /** @scrutinizer ignore-type */ wpinv_currency_symbol( $code ) . ')';
Loading history...
21
}
22
23
$invoice_number_padd_options = array();
24
for ( $i = 0; $i <= 20; $i++ ) {
25
    $invoice_number_padd_options[ $i ] = $i;
26
}
27
28
$currency_symbol = wpinv_currency_symbol();
29
30
$last_number = $reset_number = '';
31
if ( $last_invoice_number = get_option( 'wpinv_last_invoice_number' ) ) {
32
    $last_invoice_number = preg_replace( '/[^0-9]/', '', $last_invoice_number );
33
34
    if ( ! empty( $last_invoice_number ) ) {
35
        $last_number = ' ' . wp_sprintf( __( "( Last Invoice's sequential number: <b>%s</b> )", 'invoicing' ), $last_invoice_number );
36
    }
37
38
    $nonce = wp_create_nonce( 'reset_invoice_count' );
39
    $reset_number = '<a href="' . add_query_arg(
40
        array(
41
			'reset_invoice_count' => 1,
42
			'_nonce'              => $nonce,
43
        )
44
    ) . '" class="btn button">' . __( 'Force Reset Sequence', 'invoicing' ) . '</a>';
45
}
46
47
$alert_wrapper_start = '<p style="color: #F00">';
48
$alert_wrapper_close = '</p>';
49
50
return array(
51
    'general'      => apply_filters(
52
        'wpinv_settings_general',
53
        array(
54
            'main'             => array(
55
                'location_settings' => array(
56
                    'id'   => 'location_settings',
57
                    'name' => '<h3>' . __( 'Default Location', 'invoicing' ) . '</h3>',
58
                    'desc' => '',
59
                    'type' => 'header',
60
                ),
61
                'default_country'   => array(
62
                    'id'          => 'default_country',
63
                    'name'        => __( 'Default Country', 'invoicing' ),
64
                    'desc'        => __( 'Where does your store operate from?', 'invoicing' ),
65
                    'type'        => 'select',
66
                    'options'     => wpinv_get_country_list(),
67
                    'std'         => 'GB',
68
                    'class'       => 'wpi_select2',
69
                    'placeholder' => __( 'Select a country', 'invoicing' ),
70
                ),
71
                'default_state'     => array(
72
                    'id'          => 'default_state',
73
                    'name'        => __( 'Default State / Province', 'invoicing' ),
74
                    'desc'        => __( 'What state / province does your store operate from?', 'invoicing' ),
75
                    'type'        => 'country_states',
76
                    'class'       => 'wpi_select2',
77
                    'placeholder' => __( 'Select a state', 'invoicing' ),
78
                ),
79
                'store_name'        => array(
80
                    'id'   => 'store_name',
81
                    'name' => __( 'Store Name', 'invoicing' ),
82
                    'desc' => __( 'Store name to print on invoices.', 'invoicing' ),
83
                    'std'  => get_option( 'blogname' ),
84
                    'type' => 'text',
85
                ),
86
                'logo'              => array(
87
                    'id'   => 'logo',
88
                    'name' => __( 'Logo URL', 'invoicing' ),
89
                    'desc' => __( 'Store logo to print on invoices.', 'invoicing' ),
90
                    'type' => 'text',
91
                ),
92
                'logo_width'        => array(
93
                    'id'          => 'logo_width',
94
                    'name'        => __( 'Logo width', 'invoicing' ),
95
                    'desc'        => __( 'Logo width to use in invoice image.', 'invoicing' ),
96
                    'type'        => 'number',
97
                    'placeholder' => __( 'Auto', 'invoicing' ),
98
                ),
99
                'logo_height'       => array(
100
                    'id'          => 'logo_height',
101
                    'name'        => __( 'Logo height', 'invoicing' ),
102
                    'desc'        => __( 'Logo height to use in invoice image.', 'invoicing' ),
103
                    'type'        => 'number',
104
                    'placeholder' => __( 'Auto', 'invoicing' ),
105
                ),
106
                'store_address'     => array(
107
                    'id'   => 'store_address',
108
                    'name' => __( 'Store Address', 'invoicing' ),
109
                    'desc' => __( 'Enter the store address to display on invoice', 'invoicing' ),
110
                    'type' => 'textarea',
111
                ),
112
113
            ),
114
            'page_section'     => array(
115
                'page_settings'             => array(
116
                    'id'   => 'page_settings',
117
                    'name' => '<h3>' . __( 'Page Settings', 'invoicing' ) . '</h3>',
118
                    'desc' => '',
119
                    'type' => 'header',
120
                ),
121
                'checkout_page'             => array(
122
                    'id'              => 'checkout_page',
123
                    'name'            => __( 'Checkout Page', 'invoicing' ),
124
                    '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' ),
125
                    'type'            => 'select',
126
                    'options'         => $pages,
127
                    'class'           => 'wpi_select2',
128
                    'placeholder'     => __( 'Select a page', 'invoicing' ),
129
                    'default_content' => empty( $getpaid_pages['checkout_page'] ) ? '' : $getpaid_pages['checkout_page']['content'],
130
                    'help-tip'        => true,
131
                ),
132
                'success_page'              => array(
133
                    'id'              => 'success_page',
134
                    'name'            => __( 'Success Page', 'invoicing' ),
135
                    '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' ),
136
                    'type'            => 'select',
137
                    'options'         => $pages,
138
                    'class'           => 'wpi_select2',
139
                    'placeholder'     => __( 'Select a page', 'invoicing' ),
140
                    'default_content' => empty( $getpaid_pages['success_page'] ) ? '' : $getpaid_pages['success_page']['content'],
141
                    'help-tip'        => true,
142
                ),
143
                'failure_page'              => array(
144
                    'id'              => 'failure_page',
145
                    'name'            => __( 'Failed Transaction Page', 'invoicing' ),
146
                    'desc'            => __( 'This is the page buyers are sent to if their transaction is cancelled or fails.', 'invoicing' ),
147
                    'type'            => 'select',
148
                    'options'         => $pages,
149
                    'class'           => 'wpi_select2',
150
                    'placeholder'     => __( 'Select a page', 'invoicing' ),
151
                    'default_content' => empty( $getpaid_pages['failure_page'] ) ? '' : $getpaid_pages['failure_page']['content'],
152
                    'help-tip'        => true,
153
                ),
154
                'invoice_history_page'      => array(
155
                    'id'              => 'invoice_history_page',
156
                    'name'            => __( 'Invoice History Page', 'invoicing' ),
157
                    'desc'            => __( 'This page shows an invoice history for the current user. The <b>[wpinv_history]</b> short code should be on this page.', 'invoicing' ),
158
                    'type'            => 'select',
159
                    'options'         => $pages,
160
                    'class'           => 'wpi_select2',
161
                    'placeholder'     => __( 'Select a page', 'invoicing' ),
162
                    'default_content' => empty( $getpaid_pages['invoice_history_page'] ) ? '' : $getpaid_pages['invoice_history_page']['content'],
163
                    'help-tip'        => true,
164
                ),
165
                'invoice_subscription_page' => array(
166
                    'id'              => 'invoice_subscription_page',
167
                    'name'            => __( 'Invoice Subscriptions Page', 'invoicing' ),
168
                    'desc'            => __( 'This page shows subscriptions history for the current user. The <b>[wpinv_subscriptions]</b> short code should be on this page.', 'invoicing' ),
169
                    'type'            => 'select',
170
                    'options'         => $pages,
171
                    'class'           => 'wpi_select2',
172
                    'placeholder'     => __( 'Select a page', 'invoicing' ),
173
                    'default_content' => empty( $getpaid_pages['invoice_subscription_page'] ) ? '' : $getpaid_pages['invoice_subscription_page']['content'],
174
                    'help-tip'        => true,
175
                ),
176
            ),
177
            'currency_section' => array(
178
                'currency_settings'   => array(
179
                    'id'   => 'currency_settings',
180
                    'name' => '<h3>' . __( 'Currency Settings', 'invoicing' ) . '</h3>',
181
                    'desc' => '',
182
                    'type' => 'header',
183
                ),
184
                'currency'            => array(
185
                    'id'      => 'currency',
186
                    'name'    => __( 'Currency', 'invoicing' ),
187
                    'desc'    => __( 'Choose your currency. Note that some payment gateways have currency restrictions.', 'invoicing' ),
188
                    'type'    => 'select',
189
                    'class'   => 'wpi_select2',
190
                    'options' => $currency_code_options,
191
                ),
192
                'currency_position'   => array(
193
                    'id'      => 'currency_position',
194
                    'name'    => __( 'Currency Position', 'invoicing' ),
195
                    'desc'    => __( 'Choose the location of the currency sign.', 'invoicing' ),
196
                    'type'    => 'select',
197
                    'class'   => 'wpi_select2',
198
                    'options' => array(
199
                        'left'        => __( 'Left', 'invoicing' ) . ' (' . $currency_symbol . wpinv_format_amount( '99.99' ) . ')',
0 ignored issues
show
'99.99' of type string is incompatible with the type double expected by parameter $amount of wpinv_format_amount(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

199
                        'left'        => __( 'Left', 'invoicing' ) . ' (' . $currency_symbol . wpinv_format_amount( /** @scrutinizer ignore-type */ '99.99' ) . ')',
Loading history...
Are you sure $currency_symbol of type array|mixed|string can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

199
                        'left'        => __( 'Left', 'invoicing' ) . ' (' . /** @scrutinizer ignore-type */ $currency_symbol . wpinv_format_amount( '99.99' ) . ')',
Loading history...
200
                        'right'       => __( 'Right', 'invoicing' ) . ' (' . wpinv_format_amount( '99.99' ) . $currency_symbol . ')',
201
                        'left_space'  => __( 'Left with space', 'invoicing' ) . ' (' . $currency_symbol . ' ' . wpinv_format_amount( '99.99' ) . ')',
202
                        'right_space' => __( 'Right with space', 'invoicing' ) . ' (' . wpinv_format_amount( '99.99' ) . ' ' . $currency_symbol . ')',
203
                    ),
204
                ),
205
                'thousands_separator' => array(
206
                    'id'   => 'thousands_separator',
207
                    'name' => __( 'Thousands Separator', 'invoicing' ),
208
                    'desc' => __( 'The symbol (usually , or .) to separate thousands', 'invoicing' ),
209
                    'type' => 'text',
210
                    'size' => 'small',
211
                    'std'  => ',',
212
                ),
213
                'decimal_separator'   => array(
214
                    'id'   => 'decimal_separator',
215
                    'name' => __( 'Decimal Separator', 'invoicing' ),
216
                    'desc' => __( 'The symbol (usually , or .) to separate decimal points', 'invoicing' ),
217
                    'type' => 'text',
218
                    'size' => 'small',
219
                    'std'  => '.',
220
                ),
221
                'decimals'            => array(
222
                    'id'   => 'decimals',
223
                    'name' => __( 'Number of Decimals', 'invoicing' ),
224
                    'desc' => __( 'This sets the number of decimal points shown in displayed prices.', 'invoicing' ),
225
                    'type' => 'number',
226
                    'size' => 'small',
227
                    'std'  => '2',
228
                    'min'  => '0',
229
                    'max'  => '10',
230
                    'step' => '1',
231
                ),
232
            ),
233
            'labels'           => array(
234
                'labels'                   => array(
235
                    'id'   => 'labels_settings',
236
                    'name' => '<h3>' . __( 'Invoice Labels', 'invoicing' ) . '</h3>',
237
                    'desc' => '',
238
                    'type' => 'header',
239
                ),
240
                'vat_invoice_notice_label' => array(
241
                    'id'   => 'vat_invoice_notice_label',
242
                    'name' => __( 'Invoice Notice Label', 'invoicing' ),
243
                    'desc' => __( 'Use this to add an invoice notice section (label) to your invoices', 'invoicing' ),
244
                    'type' => 'text',
245
                    'size' => 'regular',
246
                ),
247
                'vat_invoice_notice'       => array(
248
                    'id'   => 'vat_invoice_notice',
249
                    'name' => __( 'Invoice notice', 'invoicing' ),
250
                    'desc' => __( 'Use this to add an invoice notice section (description) to your invoices', 'invoicing' ),
251
                    'type' => 'text',
252
                    'size' => 'regular',
253
                ),
254
            ),
255
        )
256
    ),
257
    'gateways'     => apply_filters(
258
        'wpinv_settings_gateways',
259
        array(
260
            'main' => array(
261
                'gateway_settings' => array(
262
                    'id'   => 'api_header',
263
                    'name' => '<h3>' . __( 'Gateway Settings', 'invoicing' ) . '</h3>',
264
                    'desc' => '',
265
                    'type' => 'header',
266
                ),
267
                'gateways'         => array(
268
                    'id'      => 'gateways',
269
                    'name'    => __( 'Payment Gateways', 'invoicing' ),
270
                    'desc'    => __( 'Choose the payment gateways you want to enable.', 'invoicing' ),
271
                    'type'    => 'gateways',
272
                    'std'     => array( 'manual' => 1 ),
273
                    'options' => wpinv_get_payment_gateways(),
274
                ),
275
                'default_gateway'  => array(
276
                    'id'      => 'default_gateway',
277
                    'name'    => __( 'Default Gateway', 'invoicing' ),
278
                    'desc'    => __( 'This gateway will be loaded automatically with the checkout page.', 'invoicing' ),
279
                    'type'    => 'gateway_select',
280
                    'std'     => 'manual',
281
                    'class'   => 'wpi_select2',
282
                    'options' => wpinv_get_payment_gateways(),
283
                ),
284
            ),
285
        )
286
    ),
287
    /** Taxes Settings */
288
    'taxes'        => apply_filters(
289
        'wpinv_settings_taxes',
290
        array(
291
            'main'  => array(
292
                'tax_settings'          => array(
293
                    'id'   => 'tax_settings',
294
                    'name' => '<h3>' . __( 'Tax Settings', 'invoicing' ) . '</h3>',
295
                    'type' => 'header',
296
                ),
297
298
                'enable_taxes'          => array(
299
                    'id'   => 'enable_taxes',
300
                    'name' => __( 'Enable Taxes', 'invoicing' ),
301
                    'desc' => __( 'Enable tax rates and calculations.', 'invoicing' ),
302
                    'type' => 'checkbox',
303
                    'std'  => 0,
304
                ),
305
306
                'tax_subtotal_rounding' => array(
307
                    'id'   => 'tax_subtotal_rounding',
308
                    'name' => __( 'Rounding', 'invoicing' ),
309
                    'desc' => __( 'Round tax at subtotal level, instead of rounding per tax rate', 'invoicing' ),
310
                    'type' => 'checkbox',
311
                    'std'  => 1,
312
                ),
313
314
                'prices_include_tax'    => array(
315
                    'id'      => 'prices_include_tax',
316
                    'name'    => __( 'Prices entered with tax', 'invoicing' ),
317
                    'options' => array(
318
                        'yes' => __( 'Yes, I will enter prices inclusive of tax', 'invoicing' ),
319
                        'no'  => __( 'No, I will enter prices exclusive of tax', 'invoicing' ),
320
                    ),
321
                    'type'    => 'select',
322
                    'std'     => 'no',
323
                ),
324
325
                'tax_base'              => array(
326
                    'id'      => 'tax_base',
327
                    'name'    => __( 'Calculate tax based on', 'invoicing' ),
328
                    'options' => array(
329
                        'billing' => __( 'Customer billing address', 'invoicing' ),
330
                        'base'    => __( 'Shop base address', 'invoicing' ),
331
                    ),
332
                    'type'    => 'select',
333
                    'std'     => 'billing',
334
                ),
335
336
                'vat_same_country_rule'    => array(
337
                    'id'          => 'vat_same_country_rule',
338
                    'name'        => __( 'Same country rule', 'invoicing' ),
339
                    'desc'        => __( 'What should happen if a customer is from the same country as your business?', 'invoicing' ),
340
                    'type'        => 'select',
341
                    'options'     => array(
342
                        'no'      => __( 'Do not charge tax', 'invoicing' ),
343
                        'always'  => __( 'Charge tax unless vat number is validated', 'invoicing' ),
344
                        'vat_too' => __( 'Charge tax even if vat number is validated', 'invoicing' ),
345
                    ),
346
                    'placeholder' => __( 'Select an option', 'invoicing' ),
347
                    'std'         => 'vat_too',
348
                ),
349
350
                'tax_display_totals'    => array(
351
                    'id'      => 'tax_display_totals',
352
                    'name'    => __( 'Display tax totals', 'invoicing' ),
353
                    'options' => array(
354
                        'single'     => __( 'As a single total', 'invoicing' ),
355
                        'individual' => __( 'As individual tax rates', 'invoicing' ),
356
                    ),
357
                    'type'    => 'select',
358
                    'std'     => 'individual',
359
                ),
360
361
                'tax_rate'              => array(
362
                    'id'   => 'tax_rate',
363
                    'name' => __( 'Fallback Tax Rate', 'invoicing' ),
364
                    'desc' => __( 'Enter a percentage, such as 6.5. Customers not in a specific rate will be charged this rate.', 'invoicing' ),
365
                    'type' => 'number',
366
                    'size' => 'small',
367
                    'min'  => '0',
368
                    'max'  => '99',
369
                    'step' => 'any',
370
                    'std'  => '0',
371
                ),
372
            ),
373
            'rules' => array(
374
                'tax_rules' => array(
375
                    'id'   => 'tax_rules',
376
                    'name' => '<h3>' . __( 'Tax Rules', 'invoicing' ) . '</h3>',
377
                    'desc' => __( 'Create/Update tax rules', 'invoicing' ),
378
                    'type' => 'tax_rules',
379
                ),
380
            ),
381
382
            'rates' => array(
383
                'tax_rates' => array(
384
                    'id'   => 'tax_rates',
385
                    'name' => '<h3>' . __( 'Tax Rates', 'invoicing' ) . '</h3>',
386
                    'desc' => __( 'Enter tax rates for specific regions.', 'invoicing' ),
387
                    'type' => 'tax_rates',
388
                ),
389
            ),
390
391
            'vat'   => array(
392
393
                'vat_company_name'         => array(
394
                    'id'   => 'vat_company_name',
395
                    'name' => __( 'Company Name', 'invoicing' ),
396
                    'desc' => wp_sprintf( __( 'Verify your company name and  VAT number on the %1$sEU VIES System.%2$s', 'invoicing' ), '<a href="http://ec.europa.eu/taxation_customs/vies/" target="_blank">', '</a>' ),
397
                    'type' => 'text',
398
                    'size' => 'regular',
399
                ),
400
401
                'vat_number'               => array(
402
                    'id'   => 'vat_number',
403
                    'name' => __( 'VAT Number', 'invoicing' ),
404
                    'desc' => __( 'Enter your VAT number including the country identifier, eg: GB123456789', 'invoicing' ),
405
                    'type' => 'text',
406
                    'size' => 'regular',
407
                ),
408
409
                'vat_prevent_b2c_purchase' => array(
410
                    'id'   => 'vat_prevent_b2c_purchase',
411
                    'name' => __( 'Prevent B2C Sales', 'invoicing' ),
412
                    'desc' => __( 'Require everyone in the EU to provide a VAT number.', 'invoicing' ),
413
                    'type' => 'checkbox',
414
                ),
415
416
                'validate_vat_number'      => array(
417
                    'id'   => 'validate_vat_number',
418
                    'name' => __( 'Validate VAT Number', 'invoicing' ),
419
                    'desc' => __( 'Validate VAT numbers with VIES.', 'invoicing' ),
420
                    'type' => 'checkbox',
421
                ),
422
423
            ),
424
425
        )
426
    ),
427
    /** Emails Settings */
428
    'emails'       => apply_filters(
429
        'wpinv_settings_emails',
430
        array(
431
            'main' => array(
432
                'email_settings_header'       => array(
433
                    'id'   => 'email_settings_header',
434
                    'name' => '<h3>' . __( 'Email Sender Options', 'invoicing' ) . '</h3>',
435
                    'type' => 'header',
436
                ),
437
                'email_from_name'             => array(
438
                    'id'   => 'email_from_name',
439
                    'name' => __( 'From Name', 'invoicing' ),
440
                    'desc' => __( 'Enter the sender\'s name appears in outgoing invoice emails. This should be your site name.', 'invoicing' ),
441
                    'std'  => esc_attr( get_bloginfo( 'name', 'display' ) ),
442
                    'type' => 'text',
443
                ),
444
                'email_from'                  => array(
445
                    'id'   => 'email_from',
446
                    'name' => __( 'From Email', 'invoicing' ),
447
                    'desc' => sprintf( __( 'Email address to send invoice emails from. This will act as the "from" address. %1$s If emails are not being sent it may be that your hosting prevents emails being sent if the email domains do not match.%2$s', 'invoicing' ), $alert_wrapper_start, $alert_wrapper_close ),
448
                    'std'  => get_option( 'admin_email' ),
449
                    'type' => 'text',
450
                ),
451
                'admin_email'                 => array(
452
                    'id'   => 'admin_email',
453
                    'name' => __( 'Admin Email', 'invoicing' ),
454
                    'desc' => __( 'Where should we send admin notifications? This will is also act as the "reply-to" address for invoice emails', 'invoicing' ),
455
                    'std'  => get_option( 'admin_email' ),
456
                    'type' => 'text',
457
                ),
458
                'skip_email_free_invoice'     => array(
459
                    'id'   => 'skip_email_free_invoice',
460
                    'name' => __( 'Skip Free Invoices', 'invoicing' ),
461
                    'desc' => __( 'Check this to disable sending emails for free invoices.', 'invoicing' ),
462
                    'type' => 'checkbox',
463
                    'std'  => false,
464
                ),
465
                'overdue_settings_header'     => array(
466
                    'id'   => 'overdue_settings_header',
467
                    'name' => '<h3>' . __( 'Due Date Settings', 'invoicing' ) . '</h3>',
468
                    'type' => 'header',
469
                ),
470
                'overdue_active'              => array(
471
                    'id'   => 'overdue_active',
472
                    'name' => __( 'Enable Due Date', 'invoicing' ),
473
                    'desc' => __( 'Check this to enable due date option for invoices.', 'invoicing' ),
474
                    'type' => 'checkbox',
475
                    'std'  => false,
476
                ),
477
                'email_template_header'       => array(
478
                    'id'   => 'email_template_header',
479
                    'name' => '<h3>' . __( 'Email Template', 'invoicing' ) . '</h3>',
480
                    'type' => 'header',
481
                ),
482
                'email_header_image'          => array(
483
                    'id'   => 'email_header_image',
484
                    'name' => __( 'Header Image', 'invoicing' ),
485
                    'desc' => __( 'URL to an image you want to show in the email header. Upload images using the media uploader (Admin > Media).', 'invoicing' ),
486
                    'std'  => '',
487
                    'type' => 'text',
488
                ),
489
                'email_footer_text'           => array(
490
                    'id'    => 'email_footer_text',
491
                    'name'  => __( 'Footer Text', 'invoicing' ),
492
                    'desc'  => __( 'The text to appear in the footer of all invoice emails.', 'invoicing' ),
493
                    'std'   => get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by GetPaid', 'invoicing' ),
494
                    'type'  => 'textarea',
495
                    'class' => 'regular-text',
496
                    'rows'  => 2,
497
                    'cols'  => 37,
498
                ),
499
                'email_base_color'            => array(
500
                    'id'   => 'email_base_color',
501
                    'name' => __( 'Base Color', 'invoicing' ),
502
                    'desc' => __( 'The base color for invoice email template. Default <code>#557da2</code>.', 'invoicing' ),
503
                    'std'  => '#557da2',
504
                    'type' => 'color',
505
                ),
506
                'email_background_color'      => array(
507
                    'id'   => 'email_background_color',
508
                    'name' => __( 'Background Color', 'invoicing' ),
509
                    'desc' => __( 'The background color of email template. Default <code>#f5f5f5</code>.', 'invoicing' ),
510
                    'std'  => '#f5f5f5',
511
                    'type' => 'color',
512
                ),
513
                'email_body_background_color' => array(
514
                    'id'   => 'email_body_background_color',
515
                    'name' => __( 'Body Background Color', 'invoicing' ),
516
                    'desc' => __( 'The main body background color of email template. Default <code>#fdfdfd</code>.', 'invoicing' ),
517
                    'std'  => '#fdfdfd',
518
                    'type' => 'color',
519
                ),
520
                'email_text_color'            => array(
521
                    'id'   => 'email_text_color',
522
                    'name' => __( 'Body Text Color', 'invoicing' ),
523
                    'desc' => __( 'The main body text color. Default <code>#505050</code>.', 'invoicing' ),
524
                    'std'  => '#505050',
525
                    'type' => 'color',
526
                ),
527
                'email_settings'              => array(
528
                    'id'   => 'email_settings',
529
                    'name' => '',
530
                    'desc' => '',
531
                    'type' => 'hook',
532
                ),
533
            ),
534
        )
535
    ),
536
537
    // Integrations.
538
    'integrations' => wp_list_pluck( getpaid_get_integration_settings(), 'settings', 'id' ),
539
540
    /** Privacy Settings */
541
    'privacy'      => apply_filters(
542
        'wpinv_settings_privacy',
543
        array(
544
            'main' => array(
545
                'invoicing_privacy_policy_settings' => array(
546
                    'id'   => 'invoicing_privacy_policy_settings',
547
                    'name' => '<h3>' . __( 'Privacy Policy', 'invoicing' ) . '</h3>',
548
                    'type' => 'header',
549
                ),
550
                'privacy_page'                      => array(
551
                    'id'          => 'privacy_page',
552
                    'name'        => __( 'Privacy Page', 'invoicing' ),
553
                    'desc'        => __( 'If no privacy policy page set in Settings->Privacy default settings, this page will be used on checkout page.', 'invoicing' ),
554
                    'type'        => 'select',
555
                    'options'     => wpinv_get_pages( true, __( 'Select a page', 'invoicing' ) ),
556
                    'class'       => 'wpi_select2',
557
                    'placeholder' => __( 'Select a page', 'invoicing' ),
558
                ),
559
            ),
560
        )
561
    ),
562
    /** Misc Settings */
563
    'misc'         => apply_filters(
564
        'wpinv_settings_misc',
565
        array(
566
            'main'       => array(
567
                'invoice_number_format_settings' => array(
568
                    'id'   => 'invoice_number_format_settings',
569
                    'name' => '<h3>' . __( 'Invoice Number', 'invoicing' ) . '</h3>',
570
                    'type' => 'header',
571
                ),
572
                'sequential_invoice_number'      => array(
573
                    'id'   => 'sequential_invoice_number',
574
                    'name' => __( 'Sequential Invoice Numbers', 'invoicing' ),
575
                    'desc' => __( 'Check this box to enable sequential invoice numbers.', 'invoicing' ) . $reset_number,
576
                    'type' => 'checkbox',
577
                ),
578
                'invoice_sequence_start'         => array(
579
                    'id'    => 'invoice_sequence_start',
580
                    'name'  => __( 'Sequential Starting Number', 'invoicing' ),
581
                    'desc'  => __( 'The number at which the invoice number sequence should begin.', 'invoicing' ) . $last_number,
582
                    'type'  => 'number',
583
                    'size'  => 'small',
584
                    'std'   => '1',
585
                    'class' => 'w100',
586
                ),
587
                'invoice_number_padd'            => array(
588
                    'id'      => 'invoice_number_padd',
589
                    'name'    => __( 'Minimum Digits', 'invoicing' ),
590
                    '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' ),
591
                    'type'    => 'select',
592
                    'options' => $invoice_number_padd_options,
593
                    'std'     => 5,
594
                    'class'   => 'wpi_select2',
595
                ),
596
                'invoice_number_prefix'          => array(
597
                    'id'          => 'invoice_number_prefix',
598
                    'name'        => __( 'Invoice Number Prefix', 'invoicing' ),
599
                    'desc'        => __( 'Prefix for all invoice numbers. Ex: INV-', 'invoicing' ),
600
                    'type'        => 'text',
601
                    'size'        => 'regular',
602
                    'std'         => 'INV-',
603
                    'placeholder' => 'INV-',
604
                ),
605
                'invoice_number_postfix'         => array(
606
                    'id'   => 'invoice_number_postfix',
607
                    'name' => __( 'Invoice Number Postfix', 'invoicing' ),
608
                    'desc' => __( 'Postfix for all invoice numbers.', 'invoicing' ),
609
                    'type' => 'text',
610
                    'size' => 'regular',
611
                    'std'  => '',
612
                ),
613
                'checkout_settings'              => array(
614
                    'id'   => 'checkout_settings',
615
                    'name' => '<h3>' . __( 'Checkout Settings', 'invoicing' ) . '</h3>',
616
                    'type' => 'header',
617
                ),
618
                'disable_new_user_emails'        => array(
619
                    'id'   => 'disable_new_user_emails',
620
                    'name' => __( 'Disable new user emails', 'invoicing' ),
621
                    'desc' => __( 'Do not send an email to customers when a new user account is created for them.', 'invoicing' ),
622
                    'type' => 'checkbox',
623
                ),
624
                'login_to_checkout'              => array(
625
                    'id'   => 'login_to_checkout',
626
                    'name' => __( 'Require Login To Checkout', 'invoicing' ),
627
                    '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' ),
628
                    'type' => 'checkbox',
629
                ),
630
                'enable_recaptcha'               => array(
631
                    'id'   => 'enable_recaptcha',
632
                    'name' => __( 'Enable reCAPTCHA', 'invoicing' ),
633
                    'desc' => __( 'If ticked then reCAPTCHA will be enabled on the checkout page.', 'invoicing' ),
634
                    'type' => 'checkbox',
635
                ),
636
                'recaptcha_version'              => array(
637
                    'id'      => 'recaptcha_version',
638
                    'name'    => __( 'reCAPTCHA Version', 'invoicing' ),
639
                    'desc'    => __( 'Select the version of reCAPTCHA you would like to use.', 'invoicing' ),
640
                    'type'    => 'select',
641
                    'options' => array(
642
                        'v2' => __( 'reCAPTCHA v2', 'invoicing' ),
643
                        'v3' => __( 'reCAPTCHA v3', 'invoicing' ),
644
                    ),
645
                    'std'     => 'v2',
646
                ),
647
                'recaptcha_site_key'             => array(
648
                    'id'   => 'recaptcha_site_key',
649
                    'name' => __( 'reCAPTCHA Site Key', 'invoicing' ),
650
                    'desc' => __( 'Enter your reCAPTCHA site key.', 'invoicing' ) . ' <a href="https://www.google.com/recaptcha/admin/create" target="_blank">' . __( 'Generate a site key.', 'invoicing' ) . '</a>',
651
                    'type' => 'text',
652
                    'size' => 'regular',
653
                ),
654
                'recaptcha_secret_key'           => array(
655
                    'id'   => 'recaptcha_secret_key',
656
                    'name' => __( 'reCAPTCHA Secret Key', 'invoicing' ),
657
                    'desc' => __( 'Enter your reCAPTCHA secret key.', 'invoicing' ),
658
                    'type' => 'text',
659
                    'size' => 'regular',
660
                ),
661
                'maxmind_license_key'            => array(
662
                    'id'   => 'maxmind_license_key',
663
                    'name' => __( 'MaxMind License Key', 'invoicing' ),
664
                    'type' => 'text',
665
                    'size' => 'regular',
666
                    'desc' => __( "Enter you license key if you would like to use MaxMind to automatically detect a customer's country.", 'invoicing' ) . ' <a href="https://support.maxmind.com/hc/en-us/articles/4407111582235-Generate-a-License-Key">' . __( 'How to generate a free license key.', 'invoicing' ) . '</a>',
667
                ),
668
669
                'uninstall_settings'             => array(
670
                    'id'   => 'uninstall_settings',
671
                    'name' => '<h3>' . __( 'Uninstall Settings', 'invoicing' ) . '</h3>',
672
                    'type' => 'header',
673
                ),
674
                'remove_data_on_unistall'        => array(
675
                    'id'   => 'remove_data_on_unistall',
676
                    'name' => __( 'Remove Data on Uninstall?', 'invoicing' ),
677
                    'desc' => __( 'Check this box if you would like Invoicing plugin to completely remove all of its data when the plugin is deleted/uninstalled.', 'invoicing' ),
678
                    'type' => 'checkbox',
679
                    'std'  => '',
680
                ),
681
            ),
682
683
            'custom-css' => array(
684
                'css_settings'        => array(
685
                    'id'   => 'css_settings',
686
                    'name' => '<h3>' . __( 'Custom CSS', 'invoicing' ) . '</h3>',
687
                    'type' => 'header',
688
                ),
689
                'template_custom_css' => array(
690
                    'id'    => 'template_custom_css',
691
                    'name'  => __( 'Invoice Template CSS', 'invoicing' ),
692
                    'desc'  => __( 'Add CSS to modify appearance of the print invoice page.', 'invoicing' ),
693
                    'type'  => 'textarea',
694
                    'class' => 'regular-text',
695
                    'rows'  => 10,
696
                ),
697
            ),
698
        )
699
    ),
700
    /** Tools Settings */
701
    'tools'        => apply_filters(
702
        'wpinv_settings_tools',
703
        array(
704
            'main' => array(
705
                'tool_settings' => array(
706
                    'id'   => 'tool_settings',
707
                    'name' => '<h3>' . __( 'Diagnostic Tools', 'invoicing' ) . '</h3>',
708
                    'desc' => __( 'Invoicing diagnostic tools', 'invoicing' ),
709
                    'type' => 'tools',
710
                ),
711
            ),
712
        )
713
    ),
714
);
715