@@ -8,99 +8,99 @@ discard block |
||
8 | 8 | * @version 1.0.19 |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | $getpaid_pages = GetPaid_Installer::get_pages(); |
14 | -$pages = wpinv_get_pages( true ); |
|
14 | +$pages = wpinv_get_pages(true); |
|
15 | 15 | |
16 | 16 | $currencies = wpinv_get_currencies(); |
17 | 17 | |
18 | 18 | $currency_code_options = array(); |
19 | -foreach ( $currencies as $code => $name ) { |
|
20 | - $currency_code_options[ $code ] = $code . ' - ' . $name . ' (' . wpinv_currency_symbol( $code ) . ')'; |
|
19 | +foreach ($currencies as $code => $name) { |
|
20 | + $currency_code_options[$code] = $code . ' - ' . $name . ' (' . wpinv_currency_symbol($code) . ')'; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | $invoice_number_padd_options = array(); |
24 | -for ( $i = 0; $i <= 20; $i++ ) { |
|
24 | +for ($i = 0; $i <= 20; $i++) { |
|
25 | 25 | $invoice_number_padd_options[$i] = $i; |
26 | 26 | } |
27 | 27 | |
28 | 28 | $currency_symbol = wpinv_currency_symbol(); |
29 | 29 | |
30 | 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 ); |
|
31 | +if ($last_invoice_number = get_option('wpinv_last_invoice_number')) { |
|
32 | + $last_invoice_number = preg_replace('/[^0-9]/', '', $last_invoice_number); |
|
33 | 33 | |
34 | - if ( !empty( $last_invoice_number ) ) { |
|
35 | - $last_number = ' ' . wp_sprintf( __( "( Last Invoice's sequential number: <b>%s</b> )", 'invoicing' ), $last_invoice_number ); |
|
34 | + if (!empty($last_invoice_number)) { |
|
35 | + $last_number = ' ' . wp_sprintf(__("( Last Invoice's sequential number: <b>%s</b> )", 'invoicing'), $last_invoice_number); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $nonce = wp_create_nonce('reset_invoice_count'); |
39 | - $reset_number = '<a href="'.add_query_arg(array('reset_invoice_count' => 1, '_nonce' => $nonce)).'" class="btn button">'.__('Force Reset Sequence', 'invoicing' ). '</a>'; |
|
39 | + $reset_number = '<a href="' . add_query_arg(array('reset_invoice_count' => 1, '_nonce' => $nonce)) . '" class="btn button">' . __('Force Reset Sequence', 'invoicing') . '</a>'; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $alert_wrapper_start = '<p style="color: #F00">'; |
43 | 43 | $alert_wrapper_close = '</p>'; |
44 | 44 | |
45 | 45 | return array( |
46 | - 'general' => apply_filters( 'wpinv_settings_general', |
|
46 | + 'general' => apply_filters('wpinv_settings_general', |
|
47 | 47 | array( |
48 | 48 | 'main' => array( |
49 | 49 | 'location_settings' => array( |
50 | 50 | 'id' => 'location_settings', |
51 | - 'name' => '<h3>' . __( 'Default Location', 'invoicing' ) . '</h3>', |
|
51 | + 'name' => '<h3>' . __('Default Location', 'invoicing') . '</h3>', |
|
52 | 52 | 'desc' => '', |
53 | 53 | 'type' => 'header', |
54 | 54 | ), |
55 | 55 | 'default_country' => array( |
56 | 56 | 'id' => 'default_country', |
57 | - 'name' => __( 'Default Country', 'invoicing' ), |
|
58 | - 'desc' => __( 'Where does your store operate from?', 'invoicing' ), |
|
57 | + 'name' => __('Default Country', 'invoicing'), |
|
58 | + 'desc' => __('Where does your store operate from?', 'invoicing'), |
|
59 | 59 | 'type' => 'select', |
60 | 60 | 'options' => wpinv_get_country_list(), |
61 | 61 | 'std' => 'GB', |
62 | 62 | 'class' => 'wpi_select2', |
63 | - 'placeholder' => __( 'Select a country', 'invoicing' ), |
|
63 | + 'placeholder' => __('Select a country', 'invoicing'), |
|
64 | 64 | ), |
65 | 65 | 'default_state' => array( |
66 | 66 | 'id' => 'default_state', |
67 | - 'name' => __( 'Default State / Province', 'invoicing' ), |
|
68 | - 'desc' => __( 'What state / province does your store operate from?', 'invoicing' ), |
|
67 | + 'name' => __('Default State / Province', 'invoicing'), |
|
68 | + 'desc' => __('What state / province does your store operate from?', 'invoicing'), |
|
69 | 69 | 'type' => 'country_states', |
70 | 70 | 'class' => 'wpi_select2', |
71 | - 'placeholder' => __( 'Select a state', 'invoicing' ), |
|
71 | + 'placeholder' => __('Select a state', 'invoicing'), |
|
72 | 72 | ), |
73 | 73 | 'store_name' => array( |
74 | 74 | 'id' => 'store_name', |
75 | - 'name' => __( 'Store Name', 'invoicing' ), |
|
76 | - 'desc' => __( 'Store name to print on invoices.', 'invoicing' ), |
|
75 | + 'name' => __('Store Name', 'invoicing'), |
|
76 | + 'desc' => __('Store name to print on invoices.', 'invoicing'), |
|
77 | 77 | 'std' => get_option('blogname'), |
78 | 78 | 'type' => 'text', |
79 | 79 | ), |
80 | 80 | 'logo' => array( |
81 | 81 | 'id' => 'logo', |
82 | - 'name' => __( 'Logo URL', 'invoicing' ), |
|
83 | - 'desc' => __( 'Store logo to print on invoices.', 'invoicing' ), |
|
82 | + 'name' => __('Logo URL', 'invoicing'), |
|
83 | + 'desc' => __('Store logo to print on invoices.', 'invoicing'), |
|
84 | 84 | 'type' => 'text', |
85 | 85 | ), |
86 | 86 | 'logo_width' => array( |
87 | 87 | 'id' => 'logo_width', |
88 | - 'name' => __( 'Logo width', 'invoicing' ), |
|
89 | - 'desc' => __( 'Logo width to use in invoice image.', 'invoicing' ), |
|
88 | + 'name' => __('Logo width', 'invoicing'), |
|
89 | + 'desc' => __('Logo width to use in invoice image.', 'invoicing'), |
|
90 | 90 | 'type' => 'number', |
91 | - 'placeholder' => __( 'Auto', 'invoicing' ), |
|
91 | + 'placeholder' => __('Auto', 'invoicing'), |
|
92 | 92 | ), |
93 | 93 | 'logo_height' => array( |
94 | 94 | 'id' => 'logo_height', |
95 | - 'name' => __( 'Logo height', 'invoicing' ), |
|
96 | - 'desc' => __( 'Logo height to use in invoice image.', 'invoicing' ), |
|
95 | + 'name' => __('Logo height', 'invoicing'), |
|
96 | + 'desc' => __('Logo height to use in invoice image.', 'invoicing'), |
|
97 | 97 | 'type' => 'number', |
98 | - 'placeholder' => __( 'Auto', 'invoicing' ), |
|
98 | + 'placeholder' => __('Auto', 'invoicing'), |
|
99 | 99 | ), |
100 | 100 | 'store_address' => array( |
101 | 101 | 'id' => 'store_address', |
102 | - 'name' => __( 'Store Address', 'invoicing' ), |
|
103 | - 'desc' => __( 'Enter the store address to display on invoice', 'invoicing' ), |
|
102 | + 'name' => __('Store Address', 'invoicing'), |
|
103 | + 'desc' => __('Enter the store address to display on invoice', 'invoicing'), |
|
104 | 104 | 'type' => 'textarea', |
105 | 105 | ), |
106 | 106 | |
@@ -108,114 +108,114 @@ discard block |
||
108 | 108 | 'page_section' => array( |
109 | 109 | 'page_settings' => array( |
110 | 110 | 'id' => 'page_settings', |
111 | - 'name' => '<h3>' . __( 'Page Settings', 'invoicing' ) . '</h3>', |
|
111 | + 'name' => '<h3>' . __('Page Settings', 'invoicing') . '</h3>', |
|
112 | 112 | 'desc' => '', |
113 | 113 | 'type' => 'header', |
114 | 114 | ), |
115 | 115 | 'checkout_page' => array( |
116 | 116 | 'id' => 'checkout_page', |
117 | - 'name' => __( 'Checkout Page', 'invoicing' ), |
|
118 | - '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' ), |
|
117 | + 'name' => __('Checkout Page', 'invoicing'), |
|
118 | + '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'), |
|
119 | 119 | 'type' => 'select', |
120 | 120 | 'options' => $pages, |
121 | 121 | 'class' => 'wpi_select2', |
122 | - 'placeholder' => __( 'Select a page', 'invoicing' ), |
|
123 | - 'default_content' => empty( $getpaid_pages['checkout_page'] ) ? '' : $getpaid_pages['checkout_page']['content'], |
|
122 | + 'placeholder' => __('Select a page', 'invoicing'), |
|
123 | + 'default_content' => empty($getpaid_pages['checkout_page']) ? '' : $getpaid_pages['checkout_page']['content'], |
|
124 | 124 | 'help-tip' => true, |
125 | 125 | ), |
126 | 126 | 'success_page' => array( |
127 | 127 | 'id' => 'success_page', |
128 | - 'name' => __( 'Success Page', 'invoicing' ), |
|
129 | - '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' ), |
|
128 | + 'name' => __('Success Page', 'invoicing'), |
|
129 | + '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'), |
|
130 | 130 | 'type' => 'select', |
131 | 131 | 'options' => $pages, |
132 | 132 | 'class' => 'wpi_select2', |
133 | - 'placeholder' => __( 'Select a page', 'invoicing' ), |
|
134 | - 'default_content' => empty( $getpaid_pages['success_page'] ) ? '' : $getpaid_pages['success_page']['content'], |
|
133 | + 'placeholder' => __('Select a page', 'invoicing'), |
|
134 | + 'default_content' => empty($getpaid_pages['success_page']) ? '' : $getpaid_pages['success_page']['content'], |
|
135 | 135 | 'help-tip' => true, |
136 | 136 | ), |
137 | 137 | 'failure_page' => array( |
138 | 138 | 'id' => 'failure_page', |
139 | - 'name' => __( 'Failed Transaction Page', 'invoicing' ), |
|
140 | - 'desc' => __( 'This is the page buyers are sent to if their transaction is cancelled or fails.', 'invoicing' ), |
|
139 | + 'name' => __('Failed Transaction Page', 'invoicing'), |
|
140 | + 'desc' => __('This is the page buyers are sent to if their transaction is cancelled or fails.', 'invoicing'), |
|
141 | 141 | 'type' => 'select', |
142 | 142 | 'options' => $pages, |
143 | 143 | 'class' => 'wpi_select2', |
144 | - 'placeholder' => __( 'Select a page', 'invoicing' ), |
|
145 | - 'default_content' => empty( $getpaid_pages['failure_page'] ) ? '' : $getpaid_pages['failure_page']['content'], |
|
144 | + 'placeholder' => __('Select a page', 'invoicing'), |
|
145 | + 'default_content' => empty($getpaid_pages['failure_page']) ? '' : $getpaid_pages['failure_page']['content'], |
|
146 | 146 | 'help-tip' => true, |
147 | 147 | ), |
148 | 148 | 'invoice_history_page' => array( |
149 | 149 | 'id' => 'invoice_history_page', |
150 | - 'name' => __( 'Invoice History Page', 'invoicing' ), |
|
151 | - 'desc' => __( 'This page shows an invoice history for the current user. The <b>[wpinv_history]</b> short code should be on this page.', 'invoicing' ), |
|
150 | + 'name' => __('Invoice History Page', 'invoicing'), |
|
151 | + 'desc' => __('This page shows an invoice history for the current user. The <b>[wpinv_history]</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' ), |
|
156 | - 'default_content' => empty( $getpaid_pages['invoice_history_page'] ) ? '' : $getpaid_pages['invoice_history_page']['content'], |
|
155 | + 'placeholder' => __('Select a page', 'invoicing'), |
|
156 | + 'default_content' => empty($getpaid_pages['invoice_history_page']) ? '' : $getpaid_pages['invoice_history_page']['content'], |
|
157 | 157 | 'help-tip' => true, |
158 | 158 | ), |
159 | 159 | 'invoice_subscription_page' => array( |
160 | 160 | 'id' => 'invoice_subscription_page', |
161 | - 'name' => __( 'Invoice Subscriptions Page', 'invoicing' ), |
|
162 | - 'desc' => __( 'This page shows subscriptions history for the current user. The <b>[wpinv_subscriptions]</b> short code should be on this page.', 'invoicing' ), |
|
161 | + 'name' => __('Invoice Subscriptions Page', 'invoicing'), |
|
162 | + 'desc' => __('This page shows subscriptions history for the current user. The <b>[wpinv_subscriptions]</b> short code should be on this page.', 'invoicing'), |
|
163 | 163 | 'type' => 'select', |
164 | 164 | 'options' => $pages, |
165 | 165 | 'class' => 'wpi_select2', |
166 | - 'placeholder' => __( 'Select a page', 'invoicing' ), |
|
167 | - 'default_content' => empty( $getpaid_pages['invoice_subscription_page'] ) ? '' : $getpaid_pages['invoice_subscription_page']['content'], |
|
166 | + 'placeholder' => __('Select a page', 'invoicing'), |
|
167 | + 'default_content' => empty($getpaid_pages['invoice_subscription_page']) ? '' : $getpaid_pages['invoice_subscription_page']['content'], |
|
168 | 168 | 'help-tip' => true, |
169 | 169 | ), |
170 | 170 | ), |
171 | 171 | 'currency_section' => array( |
172 | 172 | 'currency_settings' => array( |
173 | 173 | 'id' => 'currency_settings', |
174 | - 'name' => '<h3>' . __( 'Currency Settings', 'invoicing' ) . '</h3>', |
|
174 | + 'name' => '<h3>' . __('Currency Settings', 'invoicing') . '</h3>', |
|
175 | 175 | 'desc' => '', |
176 | 176 | 'type' => 'header', |
177 | 177 | ), |
178 | 178 | 'currency' => array( |
179 | 179 | 'id' => 'currency', |
180 | - 'name' => __( 'Currency', 'invoicing' ), |
|
181 | - 'desc' => __( 'Choose your currency. Note that some payment gateways have currency restrictions.', 'invoicing' ), |
|
180 | + 'name' => __('Currency', 'invoicing'), |
|
181 | + 'desc' => __('Choose your currency. Note that some payment gateways have currency restrictions.', 'invoicing'), |
|
182 | 182 | 'type' => 'select', |
183 | 183 | 'class' => 'wpi_select2', |
184 | 184 | 'options' => $currency_code_options, |
185 | 185 | ), |
186 | 186 | 'currency_position' => array( |
187 | 187 | 'id' => 'currency_position', |
188 | - 'name' => __( 'Currency Position', 'invoicing' ), |
|
189 | - 'desc' => __( 'Choose the location of the currency sign.', 'invoicing' ), |
|
188 | + 'name' => __('Currency Position', 'invoicing'), |
|
189 | + 'desc' => __('Choose the location of the currency sign.', 'invoicing'), |
|
190 | 190 | 'type' => 'select', |
191 | 191 | 'class' => 'wpi_select2', |
192 | 192 | 'options' => array( |
193 | - 'left' => __( 'Left', 'invoicing' ) . ' (' . $currency_symbol . wpinv_format_amount( '99.99' ) . ')', |
|
194 | - 'right' => __( 'Right', 'invoicing' ) . ' ('. wpinv_format_amount( '99.99' ) . $currency_symbol . ')', |
|
195 | - 'left_space' => __( 'Left with space', 'invoicing' ) . ' (' . $currency_symbol . ' ' . wpinv_format_amount( '99.99' ) . ')', |
|
196 | - 'right_space' => __( 'Right with space', 'invoicing' ) . ' (' . wpinv_format_amount( '99.99' ) . ' ' . $currency_symbol . ')' |
|
193 | + 'left' => __('Left', 'invoicing') . ' (' . $currency_symbol . wpinv_format_amount('99.99') . ')', |
|
194 | + 'right' => __('Right', 'invoicing') . ' (' . wpinv_format_amount('99.99') . $currency_symbol . ')', |
|
195 | + 'left_space' => __('Left with space', 'invoicing') . ' (' . $currency_symbol . ' ' . wpinv_format_amount('99.99') . ')', |
|
196 | + 'right_space' => __('Right with space', 'invoicing') . ' (' . wpinv_format_amount('99.99') . ' ' . $currency_symbol . ')' |
|
197 | 197 | ) |
198 | 198 | ), |
199 | 199 | 'thousands_separator' => array( |
200 | 200 | 'id' => 'thousands_separator', |
201 | - 'name' => __( 'Thousands Separator', 'invoicing' ), |
|
202 | - 'desc' => __( 'The symbol (usually , or .) to separate thousands', 'invoicing' ), |
|
201 | + 'name' => __('Thousands Separator', 'invoicing'), |
|
202 | + 'desc' => __('The symbol (usually , or .) to separate thousands', 'invoicing'), |
|
203 | 203 | 'type' => 'text', |
204 | 204 | 'size' => 'small', |
205 | 205 | 'std' => ',', |
206 | 206 | ), |
207 | 207 | 'decimal_separator' => array( |
208 | 208 | 'id' => 'decimal_separator', |
209 | - 'name' => __( 'Decimal Separator', 'invoicing' ), |
|
210 | - 'desc' => __( 'The symbol (usually , or .) to separate decimal points', 'invoicing' ), |
|
209 | + 'name' => __('Decimal Separator', 'invoicing'), |
|
210 | + 'desc' => __('The symbol (usually , or .) to separate decimal points', 'invoicing'), |
|
211 | 211 | 'type' => 'text', |
212 | 212 | 'size' => 'small', |
213 | 213 | 'std' => '.', |
214 | 214 | ), |
215 | 215 | 'decimals' => array( |
216 | 216 | 'id' => 'decimals', |
217 | - 'name' => __( 'Number of Decimals', 'invoicing' ), |
|
218 | - 'desc' => __( 'This sets the number of decimal points shown in displayed prices.', 'invoicing' ), |
|
217 | + 'name' => __('Number of Decimals', 'invoicing'), |
|
218 | + 'desc' => __('This sets the number of decimal points shown in displayed prices.', 'invoicing'), |
|
219 | 219 | 'type' => 'number', |
220 | 220 | 'size' => 'small', |
221 | 221 | 'std' => '2', |
@@ -227,21 +227,21 @@ discard block |
||
227 | 227 | 'labels' => array( |
228 | 228 | 'labels' => array( |
229 | 229 | 'id' => 'labels_settings', |
230 | - 'name' => '<h3>' . __( 'Invoice Labels', 'invoicing' ) . '</h3>', |
|
230 | + 'name' => '<h3>' . __('Invoice Labels', 'invoicing') . '</h3>', |
|
231 | 231 | 'desc' => '', |
232 | 232 | 'type' => 'header', |
233 | 233 | ), |
234 | 234 | 'vat_invoice_notice_label' => array( |
235 | 235 | 'id' => 'vat_invoice_notice_label', |
236 | - 'name' => __( 'Invoice Notice Label', 'invoicing' ), |
|
237 | - 'desc' => __( 'Use this to add an invoice notice section (label) to your invoices', 'invoicing' ), |
|
236 | + 'name' => __('Invoice Notice Label', 'invoicing'), |
|
237 | + 'desc' => __('Use this to add an invoice notice section (label) to your invoices', 'invoicing'), |
|
238 | 238 | 'type' => 'text', |
239 | 239 | 'size' => 'regular', |
240 | 240 | ), |
241 | 241 | 'vat_invoice_notice' => array( |
242 | 242 | 'id' => 'vat_invoice_notice', |
243 | - 'name' => __( 'Invoice notice', 'invoicing' ), |
|
244 | - 'desc' => __( 'Use this to add an invoice notice section (description) to your invoices', 'invoicing' ), |
|
243 | + 'name' => __('Invoice notice', 'invoicing'), |
|
244 | + 'desc' => __('Use this to add an invoice notice section (description) to your invoices', 'invoicing'), |
|
245 | 245 | 'type' => 'text', |
246 | 246 | 'size' => 'regular', |
247 | 247 | ), |
@@ -253,22 +253,22 @@ discard block |
||
253 | 253 | 'main' => array( |
254 | 254 | 'gateway_settings' => array( |
255 | 255 | 'id' => 'api_header', |
256 | - 'name' => '<h3>' . __( 'Gateway Settings', 'invoicing' ) . '</h3>', |
|
256 | + 'name' => '<h3>' . __('Gateway Settings', 'invoicing') . '</h3>', |
|
257 | 257 | 'desc' => '', |
258 | 258 | 'type' => 'header', |
259 | 259 | ), |
260 | 260 | 'gateways' => array( |
261 | 261 | 'id' => 'gateways', |
262 | - 'name' => __( 'Payment Gateways', 'invoicing' ), |
|
263 | - 'desc' => __( 'Choose the payment gateways you want to enable.', 'invoicing' ), |
|
262 | + 'name' => __('Payment Gateways', 'invoicing'), |
|
263 | + 'desc' => __('Choose the payment gateways you want to enable.', 'invoicing'), |
|
264 | 264 | 'type' => 'gateways', |
265 | - 'std' => array( 'manual'=>1 ), |
|
265 | + 'std' => array('manual'=>1), |
|
266 | 266 | 'options' => wpinv_get_payment_gateways(), |
267 | 267 | ), |
268 | 268 | 'default_gateway' => array( |
269 | 269 | 'id' => 'default_gateway', |
270 | - 'name' => __( 'Default Gateway', 'invoicing' ), |
|
271 | - 'desc' => __( 'This gateway will be loaded automatically with the checkout page.', 'invoicing' ), |
|
270 | + 'name' => __('Default Gateway', 'invoicing'), |
|
271 | + 'desc' => __('This gateway will be loaded automatically with the checkout page.', 'invoicing'), |
|
272 | 272 | 'type' => 'gateway_select', |
273 | 273 | 'std' => 'manual', |
274 | 274 | 'class' => 'wpi_select2', |
@@ -283,32 +283,32 @@ discard block |
||
283 | 283 | 'main' => array( |
284 | 284 | 'tax_settings' => array( |
285 | 285 | 'id' => 'tax_settings', |
286 | - 'name' => '<h3>' . __( 'Tax Settings', 'invoicing' ) . '</h3>', |
|
286 | + 'name' => '<h3>' . __('Tax Settings', 'invoicing') . '</h3>', |
|
287 | 287 | 'type' => 'header', |
288 | 288 | ), |
289 | 289 | |
290 | 290 | 'enable_taxes' => array( |
291 | 291 | 'id' => 'enable_taxes', |
292 | - 'name' => __( 'Enable Taxes', 'invoicing' ), |
|
293 | - 'desc' => __( 'Enable tax rates and calculations.', 'invoicing' ), |
|
292 | + 'name' => __('Enable Taxes', 'invoicing'), |
|
293 | + 'desc' => __('Enable tax rates and calculations.', 'invoicing'), |
|
294 | 294 | 'type' => 'checkbox', |
295 | 295 | 'std' => 0, |
296 | 296 | ), |
297 | 297 | |
298 | 298 | 'tax_subtotal_rounding' => array( |
299 | 299 | 'id' => 'tax_subtotal_rounding', |
300 | - 'name' => __( 'Rounding', 'invoicing' ), |
|
301 | - 'desc' => __( 'Round tax at subtotal level, instead of rounding per tax rate', 'invoicing' ), |
|
300 | + 'name' => __('Rounding', 'invoicing'), |
|
301 | + 'desc' => __('Round tax at subtotal level, instead of rounding per tax rate', 'invoicing'), |
|
302 | 302 | 'type' => 'checkbox', |
303 | 303 | 'std' => 1, |
304 | 304 | ), |
305 | 305 | |
306 | 306 | 'prices_include_tax' => array( |
307 | 307 | 'id' => 'prices_include_tax', |
308 | - 'name' => __( 'Prices entered with tax', 'invoicing' ), |
|
308 | + 'name' => __('Prices entered with tax', 'invoicing'), |
|
309 | 309 | 'options' => array( |
310 | - 'yes' => __( 'Yes, I will enter prices inclusive of tax', 'invoicing' ), |
|
311 | - 'no' => __( 'No, I will enter prices exclusive of tax', 'invoicing' ), |
|
310 | + 'yes' => __('Yes, I will enter prices inclusive of tax', 'invoicing'), |
|
311 | + 'no' => __('No, I will enter prices exclusive of tax', 'invoicing'), |
|
312 | 312 | ), |
313 | 313 | 'type' => 'select', |
314 | 314 | 'std' => 'no', |
@@ -316,10 +316,10 @@ discard block |
||
316 | 316 | |
317 | 317 | 'tax_base' => array( |
318 | 318 | 'id' => 'tax_base', |
319 | - 'name' => __( 'Calculate tax based on', 'invoicing' ), |
|
319 | + 'name' => __('Calculate tax based on', 'invoicing'), |
|
320 | 320 | 'options' => array( |
321 | - 'billing' => __( 'Customer billing address', 'invoicing' ), |
|
322 | - 'base' => __( 'Shop base address', 'invoicing' ), |
|
321 | + 'billing' => __('Customer billing address', 'invoicing'), |
|
322 | + 'base' => __('Shop base address', 'invoicing'), |
|
323 | 323 | ), |
324 | 324 | 'type' => 'select', |
325 | 325 | 'std' => 'billing', |
@@ -327,10 +327,10 @@ discard block |
||
327 | 327 | |
328 | 328 | 'tax_display_totals' => array( |
329 | 329 | 'id' => 'tax_display_totals', |
330 | - 'name' => __( 'Display tax totals', 'invoicing' ), |
|
330 | + 'name' => __('Display tax totals', 'invoicing'), |
|
331 | 331 | 'options' => array( |
332 | - 'single' => __( 'As a single total', 'invoicing' ), |
|
333 | - 'individual' => __( 'As individual tax rates', 'invoicing' ), |
|
332 | + 'single' => __('As a single total', 'invoicing'), |
|
333 | + 'individual' => __('As individual tax rates', 'invoicing'), |
|
334 | 334 | ), |
335 | 335 | 'type' => 'select', |
336 | 336 | 'std' => 'individual', |
@@ -338,8 +338,8 @@ discard block |
||
338 | 338 | |
339 | 339 | 'tax_rate' => array( |
340 | 340 | 'id' => 'tax_rate', |
341 | - 'name' => __( 'Fallback Tax Rate', 'invoicing' ), |
|
342 | - 'desc' => __( 'Enter a percentage, such as 6.5. Customers not in a specific rate will be charged this rate.', 'invoicing' ), |
|
341 | + 'name' => __('Fallback Tax Rate', 'invoicing'), |
|
342 | + 'desc' => __('Enter a percentage, such as 6.5. Customers not in a specific rate will be charged this rate.', 'invoicing'), |
|
343 | 343 | 'type' => 'number', |
344 | 344 | 'size' => 'small', |
345 | 345 | 'min' => '0', |
@@ -351,8 +351,8 @@ discard block |
||
351 | 351 | 'rates' => array( |
352 | 352 | 'tax_rates' => array( |
353 | 353 | 'id' => 'tax_rates', |
354 | - 'name' => '<h3>' . __( 'Tax Rates', 'invoicing' ) . '</h3>', |
|
355 | - 'desc' => __( 'Enter tax rates for specific regions.', 'invoicing' ), |
|
354 | + 'name' => '<h3>' . __('Tax Rates', 'invoicing') . '</h3>', |
|
355 | + 'desc' => __('Enter tax rates for specific regions.', 'invoicing'), |
|
356 | 356 | 'type' => 'tax_rates', |
357 | 357 | ), |
358 | 358 | ), |
@@ -361,45 +361,45 @@ discard block |
||
361 | 361 | |
362 | 362 | 'vat_company_name' => array( |
363 | 363 | 'id' => 'vat_company_name', |
364 | - 'name' => __( 'Company Name', 'invoicing' ), |
|
365 | - 'desc' => wp_sprintf(__( 'Verify your company name and VAT number on the %sEU VIES System.%s', 'invoicing' ), '<a href="http://ec.europa.eu/taxation_customs/vies/" target="_blank">', '</a>' ), |
|
364 | + 'name' => __('Company Name', 'invoicing'), |
|
365 | + 'desc' => wp_sprintf(__('Verify your company name and VAT number on the %sEU VIES System.%s', 'invoicing'), '<a href="http://ec.europa.eu/taxation_customs/vies/" target="_blank">', '</a>'), |
|
366 | 366 | 'type' => 'text', |
367 | 367 | 'size' => 'regular', |
368 | 368 | ), |
369 | 369 | |
370 | 370 | 'vat_number' => array( |
371 | 371 | 'id' => 'vat_number', |
372 | - 'name' => __( 'VAT Number', 'invoicing' ), |
|
373 | - 'desc' => __( 'Enter your VAT number including the country identifier, eg: GB123456789', 'invoicing' ), |
|
372 | + 'name' => __('VAT Number', 'invoicing'), |
|
373 | + 'desc' => __('Enter your VAT number including the country identifier, eg: GB123456789', 'invoicing'), |
|
374 | 374 | 'type' => 'text', |
375 | 375 | 'size' => 'regular', |
376 | 376 | ), |
377 | 377 | |
378 | 378 | 'vat_prevent_b2c_purchase' => array( |
379 | 379 | 'id' => 'vat_prevent_b2c_purchase', |
380 | - 'name' => __( 'Prevent B2C Sales', 'invoicing' ), |
|
381 | - 'desc' => __( 'Require everyone in the EU to provide a VAT number.', 'invoicing' ), |
|
380 | + 'name' => __('Prevent B2C Sales', 'invoicing'), |
|
381 | + 'desc' => __('Require everyone in the EU to provide a VAT number.', 'invoicing'), |
|
382 | 382 | 'type' => 'checkbox' |
383 | 383 | ), |
384 | 384 | |
385 | 385 | 'validate_vat_number' => array( |
386 | 386 | 'id' => 'validate_vat_number', |
387 | - 'name' => __( 'Validate VAT Number', 'invoicing' ), |
|
388 | - 'desc' => __( 'Validate VAT numbers with VIES.', 'invoicing' ), |
|
387 | + 'name' => __('Validate VAT Number', 'invoicing'), |
|
388 | + 'desc' => __('Validate VAT numbers with VIES.', 'invoicing'), |
|
389 | 389 | 'type' => 'checkbox' |
390 | 390 | ), |
391 | 391 | |
392 | 392 | 'vat_same_country_rule' => array( |
393 | 393 | 'id' => 'vat_same_country_rule', |
394 | - 'name' => __( 'Same Country Rule', 'invoicing' ), |
|
395 | - 'desc' => __( 'What should happen if a customer is from the same country as your business?', 'invoicing' ), |
|
394 | + 'name' => __('Same Country Rule', 'invoicing'), |
|
395 | + 'desc' => __('What should happen if a customer is from the same country as your business?', 'invoicing'), |
|
396 | 396 | 'type' => 'select', |
397 | 397 | 'options' => array( |
398 | - 'no' => __( 'Do not charge tax', 'invoicing' ), |
|
399 | - 'always' => __( 'Charge tax unless vat number is validated', 'invoicing' ), |
|
400 | - 'vat_too' => __( 'Charge tax even if vat number is validated', 'invoicing' ) |
|
398 | + 'no' => __('Do not charge tax', 'invoicing'), |
|
399 | + 'always' => __('Charge tax unless vat number is validated', 'invoicing'), |
|
400 | + 'vat_too' => __('Charge tax even if vat number is validated', 'invoicing') |
|
401 | 401 | ), |
402 | - 'placeholder' => __( 'Select an option', 'invoicing' ), |
|
402 | + 'placeholder' => __('Select an option', 'invoicing'), |
|
403 | 403 | 'std' => 'vat_too', |
404 | 404 | ), |
405 | 405 | |
@@ -413,66 +413,66 @@ discard block |
||
413 | 413 | 'main' => array( |
414 | 414 | 'email_settings_header' => array( |
415 | 415 | 'id' => 'email_settings_header', |
416 | - 'name' => '<h3>' . __( 'Email Sender Options', 'invoicing' ) . '</h3>', |
|
416 | + 'name' => '<h3>' . __('Email Sender Options', 'invoicing') . '</h3>', |
|
417 | 417 | 'type' => 'header', |
418 | 418 | ), |
419 | 419 | 'email_from_name' => array( |
420 | 420 | 'id' => 'email_from_name', |
421 | - 'name' => __( 'From Name', 'invoicing' ), |
|
422 | - 'desc' => __( 'Enter the sender\'s name appears in outgoing invoice emails. This should be your site name.', 'invoicing' ), |
|
423 | - 'std' => esc_attr( get_bloginfo( 'name', 'display' ) ), |
|
421 | + 'name' => __('From Name', 'invoicing'), |
|
422 | + 'desc' => __('Enter the sender\'s name appears in outgoing invoice emails. This should be your site name.', 'invoicing'), |
|
423 | + 'std' => esc_attr(get_bloginfo('name', 'display')), |
|
424 | 424 | 'type' => 'text', |
425 | 425 | ), |
426 | 426 | 'email_from' => array( |
427 | 427 | 'id' => 'email_from', |
428 | - 'name' => __( 'From Email', 'invoicing' ), |
|
429 | - 'desc' => sprintf (__( 'Email address to send invoice emails from. This will act as the "from" 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), |
|
430 | - 'std' => get_option( 'admin_email' ), |
|
428 | + 'name' => __('From Email', 'invoicing'), |
|
429 | + 'desc' => sprintf(__('Email address to send invoice emails from. This will act as the "from" 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), |
|
430 | + 'std' => get_option('admin_email'), |
|
431 | 431 | 'type' => 'text', |
432 | 432 | ), |
433 | 433 | 'admin_email' => array( |
434 | 434 | 'id' => 'admin_email', |
435 | - 'name' => __( 'Admin Email', 'invoicing' ), |
|
436 | - 'desc' => __( 'Where should we send admin notifications? This will is also act as the "reply-to" address for invoice emails', 'invoicing' ), |
|
437 | - 'std' => get_option( 'admin_email' ), |
|
435 | + 'name' => __('Admin Email', 'invoicing'), |
|
436 | + 'desc' => __('Where should we send admin notifications? This will is also act as the "reply-to" address for invoice emails', 'invoicing'), |
|
437 | + 'std' => get_option('admin_email'), |
|
438 | 438 | 'type' => 'text', |
439 | 439 | ), |
440 | 440 | 'skip_email_free_invoice' => array( |
441 | 441 | 'id' => 'skip_email_free_invoice', |
442 | - 'name' => __( 'Skip Free Invoices', 'invoicing' ), |
|
443 | - 'desc' => __( 'Check this to disable sending emails for free invoices.', 'invoicing' ), |
|
442 | + 'name' => __('Skip Free Invoices', 'invoicing'), |
|
443 | + 'desc' => __('Check this to disable sending emails for free invoices.', 'invoicing'), |
|
444 | 444 | 'type' => 'checkbox', |
445 | 445 | 'std' => false, |
446 | 446 | ), |
447 | 447 | 'overdue_settings_header' => array( |
448 | 448 | 'id' => 'overdue_settings_header', |
449 | - 'name' => '<h3>' . __( 'Due Date Settings', 'invoicing' ) . '</h3>', |
|
449 | + 'name' => '<h3>' . __('Due Date Settings', 'invoicing') . '</h3>', |
|
450 | 450 | 'type' => 'header', |
451 | 451 | ), |
452 | 452 | 'overdue_active' => array( |
453 | 453 | 'id' => 'overdue_active', |
454 | - 'name' => __( 'Enable Due Date', 'invoicing' ), |
|
455 | - 'desc' => __( 'Check this to enable due date option for invoices.', 'invoicing' ), |
|
454 | + 'name' => __('Enable Due Date', 'invoicing'), |
|
455 | + 'desc' => __('Check this to enable due date option for invoices.', 'invoicing'), |
|
456 | 456 | 'type' => 'checkbox', |
457 | 457 | 'std' => false, |
458 | 458 | ), |
459 | 459 | 'email_template_header' => array( |
460 | 460 | 'id' => 'email_template_header', |
461 | - 'name' => '<h3>' . __( 'Email Template', 'invoicing' ) . '</h3>', |
|
461 | + 'name' => '<h3>' . __('Email Template', 'invoicing') . '</h3>', |
|
462 | 462 | 'type' => 'header', |
463 | 463 | ), |
464 | 464 | 'email_header_image' => array( |
465 | 465 | 'id' => 'email_header_image', |
466 | - 'name' => __( 'Header Image', 'invoicing' ), |
|
467 | - 'desc' => __( 'URL to an image you want to show in the email header. Upload images using the media uploader (Admin > Media).', 'invoicing' ), |
|
466 | + 'name' => __('Header Image', 'invoicing'), |
|
467 | + 'desc' => __('URL to an image you want to show in the email header. Upload images using the media uploader (Admin > Media).', 'invoicing'), |
|
468 | 468 | 'std' => '', |
469 | 469 | 'type' => 'text', |
470 | 470 | ), |
471 | 471 | 'email_footer_text' => array( |
472 | 472 | 'id' => 'email_footer_text', |
473 | - 'name' => __( 'Footer Text', 'invoicing' ), |
|
474 | - 'desc' => __( 'The text to appear in the footer of all invoice emails.', 'invoicing' ), |
|
475 | - 'std' => get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by GetPaid', 'invoicing' ), |
|
473 | + 'name' => __('Footer Text', 'invoicing'), |
|
474 | + 'desc' => __('The text to appear in the footer of all invoice emails.', 'invoicing'), |
|
475 | + 'std' => get_bloginfo('name', 'display') . ' - ' . __('Powered by GetPaid', 'invoicing'), |
|
476 | 476 | 'type' => 'textarea', |
477 | 477 | 'class' => 'regular-text', |
478 | 478 | 'rows' => 2, |
@@ -480,29 +480,29 @@ discard block |
||
480 | 480 | ), |
481 | 481 | 'email_base_color' => array( |
482 | 482 | 'id' => 'email_base_color', |
483 | - 'name' => __( 'Base Color', 'invoicing' ), |
|
484 | - 'desc' => __( 'The base color for invoice email template. Default <code>#557da2</code>.', 'invoicing' ), |
|
483 | + 'name' => __('Base Color', 'invoicing'), |
|
484 | + 'desc' => __('The base color for invoice email template. Default <code>#557da2</code>.', 'invoicing'), |
|
485 | 485 | 'std' => '#557da2', |
486 | 486 | 'type' => 'color', |
487 | 487 | ), |
488 | 488 | 'email_background_color' => array( |
489 | 489 | 'id' => 'email_background_color', |
490 | - 'name' => __( 'Background Color', 'invoicing' ), |
|
491 | - 'desc' => __( 'The background color of email template. Default <code>#f5f5f5</code>.', 'invoicing' ), |
|
490 | + 'name' => __('Background Color', 'invoicing'), |
|
491 | + 'desc' => __('The background color of email template. Default <code>#f5f5f5</code>.', 'invoicing'), |
|
492 | 492 | 'std' => '#f5f5f5', |
493 | 493 | 'type' => 'color', |
494 | 494 | ), |
495 | 495 | 'email_body_background_color' => array( |
496 | 496 | 'id' => 'email_body_background_color', |
497 | - 'name' => __( 'Body Background Color', 'invoicing' ), |
|
498 | - 'desc' => __( 'The main body background color of email template. Default <code>#fdfdfd</code>.', 'invoicing' ), |
|
497 | + 'name' => __('Body Background Color', 'invoicing'), |
|
498 | + 'desc' => __('The main body background color of email template. Default <code>#fdfdfd</code>.', 'invoicing'), |
|
499 | 499 | 'std' => '#fdfdfd', |
500 | 500 | 'type' => 'color', |
501 | 501 | ), |
502 | 502 | 'email_text_color' => array( |
503 | 503 | 'id' => 'email_text_color', |
504 | - 'name' => __( 'Body Text Color', 'invoicing' ), |
|
505 | - 'desc' => __( 'The main body text color. Default <code>#505050</code>.', 'invoicing' ), |
|
504 | + 'name' => __('Body Text Color', 'invoicing'), |
|
505 | + 'desc' => __('The main body text color. Default <code>#505050</code>.', 'invoicing'), |
|
506 | 506 | 'std' => '#505050', |
507 | 507 | 'type' => 'color', |
508 | 508 | ), |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | ), |
518 | 518 | |
519 | 519 | // Integrations. |
520 | - 'integrations' => wp_list_pluck( getpaid_get_integration_settings(), 'settings', 'id' ), |
|
520 | + 'integrations' => wp_list_pluck(getpaid_get_integration_settings(), 'settings', 'id'), |
|
521 | 521 | |
522 | 522 | /** Privacy Settings */ |
523 | 523 | 'privacy' => apply_filters('wpinv_settings_privacy', |
@@ -525,17 +525,17 @@ discard block |
||
525 | 525 | 'main' => array( |
526 | 526 | 'invoicing_privacy_policy_settings' => array( |
527 | 527 | 'id' => 'invoicing_privacy_policy_settings', |
528 | - 'name' => '<h3>' . __( 'Privacy Policy', 'invoicing' ) . '</h3>', |
|
528 | + 'name' => '<h3>' . __('Privacy Policy', 'invoicing') . '</h3>', |
|
529 | 529 | 'type' => 'header', |
530 | 530 | ), |
531 | 531 | 'privacy_page' => array( |
532 | 532 | 'id' => 'privacy_page', |
533 | - 'name' => __( 'Privacy Page', 'invoicing' ), |
|
534 | - 'desc' => __( 'If no privacy policy page set in Settings->Privacy default settings, this page will be used on checkout page.', 'invoicing' ), |
|
533 | + 'name' => __('Privacy Page', 'invoicing'), |
|
534 | + 'desc' => __('If no privacy policy page set in Settings->Privacy default settings, this page will be used on checkout page.', 'invoicing'), |
|
535 | 535 | 'type' => 'select', |
536 | - 'options' => wpinv_get_pages( true, __( 'Select a page', 'invoicing' )), |
|
536 | + 'options' => wpinv_get_pages(true, __('Select a page', 'invoicing')), |
|
537 | 537 | 'class' => 'wpi_select2', |
538 | - 'placeholder' => __( 'Select a page', 'invoicing' ), |
|
538 | + 'placeholder' => __('Select a page', 'invoicing'), |
|
539 | 539 | ), |
540 | 540 | ), |
541 | 541 | ) |
@@ -546,19 +546,19 @@ discard block |
||
546 | 546 | 'main' => array( |
547 | 547 | 'invoice_number_format_settings' => array( |
548 | 548 | 'id' => 'invoice_number_format_settings', |
549 | - 'name' => '<h3>' . __( 'Invoice Number', 'invoicing' ) . '</h3>', |
|
549 | + 'name' => '<h3>' . __('Invoice Number', 'invoicing') . '</h3>', |
|
550 | 550 | 'type' => 'header', |
551 | 551 | ), |
552 | 552 | 'sequential_invoice_number' => array( |
553 | 553 | 'id' => 'sequential_invoice_number', |
554 | - 'name' => __( 'Sequential Invoice Numbers', 'invoicing' ), |
|
555 | - 'desc' => __('Check this box to enable sequential invoice numbers.', 'invoicing' ) . $reset_number, |
|
554 | + 'name' => __('Sequential Invoice Numbers', 'invoicing'), |
|
555 | + 'desc' => __('Check this box to enable sequential invoice numbers.', 'invoicing') . $reset_number, |
|
556 | 556 | 'type' => 'checkbox', |
557 | 557 | ), |
558 | 558 | 'invoice_sequence_start' => array( |
559 | 559 | 'id' => 'invoice_sequence_start', |
560 | - 'name' => __( 'Sequential Starting Number', 'invoicing' ), |
|
561 | - 'desc' => __( 'The number at which the invoice number sequence should begin.', 'invoicing' ) . $last_number, |
|
560 | + 'name' => __('Sequential Starting Number', 'invoicing'), |
|
561 | + 'desc' => __('The number at which the invoice number sequence should begin.', 'invoicing') . $last_number, |
|
562 | 562 | 'type' => 'number', |
563 | 563 | 'size' => 'small', |
564 | 564 | 'std' => '1', |
@@ -566,8 +566,8 @@ discard block |
||
566 | 566 | ), |
567 | 567 | 'invoice_number_padd' => array( |
568 | 568 | 'id' => 'invoice_number_padd', |
569 | - 'name' => __( 'Minimum Digits', 'invoicing' ), |
|
570 | - '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' ), |
|
569 | + 'name' => __('Minimum Digits', 'invoicing'), |
|
570 | + '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'), |
|
571 | 571 | 'type' => 'select', |
572 | 572 | 'options' => $invoice_number_padd_options, |
573 | 573 | 'std' => 5, |
@@ -575,8 +575,8 @@ discard block |
||
575 | 575 | ), |
576 | 576 | 'invoice_number_prefix' => array( |
577 | 577 | 'id' => 'invoice_number_prefix', |
578 | - 'name' => __( 'Invoice Number Prefix', 'invoicing' ), |
|
579 | - 'desc' => __( 'Prefix for all invoice numbers. Ex: INV-', 'invoicing' ), |
|
578 | + 'name' => __('Invoice Number Prefix', 'invoicing'), |
|
579 | + 'desc' => __('Prefix for all invoice numbers. Ex: INV-', 'invoicing'), |
|
580 | 580 | 'type' => 'text', |
581 | 581 | 'size' => 'regular', |
582 | 582 | 'std' => 'INV-', |
@@ -584,46 +584,46 @@ discard block |
||
584 | 584 | ), |
585 | 585 | 'invoice_number_postfix' => array( |
586 | 586 | 'id' => 'invoice_number_postfix', |
587 | - 'name' => __( 'Invoice Number Postfix', 'invoicing' ), |
|
588 | - 'desc' => __( 'Postfix for all invoice numbers.', 'invoicing' ), |
|
587 | + 'name' => __('Invoice Number Postfix', 'invoicing'), |
|
588 | + 'desc' => __('Postfix for all invoice numbers.', 'invoicing'), |
|
589 | 589 | 'type' => 'text', |
590 | 590 | 'size' => 'regular', |
591 | 591 | 'std' => '' |
592 | 592 | ), |
593 | 593 | 'checkout_settings' => array( |
594 | 594 | 'id' => 'checkout_settings', |
595 | - 'name' => '<h3>' . __( 'Checkout Settings', 'invoicing' ) . '</h3>', |
|
595 | + 'name' => '<h3>' . __('Checkout Settings', 'invoicing') . '</h3>', |
|
596 | 596 | 'type' => 'header', |
597 | 597 | ), |
598 | 598 | 'disable_new_user_emails' => array( |
599 | 599 | 'id' => 'disable_new_user_emails', |
600 | - 'name' => __( 'Disable new user emails', 'invoicing' ), |
|
601 | - 'desc' => __( 'Do not send an email to customers when a new user account is created for them.', 'invoicing' ), |
|
600 | + 'name' => __('Disable new user emails', 'invoicing'), |
|
601 | + 'desc' => __('Do not send an email to customers when a new user account is created for them.', 'invoicing'), |
|
602 | 602 | 'type' => 'checkbox', |
603 | 603 | ), |
604 | 604 | 'login_to_checkout' => array( |
605 | 605 | 'id' => 'login_to_checkout', |
606 | - 'name' => __( 'Require Login To Checkout', 'invoicing' ), |
|
607 | - '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' ), |
|
606 | + 'name' => __('Require Login To Checkout', 'invoicing'), |
|
607 | + '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'), |
|
608 | 608 | 'type' => 'checkbox', |
609 | 609 | ), |
610 | 610 | 'maxmind_license_key' => array( |
611 | 611 | 'id' => 'maxmind_license_key', |
612 | - 'name' => __( 'MaxMind License Key', 'invoicing' ), |
|
612 | + 'name' => __('MaxMind License Key', 'invoicing'), |
|
613 | 613 | 'type' => 'text', |
614 | 614 | 'size' => 'regular', |
615 | - 'desc' => __( "Enter you license key if you would like to use MaxMind to automatically detect a customer's country.", 'invoicing' ) . ' <a href="https://support.maxmind.com/account-faq/license-keys/how-do-i-generate-a-license-key/">' . __( 'How to generate a free license key.', 'invoicing' ) . '</a>', |
|
615 | + 'desc' => __("Enter you license key if you would like to use MaxMind to automatically detect a customer's country.", 'invoicing') . ' <a href="https://support.maxmind.com/account-faq/license-keys/how-do-i-generate-a-license-key/">' . __('How to generate a free license key.', 'invoicing') . '</a>', |
|
616 | 616 | ), |
617 | 617 | |
618 | 618 | 'uninstall_settings' => array( |
619 | 619 | 'id' => 'uninstall_settings', |
620 | - 'name' => '<h3>' . __( 'Uninstall Settings', 'invoicing' ) . '</h3>', |
|
620 | + 'name' => '<h3>' . __('Uninstall Settings', 'invoicing') . '</h3>', |
|
621 | 621 | 'type' => 'header', |
622 | 622 | ), |
623 | 623 | 'remove_data_on_unistall' => array( |
624 | 624 | 'id' => 'remove_data_on_unistall', |
625 | - 'name' => __( 'Remove Data on Uninstall?', 'invoicing' ), |
|
626 | - 'desc' => __( 'Check this box if you would like Invoicing plugin to completely remove all of its data when the plugin is deleted/uninstalled.', 'invoicing' ), |
|
625 | + 'name' => __('Remove Data on Uninstall?', 'invoicing'), |
|
626 | + 'desc' => __('Check this box if you would like Invoicing plugin to completely remove all of its data when the plugin is deleted/uninstalled.', 'invoicing'), |
|
627 | 627 | 'type' => 'checkbox', |
628 | 628 | 'std' => '' |
629 | 629 | ), |
@@ -632,13 +632,13 @@ discard block |
||
632 | 632 | 'custom-css' => array( |
633 | 633 | 'css_settings' => array( |
634 | 634 | 'id' => 'css_settings', |
635 | - 'name' => '<h3>' . __( 'Custom CSS', 'invoicing' ) . '</h3>', |
|
635 | + 'name' => '<h3>' . __('Custom CSS', 'invoicing') . '</h3>', |
|
636 | 636 | 'type' => 'header', |
637 | 637 | ), |
638 | 638 | 'template_custom_css' => array( |
639 | 639 | 'id' => 'template_custom_css', |
640 | - 'name' => __( 'Invoice Template CSS', 'invoicing' ), |
|
641 | - 'desc' => __( 'Add CSS to modify appearance of the print invoice page.', 'invoicing' ), |
|
640 | + 'name' => __('Invoice Template CSS', 'invoicing'), |
|
641 | + 'desc' => __('Add CSS to modify appearance of the print invoice page.', 'invoicing'), |
|
642 | 642 | 'type' => 'textarea', |
643 | 643 | 'class'=> 'regular-text', |
644 | 644 | 'rows' => 10, |
@@ -652,8 +652,8 @@ discard block |
||
652 | 652 | 'main' => array( |
653 | 653 | 'tool_settings' => array( |
654 | 654 | 'id' => 'tool_settings', |
655 | - 'name' => '<h3>' . __( 'Diagnostic Tools', 'invoicing' ) . '</h3>', |
|
656 | - 'desc' => __( 'Invoicing diagnostic tools', 'invoicing' ), |
|
655 | + 'name' => '<h3>' . __('Diagnostic Tools', 'invoicing') . '</h3>', |
|
656 | + 'desc' => __('Invoicing diagnostic tools', 'invoicing'), |
|
657 | 657 | 'type' => 'tools', |
658 | 658 | ), |
659 | 659 | ), |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Admin View: Page - Addons |
4 | 4 | * |
5 | 5 | */ |
6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
6 | +if (!defined('ABSPATH')) { |
|
7 | 7 | exit; |
8 | 8 | } |
9 | 9 | add_ThickBox(); |
@@ -11,19 +11,19 @@ discard block |
||
11 | 11 | <div class="wrap wpi_addons_wrap"> |
12 | 12 | <h1><?php echo get_admin_page_title(); ?></h1> |
13 | 13 | |
14 | - <?php if ( $tabs ){ ?> |
|
14 | + <?php if ($tabs) { ?> |
|
15 | 15 | <nav class="nav-tab-wrapper wpi-nav-tab-wrapper"> |
16 | 16 | <?php |
17 | - foreach ( $tabs as $name => $label ) { |
|
18 | - echo '<a href="' . admin_url( 'admin.php?page=wpi-addons&tab=' . $name ) . '" class="nav-tab ' . ( $current_tab == $name ? 'nav-tab-active' : '' ) . '">' . $label . '</a>'; |
|
17 | + foreach ($tabs as $name => $label) { |
|
18 | + echo '<a href="' . admin_url('admin.php?page=wpi-addons&tab=' . $name) . '" class="nav-tab ' . ($current_tab == $name ? 'nav-tab-active' : '') . '">' . $label . '</a>'; |
|
19 | 19 | } |
20 | - do_action( 'wpi_addons_tabs' ); |
|
20 | + do_action('wpi_addons_tabs'); |
|
21 | 21 | ?> |
22 | 22 | </nav> |
23 | 23 | |
24 | 24 | <?php |
25 | 25 | |
26 | - if($current_tab == 'membership'){ |
|
26 | + if ($current_tab == 'membership') { |
|
27 | 27 | |
28 | 28 | ?> |
29 | 29 | |
@@ -32,42 +32,42 @@ discard block |
||
32 | 32 | <!-- |
33 | 33 | <h2>With our WPInvoicing Membership you get access to all our products!</h2> |
34 | 34 | <p><a class="button button-primary" href="https://wpinvoicing.com/downloads/membership/">View Memberships</a></p>--> |
35 | - <?php if(defined('WP_EASY_UPDATES_ACTIVE')){?> |
|
36 | - <h2><?php _e("Have a membership key?","invoicing");?></h2> |
|
35 | + <?php if (defined('WP_EASY_UPDATES_ACTIVE')) {?> |
|
36 | + <h2><?php _e("Have a membership key?", "invoicing"); ?></h2> |
|
37 | 37 | <p> |
38 | 38 | <?php |
39 | - $wpeu_admin = new External_Updates_Admin('wpinvoicing.com','1'); |
|
40 | - echo $wpeu_admin->render_licence_actions('wpinvoicing.com', 'membership',array(95, 106, 108,12351)); |
|
39 | + $wpeu_admin = new External_Updates_Admin('wpinvoicing.com', '1'); |
|
40 | + echo $wpeu_admin->render_licence_actions('wpinvoicing.com', 'membership', array(95, 106, 108, 12351)); |
|
41 | 41 | ?> |
42 | 42 | </p> |
43 | 43 | <?php }?> |
44 | 44 | |
45 | 45 | <div class="membership-cta-contet"> |
46 | 46 | <div class="main-cta"> |
47 | - <h2><?php _e("Membership benefits Include:","invoicing");?></h2> |
|
47 | + <h2><?php _e("Membership benefits Include:", "invoicing"); ?></h2> |
|
48 | 48 | <div class="feature-list"> |
49 | 49 | <ul> |
50 | 50 | <?php |
51 | 51 | $addon_obj = new WPInv_Admin_Addons(); |
52 | - if ($addons = $addon_obj->get_section_data( 'addons' ) ) { |
|
53 | - foreach ( $addons as $addon ) { |
|
54 | - echo '<li><i class="far fa-check-circle fa-sm"></i> '.esc_html( $addon->info->title ).'</li>'; |
|
52 | + if ($addons = $addon_obj->get_section_data('addons')) { |
|
53 | + foreach ($addons as $addon) { |
|
54 | + echo '<li><i class="far fa-check-circle fa-sm"></i> ' . esc_html($addon->info->title) . '</li>'; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | ?> |
58 | 58 | </ul> |
59 | 59 | |
60 | 60 | <div class="feature-cta"> |
61 | - <h3><?php _e("Membership Starts from","invoicing");?></h3> |
|
61 | + <h3><?php _e("Membership Starts from", "invoicing"); ?></h3> |
|
62 | 62 | <h4>$99</h4> |
63 | - <a href="https://wpinvoicing.com/downloads/membership/" target="_blank"><?php _e("Buy Membership","invoicing");?></a> |
|
63 | + <a href="https://wpinvoicing.com/downloads/membership/" target="_blank"><?php _e("Buy Membership", "invoicing"); ?></a> |
|
64 | 64 | </div> |
65 | - <h3><?php _e("Included Gateways:","invoicing");?></h3> |
|
65 | + <h3><?php _e("Included Gateways:", "invoicing"); ?></h3> |
|
66 | 66 | <ul> |
67 | 67 | <?php |
68 | - if ($addons = $addon_obj->get_section_data( 'gateways' ) ) { |
|
69 | - foreach ( $addons as $addon ) { |
|
70 | - echo '<li><i class="far fa-check-circle fa-sm"></i> '.esc_html( $addon->info->title ).'</li>'; |
|
68 | + if ($addons = $addon_obj->get_section_data('gateways')) { |
|
69 | + foreach ($addons as $addon) { |
|
70 | + echo '<li><i class="far fa-check-circle fa-sm"></i> ' . esc_html($addon->info->title) . '</li>'; |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | ?> |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | <div class="testimonial-content"> |
82 | 82 | <div class="t-image"> |
83 | 83 | <?php |
84 | - echo '<img src="' . plugins_url( 'images/t-image2.png', dirname(__FILE__) ) . '" > '; |
|
84 | + echo '<img src="' . plugins_url('images/t-image2.png', dirname(__FILE__)) . '" > '; |
|
85 | 85 | ?> |
86 | 86 | </div> |
87 | 87 | <div class="t-content"> |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | <div class="testimonial-content"> |
102 | 102 | <div class="t-image"> |
103 | 103 | <?php |
104 | - echo '<img src="' . plugins_url( 'images/t-image1.png', dirname(__FILE__) ) . '" > '; |
|
104 | + echo '<img src="' . plugins_url('images/t-image1.png', dirname(__FILE__)) . '" > '; |
|
105 | 105 | ?> |
106 | 106 | </div> |
107 | 107 | <div class="t-content"> |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | </div> |
118 | 118 | </div> |
119 | 119 | <div class="member-footer"> |
120 | - <a class="footer-btn" href="https://wpinvoicing.com/downloads/membership/" target="_blank"><?php _e("Buy Membership","invoicing");?></a> |
|
121 | - <a class="footer-link" href="post-new.php?post_type=wpi_invoice"><?php _e("Create Invoice","invoicing");?></a> |
|
120 | + <a class="footer-btn" href="https://wpinvoicing.com/downloads/membership/" target="_blank"><?php _e("Buy Membership", "invoicing"); ?></a> |
|
121 | + <a class="footer-link" href="post-new.php?post_type=wpi_invoice"><?php _e("Create Invoice", "invoicing"); ?></a> |
|
122 | 122 | </div> |
123 | 123 | </div> |
124 | 124 | |
@@ -126,50 +126,50 @@ discard block |
||
126 | 126 | </div> |
127 | 127 | </div> |
128 | 128 | <?php |
129 | - }else{ |
|
129 | + } else { |
|
130 | 130 | $installed_plugins = get_plugins(); |
131 | 131 | $addon_obj = new WPInv_Admin_Addons(); |
132 | - if ($addons = $addon_obj->get_section_data( $current_tab ) ) : |
|
132 | + if ($addons = $addon_obj->get_section_data($current_tab)) : |
|
133 | 133 | //print_r($addons); |
134 | 134 | ?> |
135 | - <ul class="wpi-products"><?php foreach ( $addons as $addon ) : |
|
136 | - if(965==$addon->info->id){continue;}// don't show quote add on |
|
135 | + <ul class="wpi-products"><?php foreach ($addons as $addon) : |
|
136 | + if (965 == $addon->info->id) {continue; }// don't show quote add on |
|
137 | 137 | ?><li class="wpi-product"> |
138 | 138 | <div class="wpi-product-title"> |
139 | 139 | <h3><?php |
140 | - if ( ! empty( $addon->info->excerpt) ){ |
|
141 | - echo wpi_help_tip( $addon->info->excerpt ); |
|
140 | + if (!empty($addon->info->excerpt)) { |
|
141 | + echo wpi_help_tip($addon->info->excerpt); |
|
142 | 142 | } |
143 | - echo esc_html( $addon->info->title ); ?></h3> |
|
143 | + echo esc_html($addon->info->title); ?></h3> |
|
144 | 144 | </div> |
145 | 145 | |
146 | 146 | <span class="wpi-product-image"> |
147 | - <?php if ( ! empty( $addon->info->thumbnail) ) : ?> |
|
148 | - <img src="<?php echo esc_attr( $addon->info->thumbnail ); ?>"/> |
|
147 | + <?php if (!empty($addon->info->thumbnail)) : ?> |
|
148 | + <img src="<?php echo esc_attr($addon->info->thumbnail); ?>"/> |
|
149 | 149 | <?php endif; |
150 | 150 | |
151 | - if ( 'stripe-payment-gateway' == $addon->info->slug ) { |
|
151 | + if ('stripe-payment-gateway' == $addon->info->slug) { |
|
152 | 152 | $addon->info->slug = 'getpaid-stripe-payments'; |
153 | 153 | $addon->info->link = 'https://wordpress.org/plugins/getpaid-stripe-payments/'; |
154 | 154 | } |
155 | 155 | |
156 | - if(isset($addon->info->link) && substr( $addon->info->link, 0, 21 ) === "https://wordpress.org"){ |
|
157 | - echo '<a href="'.admin_url('/plugin-install.php?tab=plugin-information&plugin='.$addon->info->slug).'&width=770&height=660&TB_iframe=true" class="thickbox" >'; |
|
158 | - echo '<span class="wpi-product-info">'.__('More info','invoicing').'</span>'; |
|
156 | + if (isset($addon->info->link) && substr($addon->info->link, 0, 21) === "https://wordpress.org") { |
|
157 | + echo '<a href="' . admin_url('/plugin-install.php?tab=plugin-information&plugin=' . $addon->info->slug) . '&width=770&height=660&TB_iframe=true" class="thickbox" >'; |
|
158 | + echo '<span class="wpi-product-info">' . __('More info', 'invoicing') . '</span>'; |
|
159 | 159 | echo '</a>'; |
160 | - }elseif(isset($addon->info->link) && ( substr( $addon->info->link, 0, 23 ) === "https://wpinvoicing.com" || substr( $addon->info->link, 0, 21 ) === "https://wpgetpaid.com" ) ){ |
|
161 | - if(defined('WP_EASY_UPDATES_ACTIVE')){ |
|
162 | - $url = admin_url('/plugin-install.php?tab=plugin-information&plugin='.$addon->info->slug.'&width=770&height=660&item_id='.$addon->info->id.'&update_url=https://wpgetpaid.com&TB_iframe=true'); |
|
163 | - }else{ |
|
160 | + }elseif (isset($addon->info->link) && (substr($addon->info->link, 0, 23) === "https://wpinvoicing.com" || substr($addon->info->link, 0, 21) === "https://wpgetpaid.com")) { |
|
161 | + if (defined('WP_EASY_UPDATES_ACTIVE')) { |
|
162 | + $url = admin_url('/plugin-install.php?tab=plugin-information&plugin=' . $addon->info->slug . '&width=770&height=660&item_id=' . $addon->info->id . '&update_url=https://wpgetpaid.com&TB_iframe=true'); |
|
163 | + } else { |
|
164 | 164 | // if installed show activation link |
165 | - if(isset($installed_plugins['wp-easy-updates/external-updates.php'])){ |
|
165 | + if (isset($installed_plugins['wp-easy-updates/external-updates.php'])) { |
|
166 | 166 | $url = '#TB_inline?width=600&height=50&inlineId=wpi-wpeu-required-activation'; |
167 | - }else{ |
|
167 | + } else { |
|
168 | 168 | $url = '#TB_inline?width=600&height=50&inlineId=wpi-wpeu-required-for-external'; |
169 | 169 | } |
170 | 170 | } |
171 | - echo '<a href="'.$url.'" class="thickbox">'; |
|
172 | - echo '<span class="wpi-product-info">'.__('More info','invoicing').'</span>'; |
|
171 | + echo '<a href="' . $url . '" class="thickbox">'; |
|
172 | + echo '<span class="wpi-product-info">' . __('More info', 'invoicing') . '</span>'; |
|
173 | 173 | echo '</a>'; |
174 | 174 | } |
175 | 175 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | <span class="wpi-product-button"> |
182 | 182 | <?php |
183 | - $addon_obj->output_button( $addon ); |
|
183 | + $addon_obj->output_button($addon); |
|
184 | 184 | ?> |
185 | 185 | </span> |
186 | 186 | |
@@ -194,21 +194,21 @@ discard block |
||
194 | 194 | |
195 | 195 | <div class="clearfix" ></div> |
196 | 196 | |
197 | - <?php if($current_tab =='addons'){ ?> |
|
198 | - <p><?php printf( __( 'All of our Invoicing Addons can be found on WPInvoicing.com here: <a href="%s">Invoicing Addons</a>', 'invoicing' ), 'https://wpinvoicing.com/downloads/category/addons/' ); ?></p> |
|
199 | - <?php } if($current_tab =='gateways'){ ?> |
|
200 | - <p><?php printf( __( 'All of our Invoicing Payment Gateways can be found on WPInvoicing.com here: <a href="%s">Invoicing Payment Gateways</a>', 'invoicing' ), 'https://wpinvoicing.com/downloads/category/gateways/' ); ?></p> |
|
197 | + <?php if ($current_tab == 'addons') { ?> |
|
198 | + <p><?php printf(__('All of our Invoicing Addons can be found on WPInvoicing.com here: <a href="%s">Invoicing Addons</a>', 'invoicing'), 'https://wpinvoicing.com/downloads/category/addons/'); ?></p> |
|
199 | + <?php } if ($current_tab == 'gateways') { ?> |
|
200 | + <p><?php printf(__('All of our Invoicing Payment Gateways can be found on WPInvoicing.com here: <a href="%s">Invoicing Payment Gateways</a>', 'invoicing'), 'https://wpinvoicing.com/downloads/category/gateways/'); ?></p> |
|
201 | 201 | <?php } ?> |
202 | 202 | |
203 | - <div id="wpi-wpeu-required-activation" style="display:none;"><span class="wpi-notification "><?php printf( __("The plugin <a href='https://wpeasyupdates.com/' target='_blank'>WP Easy Updates</a> is required to check for and update some installed plugins/themes, please <a href='%s'>activate</a> it now.",'invoicing'),wp_nonce_url(admin_url('plugins.php?action=activate&plugin=wp-easy-updates/external-updates.php'), 'activate-plugin_wp-easy-updates/external-updates.php'));?></span></div> |
|
204 | - <div id="wpi-wpeu-required-for-external" style="display:none;"><span class="wpi-notification "><?php printf( __("The plugin <a href='https://wpeasyupdates.com/' target='_blank'>WP Easy Updates</a> is required to check for and update some installed plugins/themes, please <a href='%s' onclick='window.open(\"https://wpeasyupdates.com/wp-easy-updates.zip\", \"_blank\");' >download</a> and install it now.",'invoicing'),admin_url("plugin-install.php?tab=upload&wpeu-install=true"));?></span></div> |
|
203 | + <div id="wpi-wpeu-required-activation" style="display:none;"><span class="wpi-notification "><?php printf(__("The plugin <a href='https://wpeasyupdates.com/' target='_blank'>WP Easy Updates</a> is required to check for and update some installed plugins/themes, please <a href='%s'>activate</a> it now.", 'invoicing'), wp_nonce_url(admin_url('plugins.php?action=activate&plugin=wp-easy-updates/external-updates.php'), 'activate-plugin_wp-easy-updates/external-updates.php')); ?></span></div> |
|
204 | + <div id="wpi-wpeu-required-for-external" style="display:none;"><span class="wpi-notification "><?php printf(__("The plugin <a href='https://wpeasyupdates.com/' target='_blank'>WP Easy Updates</a> is required to check for and update some installed plugins/themes, please <a href='%s' onclick='window.open(\"https://wpeasyupdates.com/wp-easy-updates.zip\", \"_blank\");' >download</a> and install it now.", 'invoicing'), admin_url("plugin-install.php?tab=upload&wpeu-install=true")); ?></span></div> |
|
205 | 205 | <div id="wpeu-licence-popup" style="display:none;"> |
206 | 206 | <span class="wpi-notification noti-white"> |
207 | - <h3 class="wpeu-licence-title"><?php _e("Licence key",'invoicing');?></h3> |
|
208 | - <input class="wpeu-licence-key" type="text" placeholder="<?php _e("Enter your licence key",'invoicing');?>"> <button class="button-primary wpeu-licence-popup-button" ><?php _e("Install",'invoicing');?></button> |
|
207 | + <h3 class="wpeu-licence-title"><?php _e("Licence key", 'invoicing'); ?></h3> |
|
208 | + <input class="wpeu-licence-key" type="text" placeholder="<?php _e("Enter your licence key", 'invoicing'); ?>"> <button class="button-primary wpeu-licence-popup-button" ><?php _e("Install", 'invoicing'); ?></button> |
|
209 | 209 | <br> |
210 | 210 | <?php |
211 | - echo sprintf( __('%sFind your licence key here%s OR %sBuy one here%s', 'invoicing'), '<a href="https://wpinvoicing.com/your-account/" target="_blank">','</a>','<a class="wpeu-licence-link" href="https://wpinvoicing.com/downloads/category/addons/" target="_blank">','</a>' ); |
|
211 | + echo sprintf(__('%sFind your licence key here%s OR %sBuy one here%s', 'invoicing'), '<a href="https://wpinvoicing.com/your-account/" target="_blank">', '</a>', '<a class="wpeu-licence-link" href="https://wpinvoicing.com/downloads/category/addons/" target="_blank">', '</a>'); |
|
212 | 212 | ?> |
213 | 213 | </span> |
214 | 214 | </div> |
@@ -4,30 +4,30 @@ discard block |
||
4 | 4 | * |
5 | 5 | */ |
6 | 6 | |
7 | -defined( 'ABSPATH' ) || exit; |
|
7 | +defined('ABSPATH') || exit; |
|
8 | 8 | |
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <div class="card shadow-sm my-5">' |
12 | 12 | |
13 | - <form method="post" class="text-center card-body" action="<?php echo esc_url( admin_url() ); ?>"> |
|
14 | - <?php getpaid_hidden_field( 'getpaid-admin-action', 'install_plugin' ); ?> |
|
15 | - <?php wp_nonce_field( 'getpaid-nonce', 'getpaid-nonce' ); ?> |
|
16 | - <?php getpaid_hidden_field( 'redirect', $next_url ); ?> |
|
13 | + <form method="post" class="text-center card-body" action="<?php echo esc_url(admin_url()); ?>"> |
|
14 | + <?php getpaid_hidden_field('getpaid-admin-action', 'install_plugin'); ?> |
|
15 | + <?php wp_nonce_field('getpaid-nonce', 'getpaid-nonce'); ?> |
|
16 | + <?php getpaid_hidden_field('redirect', $next_url); ?> |
|
17 | 17 | <div class="gd-wizard-recommend"> |
18 | 18 | |
19 | - <h2 class="gd-settings-title h3"><?php _e( 'Recommended Plugins', 'invoicing' ); ?></h2> |
|
20 | - <p><?php _e( 'Below are a few of our own plugins that may help you.', 'invoicing' ); ?></p> |
|
19 | + <h2 class="gd-settings-title h3"><?php _e('Recommended Plugins', 'invoicing'); ?></h2> |
|
20 | + <p><?php _e('Below are a few of our own plugins that may help you.', 'invoicing'); ?></p> |
|
21 | 21 | |
22 | 22 | <ul class="list-group"> |
23 | - <?php foreach ( $recommended_plugins as $plugin ) : ?> |
|
23 | + <?php foreach ($recommended_plugins as $plugin) : ?> |
|
24 | 24 | <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap text-left"> |
25 | - <span class="mr-auto"><?php echo esc_html( $plugin['name'] ); ?></span> |
|
25 | + <span class="mr-auto"><?php echo esc_html($plugin['name']); ?></span> |
|
26 | 26 | <div class="custom-control custom-switch getpaid-install-plugin-siwtch-div mr-n2"> |
27 | - <input type="checkbox" name="plugins[<?php echo esc_attr( $plugin['slug'] ); ?>]" value="<?php echo esc_attr( $plugin['file'] ); ?>" class="custom-control-input" <?php if( is_plugin_active( $plugin['slug'] ) ){echo "checked";} ?>> |
|
27 | + <input type="checkbox" name="plugins[<?php echo esc_attr($plugin['slug']); ?>]" value="<?php echo esc_attr($plugin['file']); ?>" class="custom-control-input" <?php if (is_plugin_active($plugin['slug'])) {echo "checked"; } ?>> |
|
28 | 28 | <label class="custom-control-label" for="ac-setting-updates"></label> |
29 | 29 | </div> |
30 | - <small class="w-100"><?php echo esc_attr( $plugin['desc'] );?></small> |
|
30 | + <small class="w-100"><?php echo esc_attr($plugin['desc']); ?></small> |
|
31 | 31 | </li> |
32 | 32 | <?php endforeach; ?> |
33 | 33 | </ul> |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | <input |
37 | 37 | type="submit" |
38 | 38 | class="btn btn-primary button-next" |
39 | - value="<?php esc_attr_e( 'Continue', 'invoicing' ); ?>" name="save_step"/> |
|
39 | + value="<?php esc_attr_e('Continue', 'invoicing'); ?>" name="save_step"/> |
|
40 | 40 | </p> |
41 | 41 | |
42 | 42 | </div> |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * |
5 | 5 | */ |
6 | 6 | |
7 | -defined( 'ABSPATH' ) || exit; |
|
7 | +defined('ABSPATH') || exit; |
|
8 | 8 | |
9 | 9 | $aui_settings = AyeCode_UI_Settings::instance(); |
10 | 10 | $aui_settings->enqueue_scripts(); |
@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | <head> |
18 | 18 | <meta name="viewport" content="width=device-width"/> |
19 | 19 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
20 | - <title><?php esc_html_e( 'GetPaid › Setup Wizard', 'invoicing' ); ?></title> |
|
20 | + <title><?php esc_html_e('GetPaid › Setup Wizard', 'invoicing'); ?></title> |
|
21 | 21 | <?php |
22 | 22 | getpaid_admin()->enqeue_scripts(); |
23 | - wp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.13.0/css/all.css', array(), 'v5.13.0' ); |
|
24 | - wp_print_styles( 'select2' ); |
|
25 | - wp_print_scripts( 'select2' ); |
|
26 | - wp_print_scripts( 'wpinv-admin-script' ); |
|
27 | - do_action( 'admin_print_styles' ); |
|
28 | - do_action( 'admin_head' ); |
|
23 | + wp_enqueue_style('font-awesome', 'https://use.fontawesome.com/releases/v5.13.0/css/all.css', array(), 'v5.13.0'); |
|
24 | + wp_print_styles('select2'); |
|
25 | + wp_print_scripts('select2'); |
|
26 | + wp_print_scripts('wpinv-admin-script'); |
|
27 | + do_action('admin_print_styles'); |
|
28 | + do_action('admin_head'); |
|
29 | 29 | ?> |
30 | 30 | <style> |
31 | 31 | body, p{ |
@@ -37,21 +37,21 @@ discard block |
||
37 | 37 | font-weight: 500; |
38 | 38 | margin-bottom: .1rem; |
39 | 39 | } |
40 | - <?php echo $aui_settings::css_primary( '#009874', true ); ?> |
|
40 | + <?php echo $aui_settings::css_primary('#009874', true); ?> |
|
41 | 41 | </style> |
42 | 42 | </head> |
43 | 43 | |
44 | 44 | <body class="gp-setup wp-core-ui bg-lightx mx-auto text-dark scrollbars-ios" style="background: #f3f6ff;"> |
45 | 45 | |
46 | - <?php if ( isset( $_REQUEST['step'] ) ) : ?> |
|
46 | + <?php if (isset($_REQUEST['step'])) : ?> |
|
47 | 47 | <ol class="gp-setup-steps mb-0 pb-4 mw-100 list-group list-group-horizontal text-center"> |
48 | - <?php foreach ( $steps as $step => $data ) : ?> |
|
48 | + <?php foreach ($steps as $step => $data) : ?> |
|
49 | 49 | <li class="list-group-item flex-fill rounded-0 <?php |
50 | 50 | echo $step == $current ? 'active' : 'd-none d-md-block'; |
51 | - echo array_search( $current, array_keys( $steps ) ) > array_search( $step, array_keys( $steps ) ) ? ' done' : ''; |
|
51 | + echo array_search($current, array_keys($steps)) > array_search($step, array_keys($steps)) ? ' done' : ''; |
|
52 | 52 | ?>"> |
53 | - <i class="far fa-check-circle <?php echo array_search( $current, array_keys( $steps ) ) > array_search( $step, array_keys( $steps ) ) ? 'text-success' : '' ;?>"></i> |
|
54 | - <?php echo esc_html( $data['name'] ); ?> |
|
53 | + <i class="far fa-check-circle <?php echo array_search($current, array_keys($steps)) > array_search($step, array_keys($steps)) ? 'text-success' : ''; ?>"></i> |
|
54 | + <?php echo esc_html($data['name']); ?> |
|
55 | 55 | </li> |
56 | 56 | <?php endforeach; ?> |
57 | 57 | </ol> |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | <div class="text-center pb-3 mt-5"> |
63 | 63 | <a class=" text-decoration-none" href="https://wpgetpaid.com/"> |
64 | 64 | <span class="text-black-50"> |
65 | - <img class="ml-n3x" src="<?php echo WPINV_PLUGIN_URL . 'assets/images/getpaid-logo.png';?>" /> |
|
65 | + <img class="ml-n3x" src="<?php echo WPINV_PLUGIN_URL . 'assets/images/getpaid-logo.png'; ?>" /> |
|
66 | 66 | </span> |
67 | 67 | </a> |
68 | 68 | </div> |
69 | 69 | \ No newline at end of file |
@@ -4,15 +4,15 @@ discard block |
||
4 | 4 | * |
5 | 5 | */ |
6 | 6 | |
7 | -defined( 'ABSPATH' ) || exit; |
|
7 | +defined('ABSPATH') || exit; |
|
8 | 8 | |
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <div class="card shadow-sm my-5"> |
12 | 12 | |
13 | 13 | <form method="post" class="text-left card-body" action="options.php"> |
14 | - <?php settings_fields( 'wpinv_settings' ); ?> |
|
15 | - <input type="hidden" name="_wp_http_referer" value="<?php echo esc_url( $next_url ); ?>"> |
|
14 | + <?php settings_fields('wpinv_settings'); ?> |
|
15 | + <input type="hidden" name="_wp_http_referer" value="<?php echo esc_url($next_url); ?>"> |
|
16 | 16 | |
17 | 17 | <table class="gp-setup-maps w-100 " cellspacing="0"> |
18 | 18 | <tbody> |
@@ -20,28 +20,28 @@ discard block |
||
20 | 20 | |
21 | 21 | global $wp_settings_fields; |
22 | 22 | |
23 | - if ( isset( $wp_settings_fields[ $page ][ $section ] ) ) { |
|
24 | - $settings = $wp_settings_fields[ $page ][ $section ]; |
|
23 | + if (isset($wp_settings_fields[$page][$section])) { |
|
24 | + $settings = $wp_settings_fields[$page][$section]; |
|
25 | 25 | |
26 | - foreach ( $settings as $field ) { |
|
26 | + foreach ($settings as $field) { |
|
27 | 27 | |
28 | - $name = esc_attr( $field['id'] ); |
|
29 | - $id = sanitize_key( $name ); |
|
28 | + $name = esc_attr($field['id']); |
|
29 | + $id = sanitize_key($name); |
|
30 | 30 | $class = ''; |
31 | - $value = isset( $field['args']['std'] ) ? $field['args']['std'] : ''; |
|
32 | - $value = wpinv_clean( wpinv_get_option( $field['args']['id'], $value ) ); |
|
33 | - $help_text = isset( $field['args']['desc'] ) ? wp_kses_post( $field['args']['desc'] ) : ''; |
|
34 | - $type = str_replace( 'wpinv_', '', str_replace( '_callback', '', $field['callback'] ) ); |
|
35 | - $label = isset( $field['args']['name'] ) ? wp_kses_post( $field['args']['name'] ) : ''; |
|
36 | - $options = isset( $field['args']['options'] ) ? $field['args']['options'] : array(); |
|
31 | + $value = isset($field['args']['std']) ? $field['args']['std'] : ''; |
|
32 | + $value = wpinv_clean(wpinv_get_option($field['args']['id'], $value)); |
|
33 | + $help_text = isset($field['args']['desc']) ? wp_kses_post($field['args']['desc']) : ''; |
|
34 | + $type = str_replace('wpinv_', '', str_replace('_callback', '', $field['callback'])); |
|
35 | + $label = isset($field['args']['name']) ? wp_kses_post($field['args']['name']) : ''; |
|
36 | + $options = isset($field['args']['options']) ? $field['args']['options'] : array(); |
|
37 | 37 | |
38 | - if ( false !== strpos( $name, 'logo') ) { |
|
38 | + if (false !== strpos($name, 'logo')) { |
|
39 | 39 | $type = 'hidden'; |
40 | 40 | } |
41 | 41 | |
42 | - if ( 'country_states' == $type ) { |
|
42 | + if ('country_states' == $type) { |
|
43 | 43 | |
44 | - if ( 0 == count( wpinv_get_country_states( wpinv_get_default_country() ) ) ) { |
|
44 | + if (0 == count(wpinv_get_country_states(wpinv_get_default_country()))) { |
|
45 | 45 | $type = 'text'; |
46 | 46 | } else { |
47 | 47 | $type = 'select'; |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | $class = 'getpaid_js_field-state'; |
51 | 51 | } |
52 | 52 | |
53 | - if ( 'wpinv_settings[default_country]' == $name ) { |
|
53 | + if ('wpinv_settings[default_country]' == $name) { |
|
54 | 54 | $class = 'getpaid_js_field-country'; |
55 | 55 | } |
56 | 56 | |
57 | - switch ( $type ) { |
|
57 | + switch ($type) { |
|
58 | 58 | |
59 | 59 | case 'hidden': |
60 | 60 | echo "<input type='hidden' id='$id' name='$name' value='$value' />"; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | 'type' => $type, |
67 | 67 | 'id' => $id, |
68 | 68 | 'name' => $name, |
69 | - 'value' => is_scalar( $value ) ? esc_attr( $value ) : '', |
|
69 | + 'value' => is_scalar($value) ? esc_attr($value) : '', |
|
70 | 70 | 'required' => false, |
71 | 71 | 'help_text' => $help_text, |
72 | 72 | 'label' => $label, |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | array( |
83 | 83 | 'id' => $id, |
84 | 84 | 'name' => $name, |
85 | - 'value' => is_scalar( $value ) ? esc_textarea( $value ) : '', |
|
85 | + 'value' => is_scalar($value) ? esc_textarea($value) : '', |
|
86 | 86 | 'required' => false, |
87 | 87 | 'help_text' => $help_text, |
88 | 88 | 'label' => $label, |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | ); |
95 | 95 | |
96 | 96 | // Bug fixed in AUI 0.1.51 for name stripping [] |
97 | - echo str_replace( sanitize_html_class( $name ), esc_attr( $name ), $textarea ); |
|
97 | + echo str_replace(sanitize_html_class($name), esc_attr($name), $textarea); |
|
98 | 98 | |
99 | 99 | break; |
100 | 100 | case 'select': |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | 'id' => $id, |
104 | 104 | 'name' => $name, |
105 | 105 | 'placeholder' => '', |
106 | - 'value' => is_scalar( $value ) ? esc_attr( $value ) : '', |
|
106 | + 'value' => is_scalar($value) ? esc_attr($value) : '', |
|
107 | 107 | 'required' => false, |
108 | 108 | 'help_text' => $help_text, |
109 | 109 | 'label' => $label, |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | <input |
129 | 129 | type="submit" |
130 | 130 | class="btn btn-primary button-next" |
131 | - value="<?php esc_attr_e( 'Continue', 'invoicing' ); ?>" name="save_step"/> |
|
131 | + value="<?php esc_attr_e('Continue', 'invoicing'); ?>" name="save_step"/> |
|
132 | 132 | </p> |
133 | 133 | </table> |
134 | 134 | </form> |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
10 | +if (!defined('ABSPATH')) { |
|
11 | 11 | exit; // Exit if accessed directly |
12 | 12 | } |
13 | 13 | |
@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @param WP_Post $post |
23 | 23 | */ |
24 | - public static function output( $post ) { |
|
24 | + public static function output($post) { |
|
25 | 25 | |
26 | 26 | // Prepare the invoice. |
27 | - $invoice = new WPInv_Invoice( $post ); |
|
27 | + $invoice = new WPInv_Invoice($post); |
|
28 | 28 | |
29 | 29 | // Nonce field. |
30 | - wp_nonce_field( 'wpinv_details', 'wpinv_details_nonce' ) ; |
|
30 | + wp_nonce_field('wpinv_details', 'wpinv_details_nonce'); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | ?> |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | |
47 | 47 | <div class="bsui" style="margin-top: 1.5rem"> |
48 | 48 | |
49 | - <?php do_action( 'getpaid_invoice_edit_before_viewed_by_customer', $invoice ); ?> |
|
50 | - <?php if ( ! $invoice->is_draft() ) : ?> |
|
49 | + <?php do_action('getpaid_invoice_edit_before_viewed_by_customer', $invoice); ?> |
|
50 | + <?php if (!$invoice->is_draft()) : ?> |
|
51 | 51 | <div class="form-group"> |
52 | - <strong><?php _e( 'Viewed by Customer:', 'invoicing' );?></strong> |
|
53 | - <?php ( $invoice->get_is_viewed() ) ? _e( 'Yes', 'invoicing' ) : _e( 'No', 'invoicing' ); ?> |
|
52 | + <strong><?php _e('Viewed by Customer:', 'invoicing'); ?></strong> |
|
53 | + <?php ($invoice->get_is_viewed()) ? _e('Yes', 'invoicing') : _e('No', 'invoicing'); ?> |
|
54 | 54 | </div> |
55 | 55 | <?php endif; ?> |
56 | 56 | |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | |
59 | 59 | // Date created. |
60 | 60 | $label = sprintf( |
61 | - __( '%s Date:', 'invoicing' ), |
|
62 | - ucfirst( $invoice->get_invoice_quote_type() ) |
|
61 | + __('%s Date:', 'invoicing'), |
|
62 | + ucfirst($invoice->get_invoice_quote_type()) |
|
63 | 63 | ); |
64 | 64 | |
65 | - $info = sprintf( |
|
66 | - __( 'The date this %s was created.', 'invoicing' ), |
|
67 | - strtolower( $invoice->get_invoice_quote_type() ) |
|
65 | + $info = sprintf( |
|
66 | + __('The date this %s was created.', 'invoicing'), |
|
67 | + strtolower($invoice->get_invoice_quote_type()) |
|
68 | 68 | ); |
69 | 69 | |
70 | 70 | echo aui()->input( |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | 'type' => 'datepicker', |
73 | 73 | 'id' => 'wpinv_date_created', |
74 | 74 | 'name' => 'date_created', |
75 | - 'label' => $label . getpaid_get_help_tip( $info ), |
|
75 | + 'label' => $label . getpaid_get_help_tip($info), |
|
76 | 76 | 'label_type' => 'vertical', |
77 | 77 | 'placeholder' => 'YYYY-MM-DD 00:00', |
78 | 78 | 'class' => 'form-control-sm', |
79 | - 'value' => $invoice->get_date_created( 'edit' ), |
|
79 | + 'value' => $invoice->get_date_created('edit'), |
|
80 | 80 | 'extra_attributes' => array( |
81 | 81 | 'data-enable-time' => 'true', |
82 | 82 | 'data-time_24hr' => 'true', |
@@ -87,15 +87,15 @@ discard block |
||
87 | 87 | ); |
88 | 88 | |
89 | 89 | // Date paid. |
90 | - $date_paid = $invoice->get_date_completed( 'edit' ); |
|
91 | - if ( ! empty( $date_paid ) && $invoice->is_paid() ) { |
|
90 | + $date_paid = $invoice->get_date_completed('edit'); |
|
91 | + if (!empty($date_paid) && $invoice->is_paid()) { |
|
92 | 92 | |
93 | 93 | echo aui()->input( |
94 | 94 | array( |
95 | 95 | 'type' => 'text', |
96 | 96 | 'id' => 'wpinv_date_completed', |
97 | 97 | 'name' => 'wpinv_date_completed', |
98 | - 'label' => __( 'Date Completed:', 'invoicing' ), |
|
98 | + 'label' => __('Date Completed:', 'invoicing'), |
|
99 | 99 | 'label_type' => 'vertical', |
100 | 100 | 'class' => 'form-control-sm', |
101 | 101 | 'value' => $date_paid, |
@@ -105,18 +105,18 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | // Due date. |
108 | - if ( $invoice->is_type( 'invoice' ) && wpinv_get_option( 'overdue_active' ) && ( ! $invoice->is_paid() || $invoice->is_draft() ) ) { |
|
108 | + if ($invoice->is_type('invoice') && wpinv_get_option('overdue_active') && (!$invoice->is_paid() || $invoice->is_draft())) { |
|
109 | 109 | |
110 | 110 | echo aui()->input( |
111 | 111 | array( |
112 | 112 | 'type' => 'datepicker', |
113 | 113 | 'id' => 'wpinv_due_date', |
114 | 114 | 'name' => 'wpinv_due_date', |
115 | - 'label' => __( 'Due Date:', 'invoicing' ) . getpaid_get_help_tip( __( 'Leave blank to disable automated reminder emails for this invoice.', 'invoicing' ) ), |
|
115 | + 'label' => __('Due Date:', 'invoicing') . getpaid_get_help_tip(__('Leave blank to disable automated reminder emails for this invoice.', 'invoicing')), |
|
116 | 116 | 'label_type' => 'vertical', |
117 | - 'placeholder' => __( 'No due date', 'invoicing' ), |
|
117 | + 'placeholder' => __('No due date', 'invoicing'), |
|
118 | 118 | 'class' => 'form-control-sm', |
119 | - 'value' => $invoice->get_due_date( 'edit' ), |
|
119 | + 'value' => $invoice->get_due_date('edit'), |
|
120 | 120 | 'extra_attributes' => array( |
121 | 121 | 'data-enable-time' => 'true', |
122 | 122 | 'data-time_24hr' => 'true', |
@@ -128,39 +128,39 @@ discard block |
||
128 | 128 | |
129 | 129 | } |
130 | 130 | |
131 | - do_action( 'wpinv_meta_box_details_after_due_date', $invoice->get_id() ); |
|
132 | - do_action( 'getpaid_metabox_after_due_date', $invoice ); |
|
131 | + do_action('wpinv_meta_box_details_after_due_date', $invoice->get_id()); |
|
132 | + do_action('getpaid_metabox_after_due_date', $invoice); |
|
133 | 133 | |
134 | 134 | // Status. |
135 | 135 | $label = sprintf( |
136 | - __( '%s Status:', 'invoicing' ), |
|
137 | - ucfirst( $invoice->get_invoice_quote_type() ) |
|
136 | + __('%s Status:', 'invoicing'), |
|
137 | + ucfirst($invoice->get_invoice_quote_type()) |
|
138 | 138 | ); |
139 | 139 | |
140 | - $status = $invoice->get_status( 'edit' ); |
|
140 | + $status = $invoice->get_status('edit'); |
|
141 | 141 | echo aui()->select( |
142 | 142 | array( |
143 | 143 | 'id' => 'wpinv_status', |
144 | 144 | 'name' => 'wpinv_status', |
145 | 145 | 'label' => $label, |
146 | 146 | 'label_type' => 'vertical', |
147 | - 'placeholder' => __( 'Select Status', 'invoicing' ), |
|
148 | - 'value' => array_key_exists( $status, $invoice->get_all_statuses() ) ? $status : $invoice->get_default_status(), |
|
147 | + 'placeholder' => __('Select Status', 'invoicing'), |
|
148 | + 'value' => array_key_exists($status, $invoice->get_all_statuses()) ? $status : $invoice->get_default_status(), |
|
149 | 149 | 'select2' => true, |
150 | 150 | 'data-allow-clear' => 'false', |
151 | - 'options' => wpinv_get_invoice_statuses( true, false, $invoice ) |
|
151 | + 'options' => wpinv_get_invoice_statuses(true, false, $invoice) |
|
152 | 152 | ) |
153 | 153 | ); |
154 | 154 | |
155 | 155 | // Invoice number. |
156 | 156 | $label = sprintf( |
157 | - __( '%s Number:', 'invoicing' ), |
|
158 | - ucfirst( $invoice->get_invoice_quote_type() ) |
|
157 | + __('%s Number:', 'invoicing'), |
|
158 | + ucfirst($invoice->get_invoice_quote_type()) |
|
159 | 159 | ); |
160 | 160 | |
161 | - $info = sprintf( |
|
162 | - __( 'Each %s number must be unique.', 'invoicing' ), |
|
163 | - strtolower( $invoice->get_invoice_quote_type() ) |
|
161 | + $info = sprintf( |
|
162 | + __('Each %s number must be unique.', 'invoicing'), |
|
163 | + strtolower($invoice->get_invoice_quote_type()) |
|
164 | 164 | ); |
165 | 165 | |
166 | 166 | echo aui()->input( |
@@ -168,11 +168,11 @@ discard block |
||
168 | 168 | 'type' => 'text', |
169 | 169 | 'id' => 'wpinv_number', |
170 | 170 | 'name' => 'wpinv_number', |
171 | - 'label' => $label . getpaid_get_help_tip( $info ), |
|
171 | + 'label' => $label . getpaid_get_help_tip($info), |
|
172 | 172 | 'label_type' => 'vertical', |
173 | - 'placeholder' => __( 'Autogenerate', 'invoicing' ), |
|
173 | + 'placeholder' => __('Autogenerate', 'invoicing'), |
|
174 | 174 | 'class' => 'form-control-sm', |
175 | - 'value' => $invoice->get_number( 'edit' ), |
|
175 | + 'value' => $invoice->get_number('edit'), |
|
176 | 176 | ) |
177 | 177 | ); |
178 | 178 | |
@@ -182,15 +182,15 @@ discard block |
||
182 | 182 | 'type' => 'text', |
183 | 183 | 'id' => 'wpinv_cc', |
184 | 184 | 'name' => 'wpinv_cc', |
185 | - 'label' => __( 'Email CC:', 'invoicing' ) . getpaid_get_help_tip( __( 'Enter a comma separated list of other emails that should be notified about the invoice.', 'invoicing' ) ), |
|
185 | + 'label' => __('Email CC:', 'invoicing') . getpaid_get_help_tip(__('Enter a comma separated list of other emails that should be notified about the invoice.', 'invoicing')), |
|
186 | 186 | 'label_type' => 'vertical', |
187 | - 'placeholder' => __( '[email protected], [email protected]', 'invoicing' ), |
|
187 | + 'placeholder' => __('[email protected], [email protected]', 'invoicing'), |
|
188 | 188 | 'class' => 'form-control-sm', |
189 | - 'value' => $invoice->get_email_cc( 'edit' ), |
|
189 | + 'value' => $invoice->get_email_cc('edit'), |
|
190 | 190 | ) |
191 | 191 | ); |
192 | 192 | |
193 | - if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) { |
|
193 | + if (!$invoice->is_paid() && !$invoice->is_refunded()) { |
|
194 | 194 | |
195 | 195 | // Apply a discount. |
196 | 196 | echo aui()->input( |
@@ -198,25 +198,25 @@ discard block |
||
198 | 198 | 'type' => 'text', |
199 | 199 | 'id' => 'wpinv_discount_code', |
200 | 200 | 'name' => 'wpinv_discount_code', |
201 | - 'label' => __( 'Discount Code:', 'invoicing' ), |
|
202 | - 'placeholder' => __( 'Apply Discount', 'invoicing' ), |
|
201 | + 'label' => __('Discount Code:', 'invoicing'), |
|
202 | + 'placeholder' => __('Apply Discount', 'invoicing'), |
|
203 | 203 | 'label_type' => 'vertical', |
204 | 204 | 'class' => 'form-control-sm getpaid-recalculate-prices-on-change', |
205 | - 'value' => $invoice->get_discount_code( 'edit' ), |
|
205 | + 'value' => $invoice->get_discount_code('edit'), |
|
206 | 206 | ) |
207 | 207 | ); |
208 | 208 | |
209 | - } else if ( $invoice->get_discount_code( 'edit' ) ) { |
|
209 | + } else if ($invoice->get_discount_code('edit')) { |
|
210 | 210 | |
211 | 211 | echo aui()->input( |
212 | 212 | array( |
213 | 213 | 'type' => 'text', |
214 | 214 | 'id' => 'wpinv_discount_code', |
215 | 215 | 'name' => 'wpinv_discount_code', |
216 | - 'label' => __( 'Discount Code:', 'invoicing' ), |
|
216 | + 'label' => __('Discount Code:', 'invoicing'), |
|
217 | 217 | 'label_type' => 'vertical', |
218 | 218 | 'class' => 'form-control-sm', |
219 | - 'value' => $invoice->get_discount_code( 'edit' ), |
|
219 | + 'value' => $invoice->get_discount_code('edit'), |
|
220 | 220 | 'extra_attributes' => array( |
221 | 221 | 'onclick' => 'this.select();', |
222 | 222 | 'readonly' => 'true', |
@@ -226,17 +226,17 @@ discard block |
||
226 | 226 | |
227 | 227 | } |
228 | 228 | |
229 | - do_action( 'wpinv_meta_box_details_inner', $invoice->get_id() ); |
|
229 | + do_action('wpinv_meta_box_details_inner', $invoice->get_id()); |
|
230 | 230 | |
231 | 231 | // Disable taxes. |
232 | - if ( wpinv_use_taxes() && ! ( $invoice->is_paid() || $invoice->is_refunded() ) ) { |
|
232 | + if (wpinv_use_taxes() && !($invoice->is_paid() || $invoice->is_refunded())) { |
|
233 | 233 | |
234 | 234 | echo aui()->input( |
235 | 235 | array( |
236 | 236 | 'id' => 'wpinv_taxable', |
237 | 237 | 'name' => 'disable_taxes', |
238 | 238 | 'type' => 'checkbox', |
239 | - 'label' => __( 'Disable taxes', 'invoicing' ), |
|
239 | + 'label' => __('Disable taxes', 'invoicing'), |
|
240 | 240 | 'value' => '1', |
241 | 241 | 'checked' => (bool) $invoice->get_disable_taxes(), |
242 | 242 | 'class' => 'getpaid-recalculate-prices-on-change', |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | } |
247 | 247 | |
248 | - if ( $invoice->is_type( 'invoice' ) ) { |
|
248 | + if ($invoice->is_type('invoice')) { |
|
249 | 249 | |
250 | 250 | // Send to customer. |
251 | 251 | echo aui()->input( |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | 'id' => 'wpinv_send_to_customer', |
254 | 254 | 'name' => 'send_to_customer', |
255 | 255 | 'type' => 'checkbox', |
256 | - 'label' => __( 'Send invoice to customer after saving', 'invoicing' ), |
|
256 | + 'label' => __('Send invoice to customer after saving', 'invoicing'), |
|
257 | 257 | 'value' => '1', |
258 | - 'checked' => $invoice->is_draft() && (bool) wpinv_get_option( 'email_user_invoice_active', true ), |
|
258 | + 'checked' => $invoice->is_draft() && (bool) wpinv_get_option('email_user_invoice_active', true), |
|
259 | 259 | ) |
260 | 260 | ); |
261 | 261 | |
262 | 262 | } |
263 | 263 | |
264 | - do_action( 'getpaid_metabox_after_invoice_details', $invoice ); |
|
264 | + do_action('getpaid_metabox_after_invoice_details', $invoice); |
|
265 | 265 | |
266 | 266 | ?> |
267 | 267 |
@@ -4,68 +4,68 @@ |
||
4 | 4 | * |
5 | 5 | */ |
6 | 6 | |
7 | -defined( 'ABSPATH' ) || exit; |
|
7 | +defined('ABSPATH') || exit; |
|
8 | 8 | |
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <div class="card shadow-sm my-5"> |
12 | 12 | <div class="text-center card-body"> |
13 | - <h1 class="h3"><?php esc_html_e( 'Awesome, you are ready to Get Paid', 'invoicing' ); ?></h1> |
|
13 | + <h1 class="h3"><?php esc_html_e('Awesome, you are ready to Get Paid', 'invoicing'); ?></h1> |
|
14 | 14 | |
15 | 15 | <div class="geodirectory-message geodirectory-tracker"> |
16 | - <p><?php _e( 'Thank you for choosing GetPaid!', 'invoicing' ); ?> <i class="far fa-smile-beam"></i></p> |
|
16 | + <p><?php _e('Thank you for choosing GetPaid!', 'invoicing'); ?> <i class="far fa-smile-beam"></i></p> |
|
17 | 17 | </div> |
18 | 18 | |
19 | 19 | <div class="gp-setup-next-steps"> |
20 | 20 | <div class="gp-setup-next-steps-first mb-4"> |
21 | 21 | <div> |
22 | - <h2 class="h3"><i class="fas fa-arrow-down"></i> <?php esc_html_e( 'Watch This', 'invoicing' ); ?> <i class="fas fa-arrow-down"></i></h2> |
|
22 | + <h2 class="h3"><i class="fas fa-arrow-down"></i> <?php esc_html_e('Watch This', 'invoicing'); ?> <i class="fas fa-arrow-down"></i></h2> |
|
23 | 23 | <div class="embed-responsive embed-responsive-16by9 mb-4"> |
24 | 24 | <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/TXZuPXHjt9E?rel=0" allowfullscreen></iframe> |
25 | 25 | </div> |
26 | 26 | </div> |
27 | - <h2 class="h3"><?php esc_html_e( 'Next steps', 'invoicing' ); ?></h2> |
|
27 | + <h2 class="h3"><?php esc_html_e('Next steps', 'invoicing'); ?></h2> |
|
28 | 28 | |
29 | 29 | <div class="d-flex justify-content-between"> |
30 | 30 | <a |
31 | 31 | class="btn btn-outline-primary btn-sm" |
32 | - href="<?php echo esc_url( admin_url( 'post-new.php?post_type=wpi_item' ) ); ?>"> |
|
32 | + href="<?php echo esc_url(admin_url('post-new.php?post_type=wpi_item')); ?>"> |
|
33 | 33 | <span class="h1 d-block"><i class="fas fa-box-open"></i></span> |
34 | - <?php esc_html_e( 'Create Item', 'invoicing' ); ?> |
|
34 | + <?php esc_html_e('Create Item', 'invoicing'); ?> |
|
35 | 35 | </a> |
36 | 36 | <a |
37 | 37 | class="btn btn-outline-primary btn-sm" |
38 | - href="<?php echo esc_url( admin_url( 'post-new.php?post_type=wpi_payment_form' ) ); ?>"> |
|
38 | + href="<?php echo esc_url(admin_url('post-new.php?post_type=wpi_payment_form')); ?>"> |
|
39 | 39 | <span class="h1 d-block"><i class="fas fa-align-justify"></i></span> |
40 | - <?php esc_html_e( 'Create Payment Form', 'invoicing' ); ?> |
|
40 | + <?php esc_html_e('Create Payment Form', 'invoicing'); ?> |
|
41 | 41 | </a> |
42 | 42 | <a |
43 | 43 | class="btn btn-outline-primary btn-sm" |
44 | - href="<?php echo esc_url( admin_url( 'post-new.php?post_type=wpi_invoice' ) ); ?>"> |
|
44 | + href="<?php echo esc_url(admin_url('post-new.php?post_type=wpi_invoice')); ?>"> |
|
45 | 45 | <span class="h1 d-block"><i class="fas fa-file-alt"></i></span> |
46 | - <?php esc_html_e( 'Create Invoice', 'invoicing' ); ?> |
|
46 | + <?php esc_html_e('Create Invoice', 'invoicing'); ?> |
|
47 | 47 | </a> |
48 | 48 | </div> |
49 | 49 | |
50 | 50 | |
51 | 51 | |
52 | - <h2 class="h3 mt-4"><?php _e( 'Learn more', 'invoicing' ); ?></h2> |
|
52 | + <h2 class="h3 mt-4"><?php _e('Learn more', 'invoicing'); ?></h2> |
|
53 | 53 | <div class="gp-setup-next-steps-last mt-2 d-flex justify-content-between"> |
54 | 54 | <a |
55 | 55 | class="btn btn-outline-primary btn-sm" href="https://docs.wpgetpaid.com/collection/114-getting-started?utm_source=setupwizard&utm_medium=product&utm_content=getting-started&utm_campaign=invoicingplugin" |
56 | - target="_blank"><?php esc_html_e( 'Getting Started', 'invoicing' ); ?></a> |
|
56 | + target="_blank"><?php esc_html_e('Getting Started', 'invoicing'); ?></a> |
|
57 | 57 | <a |
58 | 58 | class="btn btn-outline-primary btn-sm" |
59 | 59 | href="https://docs.wpgetpaid.com/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=invoicingplugin" |
60 | - target="_blank"><?php esc_html_e( 'Documentation', 'invoicing' ); ?></a> |
|
60 | + target="_blank"><?php esc_html_e('Documentation', 'invoicing'); ?></a> |
|
61 | 61 | <a |
62 | 62 | class="btn btn-outline-primary btn-sm" |
63 | 63 | href="https://wpgetpaid.com/support/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=invoicingyplugin" |
64 | - target="_blank"><?php esc_html_e( 'Support', 'invoicing' ); ?></a> |
|
64 | + target="_blank"><?php esc_html_e('Support', 'invoicing'); ?></a> |
|
65 | 65 | <a |
66 | 66 | class="btn btn-outline-primary btn-sm" |
67 | 67 | href="https://demos.ayecode.io/getpaid/?utm_source=setupwizard&utm_medium=product&utm_content=demos&utm_campaign=invoicingyplugin" |
68 | - target="_blank"><?php esc_html_e( 'Demos', 'invoicing' ); ?></a> |
|
68 | + target="_blank"><?php esc_html_e('Demos', 'invoicing'); ?></a> |
|
69 | 69 | </div> |
70 | 70 | </div> |
71 | 71 | </div> |
@@ -14,13 +14,13 @@ |
||
14 | 14 | * Tested up to: 5.8 |
15 | 15 | */ |
16 | 16 | |
17 | -if ( ! defined( 'ABSPATH' ) ) { |
|
17 | +if (!defined('ABSPATH')) { |
|
18 | 18 | exit; |
19 | 19 | } |
20 | 20 | |
21 | -if ( ! class_exists( 'AyeCode_Deactivation_Survey' ) ) { |
|
21 | +if (!class_exists('AyeCode_Deactivation_Survey')) { |
|
22 | 22 | // include the class if needed |
23 | - include_once( dirname( __FILE__ ) . "/wp-deactivation-survey.php" ); |
|
23 | + include_once(dirname(__FILE__) . "/wp-deactivation-survey.php"); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @since 2.0.2 |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * The main installer/updater class. |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @param string $upgrade_from The current invoicing version. |
27 | 27 | */ |
28 | - public function upgrade_db( $upgrade_from ) { |
|
28 | + public function upgrade_db($upgrade_from) { |
|
29 | 29 | |
30 | 30 | // Save the current invoicing version. |
31 | - update_option( 'wpinv_version', WPINV_VERSION ); |
|
31 | + update_option('wpinv_version', WPINV_VERSION); |
|
32 | 32 | |
33 | 33 | // Setup the invoice Custom Post Type. |
34 | 34 | GetPaid_Post_Types::register_post_types(); |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | // Create any missing database tables. |
49 | 49 | $method = "upgrade_from_$upgrade_from"; |
50 | 50 | |
51 | - $installed = get_option( 'gepaid_installed_on' ); |
|
51 | + $installed = get_option('gepaid_installed_on'); |
|
52 | 52 | |
53 | - if ( empty( $installed ) ) { |
|
54 | - update_option( 'gepaid_installed_on', time() ); |
|
53 | + if (empty($installed)) { |
|
54 | + update_option('gepaid_installed_on', time()); |
|
55 | 55 | } |
56 | 56 | |
57 | - if ( method_exists( $this, $method ) ) { |
|
57 | + if (method_exists($this, $method)) { |
|
58 | 58 | $this->$method(); |
59 | 59 | } |
60 | 60 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $this->create_invoice_items_table(); |
71 | 71 | |
72 | 72 | // Save default tax rates. |
73 | - update_option( 'wpinv_tax_rates', wpinv_get_data( 'tax-rates' ) ); |
|
73 | + update_option('wpinv_tax_rates', wpinv_get_data('tax-rates')); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -81,28 +81,28 @@ discard block |
||
81 | 81 | global $wpdb; |
82 | 82 | |
83 | 83 | // Invoices. |
84 | - $results = $wpdb->get_results( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'wpi_invoice' AND post_status IN( 'pending', 'processing', 'onhold', 'refunded', 'cancelled', 'failed', 'renewal' )" ); |
|
85 | - if ( ! empty( $results ) ) { |
|
86 | - $wpdb->query( "UPDATE {$wpdb->posts} SET post_status = CONCAT( 'wpi-', post_status ) WHERE post_type = 'wpi_invoice' AND post_status IN( 'pending', 'processing', 'onhold', 'refunded', 'cancelled', 'failed', 'renewal' )" ); |
|
84 | + $results = $wpdb->get_results("SELECT ID FROM {$wpdb->posts} WHERE post_type = 'wpi_invoice' AND post_status IN( 'pending', 'processing', 'onhold', 'refunded', 'cancelled', 'failed', 'renewal' )"); |
|
85 | + if (!empty($results)) { |
|
86 | + $wpdb->query("UPDATE {$wpdb->posts} SET post_status = CONCAT( 'wpi-', post_status ) WHERE post_type = 'wpi_invoice' AND post_status IN( 'pending', 'processing', 'onhold', 'refunded', 'cancelled', 'failed', 'renewal' )"); |
|
87 | 87 | |
88 | 88 | // Clean post cache |
89 | - foreach ( $results as $row ) { |
|
90 | - clean_post_cache( $row->ID ); |
|
89 | + foreach ($results as $row) { |
|
90 | + clean_post_cache($row->ID); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | } |
94 | 94 | |
95 | 95 | // Item meta key changes |
96 | 96 | $query = "SELECT DISTINCT post_id FROM " . $wpdb->postmeta . " WHERE meta_key IN( '_wpinv_item_id', '_wpinv_package_id', '_wpinv_post_id', '_wpinv_cpt_name', '_wpinv_cpt_singular_name' )"; |
97 | - $results = $wpdb->get_results( $query ); |
|
97 | + $results = $wpdb->get_results($query); |
|
98 | 98 | |
99 | - if ( ! empty( $results ) ) { |
|
100 | - $wpdb->query( "UPDATE " . $wpdb->postmeta . " SET meta_key = '_wpinv_custom_id' WHERE meta_key IN( '_wpinv_item_id', '_wpinv_package_id', '_wpinv_post_id' )" ); |
|
101 | - $wpdb->query( "UPDATE " . $wpdb->postmeta . " SET meta_key = '_wpinv_custom_name' WHERE meta_key = '_wpinv_cpt_name'" ); |
|
102 | - $wpdb->query( "UPDATE " . $wpdb->postmeta . " SET meta_key = '_wpinv_custom_singular_name' WHERE meta_key = '_wpinv_cpt_singular_name'" ); |
|
99 | + if (!empty($results)) { |
|
100 | + $wpdb->query("UPDATE " . $wpdb->postmeta . " SET meta_key = '_wpinv_custom_id' WHERE meta_key IN( '_wpinv_item_id', '_wpinv_package_id', '_wpinv_post_id' )"); |
|
101 | + $wpdb->query("UPDATE " . $wpdb->postmeta . " SET meta_key = '_wpinv_custom_name' WHERE meta_key = '_wpinv_cpt_name'"); |
|
102 | + $wpdb->query("UPDATE " . $wpdb->postmeta . " SET meta_key = '_wpinv_custom_singular_name' WHERE meta_key = '_wpinv_cpt_singular_name'"); |
|
103 | 103 | |
104 | - foreach ( $results as $row ) { |
|
105 | - clean_post_cache( $row->post_id ); |
|
104 | + foreach ($results as $row) { |
|
105 | + clean_post_cache($row->post_id); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function upgrade_from_207() { |
137 | 137 | global $wpdb; |
138 | - $wpdb->query( "ALTER TABLE {$wpdb->prefix}getpaid_invoice_items MODIFY COLUMN quantity FLOAT(20);" ); |
|
138 | + $wpdb->query("ALTER TABLE {$wpdb->prefix}getpaid_invoice_items MODIFY COLUMN quantity FLOAT(20);"); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * |
144 | 144 | */ |
145 | 145 | public function add_capabilities() { |
146 | - $GLOBALS['wp_roles']->add_cap( 'administrator', 'manage_invoicing' ); |
|
146 | + $GLOBALS['wp_roles']->add_cap('administrator', 'manage_invoicing'); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | |
159 | 159 | // Checkout page. |
160 | 160 | 'checkout_page' => array( |
161 | - 'name' => _x( 'gp-checkout', 'Page slug', 'invoicing' ), |
|
162 | - 'title' => _x( 'Checkout', 'Page title', 'invoicing' ), |
|
161 | + 'name' => _x('gp-checkout', 'Page slug', 'invoicing'), |
|
162 | + 'title' => _x('Checkout', 'Page title', 'invoicing'), |
|
163 | 163 | 'content' => ' |
164 | 164 | <!-- wp:shortcode --> |
165 | 165 | [wpinv_checkout] |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | |
171 | 171 | // Invoice history page. |
172 | 172 | 'invoice_history_page' => array( |
173 | - 'name' => _x( 'gp-invoices', 'Page slug', 'invoicing' ), |
|
174 | - 'title' => _x( 'My Invoices', 'Page title', 'invoicing' ), |
|
173 | + 'name' => _x('gp-invoices', 'Page slug', 'invoicing'), |
|
174 | + 'title' => _x('My Invoices', 'Page title', 'invoicing'), |
|
175 | 175 | 'content' => ' |
176 | 176 | <!-- wp:shortcode --> |
177 | 177 | [wpinv_history] |
@@ -182,8 +182,8 @@ discard block |
||
182 | 182 | |
183 | 183 | // Success page content. |
184 | 184 | 'success_page' => array( |
185 | - 'name' => _x( 'gp-receipt', 'Page slug', 'invoicing' ), |
|
186 | - 'title' => _x( 'Payment Confirmation', 'Page title', 'invoicing' ), |
|
185 | + 'name' => _x('gp-receipt', 'Page slug', 'invoicing'), |
|
186 | + 'title' => _x('Payment Confirmation', 'Page title', 'invoicing'), |
|
187 | 187 | 'content' => ' |
188 | 188 | <!-- wp:shortcode --> |
189 | 189 | [wpinv_receipt] |
@@ -194,16 +194,16 @@ discard block |
||
194 | 194 | |
195 | 195 | // Failure page content. |
196 | 196 | 'failure_page' => array( |
197 | - 'name' => _x( 'gp-transaction-failed', 'Page slug', 'invoicing' ), |
|
198 | - 'title' => _x( 'Transaction Failed', 'Page title', 'invoicing' ), |
|
199 | - 'content' => __( 'Your transaction failed, please try again or contact site support.', 'invoicing' ), |
|
197 | + 'name' => _x('gp-transaction-failed', 'Page slug', 'invoicing'), |
|
198 | + 'title' => _x('Transaction Failed', 'Page title', 'invoicing'), |
|
199 | + 'content' => __('Your transaction failed, please try again or contact site support.', 'invoicing'), |
|
200 | 200 | 'parent' => 'gp-checkout', |
201 | 201 | ), |
202 | 202 | |
203 | 203 | // Subscriptions history page. |
204 | 204 | 'invoice_subscription_page' => array( |
205 | - 'name' => _x( 'gp-subscriptions', 'Page slug', 'invoicing' ), |
|
206 | - 'title' => _x( 'My Subscriptions', 'Page title', 'invoicing' ), |
|
205 | + 'name' => _x('gp-subscriptions', 'Page slug', 'invoicing'), |
|
206 | + 'title' => _x('My Subscriptions', 'Page title', 'invoicing'), |
|
207 | 207 | 'content' => ' |
208 | 208 | <!-- wp:shortcode --> |
209 | 209 | [wpinv_subscriptions] |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function create_pages() { |
225 | 225 | |
226 | - foreach ( self::get_pages() as $key => $page ) { |
|
227 | - wpinv_create_page( esc_sql( $page['name'] ), $key, $page['title'], $page['content'], $page['parent'] ); |
|
226 | + foreach (self::get_pages() as $key => $page) { |
|
227 | + wpinv_create_page(esc_sql($page['name']), $key, $page['title'], $page['content'], $page['parent']); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | global $wpdb; |
239 | 239 | |
240 | - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|
240 | + require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); |
|
241 | 241 | |
242 | 242 | // Create tables. |
243 | 243 | $charset_collate = $wpdb->get_charset_collate(); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | KEY customer_and_status (customer_id, status) |
265 | 265 | ) $charset_collate;"; |
266 | 266 | |
267 | - dbDelta( $sql ); |
|
267 | + dbDelta($sql); |
|
268 | 268 | |
269 | 269 | } |
270 | 270 | |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | public function create_invoices_table() { |
276 | 276 | global $wpdb; |
277 | 277 | |
278 | - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|
278 | + require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); |
|
279 | 279 | |
280 | 280 | // Create tables. |
281 | 281 | $charset_collate = $wpdb->get_charset_collate(); |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | KEY `key` (`key`) |
316 | 316 | ) $charset_collate;"; |
317 | 317 | |
318 | - dbDelta( $sql ); |
|
318 | + dbDelta($sql); |
|
319 | 319 | |
320 | 320 | } |
321 | 321 | |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | public function create_invoice_items_table() { |
327 | 327 | global $wpdb; |
328 | 328 | |
329 | - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|
329 | + require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); |
|
330 | 330 | |
331 | 331 | // Create tables. |
332 | 332 | $charset_collate = $wpdb->get_charset_collate(); |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | KEY post_id (post_id) |
353 | 353 | ) $charset_collate;"; |
354 | 354 | |
355 | - dbDelta( $sql ); |
|
355 | + dbDelta($sql); |
|
356 | 356 | |
357 | 357 | } |
358 | 358 | |
@@ -365,40 +365,40 @@ discard block |
||
365 | 365 | |
366 | 366 | $invoices_table = $wpdb->prefix . 'getpaid_invoices'; |
367 | 367 | $invoice_items_table = $wpdb->prefix . 'getpaid_invoice_items'; |
368 | - $migrated = $wpdb->get_col( "SELECT post_id FROM $invoices_table" ); |
|
368 | + $migrated = $wpdb->get_col("SELECT post_id FROM $invoices_table"); |
|
369 | 369 | $invoices = array_unique( |
370 | 370 | get_posts( |
371 | 371 | array( |
372 | - 'post_type' => array( 'wpi_invoice', 'wpi_quote' ), |
|
372 | + 'post_type' => array('wpi_invoice', 'wpi_quote'), |
|
373 | 373 | 'posts_per_page' => -1, |
374 | 374 | 'fields' => 'ids', |
375 | - 'post_status' => array_keys( get_post_stati() ), |
|
375 | + 'post_status' => array_keys(get_post_stati()), |
|
376 | 376 | 'exclude' => (array) $migrated, |
377 | 377 | ) |
378 | 378 | ) |
379 | 379 | ); |
380 | 380 | |
381 | 381 | // Abort if we do not have any invoices. |
382 | - if ( empty( $invoices ) ) { |
|
382 | + if (empty($invoices)) { |
|
383 | 383 | return; |
384 | 384 | } |
385 | 385 | |
386 | - require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-legacy-invoice.php' ); |
|
386 | + require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-legacy-invoice.php'); |
|
387 | 387 | |
388 | 388 | $invoice_rows = array(); |
389 | - foreach ( $invoices as $invoice ) { |
|
389 | + foreach ($invoices as $invoice) { |
|
390 | 390 | |
391 | - $invoice = new WPInv_Legacy_Invoice( $invoice ); |
|
391 | + $invoice = new WPInv_Legacy_Invoice($invoice); |
|
392 | 392 | |
393 | - if ( empty( $invoice->ID ) ) { |
|
393 | + if (empty($invoice->ID)) { |
|
394 | 394 | return; |
395 | 395 | } |
396 | 396 | |
397 | - $fields = array ( |
|
397 | + $fields = array( |
|
398 | 398 | 'post_id' => $invoice->ID, |
399 | 399 | 'number' => $invoice->get_number(), |
400 | 400 | 'key' => $invoice->get_key(), |
401 | - 'type' => str_replace( 'wpi_', '', $invoice->post_type ), |
|
401 | + 'type' => str_replace('wpi_', '', $invoice->post_type), |
|
402 | 402 | 'mode' => $invoice->mode, |
403 | 403 | 'user_ip' => $invoice->get_ip(), |
404 | 404 | 'first_name' => $invoice->get_first_name(), |
@@ -427,27 +427,27 @@ discard block |
||
427 | 427 | 'custom_meta' => $invoice->payment_meta |
428 | 428 | ); |
429 | 429 | |
430 | - foreach ( $fields as $key => $val ) { |
|
431 | - if ( is_null( $val ) ) { |
|
430 | + foreach ($fields as $key => $val) { |
|
431 | + if (is_null($val)) { |
|
432 | 432 | $val = ''; |
433 | 433 | } |
434 | - $val = maybe_serialize( $val ); |
|
435 | - $fields[ $key ] = $wpdb->prepare( '%s', $val ); |
|
434 | + $val = maybe_serialize($val); |
|
435 | + $fields[$key] = $wpdb->prepare('%s', $val); |
|
436 | 436 | } |
437 | 437 | |
438 | - $fields = implode( ', ', $fields ); |
|
438 | + $fields = implode(', ', $fields); |
|
439 | 439 | $invoice_rows[] = "($fields)"; |
440 | 440 | |
441 | 441 | $item_rows = array(); |
442 | 442 | $item_columns = array(); |
443 | - foreach ( $invoice->get_cart_details() as $details ) { |
|
443 | + foreach ($invoice->get_cart_details() as $details) { |
|
444 | 444 | $fields = array( |
445 | 445 | 'post_id' => $invoice->ID, |
446 | 446 | 'item_id' => $details['id'], |
447 | 447 | 'item_name' => $details['name'], |
448 | - 'item_description' => empty( $details['meta']['description'] ) ? '' : $details['meta']['description'], |
|
448 | + 'item_description' => empty($details['meta']['description']) ? '' : $details['meta']['description'], |
|
449 | 449 | 'vat_rate' => $details['vat_rate'], |
450 | - 'vat_class' => empty( $details['vat_class'] ) ? '_standard' : $details['vat_class'], |
|
450 | + 'vat_class' => empty($details['vat_class']) ? '_standard' : $details['vat_class'], |
|
451 | 451 | 'tax' => $details['tax'], |
452 | 452 | 'item_price' => $details['item_price'], |
453 | 453 | 'custom_price' => $details['custom_price'], |
@@ -459,31 +459,31 @@ discard block |
||
459 | 459 | 'fees' => $details['fees'], |
460 | 460 | ); |
461 | 461 | |
462 | - $item_columns = array_keys ( $fields ); |
|
462 | + $item_columns = array_keys($fields); |
|
463 | 463 | |
464 | - foreach ( $fields as $key => $val ) { |
|
465 | - if ( is_null( $val ) ) { |
|
464 | + foreach ($fields as $key => $val) { |
|
465 | + if (is_null($val)) { |
|
466 | 466 | $val = ''; |
467 | 467 | } |
468 | - $val = maybe_serialize( $val ); |
|
469 | - $fields[ $key ] = $wpdb->prepare( '%s', $val ); |
|
468 | + $val = maybe_serialize($val); |
|
469 | + $fields[$key] = $wpdb->prepare('%s', $val); |
|
470 | 470 | } |
471 | 471 | |
472 | - $fields = implode( ', ', $fields ); |
|
472 | + $fields = implode(', ', $fields); |
|
473 | 473 | $item_rows[] = "($fields)"; |
474 | 474 | } |
475 | 475 | |
476 | - $item_rows = implode( ', ', $item_rows ); |
|
477 | - $item_columns = implode( ', ', $item_columns ); |
|
478 | - $wpdb->query( "INSERT INTO $invoice_items_table ($item_columns) VALUES $item_rows" ); |
|
476 | + $item_rows = implode(', ', $item_rows); |
|
477 | + $item_columns = implode(', ', $item_columns); |
|
478 | + $wpdb->query("INSERT INTO $invoice_items_table ($item_columns) VALUES $item_rows"); |
|
479 | 479 | } |
480 | 480 | |
481 | - if ( empty( $invoice_rows ) ) { |
|
481 | + if (empty($invoice_rows)) { |
|
482 | 482 | return; |
483 | 483 | } |
484 | 484 | |
485 | - $invoice_rows = implode( ', ', $invoice_rows ); |
|
486 | - $wpdb->query( "INSERT INTO $invoices_table VALUES $invoice_rows" ); |
|
485 | + $invoice_rows = implode(', ', $invoice_rows); |
|
486 | + $wpdb->query("INSERT INTO $invoices_table VALUES $invoice_rows"); |
|
487 | 487 | |
488 | 488 | } |
489 | 489 | |
@@ -494,12 +494,12 @@ discard block |
||
494 | 494 | public static function rename_gateways_label() { |
495 | 495 | global $wpdb; |
496 | 496 | |
497 | - foreach ( array_keys( wpinv_get_payment_gateways() ) as $gateway ) { |
|
497 | + foreach (array_keys(wpinv_get_payment_gateways()) as $gateway) { |
|
498 | 498 | |
499 | 499 | $wpdb->update( |
500 | 500 | $wpdb->prefix . 'getpaid_invoices', |
501 | - array( 'gateway' => $gateway ), |
|
502 | - array( 'gateway' => wpinv_get_gateway_admin_label( $gateway ) ), |
|
501 | + array('gateway' => $gateway), |
|
502 | + array('gateway' => wpinv_get_gateway_admin_label($gateway)), |
|
503 | 503 | '%s', |
504 | 504 | '%s' |
505 | 505 | ); |