@@ -8,18 +8,18 @@ |
||
8 | 8 | * @var WPInv_Subscription $object |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | $invoice = $object->get_parent_payment(); |
14 | 14 | |
15 | 15 | // Print the email header. |
16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
17 | 17 | |
18 | 18 | // Generate the custom message body. |
19 | 19 | echo $message_body; |
20 | 20 | |
21 | 21 | // Print the billing details. |
22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
22 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
23 | 23 | |
24 | 24 | // Print the email footer. |
25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
25 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
@@ -8,18 +8,18 @@ |
||
8 | 8 | * @var WPInv_Subscription $object |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | $invoice = $object->get_parent_payment(); |
14 | 14 | |
15 | 15 | // Print the email header. |
16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
17 | 17 | |
18 | 18 | // Generate the custom message body. |
19 | 19 | echo $message_body; |
20 | 20 | |
21 | 21 | // Print the billing details. |
22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
22 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
23 | 23 | |
24 | 24 | // Print the email footer. |
25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
25 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
@@ -8,18 +8,18 @@ |
||
8 | 8 | * @var WPInv_Subscription $object |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | $invoice = $object->get_parent_payment(); |
14 | 14 | |
15 | 15 | // Print the email header. |
16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
17 | 17 | |
18 | 18 | // Generate the custom message body. |
19 | 19 | echo $message_body; |
20 | 20 | |
21 | 21 | // Print the billing details. |
22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
22 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
23 | 23 | |
24 | 24 | // Print the email footer. |
25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
25 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
@@ -7,55 +7,55 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Fetch the invoice. |
13 | -$invoice = new WPInv_Invoice( $invoice ); |
|
13 | +$invoice = new WPInv_Invoice($invoice); |
|
14 | 14 | |
15 | 15 | // @deprecated |
16 | -do_action( 'wpinv_success_content_before', $invoice ); |
|
17 | -do_action( 'wpinv_before_receipt', $invoice ); |
|
16 | +do_action('wpinv_success_content_before', $invoice); |
|
17 | +do_action('wpinv_before_receipt', $invoice); |
|
18 | 18 | |
19 | 19 | wpinv_print_errors(); |
20 | 20 | |
21 | 21 | // Prepare header text. |
22 | -if ( $invoice->is_paid() ) { |
|
22 | +if ($invoice->is_paid()) { |
|
23 | 23 | |
24 | 24 | $alert = aui()->alert( |
25 | 25 | array( |
26 | 26 | 'type' => 'success', |
27 | - 'content' => __( 'Thank you for your payment!', 'invoicing' ), |
|
27 | + 'content' => __('Thank you for your payment!', 'invoicing'), |
|
28 | 28 | ) |
29 | 29 | ); |
30 | 30 | |
31 | -} else if ( $invoice->is_refunded() ) { |
|
31 | +} else if ($invoice->is_refunded()) { |
|
32 | 32 | |
33 | 33 | $alert = aui()->alert( |
34 | 34 | array( |
35 | 35 | 'type' => 'info', |
36 | - 'content' => __( 'This invoice was refunded.', 'invoicing' ), |
|
36 | + 'content' => __('This invoice was refunded.', 'invoicing'), |
|
37 | 37 | ) |
38 | 38 | ); |
39 | 39 | |
40 | -} else if ( $invoice->is_held() ) { |
|
40 | +} else if ($invoice->is_held()) { |
|
41 | 41 | |
42 | 42 | $alert = aui()->alert( |
43 | 43 | array( |
44 | 44 | 'type' => 'info', |
45 | - 'content' => __( 'This invoice will be processed as soon we verify your payment.', 'invoicing' ), |
|
45 | + 'content' => __('This invoice will be processed as soon we verify your payment.', 'invoicing'), |
|
46 | 46 | ) |
47 | 47 | ); |
48 | 48 | |
49 | -} else if ( $invoice->needs_payment() ) { |
|
49 | +} else if ($invoice->needs_payment()) { |
|
50 | 50 | |
51 | - if ( $invoice->is_due() ) { |
|
51 | + if ($invoice->is_due()) { |
|
52 | 52 | |
53 | 53 | $alert = aui()->alert( |
54 | 54 | array( |
55 | 55 | 'type' => 'danger', |
56 | 56 | 'content' => sprintf( |
57 | - __( 'This invoice was due on %.', 'invoicing' ), |
|
58 | - getpaid_format_date_value( $invoice->get_due_date() ) |
|
57 | + __('This invoice was due on %.', 'invoicing'), |
|
58 | + getpaid_format_date_value($invoice->get_due_date()) |
|
59 | 59 | ), |
60 | 60 | ) |
61 | 61 | ); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $alert = aui()->alert( |
66 | 66 | array( |
67 | 67 | 'type' => 'warning', |
68 | - 'content' => __( 'This invoice needs payment.', 'invoicing' ), |
|
68 | + 'content' => __('This invoice needs payment.', 'invoicing'), |
|
69 | 69 | ) |
70 | 70 | ); |
71 | 71 | |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | |
81 | 81 | 'pay' => array( |
82 | 82 | 'url' => $invoice->get_checkout_payment_url(), |
83 | - 'name' => __( 'Pay For Invoice', 'invoicing' ), |
|
83 | + 'name' => __('Pay For Invoice', 'invoicing'), |
|
84 | 84 | 'class' => 'btn-success', |
85 | 85 | ), |
86 | 86 | |
87 | 87 | 'view' => array( |
88 | 88 | 'url' => $invoice->get_view_url(), |
89 | - 'name' => __( 'View Invoice', 'invoicing' ), |
|
89 | + 'name' => __('View Invoice', 'invoicing'), |
|
90 | 90 | 'class' => 'btn-primary', |
91 | 91 | ), |
92 | 92 | |
93 | 93 | 'history' => array( |
94 | 94 | 'url' => wpinv_get_history_page_uri(), |
95 | - 'name' => __( 'Invoice History', 'invoicing' ), |
|
95 | + 'name' => __('Invoice History', 'invoicing'), |
|
96 | 96 | 'class' => 'btn-warning', |
97 | 97 | ), |
98 | 98 | |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | |
102 | 102 | ); |
103 | 103 | |
104 | -if ( ( ! $invoice->needs_payment() || $invoice->is_held() ) && isset( $actions['pay'] ) ) { |
|
105 | - unset( $actions['pay'] ); |
|
104 | +if ((!$invoice->needs_payment() || $invoice->is_held()) && isset($actions['pay'])) { |
|
105 | + unset($actions['pay']); |
|
106 | 106 | } |
107 | 107 | |
108 | -if ( ! is_user_logged_in() && isset( $actions['history'] ) ) { |
|
109 | - unset( $actions['history'] ); |
|
108 | +if (!is_user_logged_in() && isset($actions['history'])) { |
|
109 | + unset($actions['history']); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | ?> |
@@ -115,19 +115,19 @@ discard block |
||
115 | 115 | |
116 | 116 | <?php |
117 | 117 | |
118 | - do_action( 'wpinv_receipt_start', $invoice ); |
|
118 | + do_action('wpinv_receipt_start', $invoice); |
|
119 | 119 | |
120 | - if ( ! empty( $actions ) ) { |
|
120 | + if (!empty($actions)) { |
|
121 | 121 | |
122 | 122 | echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">'; |
123 | 123 | |
124 | - foreach ( $actions as $key => $action ) { |
|
124 | + foreach ($actions as $key => $action) { |
|
125 | 125 | |
126 | - $key = sanitize_html_class( $key ); |
|
127 | - $class = empty( $action['class'] ) ? 'btn-dark' : sanitize_html_class( $action['class'] ); |
|
128 | - $url = empty( $action['url'] ) ? '#' : esc_url( $action['url'] ); |
|
129 | - $attrs = empty( $action['attrs'] ) ? '' : $action['attrs']; |
|
130 | - $anchor = sanitize_text_field( $action['name'] ); |
|
126 | + $key = sanitize_html_class($key); |
|
127 | + $class = empty($action['class']) ? 'btn-dark' : sanitize_html_class($action['class']); |
|
128 | + $url = empty($action['url']) ? '#' : esc_url($action['url']); |
|
129 | + $attrs = empty($action['attrs']) ? '' : $action['attrs']; |
|
130 | + $anchor = sanitize_text_field($action['name']); |
|
131 | 131 | |
132 | 132 | echo "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>"; |
133 | 133 | } |
@@ -143,20 +143,20 @@ discard block |
||
143 | 143 | <div class="wpinv-receipt-details"> |
144 | 144 | |
145 | 145 | <h4 class="wpinv-details-t mb-3 mt-3"> |
146 | - <?php echo apply_filters( 'wpinv_receipt_details_title', __( 'Invoice Details', 'invoicing' ), $invoice ); ?> |
|
146 | + <?php echo apply_filters('wpinv_receipt_details_title', __('Invoice Details', 'invoicing'), $invoice); ?> |
|
147 | 147 | </h4> |
148 | 148 | |
149 | - <?php getpaid_invoice_meta( $invoice ); ?> |
|
149 | + <?php getpaid_invoice_meta($invoice); ?> |
|
150 | 150 | |
151 | 151 | </div> |
152 | 152 | |
153 | 153 | |
154 | - <?php do_action( 'wpinv_receipt_end', $invoice ); ?> |
|
154 | + <?php do_action('wpinv_receipt_end', $invoice); ?> |
|
155 | 155 | |
156 | 156 | </div> |
157 | 157 | |
158 | 158 | <?php |
159 | 159 | |
160 | 160 | // @deprecated |
161 | -do_action( 'wpinv_success_content_after', $invoice ); |
|
162 | -do_action( 'wpinv_after_receipt', $invoice ); |
|
161 | +do_action('wpinv_success_content_after', $invoice); |
|
162 | +do_action('wpinv_after_receipt', $invoice); |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // MUST have WordPress. |
10 | -if ( !defined( 'WPINC' ) ) { |
|
10 | +if (!defined('WPINC')) { |
|
11 | 11 | exit; |
12 | 12 | } |
13 | 13 | |
@@ -24,40 +24,40 @@ discard block |
||
24 | 24 | * @param Array $assoc_args Key value arguments stored in associated array format. |
25 | 25 | * @since 1.0.13 |
26 | 26 | */ |
27 | - public function insert_invoice( $args, $assoc_args ) { |
|
27 | + public function insert_invoice($args, $assoc_args) { |
|
28 | 28 | |
29 | 29 | // Fetch invoice data from the args |
30 | - $invoice_data = wp_unslash( $assoc_args ); |
|
30 | + $invoice_data = wp_unslash($assoc_args); |
|
31 | 31 | |
32 | 32 | // Abort if no invoice data is provided |
33 | - if( empty( $invoice_data ) ) { |
|
34 | - return WP_CLI::error( __( 'Invoice data not provided', 'invoicing' ) ); |
|
33 | + if (empty($invoice_data)) { |
|
34 | + return WP_CLI::error(__('Invoice data not provided', 'invoicing')); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | //Cart details |
38 | - if( !empty( $invoice_data['cart_details'] ) ) { |
|
39 | - $invoice_data['cart_details'] = json_decode( $invoice_data['cart_details'], true ); |
|
38 | + if (!empty($invoice_data['cart_details'])) { |
|
39 | + $invoice_data['cart_details'] = json_decode($invoice_data['cart_details'], true); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | //User details |
43 | - if( !empty( $invoice_data['user_info'] ) ) { |
|
44 | - $invoice_data['user_info'] = json_decode( $invoice_data['user_info'], true ); |
|
43 | + if (!empty($invoice_data['user_info'])) { |
|
44 | + $invoice_data['user_info'] = json_decode($invoice_data['user_info'], true); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | //Payment info |
48 | - if( !empty( $invoice_data['payment_details'] ) ) { |
|
49 | - $invoice_data['payment_details'] = json_decode( $invoice_data['payment_details'], true ); |
|
48 | + if (!empty($invoice_data['payment_details'])) { |
|
49 | + $invoice_data['payment_details'] = json_decode($invoice_data['payment_details'], true); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | // Try creating the invoice |
53 | - $invoice = wpinv_insert_invoice( $invoice_data, true ); |
|
53 | + $invoice = wpinv_insert_invoice($invoice_data, true); |
|
54 | 54 | |
55 | - if ( is_wp_error( $invoice ) ) { |
|
56 | - return WP_CLI::error( $invoice->get_error_message() ); |
|
55 | + if (is_wp_error($invoice)) { |
|
56 | + return WP_CLI::error($invoice->get_error_message()); |
|
57 | 57 | } |
58 | 58 | |
59 | - $message = sprintf( __( 'Invoice %s created', 'invoicing' ), $invoice->get_id() ); |
|
60 | - WP_CLI::success( $message ); |
|
59 | + $message = sprintf(__('Invoice %s created', 'invoicing'), $invoice->get_id()); |
|
60 | + WP_CLI::success($message); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 |
@@ -8,23 +8,23 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | ?> |
14 | 14 | |
15 | 15 | <div class='form-group'> |
16 | - <label :for="active_form_element.id + '_edit_heading'"><?php esc_html_e( 'Heading', 'invoicing' ) ?></label> |
|
16 | + <label :for="active_form_element.id + '_edit_heading'"><?php esc_html_e('Heading', 'invoicing') ?></label> |
|
17 | 17 | <input :id="active_form_element.id + '_edit_heading'" v-model='active_form_element.text' class='form-control' type='text' /> |
18 | 18 | </div> |
19 | 19 | |
20 | 20 | <div class='form-group'> |
21 | - <label :for="active_form_element.id + '_edit_level'"><?php esc_html_e( 'Select Heading Level', 'invoicing' ) ?></label> |
|
21 | + <label :for="active_form_element.id + '_edit_level'"><?php esc_html_e('Select Heading Level', 'invoicing') ?></label> |
|
22 | 22 | <select class='form-control custom-select' :id="active_form_element.id + '_edit_level'" v-model='active_form_element.level'> |
23 | - <option value='h1'><?php esc_html_e( 'H1', 'invoicing' ); ?></option> |
|
24 | - <option value='h2'><?php esc_html_e( 'H2', 'invoicing' ); ?></option> |
|
25 | - <option value='h3'><?php esc_html_e( 'H3', 'invoicing' ); ?></option> |
|
26 | - <option value='h4'><?php esc_html_e( 'H4', 'invoicing' ); ?></option> |
|
27 | - <option value='h5'><?php esc_html_e( 'H5', 'invoicing' ); ?></option> |
|
28 | - <option value='h6'><?php esc_html_e( 'H6', 'invoicing' ); ?></option> |
|
23 | + <option value='h1'><?php esc_html_e('H1', 'invoicing'); ?></option> |
|
24 | + <option value='h2'><?php esc_html_e('H2', 'invoicing'); ?></option> |
|
25 | + <option value='h3'><?php esc_html_e('H3', 'invoicing'); ?></option> |
|
26 | + <option value='h4'><?php esc_html_e('H4', 'invoicing'); ?></option> |
|
27 | + <option value='h5'><?php esc_html_e('H5', 'invoicing'); ?></option> |
|
28 | + <option value='h6'><?php esc_html_e('H6', 'invoicing'); ?></option> |
|
29 | 29 | </select> |
30 | 30 | </div> |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @version 1.0.19 |
6 | 6 | */ |
7 | 7 | |
8 | -defined( 'ABSPATH' ) || exit; |
|
8 | +defined('ABSPATH') || exit; |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * REST API invoices controller class. |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | |
54 | 54 | 'customers' => array( |
55 | - 'description' => __( 'Limit result set to invoices for specific user ids.', 'invoicing' ), |
|
55 | + 'description' => __('Limit result set to invoices for specific user ids.', 'invoicing'), |
|
56 | 56 | 'type' => 'array', |
57 | 57 | 'items' => array( |
58 | 58 | 'type' => 'integer', |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | ), |
63 | 63 | |
64 | 64 | 'exclude_customers' => array( |
65 | - 'description' => __( 'Exclude invoices to specific users.', 'invoicing' ), |
|
65 | + 'description' => __('Exclude invoices to specific users.', 'invoicing'), |
|
66 | 66 | 'type' => 'array', |
67 | 67 | 'items' => array( |
68 | 68 | 'type' => 'integer', |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | ), |
73 | 73 | |
74 | 74 | 'parent' => array( |
75 | - 'description' => __( 'Limit result set to those of particular parent IDs.', 'invoicing' ), |
|
75 | + 'description' => __('Limit result set to those of particular parent IDs.', 'invoicing'), |
|
76 | 76 | 'type' => 'array', |
77 | 77 | 'items' => array( |
78 | 78 | 'type' => 'integer', |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | ), |
83 | 83 | |
84 | 84 | 'parent_exclude' => array( |
85 | - 'description' => __( 'Limit result set to all items except those of a particular parent ID.', 'invoicing' ), |
|
85 | + 'description' => __('Limit result set to all items except those of a particular parent ID.', 'invoicing'), |
|
86 | 86 | 'type' => 'array', |
87 | 87 | 'items' => array( |
88 | 88 | 'type' => 'integer', |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ); |
97 | 97 | |
98 | 98 | // Filter collection parameters for the invoices controller. |
99 | - return apply_filters( 'getpaid_rest_invoices_collection_params', $params, $this ); |
|
99 | + return apply_filters('getpaid_rest_invoices_collection_params', $params, $this); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -107,21 +107,21 @@ discard block |
||
107 | 107 | * @param WP_REST_Request $request Request object. |
108 | 108 | * @return array $query_args |
109 | 109 | */ |
110 | - protected function prepare_items_query( $prepared_args = array(), $request = null ) { |
|
110 | + protected function prepare_items_query($prepared_args = array(), $request = null) { |
|
111 | 111 | |
112 | - $query_args = parent::prepare_items_query( $prepared_args ); |
|
112 | + $query_args = parent::prepare_items_query($prepared_args); |
|
113 | 113 | |
114 | 114 | // Retrieve invoices for specific customers. |
115 | - if ( ! empty( $request['customers'] ) ) { |
|
115 | + if (!empty($request['customers'])) { |
|
116 | 116 | $query_args['author__in'] = $request['customers']; |
117 | 117 | } |
118 | 118 | |
119 | 119 | // Skip invoices for specific customers. |
120 | - if ( ! empty( $request['exclude_customers'] ) ) { |
|
120 | + if (!empty($request['exclude_customers'])) { |
|
121 | 121 | $query_args['author__not_in'] = $request['exclude_customers']; |
122 | 122 | } |
123 | 123 | |
124 | - return apply_filters( 'getpaid_rest_invoices_prepare_items_query', $query_args, $request, $this ); |
|
124 | + return apply_filters('getpaid_rest_invoices_prepare_items_query', $query_args, $request, $this); |
|
125 | 125 | |
126 | 126 | } |
127 | 127 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @return array A list of registered item statuses. |
134 | 134 | */ |
135 | 135 | public function get_post_statuses() { |
136 | - return array_keys( wpinv_get_invoice_statuses( true, false, $this->post_type ) ); |
|
136 | + return array_keys(wpinv_get_invoice_statuses(true, false, $this->post_type)); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | * @param WPInv_Invoice $invoice Invoice to save. |
143 | 143 | * @return WP_Error|WPInv_Invoice |
144 | 144 | */ |
145 | - protected function save_object( $invoice ) { |
|
145 | + protected function save_object($invoice) { |
|
146 | 146 | $invoice->recalculate_total(); |
147 | - return parent::save_object( $invoice ); |
|
147 | + return parent::save_object($invoice); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | } |
@@ -7,44 +7,44 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class='form-group'> |
15 | 15 | <label class="d-block"> |
16 | - <span><?php esc_html_e( 'Button Text', 'invoicing' ); ?></span> |
|
16 | + <span><?php esc_html_e('Button Text', 'invoicing'); ?></span> |
|
17 | 17 | <input v-model='active_form_element.label' class='form-control' type="text"/> |
18 | - <small class="form-text text-muted"><?php _e( '%price% will be replaced by the total payable amount', 'invoicing' ); ?></small> |
|
18 | + <small class="form-text text-muted"><?php _e('%price% will be replaced by the total payable amount', 'invoicing'); ?></small> |
|
19 | 19 | </label> |
20 | 20 | </div> |
21 | 21 | |
22 | 22 | <div class='form-group'> |
23 | 23 | <label class="d-block"> |
24 | - <span><?php esc_html_e( 'Free Checkout Text', 'invoicing' ); ?></span> |
|
24 | + <span><?php esc_html_e('Free Checkout Text', 'invoicing'); ?></span> |
|
25 | 25 | <input v-model='active_form_element.free' class='form-control' type="text"/> |
26 | - <small class="form-text text-muted"><?php _e( 'The text to display if the total payable amount is zero', 'invoicing' ); ?></small> |
|
26 | + <small class="form-text text-muted"><?php _e('The text to display if the total payable amount is zero', 'invoicing'); ?></small> |
|
27 | 27 | </label> |
28 | 28 | </div> |
29 | 29 | |
30 | 30 | <div class='form-group'> |
31 | 31 | <label class="d-block"> |
32 | - <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span> |
|
33 | - <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea> |
|
32 | + <span><?php esc_html_e('Help Text', 'invoicing'); ?></span> |
|
33 | + <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea> |
|
34 | 34 | </label> |
35 | 35 | </div> |
36 | 36 | |
37 | 37 | <div class='form-group'> |
38 | - <label :for="active_form_element.id + '_edit_type'"><?php esc_html_e( 'Button Type', 'invoicing' ) ?></label> |
|
38 | + <label :for="active_form_element.id + '_edit_type'"><?php esc_html_e('Button Type', 'invoicing') ?></label> |
|
39 | 39 | <select class='form-control custom-select' :id="active_form_element.id + '_edit_type'" v-model='active_form_element.class'> |
40 | - <option value='btn-primary'><?php esc_html_e( 'Primary', 'invoicing' ); ?></option> |
|
41 | - <option value='btn-secondary'><?php esc_html_e( 'Secondary', 'invoicing' ); ?></option> |
|
42 | - <option value='btn-success'><?php esc_html_e( 'Success', 'invoicing' ); ?></option> |
|
43 | - <option value='btn-danger'><?php esc_html_e( 'Danger', 'invoicing' ); ?></option> |
|
44 | - <option value='btn-warning'><?php esc_html_e( 'Warning', 'invoicing' ); ?></option> |
|
45 | - <option value='btn-info'><?php esc_html_e( 'Info', 'invoicing' ); ?></option> |
|
46 | - <option value='btn-light'><?php esc_html_e( 'Light', 'invoicing' ); ?></option> |
|
47 | - <option value='btn-dark'><?php esc_html_e( 'Dark', 'invoicing' ); ?></option> |
|
48 | - <option value='btn-link'><?php esc_html_e( 'Link', 'invoicing' ); ?></option> |
|
40 | + <option value='btn-primary'><?php esc_html_e('Primary', 'invoicing'); ?></option> |
|
41 | + <option value='btn-secondary'><?php esc_html_e('Secondary', 'invoicing'); ?></option> |
|
42 | + <option value='btn-success'><?php esc_html_e('Success', 'invoicing'); ?></option> |
|
43 | + <option value='btn-danger'><?php esc_html_e('Danger', 'invoicing'); ?></option> |
|
44 | + <option value='btn-warning'><?php esc_html_e('Warning', 'invoicing'); ?></option> |
|
45 | + <option value='btn-info'><?php esc_html_e('Info', 'invoicing'); ?></option> |
|
46 | + <option value='btn-light'><?php esc_html_e('Light', 'invoicing'); ?></option> |
|
47 | + <option value='btn-dark'><?php esc_html_e('Dark', 'invoicing'); ?></option> |
|
48 | + <option value='btn-link'><?php esc_html_e('Link', 'invoicing'); ?></option> |
|
49 | 49 | </select> |
50 | 50 | </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 | /** |
10 | 10 | * Daily maintenance class. |
@@ -15,19 +15,19 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * Class constructor. |
17 | 17 | */ |
18 | - public function __construct(){ |
|
18 | + public function __construct() { |
|
19 | 19 | |
20 | 20 | // Clear deprecated events. |
21 | - add_action( 'wp', array( $this, 'maybe_clear_deprecated_events' ) ); |
|
21 | + add_action('wp', array($this, 'maybe_clear_deprecated_events')); |
|
22 | 22 | |
23 | 23 | // (Maybe) schedule a cron that runs daily. |
24 | - add_action( 'wp', array( $this, 'maybe_create_scheduled_event' ) ); |
|
24 | + add_action('wp', array($this, 'maybe_create_scheduled_event')); |
|
25 | 25 | |
26 | 26 | // Fired everyday at 7 a.m (this might vary for sites with few visitors) |
27 | - add_action( 'getpaid_daily_maintenance', array( $this, 'log_cron_run' ) ); |
|
28 | - add_action( 'getpaid_daily_maintenance', array( $this, 'backwards_compat' ) ); |
|
29 | - add_action( 'getpaid_daily_maintenance', array( $this, 'maybe_expire_subscriptions' ) ); |
|
30 | - add_action( 'getpaid_daily_maintenance', array( $this, 'maybe_update_geoip_databases' ) ); |
|
27 | + add_action('getpaid_daily_maintenance', array($this, 'log_cron_run')); |
|
28 | + add_action('getpaid_daily_maintenance', array($this, 'backwards_compat')); |
|
29 | + add_action('getpaid_daily_maintenance', array($this, 'maybe_expire_subscriptions')); |
|
30 | + add_action('getpaid_daily_maintenance', array($this, 'maybe_update_geoip_databases')); |
|
31 | 31 | |
32 | 32 | } |
33 | 33 | |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function maybe_create_scheduled_event() { |
39 | 39 | |
40 | - if ( ! wp_next_scheduled( 'getpaid_daily_maintenance' ) ) { |
|
41 | - $timestamp = strtotime( 'tomorrow 07:00:00', current_time( 'timestamp' ) ); |
|
42 | - wp_schedule_event( $timestamp, 'daily', 'getpaid_daily_maintenance' ); |
|
40 | + if (!wp_next_scheduled('getpaid_daily_maintenance')) { |
|
41 | + $timestamp = strtotime('tomorrow 07:00:00', current_time('timestamp')); |
|
42 | + wp_schedule_event($timestamp, 'daily', 'getpaid_daily_maintenance'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | } |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function maybe_clear_deprecated_events() { |
52 | 52 | |
53 | - if ( ! get_option( 'wpinv_cleared_old_events' ) ) { |
|
54 | - wp_clear_scheduled_hook( 'wpinv_register_schedule_event_twicedaily' ); |
|
55 | - wp_clear_scheduled_hook( 'wpinv_register_schedule_event_daily' ); |
|
56 | - update_option( 'wpinv_cleared_old_events', 1 ); |
|
53 | + if (!get_option('wpinv_cleared_old_events')) { |
|
54 | + wp_clear_scheduled_hook('wpinv_register_schedule_event_twicedaily'); |
|
55 | + wp_clear_scheduled_hook('wpinv_register_schedule_event_daily'); |
|
56 | + update_option('wpinv_cleared_old_events', 1); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * |
64 | 64 | */ |
65 | 65 | public function backwards_compat() { |
66 | - do_action( 'wpinv_register_schedule_event_daily' ); |
|
66 | + do_action('wpinv_register_schedule_event_daily'); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | public function maybe_expire_subscriptions() { |
74 | 74 | |
75 | 75 | // Fetch expired subscriptions (skips those that expire today). |
76 | - $args = array( |
|
76 | + $args = array( |
|
77 | 77 | 'number' => -1, |
78 | 78 | 'count_total' => false, |
79 | 79 | 'status' => 'trialling active failing cancelled', |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | ), |
84 | 84 | ); |
85 | 85 | |
86 | - $subscriptions = new GetPaid_Subscriptions_Query( $args ); |
|
86 | + $subscriptions = new GetPaid_Subscriptions_Query($args); |
|
87 | 87 | |
88 | - foreach ( $subscriptions->get_results() as $subscription ) { |
|
89 | - if ( apply_filters( 'getpaid_daily_maintenance_should_expire_subscription', true, $subscription ) ) { |
|
90 | - $subscription->set_status( 'expired' ); |
|
88 | + foreach ($subscriptions->get_results() as $subscription) { |
|
89 | + if (apply_filters('getpaid_daily_maintenance_should_expire_subscription', true, $subscription)) { |
|
90 | + $subscription->set_status('expired'); |
|
91 | 91 | $subscription->save(); |
92 | 92 | } |
93 | 93 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * |
100 | 100 | */ |
101 | 101 | public function log_cron_run() { |
102 | - wpinv_error_log( 'GetPaid Daily Cron' ); |
|
102 | + wpinv_error_log('GetPaid Daily Cron'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | * |
108 | 108 | */ |
109 | 109 | public function maybe_update_geoip_databases() { |
110 | - $updated = get_transient( 'getpaid_updated_geoip_databases' ); |
|
110 | + $updated = get_transient('getpaid_updated_geoip_databases'); |
|
111 | 111 | |
112 | - if ( false === $updated ) { |
|
113 | - set_transient( 'getpaid_updated_geoip_databases', 1, 15 * DAY_IN_SECONDS ); |
|
114 | - do_action( 'getpaid_update_geoip_databases' ); |
|
112 | + if (false === $updated) { |
|
113 | + set_transient('getpaid_updated_geoip_databases', 1, 15 * DAY_IN_SECONDS); |
|
114 | + do_action('getpaid_update_geoip_databases'); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | } |