@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Personal data exporters. |
4 | 4 | */ |
5 | 5 | |
6 | -defined( 'ABSPATH' ) || exit; |
|
6 | +defined('ABSPATH') || exit; |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * WPInv_Privacy_Exporters Class. |
@@ -17,39 +17,39 @@ discard block |
||
17 | 17 | * @param int $page Page. |
18 | 18 | * @return array An array of invoice data in name value pairs |
19 | 19 | */ |
20 | - public static function customer_invoice_data_exporter( $email_address, $page ) { |
|
20 | + public static function customer_invoice_data_exporter($email_address, $page) { |
|
21 | 21 | $done = false; |
22 | 22 | $page = (int) $page; |
23 | 23 | $data_to_export = array(); |
24 | 24 | |
25 | - $user = get_user_by( 'email', $email_address ); |
|
26 | - if ( ! $user instanceof WP_User ) { |
|
25 | + $user = get_user_by('email', $email_address); |
|
26 | + if (!$user instanceof WP_User) { |
|
27 | 27 | return array( |
28 | 28 | 'data' => $data_to_export, |
29 | 29 | 'done' => true, |
30 | 30 | ); |
31 | 31 | } |
32 | 32 | |
33 | - $args = array( |
|
34 | - 'limit' => get_option( 'posts_per_page' ), |
|
33 | + $args = array( |
|
34 | + 'limit' => get_option('posts_per_page'), |
|
35 | 35 | 'page' => $page, |
36 | 36 | 'user' => $user->ID, |
37 | 37 | 'paginate' => false, |
38 | 38 | ); |
39 | 39 | |
40 | - $invoices = wpinv_get_invoices( $args ); |
|
40 | + $invoices = wpinv_get_invoices($args); |
|
41 | 41 | |
42 | - if ( 0 < count( $invoices ) ) { |
|
43 | - foreach ( $invoices as $invoice ) { |
|
42 | + if (0 < count($invoices)) { |
|
43 | + foreach ($invoices as $invoice) { |
|
44 | 44 | $data_to_export[] = array( |
45 | 45 | 'group_id' => 'customer_invoices', |
46 | - 'group_label' => __( 'GetPaid: Invoices', 'invoicing' ), |
|
47 | - 'group_description' => __( 'Customer invoices.', 'invoicing' ), |
|
46 | + 'group_label' => __('GetPaid: Invoices', 'invoicing'), |
|
47 | + 'group_description' => __('Customer invoices.', 'invoicing'), |
|
48 | 48 | 'item_id' => "wpinv-{$invoice->get_id()}", |
49 | - 'data' => self::get_customer_invoice_data( $invoice ), |
|
49 | + 'data' => self::get_customer_invoice_data($invoice), |
|
50 | 50 | ); |
51 | 51 | } |
52 | - $done = get_option( 'posts_per_page' ) > count( $invoices ); |
|
52 | + $done = get_option('posts_per_page') > count($invoices); |
|
53 | 53 | } else { |
54 | 54 | $done = true; |
55 | 55 | } |
@@ -67,122 +67,122 @@ discard block |
||
67 | 67 | * @param WPInv_Invoice $invoice invoice object. |
68 | 68 | * @return array |
69 | 69 | */ |
70 | - public static function get_customer_invoice_data( $invoice ) { |
|
70 | + public static function get_customer_invoice_data($invoice) { |
|
71 | 71 | |
72 | 72 | // Prepare basic properties. |
73 | 73 | $props_to_export = array( |
74 | 74 | 'number' => array( |
75 | - 'name' => __( 'Invoice Number', 'invoicing' ), |
|
75 | + 'name' => __('Invoice Number', 'invoicing'), |
|
76 | 76 | 'value' => $invoice->get_number(), |
77 | 77 | ), |
78 | 78 | 'created_date' => array( |
79 | - 'name' => __( 'Created Date', 'invoicing' ), |
|
79 | + 'name' => __('Created Date', 'invoicing'), |
|
80 | 80 | 'value' => $invoice->get_date_created(), |
81 | 81 | ), |
82 | 82 | 'due_date' => array( |
83 | - 'name' => __( 'Due Date', 'invoicing' ), |
|
83 | + 'name' => __('Due Date', 'invoicing'), |
|
84 | 84 | 'value' => $invoice->get_due_date(), |
85 | 85 | ), |
86 | 86 | 'items' => array( |
87 | - 'name' => __( 'Invoice Items', 'invoicing' ), |
|
88 | - 'value' => self::process_invoice_items( $invoice ), |
|
87 | + 'name' => __('Invoice Items', 'invoicing'), |
|
88 | + 'value' => self::process_invoice_items($invoice), |
|
89 | 89 | ), |
90 | 90 | 'discount' => array( |
91 | - 'name' => __( 'Invoice Discount', 'invoicing' ), |
|
92 | - 'value' => wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() ), |
|
91 | + 'name' => __('Invoice Discount', 'invoicing'), |
|
92 | + 'value' => wpinv_price($invoice->get_total_discount(), $invoice->get_currency()), |
|
93 | 93 | ), |
94 | 94 | 'total' => array( |
95 | - 'name' => __( 'Invoice Total', 'invoicing' ), |
|
96 | - 'value' => wpinv_price( $invoice->get_total(), $invoice->get_currency() ), |
|
95 | + 'name' => __('Invoice Total', 'invoicing'), |
|
96 | + 'value' => wpinv_price($invoice->get_total(), $invoice->get_currency()), |
|
97 | 97 | ), |
98 | 98 | 'status' => array( |
99 | - 'name' => __( 'Invoice Status', 'invoicing' ), |
|
99 | + 'name' => __('Invoice Status', 'invoicing'), |
|
100 | 100 | 'value' => $invoice->get_status_nicename(), |
101 | 101 | ), |
102 | 102 | 'first_name' => array( |
103 | - 'name' => __( 'First Name', 'invoicing' ), |
|
103 | + 'name' => __('First Name', 'invoicing'), |
|
104 | 104 | 'value' => $invoice->get_first_name(), |
105 | 105 | ), |
106 | 106 | 'last_name' => array( |
107 | - 'name' => __( 'Last Name', 'invoicing' ), |
|
107 | + 'name' => __('Last Name', 'invoicing'), |
|
108 | 108 | 'value' => $invoice->get_last_name(), |
109 | 109 | ), |
110 | 110 | 'email' => array( |
111 | - 'name' => __( 'Email Address', 'invoicing' ), |
|
111 | + 'name' => __('Email Address', 'invoicing'), |
|
112 | 112 | 'value' => $invoice->get_email(), |
113 | 113 | ), |
114 | 114 | 'company' => array( |
115 | - 'name' => __( 'Company', 'invoicing' ), |
|
115 | + 'name' => __('Company', 'invoicing'), |
|
116 | 116 | 'value' => $invoice->get_company(), |
117 | 117 | ), |
118 | 118 | 'phone' => array( |
119 | - 'name' => __( 'Phone Number', 'invoicing' ), |
|
119 | + 'name' => __('Phone Number', 'invoicing'), |
|
120 | 120 | 'value' => $invoice->get_phone(), |
121 | 121 | ), |
122 | 122 | 'address' => array( |
123 | - 'name' => __( 'Address', 'invoicing' ), |
|
123 | + 'name' => __('Address', 'invoicing'), |
|
124 | 124 | 'value' => $invoice->get_address(), |
125 | 125 | ), |
126 | 126 | 'city' => array( |
127 | - 'name' => __( 'City', 'invoicing' ), |
|
127 | + 'name' => __('City', 'invoicing'), |
|
128 | 128 | 'value' => $invoice->get_city(), |
129 | 129 | ), |
130 | 130 | 'state' => array( |
131 | - 'name' => __( 'State', 'invoicing' ), |
|
131 | + 'name' => __('State', 'invoicing'), |
|
132 | 132 | 'value' => $invoice->get_state(), |
133 | 133 | ), |
134 | 134 | 'zip' => array( |
135 | - 'name' => __( 'Zip', 'invoicing' ), |
|
135 | + 'name' => __('Zip', 'invoicing'), |
|
136 | 136 | 'value' => $invoice->get_zip(), |
137 | 137 | ), |
138 | 138 | 'vat_number' => array( |
139 | - 'name' => __( 'VAT Number', 'invoicing' ), |
|
139 | + 'name' => __('VAT Number', 'invoicing'), |
|
140 | 140 | 'value' => $invoice->get_vat_number(), |
141 | 141 | ), |
142 | 142 | 'description' => array( |
143 | - 'name' => __( 'Description', 'invoicing' ), |
|
143 | + 'name' => __('Description', 'invoicing'), |
|
144 | 144 | 'value' => $invoice->get_description(), |
145 | 145 | ), |
146 | 146 | ); |
147 | 147 | |
148 | 148 | // In case the invoice is paid, add the payment date and gateway. |
149 | - if ( $invoice->is_paid() ) { |
|
149 | + if ($invoice->is_paid()) { |
|
150 | 150 | |
151 | 151 | $props_to_export['completed_date'] = array( |
152 | - 'name' => __( 'Completed Date', 'invoicing' ), |
|
152 | + 'name' => __('Completed Date', 'invoicing'), |
|
153 | 153 | 'value' => $invoice->get_completed_date(), |
154 | 154 | ); |
155 | 155 | |
156 | 156 | $props_to_export['gateway'] = array( |
157 | - 'name' => __( 'Paid Via', 'invoicing' ), |
|
157 | + 'name' => __('Paid Via', 'invoicing'), |
|
158 | 158 | 'value' => $invoice->get_gateway(), |
159 | 159 | ); |
160 | 160 | |
161 | 161 | } |
162 | 162 | |
163 | 163 | // Maybe add subscription details. |
164 | - $props_to_export = self::process_subscription( $invoice, $props_to_export ); |
|
164 | + $props_to_export = self::process_subscription($invoice, $props_to_export); |
|
165 | 165 | |
166 | 166 | // Add the ip address. |
167 | 167 | $props_to_export['ip'] = array( |
168 | - 'name' => __( 'IP Address', 'invoicing' ), |
|
168 | + 'name' => __('IP Address', 'invoicing'), |
|
169 | 169 | 'value' => $invoice->get_ip(), |
170 | 170 | ); |
171 | 171 | |
172 | 172 | // Add the invoice url. |
173 | 173 | $props_to_export['view_url'] = array( |
174 | - 'name' => __( 'Invoice URL', 'invoicing' ), |
|
174 | + 'name' => __('Invoice URL', 'invoicing'), |
|
175 | 175 | 'value' => $invoice->get_view_url(), |
176 | 176 | ); |
177 | 177 | |
178 | 178 | // Return the values. |
179 | - $items = apply_filters( 'getpaid_privacy_export_invoice_personal_data', array_values( $props_to_export ), $invoice ); |
|
179 | + $items = apply_filters('getpaid_privacy_export_invoice_personal_data', array_values($props_to_export), $invoice); |
|
180 | 180 | |
181 | 181 | $data = array(); |
182 | 182 | |
183 | 183 | // Unset null values to prevent PHP deprecated notice. |
184 | - foreach ( $items as $item ) { |
|
185 | - if ( isset( $item['value'] ) && ! is_null( $item['value'] ) ) { |
|
184 | + foreach ($items as $item) { |
|
185 | + if (isset($item['value']) && !is_null($item['value'])) { |
|
186 | 186 | $data[] = $item; |
187 | 187 | } |
188 | 188 | } |
@@ -198,40 +198,40 @@ discard block |
||
198 | 198 | * @param array $props invoice props. |
199 | 199 | * @return array |
200 | 200 | */ |
201 | - public static function process_subscription( $invoice, $props ) { |
|
201 | + public static function process_subscription($invoice, $props) { |
|
202 | 202 | |
203 | - $subscription = wpinv_get_subscription( $invoice ); |
|
204 | - if ( ! empty( $subscription ) ) { |
|
203 | + $subscription = wpinv_get_subscription($invoice); |
|
204 | + if (!empty($subscription)) { |
|
205 | 205 | |
206 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency() ); |
|
207 | - $period = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ) . ' / ' . $frequency; |
|
208 | - $initial_amt = wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
209 | - $bill_times = $subscription->get_times_billed() . ' / ' . ( ( $subscription->get_bill_times() == 0 ) ? __( 'Until Cancelled', 'invoicing' ) : $subscription->get_bill_times() ); |
|
210 | - $renewal_date = getpaid_format_date_value( $subscription->get_expiration() ); |
|
206 | + $frequency = getpaid_get_subscription_period_label($subscription->get_period(), $subscription->get_frequency()); |
|
207 | + $period = wpinv_price($subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency()) . ' / ' . $frequency; |
|
208 | + $initial_amt = wpinv_price($subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency()); |
|
209 | + $bill_times = $subscription->get_times_billed() . ' / ' . (($subscription->get_bill_times() == 0) ? __('Until Cancelled', 'invoicing') : $subscription->get_bill_times()); |
|
210 | + $renewal_date = getpaid_format_date_value($subscription->get_expiration()); |
|
211 | 211 | |
212 | 212 | // Billing cycle. |
213 | 213 | $props['period'] = array( |
214 | - 'name' => __( 'Billing Cycle', 'invoicing' ), |
|
214 | + 'name' => __('Billing Cycle', 'invoicing'), |
|
215 | 215 | 'value' => $period, |
216 | 216 | ); |
217 | 217 | |
218 | 218 | // Initial amount. |
219 | 219 | $props['initial_amount'] = array( |
220 | - 'name' => __( 'Initial Amount', 'invoicing' ), |
|
220 | + 'name' => __('Initial Amount', 'invoicing'), |
|
221 | 221 | 'value' => $initial_amt, |
222 | 222 | ); |
223 | 223 | |
224 | 224 | // Bill times. |
225 | 225 | $props['bill_times'] = array( |
226 | - 'name' => __( 'Times Billed', 'invoicing' ), |
|
226 | + 'name' => __('Times Billed', 'invoicing'), |
|
227 | 227 | 'value' => $bill_times, |
228 | 228 | ); |
229 | 229 | |
230 | 230 | // Add expiry date. |
231 | - if ( $subscription->is_active() ) { |
|
231 | + if ($subscription->is_active()) { |
|
232 | 232 | |
233 | 233 | $props['renewal_date'] = array( |
234 | - 'name' => __( 'Expires', 'invoicing' ), |
|
234 | + 'name' => __('Expires', 'invoicing'), |
|
235 | 235 | 'value' => $renewal_date, |
236 | 236 | ); |
237 | 237 | |
@@ -249,19 +249,19 @@ discard block |
||
249 | 249 | * @param WPInv_Invoice $invoice invoice object. |
250 | 250 | * @return array |
251 | 251 | */ |
252 | - public static function process_invoice_items( $invoice ) { |
|
252 | + public static function process_invoice_items($invoice) { |
|
253 | 253 | |
254 | 254 | $item_names = array(); |
255 | - foreach ( $invoice->get_items() as $cart_item ) { |
|
255 | + foreach ($invoice->get_items() as $cart_item) { |
|
256 | 256 | $item_names[] = sprintf( |
257 | 257 | '%s x %s - %s', |
258 | 258 | $cart_item->get_name(), |
259 | 259 | $cart_item->get_quantity(), |
260 | - wpinv_price( $invoice->is_renewal() ? $cart_item->get_recurring_sub_total() : $cart_item->get_sub_total(), $invoice->get_currency() ) |
|
260 | + wpinv_price($invoice->is_renewal() ? $cart_item->get_recurring_sub_total() : $cart_item->get_sub_total(), $invoice->get_currency()) |
|
261 | 261 | ); |
262 | 262 | } |
263 | 263 | |
264 | - return implode( ', ', $item_names ); |
|
264 | + return implode(', ', $item_names); |
|
265 | 265 | |
266 | 266 | } |
267 | 267 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | add_action( 'init', array( $this, 'register_erasers_exporters' ) ); |
30 | 30 | } |
31 | 31 | |
32 | - /** |
|
32 | + /** |
|
33 | 33 | * Initial registration of privacy erasers and exporters. |
34 | 34 | * |
35 | 35 | * Due to the use of translation functions, this should run only after plugins loaded. |
@@ -49,25 +49,25 @@ discard block |
||
49 | 49 | public function get_privacy_message() { |
50 | 50 | |
51 | 51 | $content = '<div class="wp-suggested-text">' . |
52 | - '<h2>' . __( 'Invoices and checkout', 'invoicing' ) . '</h2>' . |
|
53 | - '<p class="privacy-policy-tutorial">' . __( 'Example privacy texts.', 'invoicing' ) . '</p>' . |
|
54 | - '<p>' . __( 'We collect information about you during the checkout process on our site. This information may include, but is not limited to, your name, email address, phone number, address, IP and any other details that might be requested from you for the purpose of processing your payment and retaining your invoice details for legal reasons.', 'invoicing' ) . '</p>' . |
|
55 | - '<p>' . __( 'Handling this data also allows us to:', 'invoicing' ) . '</p>' . |
|
56 | - '<ul>' . |
|
57 | - '<li>' . __( '- Send you important account/invoice/service information.', 'invoicing' ) . '</li>' . |
|
58 | - '<li>' . __( '- Estimate taxes based on your location.', 'invoicing' ) . '</li>' . |
|
59 | - '<li>' . __( '- Respond to your queries or complaints.', 'invoicing' ) . '</li>' . |
|
60 | - '<li>' . __( '- Process payments and to prevent fraudulent transactions. We do this on the basis of our legitimate business interests.', 'invoicing' ) . '</li>' . |
|
61 | - '<li>' . __( '- Retain historical payment and invoice history. We do this on the basis of legal obligations.', 'invoicing' ) . '</li>' . |
|
62 | - '<li>' . __( '- Set up and administer your account, provide technical and/or customer support, and to verify your identity. We do this on the basis of our legitimate business interests.', 'invoicing' ) . '</li>' . |
|
63 | - '</ul>' . |
|
64 | - '<p>' . __( 'In addition to collecting information at checkout we may also use and store your contact details when manually creating invoices for require payments relating to prior contractual agreements or agreed terms.', 'invoicing' ) . '</p>' . |
|
65 | - '<h2>' . __( 'What we share with others', 'invoicing' ) . '</h2>' . |
|
66 | - '<p>' . __( 'We share information with third parties who help us provide our payment and invoicing services to you; for example --', 'invoicing' ) . '</p>' . |
|
67 | - '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list which third party payment processors you’re using to take payments since these may handle customer data. We’ve included PayPal as an example, but you should remove this if you’re not using PayPal.', 'invoicing' ) . '</p>' . |
|
68 | - '<p>' . __( 'We accept payments through PayPal. When processing payments, some of your data will be passed to PayPal, including information required to process or support the payment, such as the purchase total and billing information.', 'invoicing' ) . '</p>' . |
|
69 | - '<p>' . __( 'Please see the <a href="https://www.paypal.com/us/webapps/mpp/ua/privacy-full">PayPal Privacy Policy</a> for more details.', 'invoicing' ) . '</p>' . |
|
70 | - '</div>'; |
|
52 | + '<h2>' . __( 'Invoices and checkout', 'invoicing' ) . '</h2>' . |
|
53 | + '<p class="privacy-policy-tutorial">' . __( 'Example privacy texts.', 'invoicing' ) . '</p>' . |
|
54 | + '<p>' . __( 'We collect information about you during the checkout process on our site. This information may include, but is not limited to, your name, email address, phone number, address, IP and any other details that might be requested from you for the purpose of processing your payment and retaining your invoice details for legal reasons.', 'invoicing' ) . '</p>' . |
|
55 | + '<p>' . __( 'Handling this data also allows us to:', 'invoicing' ) . '</p>' . |
|
56 | + '<ul>' . |
|
57 | + '<li>' . __( '- Send you important account/invoice/service information.', 'invoicing' ) . '</li>' . |
|
58 | + '<li>' . __( '- Estimate taxes based on your location.', 'invoicing' ) . '</li>' . |
|
59 | + '<li>' . __( '- Respond to your queries or complaints.', 'invoicing' ) . '</li>' . |
|
60 | + '<li>' . __( '- Process payments and to prevent fraudulent transactions. We do this on the basis of our legitimate business interests.', 'invoicing' ) . '</li>' . |
|
61 | + '<li>' . __( '- Retain historical payment and invoice history. We do this on the basis of legal obligations.', 'invoicing' ) . '</li>' . |
|
62 | + '<li>' . __( '- Set up and administer your account, provide technical and/or customer support, and to verify your identity. We do this on the basis of our legitimate business interests.', 'invoicing' ) . '</li>' . |
|
63 | + '</ul>' . |
|
64 | + '<p>' . __( 'In addition to collecting information at checkout we may also use and store your contact details when manually creating invoices for require payments relating to prior contractual agreements or agreed terms.', 'invoicing' ) . '</p>' . |
|
65 | + '<h2>' . __( 'What we share with others', 'invoicing' ) . '</h2>' . |
|
66 | + '<p>' . __( 'We share information with third parties who help us provide our payment and invoicing services to you; for example --', 'invoicing' ) . '</p>' . |
|
67 | + '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list which third party payment processors you’re using to take payments since these may handle customer data. We’ve included PayPal as an example, but you should remove this if you’re not using PayPal.', 'invoicing' ) . '</p>' . |
|
68 | + '<p>' . __( 'We accept payments through PayPal. When processing payments, some of your data will be passed to PayPal, including information required to process or support the payment, such as the purchase total and billing information.', 'invoicing' ) . '</p>' . |
|
69 | + '<p>' . __( 'Please see the <a href="https://www.paypal.com/us/webapps/mpp/ua/privacy-full">PayPal Privacy Policy</a> for more details.', 'invoicing' ) . '</p>' . |
|
70 | + '</div>'; |
|
71 | 71 | |
72 | 72 | return apply_filters( 'wpinv_privacy_policy_content', $content ); |
73 | 73 | } |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Privacy/GDPR related functionality which ties into WordPress functionality. |
4 | 4 | */ |
5 | 5 | |
6 | -defined( 'ABSPATH' ) || exit; |
|
6 | +defined('ABSPATH') || exit; |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * WPInv_Privacy Class. |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->init(); |
27 | 27 | |
28 | 28 | // Initialize data exporters and erasers. |
29 | - add_action( 'init', array( $this, 'register_erasers_exporters' ) ); |
|
29 | + add_action('init', array($this, 'register_erasers_exporters')); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | * Due to the use of translation functions, this should run only after plugins loaded. |
36 | 36 | */ |
37 | 37 | public function register_erasers_exporters() { |
38 | - $this->name = __( 'GetPaid', 'invoicing' ); |
|
38 | + $this->name = __('GetPaid', 'invoicing'); |
|
39 | 39 | |
40 | 40 | // This hook registers Invoicing data exporters. |
41 | - $this->add_exporter( 'wpinv-customer-invoices', __( 'Customer Invoices', 'invoicing' ), array( 'WPInv_Privacy_Exporters', 'customer_invoice_data_exporter' ) ); |
|
41 | + $this->add_exporter('wpinv-customer-invoices', __('Customer Invoices', 'invoicing'), array('WPInv_Privacy_Exporters', 'customer_invoice_data_exporter')); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -49,27 +49,27 @@ discard block |
||
49 | 49 | public function get_privacy_message() { |
50 | 50 | |
51 | 51 | $content = '<div class="wp-suggested-text">' . |
52 | - '<h2>' . __( 'Invoices and checkout', 'invoicing' ) . '</h2>' . |
|
53 | - '<p class="privacy-policy-tutorial">' . __( 'Example privacy texts.', 'invoicing' ) . '</p>' . |
|
54 | - '<p>' . __( 'We collect information about you during the checkout process on our site. This information may include, but is not limited to, your name, email address, phone number, address, IP and any other details that might be requested from you for the purpose of processing your payment and retaining your invoice details for legal reasons.', 'invoicing' ) . '</p>' . |
|
55 | - '<p>' . __( 'Handling this data also allows us to:', 'invoicing' ) . '</p>' . |
|
52 | + '<h2>' . __('Invoices and checkout', 'invoicing') . '</h2>' . |
|
53 | + '<p class="privacy-policy-tutorial">' . __('Example privacy texts.', 'invoicing') . '</p>' . |
|
54 | + '<p>' . __('We collect information about you during the checkout process on our site. This information may include, but is not limited to, your name, email address, phone number, address, IP and any other details that might be requested from you for the purpose of processing your payment and retaining your invoice details for legal reasons.', 'invoicing') . '</p>' . |
|
55 | + '<p>' . __('Handling this data also allows us to:', 'invoicing') . '</p>' . |
|
56 | 56 | '<ul>' . |
57 | - '<li>' . __( '- Send you important account/invoice/service information.', 'invoicing' ) . '</li>' . |
|
58 | - '<li>' . __( '- Estimate taxes based on your location.', 'invoicing' ) . '</li>' . |
|
59 | - '<li>' . __( '- Respond to your queries or complaints.', 'invoicing' ) . '</li>' . |
|
60 | - '<li>' . __( '- Process payments and to prevent fraudulent transactions. We do this on the basis of our legitimate business interests.', 'invoicing' ) . '</li>' . |
|
61 | - '<li>' . __( '- Retain historical payment and invoice history. We do this on the basis of legal obligations.', 'invoicing' ) . '</li>' . |
|
62 | - '<li>' . __( '- Set up and administer your account, provide technical and/or customer support, and to verify your identity. We do this on the basis of our legitimate business interests.', 'invoicing' ) . '</li>' . |
|
57 | + '<li>' . __('- Send you important account/invoice/service information.', 'invoicing') . '</li>' . |
|
58 | + '<li>' . __('- Estimate taxes based on your location.', 'invoicing') . '</li>' . |
|
59 | + '<li>' . __('- Respond to your queries or complaints.', 'invoicing') . '</li>' . |
|
60 | + '<li>' . __('- Process payments and to prevent fraudulent transactions. We do this on the basis of our legitimate business interests.', 'invoicing') . '</li>' . |
|
61 | + '<li>' . __('- Retain historical payment and invoice history. We do this on the basis of legal obligations.', 'invoicing') . '</li>' . |
|
62 | + '<li>' . __('- Set up and administer your account, provide technical and/or customer support, and to verify your identity. We do this on the basis of our legitimate business interests.', 'invoicing') . '</li>' . |
|
63 | 63 | '</ul>' . |
64 | - '<p>' . __( 'In addition to collecting information at checkout we may also use and store your contact details when manually creating invoices for require payments relating to prior contractual agreements or agreed terms.', 'invoicing' ) . '</p>' . |
|
65 | - '<h2>' . __( 'What we share with others', 'invoicing' ) . '</h2>' . |
|
66 | - '<p>' . __( 'We share information with third parties who help us provide our payment and invoicing services to you; for example --', 'invoicing' ) . '</p>' . |
|
67 | - '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list which third party payment processors you’re using to take payments since these may handle customer data. We’ve included PayPal as an example, but you should remove this if you’re not using PayPal.', 'invoicing' ) . '</p>' . |
|
68 | - '<p>' . __( 'We accept payments through PayPal. When processing payments, some of your data will be passed to PayPal, including information required to process or support the payment, such as the purchase total and billing information.', 'invoicing' ) . '</p>' . |
|
69 | - '<p>' . __( 'Please see the <a href="https://www.paypal.com/us/webapps/mpp/ua/privacy-full">PayPal Privacy Policy</a> for more details.', 'invoicing' ) . '</p>' . |
|
64 | + '<p>' . __('In addition to collecting information at checkout we may also use and store your contact details when manually creating invoices for require payments relating to prior contractual agreements or agreed terms.', 'invoicing') . '</p>' . |
|
65 | + '<h2>' . __('What we share with others', 'invoicing') . '</h2>' . |
|
66 | + '<p>' . __('We share information with third parties who help us provide our payment and invoicing services to you; for example --', 'invoicing') . '</p>' . |
|
67 | + '<p class="privacy-policy-tutorial">' . __('In this subsection you should list which third party payment processors you’re using to take payments since these may handle customer data. We’ve included PayPal as an example, but you should remove this if you’re not using PayPal.', 'invoicing') . '</p>' . |
|
68 | + '<p>' . __('We accept payments through PayPal. When processing payments, some of your data will be passed to PayPal, including information required to process or support the payment, such as the purchase total and billing information.', 'invoicing') . '</p>' . |
|
69 | + '<p>' . __('Please see the <a href="https://www.paypal.com/us/webapps/mpp/ua/privacy-full">PayPal Privacy Policy</a> for more details.', 'invoicing') . '</p>' . |
|
70 | 70 | '</div>'; |
71 | 71 | |
72 | - return apply_filters( 'wpinv_privacy_policy_content', $content ); |
|
72 | + return apply_filters('wpinv_privacy_policy_content', $content); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | } |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Abstract privacy class. |
4 | 4 | */ |
5 | 5 | |
6 | -defined( 'ABSPATH' ) || exit; |
|
6 | +defined('ABSPATH') || exit; |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * Abstract class that is intended to be extended by |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @param string $name Plugin identifier. |
40 | 40 | */ |
41 | - public function __construct( $name = '' ) { |
|
41 | + public function __construct($name = '') { |
|
42 | 42 | $this->name = $name; |
43 | 43 | $this->init(); |
44 | 44 | } |
@@ -47,26 +47,26 @@ discard block |
||
47 | 47 | * Hook in events. |
48 | 48 | */ |
49 | 49 | protected function init() { |
50 | - add_action( 'admin_init', array( $this, 'add_privacy_message' ) ); |
|
50 | + add_action('admin_init', array($this, 'add_privacy_message')); |
|
51 | 51 | // Register data exporters |
52 | - add_filter( 'wp_privacy_personal_data_exporters', array( $this, 'register_exporters' ), 10 ); |
|
52 | + add_filter('wp_privacy_personal_data_exporters', array($this, 'register_exporters'), 10); |
|
53 | 53 | // Register data erasers |
54 | - add_filter( 'wp_privacy_personal_data_erasers', array( $this, 'register_erasers' ) ); |
|
54 | + add_filter('wp_privacy_personal_data_erasers', array($this, 'register_erasers')); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | 58 | * Adds the privacy message on invoicing privacy page. |
59 | 59 | */ |
60 | 60 | public function add_privacy_message() { |
61 | - if ( function_exists( 'wp_add_privacy_policy_content' ) ) { |
|
61 | + if (function_exists('wp_add_privacy_policy_content')) { |
|
62 | 62 | $content = $this->get_privacy_message(); |
63 | 63 | |
64 | - if ( $content ) { |
|
65 | - if ( empty( $this->name ) ) { |
|
66 | - $this->name = __( 'GetPaid', 'invoicing' ); |
|
64 | + if ($content) { |
|
65 | + if (empty($this->name)) { |
|
66 | + $this->name = __('GetPaid', 'invoicing'); |
|
67 | 67 | } |
68 | 68 | |
69 | - wp_add_privacy_policy_content( $this->name, $this->get_privacy_message() ); |
|
69 | + wp_add_privacy_policy_content($this->name, $this->get_privacy_message()); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | } |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | * @param array $exporters List of exporter callbacks. |
88 | 88 | * @return array |
89 | 89 | */ |
90 | - public function register_exporters( $exporters = array() ) { |
|
91 | - foreach ( $this->exporters as $id => $exporter ) { |
|
92 | - $exporters[ $id ] = $exporter; |
|
90 | + public function register_exporters($exporters = array()) { |
|
91 | + foreach ($this->exporters as $id => $exporter) { |
|
92 | + $exporters[$id] = $exporter; |
|
93 | 93 | } |
94 | 94 | return $exporters; |
95 | 95 | } |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | * @param array $erasers List of eraser callbacks. |
101 | 101 | * @return array |
102 | 102 | */ |
103 | - public function register_erasers( $erasers = array() ) { |
|
104 | - foreach ( $this->erasers as $id => $eraser ) { |
|
105 | - $erasers[ $id ] = $eraser; |
|
103 | + public function register_erasers($erasers = array()) { |
|
104 | + foreach ($this->erasers as $id => $eraser) { |
|
105 | + $erasers[$id] = $eraser; |
|
106 | 106 | } |
107 | 107 | return $erasers; |
108 | 108 | } |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | * |
117 | 117 | * @return array |
118 | 118 | */ |
119 | - public function add_exporter( $id, $name, $callback ) { |
|
120 | - $this->exporters[ $id ] = array( |
|
119 | + public function add_exporter($id, $name, $callback) { |
|
120 | + $this->exporters[$id] = array( |
|
121 | 121 | 'exporter_friendly_name' => $name, |
122 | 122 | 'callback' => $callback, |
123 | 123 | ); |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @return array |
135 | 135 | */ |
136 | - public function add_eraser( $id, $name, $callback ) { |
|
137 | - $this->erasers[ $id ] = array( |
|
136 | + public function add_eraser($id, $name, $callback) { |
|
137 | + $this->erasers[$id] = array( |
|
138 | 138 | 'eraser_friendly_name' => $name, |
139 | 139 | 'callback' => $callback, |
140 | 140 | ); |