@@ -1,38 +1,38 @@ |
||
1 | 1 | <?php |
2 | 2 | // MUST have WordPress. |
3 | -if ( ! defined( 'WPINC' ) ) { |
|
3 | +if (!defined('WPINC')) { |
|
4 | 4 | exit; |
5 | 5 | } |
6 | 6 | |
7 | 7 | class WPInv_Meta_Box_Notes { |
8 | - public static function output( $post ) { |
|
8 | + public static function output($post) { |
|
9 | 9 | global $post; |
10 | 10 | |
11 | - $notes = wpinv_get_invoice_notes( $post->ID ); |
|
11 | + $notes = wpinv_get_invoice_notes($post->ID); |
|
12 | 12 | |
13 | 13 | echo '<ul class="invoice_notes">'; |
14 | 14 | |
15 | - if ( $notes ) { |
|
16 | - foreach ( $notes as $note ) { |
|
17 | - wpinv_get_invoice_note_line_item( $note ); |
|
15 | + if ($notes) { |
|
16 | + foreach ($notes as $note) { |
|
17 | + wpinv_get_invoice_note_line_item($note); |
|
18 | 18 | } |
19 | 19 | } else { |
20 | - echo '<li>' . esc_html__( 'There are no notes yet.', 'invoicing' ) . '</li>'; |
|
20 | + echo '<li>' . esc_html__('There are no notes yet.', 'invoicing') . '</li>'; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | echo '</ul>'; |
24 | 24 | ?> |
25 | 25 | <div class="add_note"> |
26 | - <h4><?php esc_html_e( 'Add note', 'invoicing' ); ?></h4> |
|
26 | + <h4><?php esc_html_e('Add note', 'invoicing'); ?></h4> |
|
27 | 27 | <p> |
28 | 28 | <textarea type="text" name="invoice_note" id="add_invoice_note" class="input-text" cols="20" rows="5"></textarea> |
29 | 29 | </p> |
30 | 30 | <p> |
31 | 31 | <select name="invoice_note_type" id="invoice_note_type" class="regular-text"> |
32 | - <option value=""><?php esc_html_e( 'Private note', 'invoicing' ); ?></option> |
|
33 | - <option value="customer"><?php esc_html_e( 'Note to customer', 'invoicing' ); ?></option> |
|
32 | + <option value=""><?php esc_html_e('Private note', 'invoicing'); ?></option> |
|
33 | + <option value="customer"><?php esc_html_e('Note to customer', 'invoicing'); ?></option> |
|
34 | 34 | </select> |
35 | - <a href="#" class="add_note button"><?php esc_html_e( 'Add', 'invoicing' ); ?></a> <span class="description"><?php esc_html_e( 'Add a note for your reference, or add a customer note (the user will be notified).', 'invoicing' ); ?></span> |
|
35 | + <a href="#" class="add_note button"><?php esc_html_e('Add', 'invoicing'); ?></a> <span class="description"><?php esc_html_e('Add a note for your reference, or add a customer note (the user will be notified).', 'invoicing'); ?></span> |
|
36 | 36 | </p> |
37 | 37 | </div> |
38 | 38 | <?php |
@@ -126,14 +126,14 @@ |
||
126 | 126 | */ |
127 | 127 | function getpaid_doing_it_wrong( $function, $message, $version ) { |
128 | 128 | |
129 | - $message .= ' Backtrace: ' . wp_debug_backtrace_summary(); |
|
130 | - |
|
131 | - if ( wp_doing_ajax() || defined( 'REST_REQUEST' ) ) { |
|
132 | - do_action( 'doing_it_wrong_run', $function, $message, $version ); |
|
133 | - error_log( "{$function} was called incorrectly. {$message}. This message was added in version {$version}." ); |
|
134 | - } else { |
|
135 | - _doing_it_wrong( esc_html( $function ), wp_kses_post( $message ), esc_html( $version ) ); |
|
136 | - } |
|
129 | + $message .= ' Backtrace: ' . wp_debug_backtrace_summary(); |
|
130 | + |
|
131 | + if ( wp_doing_ajax() || defined( 'REST_REQUEST' ) ) { |
|
132 | + do_action( 'doing_it_wrong_run', $function, $message, $version ); |
|
133 | + error_log( "{$function} was called incorrectly. {$message}. This message was added in version {$version}." ); |
|
134 | + } else { |
|
135 | + _doing_it_wrong( esc_html( $function ), wp_kses_post( $message ), esc_html( $version ) ); |
|
136 | + } |
|
137 | 137 | |
138 | 138 | } |
139 | 139 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Invoicing |
7 | 7 | */ |
8 | 8 | |
9 | -defined( 'ABSPATH' ) || exit; |
|
9 | +defined('ABSPATH') || exit; |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * Returns the errors as html |
@@ -15,35 +15,35 @@ discard block |
||
15 | 15 | * @param bool $wrap whether or not to wrap the errors. |
16 | 16 | * @since 1.0.19 |
17 | 17 | */ |
18 | -function getpaid_get_errors_html( $clear = true, $wrap = true ) { |
|
18 | +function getpaid_get_errors_html($clear = true, $wrap = true) { |
|
19 | 19 | |
20 | 20 | $errors = ''; |
21 | - foreach ( wpinv_get_errors() as $id => $error ) { |
|
22 | - $type = 'error'; |
|
21 | + foreach (wpinv_get_errors() as $id => $error) { |
|
22 | + $type = 'error'; |
|
23 | 23 | |
24 | - if ( is_array( $error ) ) { |
|
24 | + if (is_array($error)) { |
|
25 | 25 | $type = $error['type']; |
26 | 26 | $error = $error['text']; |
27 | 27 | } |
28 | 28 | |
29 | - if ( $wrap ) { |
|
29 | + if ($wrap) { |
|
30 | 30 | |
31 | 31 | $errors .= aui()->alert( |
32 | 32 | array( |
33 | - 'content' => wp_kses_post( $error ), |
|
33 | + 'content' => wp_kses_post($error), |
|
34 | 34 | 'type' => $type, |
35 | 35 | ) |
36 | 36 | ); |
37 | 37 | |
38 | 38 | } else { |
39 | 39 | |
40 | - $id = esc_attr( $id ); |
|
41 | - $error = wp_kses_post( $error ); |
|
40 | + $id = esc_attr($id); |
|
41 | + $error = wp_kses_post($error); |
|
42 | 42 | $errors .= "<div data-code='$id'>$error</div>"; |
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
46 | - if ( $clear ) { |
|
46 | + if ($clear) { |
|
47 | 47 | wpinv_clear_errors(); |
48 | 48 | } |
49 | 49 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * Prints (then clears) all available errors. |
56 | 56 | */ |
57 | 57 | function wpinv_print_errors() { |
58 | - echo wp_kses_post( getpaid_get_errors_html() ); |
|
58 | + echo wp_kses_post(getpaid_get_errors_html()); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -69,54 +69,54 @@ discard block |
||
69 | 69 | $all_errors = array( |
70 | 70 | 'perm_cancel_subscription' => array( |
71 | 71 | 'type' => 'error', |
72 | - 'text' => __( 'You do not have permission to cancel this subscription', 'invoicing' ), |
|
72 | + 'text' => __('You do not have permission to cancel this subscription', 'invoicing'), |
|
73 | 73 | ), |
74 | 74 | 'cannot_cancel_subscription' => array( |
75 | 75 | 'type' => 'error', |
76 | - 'text' => __( 'This subscription cannot be cancelled as it is not active.', 'invoicing' ), |
|
76 | + 'text' => __('This subscription cannot be cancelled as it is not active.', 'invoicing'), |
|
77 | 77 | ), |
78 | 78 | 'cancelled_subscription' => array( |
79 | 79 | 'type' => 'success', |
80 | - 'text' => __( 'Subscription cancelled successfully.', 'invoicing' ), |
|
80 | + 'text' => __('Subscription cancelled successfully.', 'invoicing'), |
|
81 | 81 | ), |
82 | 82 | 'address_updated' => array( |
83 | 83 | 'type' => 'success', |
84 | - 'text' => __( 'Address updated successfully.', 'invoicing' ), |
|
84 | + 'text' => __('Address updated successfully.', 'invoicing'), |
|
85 | 85 | ), |
86 | 86 | 'perm_delete_invoice' => array( |
87 | 87 | 'type' => 'error', |
88 | - 'text' => __( 'You do not have permission to delete this invoice', 'invoicing' ), |
|
88 | + 'text' => __('You do not have permission to delete this invoice', 'invoicing'), |
|
89 | 89 | ), |
90 | 90 | 'cannot_delete_invoice' => array( |
91 | 91 | 'type' => 'error', |
92 | - 'text' => __( 'This invoice cannot be deleted as it has already been paid.', 'invoicing' ), |
|
92 | + 'text' => __('This invoice cannot be deleted as it has already been paid.', 'invoicing'), |
|
93 | 93 | ), |
94 | 94 | 'deleted_invoice' => array( |
95 | 95 | 'type' => 'success', |
96 | - 'text' => __( 'Invoice deleted successfully.', 'invoicing' ), |
|
96 | + 'text' => __('Invoice deleted successfully.', 'invoicing'), |
|
97 | 97 | ), |
98 | 98 | 'card_declined' => array( |
99 | 99 | 'type' => 'error', |
100 | - 'text' => __( 'Your card was declined.', 'invoicing' ), |
|
100 | + 'text' => __('Your card was declined.', 'invoicing'), |
|
101 | 101 | ), |
102 | 102 | 'invalid_currency' => array( |
103 | 103 | 'type' => 'error', |
104 | - 'text' => __( 'The chosen payment gateway does not support this currency.', 'invoicing' ), |
|
104 | + 'text' => __('The chosen payment gateway does not support this currency.', 'invoicing'), |
|
105 | 105 | ), |
106 | 106 | ); |
107 | 107 | |
108 | - $errors = apply_filters( 'wpinv_errors', array() ); |
|
108 | + $errors = apply_filters('wpinv_errors', array()); |
|
109 | 109 | |
110 | - if ( isset( $_GET['wpinv-notice'] ) && isset( $all_errors[ $_GET['wpinv-notice'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
|
111 | - $errors[ $_GET['wpinv-notice'] ] = $all_errors[ $_GET['wpinv-notice'] ]; // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
|
110 | + if (isset($_GET['wpinv-notice']) && isset($all_errors[$_GET['wpinv-notice']])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
|
111 | + $errors[$_GET['wpinv-notice']] = $all_errors[$_GET['wpinv-notice']]; // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
|
112 | 112 | } |
113 | 113 | |
114 | - if ( isset( $GLOBALS['wpinv_notice'] ) && isset( $all_errors[ $GLOBALS['wpinv_notice'] ] ) ) { |
|
115 | - $errors[ $GLOBALS['wpinv_notice'] ] = $all_errors[ $GLOBALS['wpinv_notice'] ]; |
|
114 | + if (isset($GLOBALS['wpinv_notice']) && isset($all_errors[$GLOBALS['wpinv_notice']])) { |
|
115 | + $errors[$GLOBALS['wpinv_notice']] = $all_errors[$GLOBALS['wpinv_notice']]; |
|
116 | 116 | } |
117 | 117 | |
118 | - if ( isset( $GLOBALS['wpinv_custom_notice'] ) ) { |
|
119 | - $errors[ $GLOBALS['wpinv_custom_notice']['code'] ] = $GLOBALS['wpinv_custom_notice']; |
|
118 | + if (isset($GLOBALS['wpinv_custom_notice'])) { |
|
119 | + $errors[$GLOBALS['wpinv_custom_notice']['code']] = $GLOBALS['wpinv_custom_notice']; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | return $errors; |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | * @param string $error The error message. |
130 | 130 | * @param string $type The error type. |
131 | 131 | */ |
132 | -function wpinv_set_error( $error_id, $message = '', $type = 'error' ) { |
|
132 | +function wpinv_set_error($error_id, $message = '', $type = 'error') { |
|
133 | 133 | |
134 | - if ( ! empty( $message ) ) { |
|
134 | + if (!empty($message)) { |
|
135 | 135 | $GLOBALS['wpinv_custom_notice'] = array( |
136 | 136 | 'code' => $error_id, |
137 | 137 | 'type' => $type, |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * |
148 | 148 | */ |
149 | 149 | function wpinv_has_errors() { |
150 | - return count( wpinv_get_errors() ) > 0; |
|
150 | + return count(wpinv_get_errors()) > 0; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * |
156 | 156 | */ |
157 | 157 | function wpinv_clear_errors() { |
158 | - unset( $GLOBALS['wpinv_notice'] ); |
|
158 | + unset($GLOBALS['wpinv_notice']); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * |
164 | 164 | */ |
165 | 165 | function wpinv_unset_error() { |
166 | - unset( $GLOBALS['wpinv_notice'] ); |
|
166 | + unset($GLOBALS['wpinv_notice']); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -174,15 +174,15 @@ discard block |
||
174 | 174 | * @param string $message Message to log. |
175 | 175 | * @param string $version Version the message was added in. |
176 | 176 | */ |
177 | -function getpaid_doing_it_wrong( $function, $message, $version ) { |
|
177 | +function getpaid_doing_it_wrong($function, $message, $version) { |
|
178 | 178 | |
179 | 179 | $message .= ' Backtrace: ' . wp_debug_backtrace_summary(); |
180 | 180 | |
181 | - if ( wp_doing_ajax() || defined( 'REST_REQUEST' ) ) { |
|
182 | - do_action( 'doing_it_wrong_run', $function, $message, $version ); |
|
183 | - error_log( "{$function} was called incorrectly. {$message}. This message was added in version {$version}." ); |
|
181 | + if (wp_doing_ajax() || defined('REST_REQUEST')) { |
|
182 | + do_action('doing_it_wrong_run', $function, $message, $version); |
|
183 | + error_log("{$function} was called incorrectly. {$message}. This message was added in version {$version}."); |
|
184 | 184 | } else { |
185 | - _doing_it_wrong( esc_html( $function ), wp_kses_post( $message ), esc_html( $version ) ); |
|
185 | + _doing_it_wrong(esc_html($function), wp_kses_post($message), esc_html($version)); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | } |
@@ -196,41 +196,41 @@ discard block |
||
196 | 196 | * @param string $line The line that contains the error. |
197 | 197 | * @param bool $exit Whether or not to exit function execution. |
198 | 198 | */ |
199 | -function wpinv_error_log( $log, $title = '', $file = '', $line = '', $exit = false ) { |
|
199 | +function wpinv_error_log($log, $title = '', $file = '', $line = '', $exit = false) { |
|
200 | 200 | |
201 | - if ( true === apply_filters( 'wpinv_log_errors', true ) ) { |
|
201 | + if (true === apply_filters('wpinv_log_errors', true)) { |
|
202 | 202 | |
203 | 203 | // Ensure the log is a scalar. |
204 | - if ( ! is_scalar( $log ) ) { |
|
205 | - $log = print_r( $log, true ); |
|
204 | + if (!is_scalar($log)) { |
|
205 | + $log = print_r($log, true); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | // Add title. |
209 | - if ( ! empty( $title ) ) { |
|
210 | - $log = $title . ' ' . trim( $log ); |
|
209 | + if (!empty($title)) { |
|
210 | + $log = $title . ' ' . trim($log); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | // Add the file to the label. |
214 | - if ( ! empty( $file ) ) { |
|
214 | + if (!empty($file)) { |
|
215 | 215 | $log .= ' in ' . $file; |
216 | 216 | } |
217 | 217 | |
218 | 218 | // Add the line number to the label. |
219 | - if ( ! empty( $line ) ) { |
|
219 | + if (!empty($line)) { |
|
220 | 220 | $log .= ' on line ' . $line; |
221 | 221 | } |
222 | 222 | |
223 | 223 | // Log the message. |
224 | - error_log( trim( $log ) ); |
|
224 | + error_log(trim($log)); |
|
225 | 225 | |
226 | 226 | // ... and a backtrace. |
227 | - if ( false !== $title && false !== $file ) { |
|
228 | - error_log( 'Backtrace ' . wp_debug_backtrace_summary() ); |
|
227 | + if (false !== $title && false !== $file) { |
|
228 | + error_log('Backtrace ' . wp_debug_backtrace_summary()); |
|
229 | 229 | } |
230 | 230 | } |
231 | 231 | |
232 | 232 | // Maybe exit. |
233 | - if ( $exit ) { |
|
233 | + if ($exit) { |
|
234 | 234 | exit; |
235 | 235 | } |
236 | 236 |
@@ -42,92 +42,92 @@ discard block |
||
42 | 42 | <tr class="wpinv-item wpinv-item-<?php echo esc_attr( $invoice->get_status() ); ?>"> |
43 | 43 | <?php |
44 | 44 | |
45 | - foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
45 | + foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
46 | 46 | |
47 | - $column_id = sanitize_html_class( $column_id ); |
|
48 | - $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
47 | + $column_id = sanitize_html_class( $column_id ); |
|
48 | + $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
49 | 49 | |
50 | - echo "<td class='" . esc_attr( $column_id . ' ' . $class ) . "'>"; |
|
51 | - switch ( $column_id ) { |
|
50 | + echo "<td class='" . esc_attr( $column_id . ' ' . $class ) . "'>"; |
|
51 | + switch ( $column_id ) { |
|
52 | 52 | |
53 | - case 'invoice-number': |
|
54 | - echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
55 | - break; |
|
53 | + case 'invoice-number': |
|
54 | + echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
55 | + break; |
|
56 | 56 | |
57 | - case 'created-date': |
|
58 | - echo esc_html( getpaid_format_date_value( $invoice->get_date_created() ) ); |
|
59 | - break; |
|
57 | + case 'created-date': |
|
58 | + echo esc_html( getpaid_format_date_value( $invoice->get_date_created() ) ); |
|
59 | + break; |
|
60 | 60 | |
61 | - case 'payment-date': |
|
62 | - if ( $invoice->needs_payment() ) { |
|
63 | - echo '—'; |
|
64 | - } else { |
|
65 | - echo esc_html( getpaid_format_date_value( $invoice->get_date_completed() ) ); |
|
66 | - } |
|
61 | + case 'payment-date': |
|
62 | + if ( $invoice->needs_payment() ) { |
|
63 | + echo '—'; |
|
64 | + } else { |
|
65 | + echo esc_html( getpaid_format_date_value( $invoice->get_date_completed() ) ); |
|
66 | + } |
|
67 | 67 | |
68 | - break; |
|
68 | + break; |
|
69 | 69 | |
70 | - case 'invoice-status': |
|
71 | - echo wp_kses_post( $invoice->get_status_label_html() ); |
|
70 | + case 'invoice-status': |
|
71 | + echo wp_kses_post( $invoice->get_status_label_html() ); |
|
72 | 72 | |
73 | - break; |
|
73 | + break; |
|
74 | 74 | |
75 | - case 'invoice-total': |
|
76 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
75 | + case 'invoice-total': |
|
76 | + wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
77 | 77 | |
78 | - break; |
|
78 | + break; |
|
79 | 79 | |
80 | - case 'invoice-actions': |
|
81 | - $actions = array( |
|
80 | + case 'invoice-actions': |
|
81 | + $actions = array( |
|
82 | 82 | |
83 | - 'pay' => array( |
|
84 | - 'url' => $invoice->get_checkout_payment_url(), |
|
85 | - 'name' => __( 'Pay Now', 'invoicing' ), |
|
86 | - 'class' => 'btn-success', |
|
87 | - ), |
|
83 | + 'pay' => array( |
|
84 | + 'url' => $invoice->get_checkout_payment_url(), |
|
85 | + 'name' => __( 'Pay Now', 'invoicing' ), |
|
86 | + 'class' => 'btn-success', |
|
87 | + ), |
|
88 | 88 | |
89 | - 'print' => array( |
|
90 | - 'url' => $invoice->get_view_url(), |
|
91 | - 'name' => __( 'View', 'invoicing' ), |
|
92 | - 'class' => 'btn-secondary', |
|
93 | - 'attrs' => 'target="_blank"', |
|
94 | - ), |
|
95 | - ); |
|
89 | + 'print' => array( |
|
90 | + 'url' => $invoice->get_view_url(), |
|
91 | + 'name' => __( 'View', 'invoicing' ), |
|
92 | + 'class' => 'btn-secondary', |
|
93 | + 'attrs' => 'target="_blank"', |
|
94 | + ), |
|
95 | + ); |
|
96 | 96 | |
97 | - if ( ! $invoice->needs_payment() ) { |
|
98 | - unset( $actions['pay'] ); |
|
99 | - } |
|
97 | + if ( ! $invoice->needs_payment() ) { |
|
98 | + unset( $actions['pay'] ); |
|
99 | + } |
|
100 | 100 | |
101 | - if ( $invoice->needs_payment() ) { |
|
102 | - $actions['delete'] = array( |
|
103 | - 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
104 | - 'name' => __( 'Delete', 'invoicing' ), |
|
105 | - 'class' => 'btn-danger', |
|
106 | - ); |
|
107 | - } |
|
101 | + if ( $invoice->needs_payment() ) { |
|
102 | + $actions['delete'] = array( |
|
103 | + 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
104 | + 'name' => __( 'Delete', 'invoicing' ), |
|
105 | + 'class' => 'btn-danger', |
|
106 | + ); |
|
107 | + } |
|
108 | 108 | |
109 | - $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
109 | + $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
110 | 110 | |
111 | - foreach ( $actions as $key => $action ) { |
|
112 | - $class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : ''; |
|
113 | - echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $action['name'] ) . '</a>'; |
|
114 | - } |
|
111 | + foreach ( $actions as $key => $action ) { |
|
112 | + $class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : ''; |
|
113 | + echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $action['name'] ) . '</a>'; |
|
114 | + } |
|
115 | 115 | |
116 | - break; |
|
116 | + break; |
|
117 | 117 | |
118 | - default: |
|
119 | - do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
120 | - break; |
|
118 | + default: |
|
119 | + do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
120 | + break; |
|
121 | 121 | |
122 | 122 | |
123 | - } |
|
123 | + } |
|
124 | 124 | |
125 | - do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
125 | + do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
126 | 126 | |
127 | - echo '</td>'; |
|
127 | + echo '</td>'; |
|
128 | 128 | |
129 | - endforeach; |
|
130 | - ?> |
|
129 | + endforeach; |
|
130 | + ?> |
|
131 | 131 | </tr> |
132 | 132 | |
133 | 133 | <?php endforeach; ?> |
@@ -141,18 +141,18 @@ discard block |
||
141 | 141 | <?php if ( 1 < $invoices->max_num_pages ) : ?> |
142 | 142 | <div class="invoicing-Pagination"> |
143 | 143 | <?php |
144 | - $big = 999999; |
|
145 | - |
|
146 | - echo wp_kses_post( |
|
147 | - paginate_links( |
|
148 | - array( |
|
149 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
150 | - 'format' => '?paged=%#%', |
|
151 | - 'total' => $invoices->max_num_pages, |
|
152 | - ) |
|
153 | - ) |
|
144 | + $big = 999999; |
|
145 | + |
|
146 | + echo wp_kses_post( |
|
147 | + paginate_links( |
|
148 | + array( |
|
149 | + 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
150 | + 'format' => '?paged=%#%', |
|
151 | + 'total' => $invoices->max_num_pages, |
|
152 | + ) |
|
153 | + ) |
|
154 | 154 | ); |
155 | - ?> |
|
155 | + ?> |
|
156 | 156 | </div> |
157 | 157 | <?php endif; ?> |
158 | 158 |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Current page. |
13 | -$current_page = empty( $_GET['page'] ) ? 1 : absint( $_GET['page'] ); |
|
13 | +$current_page = empty($_GET['page']) ? 1 : absint($_GET['page']); |
|
14 | 14 | |
15 | 15 | // Fires before displaying user invoices. |
16 | -do_action( 'wpinv_before_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type ); |
|
16 | +do_action('wpinv_before_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type); |
|
17 | 17 | |
18 | 18 | wpinv_print_errors(); |
19 | 19 | |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | |
22 | 22 | |
23 | 23 | <div class="table-responsive"> |
24 | - <table class="table table-bordered table-hover getpaid-user-invoices <?php echo esc_attr( $post_type ); ?>"> |
|
24 | + <table class="table table-bordered table-hover getpaid-user-invoices <?php echo esc_attr($post_type); ?>"> |
|
25 | 25 | |
26 | 26 | |
27 | 27 | <thead> |
28 | 28 | <tr> |
29 | 29 | |
30 | - <?php foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : ?> |
|
31 | - <th class="<?php echo esc_attr( $column_id ); ?> <?php echo ( ! empty( $column_name['class'] ) ? sanitize_html_class( $column_name['class'] ) : ''); ?> border-bottom-0"> |
|
32 | - <span class="nobr"><?php echo esc_html( $column_name['title'] ); ?></span> |
|
30 | + <?php foreach (wpinv_get_user_invoices_columns($post_type) as $column_id => $column_name) : ?> |
|
31 | + <th class="<?php echo esc_attr($column_id); ?> <?php echo (!empty($column_name['class']) ? sanitize_html_class($column_name['class']) : ''); ?> border-bottom-0"> |
|
32 | + <span class="nobr"><?php echo esc_html($column_name['title']); ?></span> |
|
33 | 33 | </th> |
34 | 34 | <?php endforeach; ?> |
35 | 35 | |
@@ -39,43 +39,43 @@ discard block |
||
39 | 39 | |
40 | 40 | |
41 | 41 | <tbody> |
42 | - <?php foreach ( $invoices->invoices as $invoice ) : ?> |
|
42 | + <?php foreach ($invoices->invoices as $invoice) : ?> |
|
43 | 43 | |
44 | - <tr class="wpinv-item wpinv-item-<?php echo esc_attr( $invoice->get_status() ); ?>"> |
|
44 | + <tr class="wpinv-item wpinv-item-<?php echo esc_attr($invoice->get_status()); ?>"> |
|
45 | 45 | <?php |
46 | 46 | |
47 | - foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
47 | + foreach (wpinv_get_user_invoices_columns($post_type) as $column_id => $column_name) : |
|
48 | 48 | |
49 | - $column_id = sanitize_html_class( $column_id ); |
|
50 | - $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
49 | + $column_id = sanitize_html_class($column_id); |
|
50 | + $class = empty($column_name['class']) ? '' : sanitize_html_class($column_name['class']); |
|
51 | 51 | |
52 | - echo "<td class='" . esc_attr( $column_id . ' ' . $class ) . "'>"; |
|
53 | - switch ( $column_id ) { |
|
52 | + echo "<td class='" . esc_attr($column_id . ' ' . $class) . "'>"; |
|
53 | + switch ($column_id) { |
|
54 | 54 | |
55 | 55 | case 'invoice-number': |
56 | - echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
56 | + echo wp_kses_post(wpinv_invoice_link($invoice)); |
|
57 | 57 | break; |
58 | 58 | |
59 | 59 | case 'created-date': |
60 | - echo esc_html( getpaid_format_date_value( $invoice->get_date_created() ) ); |
|
60 | + echo esc_html(getpaid_format_date_value($invoice->get_date_created())); |
|
61 | 61 | break; |
62 | 62 | |
63 | 63 | case 'payment-date': |
64 | - if ( $invoice->needs_payment() ) { |
|
64 | + if ($invoice->needs_payment()) { |
|
65 | 65 | echo '—'; |
66 | 66 | } else { |
67 | - echo esc_html( getpaid_format_date_value( $invoice->get_date_completed() ) ); |
|
67 | + echo esc_html(getpaid_format_date_value($invoice->get_date_completed())); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | break; |
71 | 71 | |
72 | 72 | case 'invoice-status': |
73 | - echo wp_kses_post( $invoice->get_status_label_html() ); |
|
73 | + echo wp_kses_post($invoice->get_status_label_html()); |
|
74 | 74 | |
75 | 75 | break; |
76 | 76 | |
77 | 77 | case 'invoice-total': |
78 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
78 | + wpinv_the_price($invoice->get_total(), $invoice->get_currency()); |
|
79 | 79 | |
80 | 80 | break; |
81 | 81 | |
@@ -84,47 +84,47 @@ discard block |
||
84 | 84 | |
85 | 85 | 'pay' => array( |
86 | 86 | 'url' => $invoice->get_checkout_payment_url(), |
87 | - 'name' => __( 'Pay Now', 'invoicing' ), |
|
87 | + 'name' => __('Pay Now', 'invoicing'), |
|
88 | 88 | 'class' => 'btn-success', |
89 | 89 | ), |
90 | 90 | |
91 | 91 | 'print' => array( |
92 | 92 | 'url' => $invoice->get_view_url(), |
93 | - 'name' => __( 'View', 'invoicing' ), |
|
93 | + 'name' => __('View', 'invoicing'), |
|
94 | 94 | 'class' => 'btn-secondary', |
95 | 95 | 'attrs' => 'target="_blank"', |
96 | 96 | ), |
97 | 97 | ); |
98 | 98 | |
99 | - if ( ! $invoice->needs_payment() ) { |
|
100 | - unset( $actions['pay'] ); |
|
99 | + if (!$invoice->needs_payment()) { |
|
100 | + unset($actions['pay']); |
|
101 | 101 | } |
102 | 102 | |
103 | - if ( $invoice->needs_payment() ) { |
|
103 | + if ($invoice->needs_payment()) { |
|
104 | 104 | $actions['delete'] = array( |
105 | - 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
106 | - 'name' => __( 'Delete', 'invoicing' ), |
|
105 | + 'url' => getpaid_get_authenticated_action_url('delete_invoice', add_query_arg('invoice_id', $invoice->get_id())), |
|
106 | + 'name' => __('Delete', 'invoicing'), |
|
107 | 107 | 'class' => 'btn-danger', |
108 | 108 | ); |
109 | 109 | } |
110 | 110 | |
111 | - $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
111 | + $actions = apply_filters('wpinv_user_invoices_actions', $actions, $invoice, $post_type); |
|
112 | 112 | |
113 | - foreach ( $actions as $key => $action ) { |
|
114 | - $class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : ''; |
|
115 | - echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $action['name'] ) . '</a>'; |
|
113 | + foreach ($actions as $key => $action) { |
|
114 | + $class = !empty($action['class']) ? sanitize_html_class($action['class']) : ''; |
|
115 | + echo '<a href="' . esc_url($action['url']) . '" class="btn btn-sm btn-block ' . esc_attr($class . ' ' . sanitize_html_class($key)) . '" ' . (!empty($action['attrs']) ? esc_html($action['attrs']) : '') . '>' . esc_attr($action['name']) . '</a>'; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | break; |
119 | 119 | |
120 | 120 | default: |
121 | - do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
121 | + do_action("wpinv_user_invoices_column_$column_id", $invoice); |
|
122 | 122 | break; |
123 | 123 | |
124 | 124 | |
125 | 125 | } |
126 | 126 | |
127 | - do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
127 | + do_action("wpinv_user_invoices_column_after_$column_id", $invoice); |
|
128 | 128 | |
129 | 129 | echo '</td>'; |
130 | 130 | |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | </table> |
139 | 139 | </div> |
140 | 140 | |
141 | - <?php do_action( 'wpinv_before_user_invoices_pagination' ); ?> |
|
141 | + <?php do_action('wpinv_before_user_invoices_pagination'); ?> |
|
142 | 142 | |
143 | - <?php if ( 1 < $invoices->max_num_pages ) : ?> |
|
143 | + <?php if (1 < $invoices->max_num_pages) : ?> |
|
144 | 144 | <div class="invoicing-Pagination"> |
145 | 145 | <?php |
146 | 146 | $big = 999999; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | echo wp_kses_post( |
149 | 149 | paginate_links( |
150 | 150 | array( |
151 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
151 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
152 | 152 | 'format' => '?paged=%#%', |
153 | 153 | 'total' => $invoices->max_num_pages, |
154 | 154 | ) |
@@ -158,4 +158,4 @@ discard block |
||
158 | 158 | </div> |
159 | 159 | <?php endif; ?> |
160 | 160 | |
161 | -<?php do_action( 'wpinv_after_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type ); ?> |
|
161 | +<?php do_action('wpinv_after_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type); ?> |
@@ -8,45 +8,45 @@ discard block |
||
8 | 8 | * @var WPInv_Invoice $invoice |
9 | 9 | * @var array $columns |
10 | 10 | */ |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | -$meta_data = getpaid_get_invoice_meta( $invoice ); |
|
13 | +$meta_data = getpaid_get_invoice_meta($invoice); |
|
14 | 14 | |
15 | -if ( isset( $meta_data['status'] ) ) { |
|
15 | +if (isset($meta_data['status'])) { |
|
16 | 16 | $meta_data['status']['value'] = $invoice->get_status_nicename(); |
17 | 17 | } |
18 | 18 | |
19 | -do_action( 'wpinv_email_before_invoice_details', $invoice, $sent_to_admin ); |
|
19 | +do_action('wpinv_email_before_invoice_details', $invoice, $sent_to_admin); |
|
20 | 20 | |
21 | 21 | ?> |
22 | 22 | |
23 | 23 | <div id="wpinv-email-details"> |
24 | 24 | |
25 | 25 | <h3 class="invoice-details-title"> |
26 | - <?php echo sprintf( esc_html__( '%s Details', 'invoicing' ), esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) ); ?> |
|
26 | + <?php echo sprintf(esc_html__('%s Details', 'invoicing'), esc_html(ucfirst($invoice->get_invoice_quote_type()))); ?> |
|
27 | 27 | </h3> |
28 | 28 | |
29 | 29 | <table class="table table-bordered table-sm"> |
30 | 30 | |
31 | - <?php foreach ( $meta_data as $key => $data ) : ?> |
|
31 | + <?php foreach ($meta_data as $key => $data) : ?> |
|
32 | 32 | |
33 | - <?php if ( ! empty( $data['value'] ) ) : ?> |
|
33 | + <?php if (!empty($data['value'])) : ?> |
|
34 | 34 | |
35 | - <?php do_action( "getpaid_before_email_details_$key", $invoice, $data ); ?> |
|
35 | + <?php do_action("getpaid_before_email_details_$key", $invoice, $data); ?> |
|
36 | 36 | |
37 | - <tr class="getpaid-email-details-<?php echo esc_attr( $key ); ?>"> |
|
37 | + <tr class="getpaid-email-details-<?php echo esc_attr($key); ?>"> |
|
38 | 38 | |
39 | 39 | <td class="getpaid-lable-td"> |
40 | - <?php echo esc_html( $data['label'] ); ?> |
|
40 | + <?php echo esc_html($data['label']); ?> |
|
41 | 41 | </td> |
42 | 42 | |
43 | 43 | <td class="getpaid-value-td"> |
44 | - <span class="getpaid-invoice-meta-<?php echo esc_attr( $key ); ?>-value"><?php echo wp_kses_post( $data['value'] ); ?></span> |
|
44 | + <span class="getpaid-invoice-meta-<?php echo esc_attr($key); ?>-value"><?php echo wp_kses_post($data['value']); ?></span> |
|
45 | 45 | </td> |
46 | 46 | |
47 | 47 | </tr> |
48 | 48 | |
49 | - <?php do_action( "getpaid_after_email_details_$key", $invoice, $data ); ?> |
|
49 | + <?php do_action("getpaid_after_email_details_$key", $invoice, $data); ?> |
|
50 | 50 | |
51 | 51 | <?php endif; ?> |
52 | 52 | |
@@ -56,4 +56,4 @@ discard block |
||
56 | 56 | |
57 | 57 | </div> |
58 | 58 | |
59 | -<?php do_action( 'wpinv_email_after_invoice_details', $invoice, $sent_to_admin ); ?> |
|
59 | +<?php do_action('wpinv_email_after_invoice_details', $invoice, $sent_to_admin); ?> |
@@ -8,8 +8,8 @@ |
||
8 | 8 | |
9 | 9 | $dummy_rule = array( |
10 | 10 | 'key' => 'TAX_RULE_KEY', |
11 | - 'label' => __( 'New Tax Rule', 'invoicing' ), |
|
12 | - 'tax_base' => wpinv_get_option( 'tax_base', 'billing' ), |
|
11 | + 'label' => __( 'New Tax Rule', 'invoicing' ), |
|
12 | + 'tax_base' => wpinv_get_option( 'tax_base', 'billing' ), |
|
13 | 13 | 'same_country_rule' => wpinv_get_option( 'vat_same_country_rule', 'vat_too' ), |
14 | 14 | ); |
15 | 15 |
@@ -4,40 +4,40 @@ discard block |
||
4 | 4 | * |
5 | 5 | */ |
6 | 6 | |
7 | -defined( 'ABSPATH' ) || exit; |
|
7 | +defined('ABSPATH') || exit; |
|
8 | 8 | |
9 | 9 | $dummy_rule = array( |
10 | 10 | 'key' => 'TAX_RULE_KEY', |
11 | - 'label' => __( 'New Tax Rule', 'invoicing' ), |
|
12 | - 'tax_base' => wpinv_get_option( 'tax_base', 'billing' ), |
|
13 | - 'same_country_rule' => wpinv_get_option( 'vat_same_country_rule', 'vat_too' ), |
|
11 | + 'label' => __('New Tax Rule', 'invoicing'), |
|
12 | + 'tax_base' => wpinv_get_option('tax_base', 'billing'), |
|
13 | + 'same_country_rule' => wpinv_get_option('vat_same_country_rule', 'vat_too'), |
|
14 | 14 | ); |
15 | 15 | |
16 | -wp_nonce_field( 'wpinv_tax_rules', 'wpinv_tax_rules_nonce' ); |
|
16 | +wp_nonce_field('wpinv_tax_rules', 'wpinv_tax_rules_nonce'); |
|
17 | 17 | |
18 | 18 | ?> |
19 | 19 | <div class="table-responsive"> |
20 | 20 | <table id="wpinv-tax-rules" class="widefat fixed table"> |
21 | - <caption><?php echo esc_html_e( 'You can use this section to create or edit your tax rules', 'invoicing' ); ?></caption> |
|
21 | + <caption><?php echo esc_html_e('You can use this section to create or edit your tax rules', 'invoicing'); ?></caption> |
|
22 | 22 | |
23 | 23 | <thead> |
24 | 24 | <tr class="table-light"> |
25 | 25 | |
26 | 26 | <th scope="col" class="border-bottom border-top"> |
27 | - <?php esc_html_e( 'Unique Key', 'invoicing' ); ?> |
|
27 | + <?php esc_html_e('Unique Key', 'invoicing'); ?> |
|
28 | 28 | </th> |
29 | 29 | |
30 | 30 | <th scope="col" class="border-bottom border-top"> |
31 | - <?php esc_html_e( 'Label', 'invoicing' ); ?> |
|
31 | + <?php esc_html_e('Label', 'invoicing'); ?> |
|
32 | 32 | </th> |
33 | 33 | |
34 | 34 | <th scope="col" class="border-bottom border-top"> |
35 | - <?php esc_html_e( 'Calculate tax based on', 'invoicing' ); ?> |
|
35 | + <?php esc_html_e('Calculate tax based on', 'invoicing'); ?> |
|
36 | 36 | </th> |
37 | 37 | |
38 | 38 | <!-- <th scope="col" class="border-bottom border-top"> |
39 | - <?php esc_html_e( 'Same country rule', 'invoicing' ); ?> |
|
40 | - <?php getpaid_get_help_tip( __( 'What should happen if a customer is from the same country as your business?.', 'invoicing' ), 'position-static', true ); ?> |
|
39 | + <?php esc_html_e('Same country rule', 'invoicing'); ?> |
|
40 | + <?php getpaid_get_help_tip(__('What should happen if a customer is from the same country as your business?.', 'invoicing'), 'position-static', true); ?> |
|
41 | 41 | </th> --> |
42 | 42 | |
43 | 43 | <th scope="col" class="border-bottom border-top" style="width:32px"> </th> |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | </thead> |
47 | 47 | |
48 | 48 | <tbody> |
49 | - <?php foreach ( GetPaid_Tax::get_all_tax_rules() as $tax_rule ) : ?> |
|
50 | - <?php include plugin_dir_path( __FILE__ ) . 'html-tax-rule-edit.php'; ?> |
|
49 | + <?php foreach (GetPaid_Tax::get_all_tax_rules() as $tax_rule) : ?> |
|
50 | + <?php include plugin_dir_path(__FILE__) . 'html-tax-rule-edit.php'; ?> |
|
51 | 51 | <?php endforeach; ?> |
52 | 52 | </tbody> |
53 | 53 | |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | <tr class="table-light"> |
56 | 56 | <td colspan="4" class="border-top"> |
57 | 57 | |
58 | - <button type="button" class="button button-secondary wpinv_add_tax_rule" aria-label="<?php esc_attr_e( 'Add Tax Rule', 'invoicing' ); ?>"> |
|
59 | - <span><?php esc_html_e( 'Add Tax Rule', 'invoicing' ); ?></span> |
|
58 | + <button type="button" class="button button-secondary wpinv_add_tax_rule" aria-label="<?php esc_attr_e('Add Tax Rule', 'invoicing'); ?>"> |
|
59 | + <span><?php esc_html_e('Add Tax Rule', 'invoicing'); ?></span> |
|
60 | 60 | </button> |
61 | 61 | |
62 | 62 | </td> |
@@ -67,6 +67,6 @@ discard block |
||
67 | 67 | |
68 | 68 | <script type="text/html" id="tmpl-wpinv-tax-rule-row"> |
69 | 69 | <?php $tax_rule = $dummy_rule; ?> |
70 | - <?php include plugin_dir_path( __FILE__ ) . 'html-tax-rule-edit.php'; ?> |
|
70 | + <?php include plugin_dir_path(__FILE__) . 'html-tax-rule-edit.php'; ?> |
|
71 | 71 | </script> |
72 | 72 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * |
5 | 5 | */ |
6 | 6 | |
7 | -defined( 'ABSPATH' ) || exit; |
|
7 | +defined('ABSPATH') || exit; |
|
8 | 8 | |
9 | 9 | ?> |
10 | 10 | |
@@ -12,24 +12,24 @@ discard block |
||
12 | 12 | |
13 | 13 | <form method="post" class="text-center card-body"> |
14 | 14 | <div class="gp-wizard-payments"> |
15 | - <h2 class="gd-settings-title h3 "><?php esc_html_e( 'Gateway Setup', 'invoicing' ); ?></h2> |
|
16 | - <p><?php esc_html_e( 'Below are a few gateways that can be setup in a few seconds.', 'invoicing' ); ?> |
|
15 | + <h2 class="gd-settings-title h3 "><?php esc_html_e('Gateway Setup', 'invoicing'); ?></h2> |
|
16 | + <p><?php esc_html_e('Below are a few gateways that can be setup in a few seconds.', 'invoicing'); ?> |
|
17 | 17 | <br> |
18 | - <?php esc_html_e( 'We have 20+ Gateways that can be setup later.', 'invoicing' ); ?> |
|
18 | + <?php esc_html_e('We have 20+ Gateways that can be setup later.', 'invoicing'); ?> |
|
19 | 19 | </p> |
20 | 20 | |
21 | 21 | <ul class="list-group"> |
22 | 22 | |
23 | 23 | <li class="list-group-item d-flex justify-content-between align-items-center"> |
24 | - <span class="mr-auto"><img src="<?php echo esc_url( WPINV_PLUGIN_URL . 'assets/images/stripe-verified.svg' ); ?>" class="ml-n2" alt="Stripe"></span> |
|
25 | - <?php if ( false === wpinv_get_option( 'stripe_live_connect_account_id' ) ) : ?> |
|
24 | + <span class="mr-auto"><img src="<?php echo esc_url(WPINV_PLUGIN_URL . 'assets/images/stripe-verified.svg'); ?>" class="ml-n2" alt="Stripe"></span> |
|
25 | + <?php if (false === wpinv_get_option('stripe_live_connect_account_id')) : ?> |
|
26 | 26 | <a href="<?php |
27 | - echo esc_url( wp_nonce_url( |
|
27 | + echo esc_url(wp_nonce_url( |
|
28 | 28 | add_query_arg( |
29 | 29 | array( |
30 | 30 | 'getpaid-admin-action' => 'connect_gateway', |
31 | 31 | 'plugin' => 'stripe', |
32 | - 'redirect' => urlencode( add_query_arg( 'step', 'payments' ) ), |
|
32 | + 'redirect' => urlencode(add_query_arg('step', 'payments')), |
|
33 | 33 | ), |
34 | 34 | admin_url() |
35 | 35 | ), |
@@ -37,31 +37,31 @@ discard block |
||
37 | 37 | 'getpaid-nonce' |
38 | 38 | )); |
39 | 39 | ?>" |
40 | - class="btn btn-sm btn-outline-primary"><?php esc_html_e( 'Connect', 'invoicing' ); ?></a> |
|
40 | + class="btn btn-sm btn-outline-primary"><?php esc_html_e('Connect', 'invoicing'); ?></a> |
|
41 | 41 | <?php else : ?> |
42 | - <span class="btn btn-sm btn-success"><?php esc_html_e( 'Connected', 'invoicing' ); ?></span> |
|
42 | + <span class="btn btn-sm btn-success"><?php esc_html_e('Connected', 'invoicing'); ?></span> |
|
43 | 43 | <?php endif; ?> |
44 | 44 | </li> |
45 | 45 | |
46 | 46 | <li class="list-group-item"> |
47 | 47 | <div class="d-flex justify-content-between align-items-center"> |
48 | 48 | <span class="mr-auto"> |
49 | - <img src="<?php echo esc_url( WPINV_PLUGIN_URL . 'assets/images/pp-logo-150px.webp' ); ?>" class="" alt="PayPal" height="25"> |
|
49 | + <img src="<?php echo esc_url(WPINV_PLUGIN_URL . 'assets/images/pp-logo-150px.webp'); ?>" class="" alt="PayPal" height="25"> |
|
50 | 50 | </span> |
51 | 51 | <a |
52 | 52 | href="#" |
53 | 53 | onclick="jQuery('.getpaid-setup-paypal-input').toggleClass('d-none'); return false;" |
54 | - class="getpaid-setup-paypal btn btn-sm btn-outline-primary"><?php esc_html_e( 'Set-up', 'invoicing' ); ?></a> |
|
54 | + class="getpaid-setup-paypal btn btn-sm btn-outline-primary"><?php esc_html_e('Set-up', 'invoicing'); ?></a> |
|
55 | 55 | </div> |
56 | 56 | <div class="mt-4 getpaid-setup-paypal-input d-none"> |
57 | - <input type="text" placeholder="<?php esc_attr_e( 'PayPal Email', 'invoicing' ); ?>" name="paypal-email" class="form-control" value="<?php echo esc_attr( wpinv_get_option( 'paypal_email' ) ); ?>"> |
|
57 | + <input type="text" placeholder="<?php esc_attr_e('PayPal Email', 'invoicing'); ?>" name="paypal-email" class="form-control" value="<?php echo esc_attr(wpinv_get_option('paypal_email')); ?>"> |
|
58 | 58 | </div> |
59 | 59 | </li> |
60 | 60 | |
61 | 61 | <li class="list-group-item d-flex justify-content-between align-items-center"> |
62 | - <span class="mr-auto"><?php esc_html_e( 'Test Gateway', 'invoicing' ); ?></span> |
|
62 | + <span class="mr-auto"><?php esc_html_e('Test Gateway', 'invoicing'); ?></span> |
|
63 | 63 | <div class="custom-control custom-switch"> |
64 | - <input type="checkbox" name="enable-manual-gateway" class="custom-control-input" id="enable-manual-gateway" <?php checked( wpinv_is_gateway_active( 'manual' ) ); ?>> |
|
64 | + <input type="checkbox" name="enable-manual-gateway" class="custom-control-input" id="enable-manual-gateway" <?php checked(wpinv_is_gateway_active('manual')); ?>> |
|
65 | 65 | <label class="custom-control-label" for="enable-manual-gateway"></label> |
66 | 66 | </div> |
67 | 67 | </li> |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | </div> |
71 | 71 | |
72 | 72 | <p class="gp-setup-actions step text-center mt-4"> |
73 | - <input type="submit" class="btn btn-primary" value="<?php esc_attr_e( 'Continue', 'invoicing' ); ?>" /> |
|
73 | + <input type="submit" class="btn btn-primary" value="<?php esc_attr_e('Continue', 'invoicing'); ?>" /> |
|
74 | 74 | </p> |
75 | 75 | |
76 | - <?php getpaid_hidden_field( 'save_step', 1 ); ?> |
|
77 | - <?php wp_nonce_field( 'getpaid-setup-wizard', 'getpaid-setup-wizard' ); ?> |
|
76 | + <?php getpaid_hidden_field('save_step', 1); ?> |
|
77 | + <?php wp_nonce_field('getpaid-setup-wizard', 'getpaid-setup-wizard'); ?> |
|
78 | 78 | </form> |
79 | 79 | </div> |
@@ -38,8 +38,11 @@ |
||
38 | 38 | )); |
39 | 39 | ?>" |
40 | 40 | class="btn btn-sm btn-outline-primary"><?php esc_html_e( 'Connect', 'invoicing' ); ?></a> |
41 | - <?php else : ?> |
|
42 | - <span class="btn btn-sm btn-success"><?php esc_html_e( 'Connected', 'invoicing' ); ?></span> |
|
41 | + <?php else { |
|
42 | + : ?> |
|
43 | + <span class="btn btn-sm btn-success"><?php esc_html_e( 'Connected', 'invoicing' ); |
|
44 | +} |
|
45 | +?></span> |
|
43 | 46 | <?php endif; ?> |
44 | 47 | </li> |
45 | 48 |
@@ -1,32 +1,32 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | - // Is the request set up correctly? |
|
4 | - if ( empty( $_GET['form'] ) && empty( $_GET['item'] ) ) { |
|
5 | - return aui()->alert( |
|
6 | - array( |
|
7 | - 'type' => 'warning', |
|
8 | - 'content' => __( 'No payment form or item selected', 'invoicing' ), |
|
9 | - ) |
|
10 | - ); |
|
11 | - wp_die( esc_html__( 'No payment form or item selected', 'invoicing' ), 400 ); |
|
12 | - } |
|
13 | - |
|
14 | - // Payment form or button? |
|
15 | - if ( ! empty( $_GET['form'] ) ) { |
|
16 | - |
|
17 | - $shortcode = sprintf( |
|
18 | - '[getpaid form=%s]', |
|
19 | - (int) $_GET['form'] |
|
20 | - ); |
|
21 | - |
|
22 | - } else { |
|
23 | - |
|
24 | - $shortcode = sprintf( |
|
25 | - '[getpaid item=%s]', |
|
26 | - esc_attr( urldecode( $_GET['item'] ) ) |
|
27 | - ); |
|
28 | - |
|
29 | - } |
|
3 | + // Is the request set up correctly? |
|
4 | + if ( empty( $_GET['form'] ) && empty( $_GET['item'] ) ) { |
|
5 | + return aui()->alert( |
|
6 | + array( |
|
7 | + 'type' => 'warning', |
|
8 | + 'content' => __( 'No payment form or item selected', 'invoicing' ), |
|
9 | + ) |
|
10 | + ); |
|
11 | + wp_die( esc_html__( 'No payment form or item selected', 'invoicing' ), 400 ); |
|
12 | + } |
|
13 | + |
|
14 | + // Payment form or button? |
|
15 | + if ( ! empty( $_GET['form'] ) ) { |
|
16 | + |
|
17 | + $shortcode = sprintf( |
|
18 | + '[getpaid form=%s]', |
|
19 | + (int) $_GET['form'] |
|
20 | + ); |
|
21 | + |
|
22 | + } else { |
|
23 | + |
|
24 | + $shortcode = sprintf( |
|
25 | + '[getpaid item=%s]', |
|
26 | + esc_attr( urldecode( $_GET['item'] ) ) |
|
27 | + ); |
|
28 | + |
|
29 | + } |
|
30 | 30 | |
31 | 31 | ?> |
32 | 32 | |
@@ -44,13 +44,13 @@ discard block |
||
44 | 44 | |
45 | 45 | <title><?php echo esc_html( get_bloginfo( 'name' ) ); ?></title> |
46 | 46 | <?php |
47 | - wp_enqueue_scripts(); |
|
48 | - wp_print_styles(); |
|
49 | - wp_print_head_scripts(); |
|
50 | - wp_custom_css_cb(); |
|
51 | - wpinv_get_template( 'frontend-head.php' ); |
|
52 | - wp_site_icon(); |
|
53 | - ?> |
|
47 | + wp_enqueue_scripts(); |
|
48 | + wp_print_styles(); |
|
49 | + wp_print_head_scripts(); |
|
50 | + wp_custom_css_cb(); |
|
51 | + wpinv_get_template( 'frontend-head.php' ); |
|
52 | + wp_site_icon(); |
|
53 | + ?> |
|
54 | 54 | |
55 | 55 | <style type="text/css"> |
56 | 56 | .body{ |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | <body class="body page-template-default page"> |
85 | 85 | <div id="getpaid-form-embed" class="container my-5 page type-page status-publish hentry post post-content"> |
86 | 86 | <?php |
87 | - do_action( 'getpaid_payment_form_embed_top' ); |
|
88 | - echo do_shortcode( $shortcode ); |
|
89 | - do_action( 'getpaid_payment_form_embed_bottom' ); |
|
90 | - wpinv_get_template( 'frontend-footer.php' ); |
|
91 | - ?> |
|
87 | + do_action( 'getpaid_payment_form_embed_top' ); |
|
88 | + echo do_shortcode( $shortcode ); |
|
89 | + do_action( 'getpaid_payment_form_embed_bottom' ); |
|
90 | + wpinv_get_template( 'frontend-footer.php' ); |
|
91 | + ?> |
|
92 | 92 | </div> |
93 | 93 | <?php wp_footer(); ?> |
94 | 94 | </body> |
@@ -1,18 +1,18 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Is the request set up correctly? |
4 | - if ( empty( $_GET['form'] ) && empty( $_GET['item'] ) ) { |
|
4 | + if (empty($_GET['form']) && empty($_GET['item'])) { |
|
5 | 5 | return aui()->alert( |
6 | 6 | array( |
7 | 7 | 'type' => 'warning', |
8 | - 'content' => __( 'No payment form or item selected', 'invoicing' ), |
|
8 | + 'content' => __('No payment form or item selected', 'invoicing'), |
|
9 | 9 | ) |
10 | 10 | ); |
11 | - wp_die( esc_html__( 'No payment form or item selected', 'invoicing' ), 400 ); |
|
11 | + wp_die(esc_html__('No payment form or item selected', 'invoicing'), 400); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // Payment form or button? |
15 | - if ( ! empty( $_GET['form'] ) ) { |
|
15 | + if (!empty($_GET['form'])) { |
|
16 | 16 | |
17 | 17 | $shortcode = sprintf( |
18 | 18 | '[getpaid form=%s]', |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | $shortcode = sprintf( |
25 | 25 | '[getpaid item=%s]', |
26 | - esc_attr( urldecode( $_GET['item'] ) ) |
|
26 | + esc_attr(urldecode($_GET['item'])) |
|
27 | 27 | ); |
28 | 28 | |
29 | 29 | } |
@@ -35,20 +35,20 @@ discard block |
||
35 | 35 | |
36 | 36 | <head> |
37 | 37 | |
38 | - <meta charset="<?php bloginfo( 'charset' ); ?>"> |
|
38 | + <meta charset="<?php bloginfo('charset'); ?>"> |
|
39 | 39 | <meta name="viewport" content="width=device-width, initial-scale=1.0" > |
40 | 40 | |
41 | 41 | <meta name="robots" content="noindex,nofollow"> |
42 | 42 | |
43 | 43 | <link rel="profile" href="https://gmpg.org/xfn/11"> |
44 | 44 | |
45 | - <title><?php echo esc_html( get_bloginfo( 'name' ) ); ?></title> |
|
45 | + <title><?php echo esc_html(get_bloginfo('name')); ?></title> |
|
46 | 46 | <?php |
47 | 47 | wp_enqueue_scripts(); |
48 | 48 | wp_print_styles(); |
49 | 49 | wp_print_head_scripts(); |
50 | 50 | wp_custom_css_cb(); |
51 | - wpinv_get_template( 'frontend-head.php' ); |
|
51 | + wpinv_get_template('frontend-head.php'); |
|
52 | 52 | wp_site_icon(); |
53 | 53 | ?> |
54 | 54 | |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | <body class="body page-template-default page"> |
85 | 85 | <div id="getpaid-form-embed" class="container my-5 page type-page status-publish hentry post post-content"> |
86 | 86 | <?php |
87 | - do_action( 'getpaid_payment_form_embed_top' ); |
|
88 | - echo do_shortcode( $shortcode ); |
|
89 | - do_action( 'getpaid_payment_form_embed_bottom' ); |
|
90 | - wpinv_get_template( 'frontend-footer.php' ); |
|
87 | + do_action('getpaid_payment_form_embed_top'); |
|
88 | + echo do_shortcode($shortcode); |
|
89 | + do_action('getpaid_payment_form_embed_bottom'); |
|
90 | + wpinv_get_template('frontend-footer.php'); |
|
91 | 91 | ?> |
92 | 92 | </div> |
93 | 93 | <?php wp_footer(); ?> |
@@ -7,50 +7,50 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -$class = ! is_singular( 'page' ) ? 'px-1' : ''; |
|
12 | +$class = !is_singular('page') ? 'px-1' : ''; |
|
13 | 13 | ?> |
14 | 14 | |
15 | - <?php do_action( 'getpaid_before_invoice_meta', $invoice ); ?> |
|
15 | + <?php do_action('getpaid_before_invoice_meta', $invoice); ?> |
|
16 | 16 | <div class="getpaid-invoice-meta-data"> |
17 | 17 | |
18 | - <?php do_action( 'getpaid_before_invoice_meta_table', $invoice ); ?> |
|
18 | + <?php do_action('getpaid_before_invoice_meta_table', $invoice); ?> |
|
19 | 19 | <table class="table table-bordered"> |
20 | 20 | <tbody> |
21 | 21 | |
22 | - <?php do_action( 'getpaid_before_invoice_meta_rows', $invoice ); ?> |
|
23 | - <?php foreach ( $meta as $key => $data ) : ?> |
|
22 | + <?php do_action('getpaid_before_invoice_meta_rows', $invoice); ?> |
|
23 | + <?php foreach ($meta as $key => $data) : ?> |
|
24 | 24 | |
25 | - <?php if ( ! empty( $data['value'] ) ) : ?> |
|
25 | + <?php if (!empty($data['value'])) : ?> |
|
26 | 26 | |
27 | - <?php do_action( "getpaid_before_invoice_meta_$key", $invoice, $data ); ?> |
|
27 | + <?php do_action("getpaid_before_invoice_meta_$key", $invoice, $data); ?> |
|
28 | 28 | |
29 | - <tr class="getpaid-invoice-meta-<?php echo esc_attr( $key ); ?>"> |
|
29 | + <tr class="getpaid-invoice-meta-<?php echo esc_attr($key); ?>"> |
|
30 | 30 | |
31 | - <th class="<?php echo esc_attr( $class ); ?> font-weight-bold" style="width: 40%"> |
|
32 | - <?php echo esc_html( $data['label'] ); ?> |
|
31 | + <th class="<?php echo esc_attr($class); ?> font-weight-bold" style="width: 40%"> |
|
32 | + <?php echo esc_html($data['label']); ?> |
|
33 | 33 | </th> |
34 | 34 | |
35 | - <td class="<?php echo esc_attr( $class ); ?> <?php echo 'invoice_total' === $key ? 'font-weight-bold' : 'font-weight-normal'; ?> text-break" style="width: 60%"> |
|
36 | - <span class="getpaid-invoice-meta-<?php echo esc_attr( $key ); ?>-value"><?php echo wp_kses_post( $data['value'] ); ?></span> |
|
35 | + <td class="<?php echo esc_attr($class); ?> <?php echo 'invoice_total' === $key ? 'font-weight-bold' : 'font-weight-normal'; ?> text-break" style="width: 60%"> |
|
36 | + <span class="getpaid-invoice-meta-<?php echo esc_attr($key); ?>-value"><?php echo wp_kses_post($data['value']); ?></span> |
|
37 | 37 | </td> |
38 | 38 | |
39 | 39 | </tr> |
40 | 40 | |
41 | - <?php do_action( "getpaid_after_invoice_meta_$key", $invoice, $data ); ?> |
|
41 | + <?php do_action("getpaid_after_invoice_meta_$key", $invoice, $data); ?> |
|
42 | 42 | |
43 | 43 | <?php endif; ?> |
44 | 44 | |
45 | 45 | <?php endforeach; ?> |
46 | - <?php do_action( 'getpaid_after_invoice_meta_rows', $invoice ); ?> |
|
46 | + <?php do_action('getpaid_after_invoice_meta_rows', $invoice); ?> |
|
47 | 47 | |
48 | 48 | </tbody> |
49 | 49 | </table> |
50 | - <?php do_action( 'getpaid_after_invoice_meta_table', $invoice ); ?> |
|
50 | + <?php do_action('getpaid_after_invoice_meta_table', $invoice); ?> |
|
51 | 51 | |
52 | 52 | |
53 | 53 | </div> |
54 | - <?php do_action( 'getpaid_after_invoice_meta', $invoice ); ?> |
|
54 | + <?php do_action('getpaid_after_invoice_meta', $invoice); ?> |
|
55 | 55 | |
56 | 56 | <?php |
@@ -7,20 +7,20 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -$class = empty( $class ) ? 'btn-primary' : sanitize_html_class( $class ); |
|
13 | -$label = empty( $label ) ? esc_attr__( 'Pay %price% »', 'invoicing' ) : esc_attr( $label ); |
|
14 | -$free = empty( $free ) ? esc_attr__( 'Continue »', 'invoicing' ) : esc_attr( $free ); |
|
12 | +$class = empty($class) ? 'btn-primary' : sanitize_html_class($class); |
|
13 | +$label = empty($label) ? esc_attr__('Pay %price% »', 'invoicing') : esc_attr($label); |
|
14 | +$free = empty($free) ? esc_attr__('Continue »', 'invoicing') : esc_attr($free); |
|
15 | 15 | |
16 | -do_action( 'getpaid_before_payment_form_pay_button', $form ); |
|
16 | +do_action('getpaid_before_payment_form_pay_button', $form); |
|
17 | 17 | |
18 | 18 | aui()->input( |
19 | 19 | array( |
20 | - 'name' => esc_attr( $id ), |
|
21 | - 'id' => esc_attr( $element_id ), |
|
20 | + 'name' => esc_attr($id), |
|
21 | + 'id' => esc_attr($element_id), |
|
22 | 22 | 'value' => $label, |
23 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
23 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
24 | 24 | 'type' => 'submit', |
25 | 25 | 'class' => 'getpaid-payment-form-submit btn btn-block submit-button ' . $class, |
26 | 26 | 'extra_attributes' => array( |
@@ -31,4 +31,4 @@ discard block |
||
31 | 31 | true |
32 | 32 | ); |
33 | 33 | |
34 | -do_action( 'getpaid_after_payment_form_pay_button', $form ); |
|
34 | +do_action('getpaid_after_payment_form_pay_button', $form); |