@@ -6,7 +6,7 @@ |
||
6 | 6 | * @package Invoicing/data |
7 | 7 | */ |
8 | 8 | |
9 | -defined( 'ABSPATH' ) || exit; |
|
9 | +defined('ABSPATH') || exit; |
|
10 | 10 | |
11 | 11 | return array( |
12 | 12 |
@@ -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 | // This hook registers Invoicing data exporters. |
29 | - $this->add_exporter( 'wpinv-customer-invoices', __( 'Customer Invoices', 'invoicing' ), array( 'WPInv_Privacy_Exporters', 'customer_invoice_data_exporter' ) ); |
|
29 | + $this->add_exporter('wpinv-customer-invoices', __('Customer Invoices', 'invoicing'), array('WPInv_Privacy_Exporters', 'customer_invoice_data_exporter')); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -37,27 +37,27 @@ discard block |
||
37 | 37 | public function get_privacy_message() { |
38 | 38 | |
39 | 39 | $content = '<div class="wp-suggested-text">' . |
40 | - '<h2>' . __( 'Invoices and checkout', 'invoicing' ) . '</h2>' . |
|
41 | - '<p class="privacy-policy-tutorial">' . __( 'Example privacy texts.', 'invoicing' ) . '</p>' . |
|
42 | - '<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>' . |
|
43 | - '<p>' . __( 'Handling this data also allows us to:', 'invoicing' ) . '</p>' . |
|
40 | + '<h2>' . __('Invoices and checkout', 'invoicing') . '</h2>' . |
|
41 | + '<p class="privacy-policy-tutorial">' . __('Example privacy texts.', 'invoicing') . '</p>' . |
|
42 | + '<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>' . |
|
43 | + '<p>' . __('Handling this data also allows us to:', 'invoicing') . '</p>' . |
|
44 | 44 | '<ul>' . |
45 | - '<li>' . __( '- Send you important account/invoice/service information.', 'invoicing' ) . '</li>' . |
|
46 | - '<li>' . __( '- Estimate taxes based on your location.', 'invoicing' ) . '</li>' . |
|
47 | - '<li>' . __( '- Respond to your queries or complaints.', 'invoicing' ) . '</li>' . |
|
48 | - '<li>' . __( '- Process payments and to prevent fraudulent transactions. We do this on the basis of our legitimate business interests.', 'invoicing' ) . '</li>' . |
|
49 | - '<li>' . __( '- Retain historical payment and invoice history. We do this on the basis of legal obligations.', 'invoicing' ) . '</li>' . |
|
50 | - '<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>' . |
|
45 | + '<li>' . __('- Send you important account/invoice/service information.', 'invoicing') . '</li>' . |
|
46 | + '<li>' . __('- Estimate taxes based on your location.', 'invoicing') . '</li>' . |
|
47 | + '<li>' . __('- Respond to your queries or complaints.', 'invoicing') . '</li>' . |
|
48 | + '<li>' . __('- Process payments and to prevent fraudulent transactions. We do this on the basis of our legitimate business interests.', 'invoicing') . '</li>' . |
|
49 | + '<li>' . __('- Retain historical payment and invoice history. We do this on the basis of legal obligations.', 'invoicing') . '</li>' . |
|
50 | + '<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>' . |
|
51 | 51 | '</ul>' . |
52 | - '<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>' . |
|
53 | - '<h2>' . __( 'What we share with others', 'invoicing' ) . '</h2>' . |
|
54 | - '<p>' . __( 'We share information with third parties who help us provide our payment and invoicing services to you; for example --', 'invoicing' ) . '</p>' . |
|
55 | - '<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>' . |
|
56 | - '<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>' . |
|
57 | - '<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>' . |
|
52 | + '<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>' . |
|
53 | + '<h2>' . __('What we share with others', 'invoicing') . '</h2>' . |
|
54 | + '<p>' . __('We share information with third parties who help us provide our payment and invoicing services to you; for example --', 'invoicing') . '</p>' . |
|
55 | + '<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>' . |
|
56 | + '<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>' . |
|
57 | + '<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>' . |
|
58 | 58 | '</div>'; |
59 | 59 | |
60 | - return apply_filters( 'wpinv_privacy_policy_content', $content ); |
|
60 | + return apply_filters('wpinv_privacy_policy_content', $content); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | { |
166 | 166 | $installPath = $this->getPackageBasePath($package); |
167 | 167 | $io = $this->io; |
168 | - $outputStatus = function () use ($io, $installPath) { |
|
168 | + $outputStatus = function() use ($io, $installPath) { |
|
169 | 169 | $io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>')); |
170 | 170 | }; |
171 | 171 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $pattern = $locations ? '(' . implode('|', $locations) . ')' : false; |
236 | 236 | } |
237 | 237 | |
238 | - return $pattern ? : '(\w+)'; |
|
238 | + return $pattern ?: '(\w+)'; |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | public function getLocations() |
37 | 37 | { |
38 | 38 | if ($this->matchesCakeVersion('>=', '3.0.0')) { |
39 | - $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/'; |
|
39 | + $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/'; |
|
40 | 40 | } |
41 | 41 | return $this->locations; |
42 | 42 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | protected function matchesCakeVersion($matcher, $version) |
52 | 52 | { |
53 | 53 | $repositoryManager = $this->composer->getRepositoryManager(); |
54 | - if (! $repositoryManager) { |
|
54 | + if (!$repositoryManager) { |
|
55 | 55 | return false; |
56 | 56 | } |
57 | 57 |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * @since 2.2.2 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Payment exception class. |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | * @param int $http_status_code Proper HTTP status code to respond with, e.g. 400. |
37 | 37 | * @param array $data Extra error data. |
38 | 38 | */ |
39 | - public function __construct( $code, $message, $http_status_code = 400, $data = array() ) { |
|
39 | + public function __construct($code, $message, $http_status_code = 400, $data = array()) { |
|
40 | 40 | $this->error_code = $code; |
41 | - $this->error_data = array_merge( array( 'status' => $http_status_code ), $data ); |
|
41 | + $this->error_data = array_merge(array('status' => $http_status_code), $data); |
|
42 | 42 | |
43 | - parent::__construct( $message, $http_status_code ); |
|
43 | + parent::__construct($message, $http_status_code); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * |
6 | 6 | */ |
7 | 7 | |
8 | -if ( ! defined( 'ABSPATH' ) ) { |
|
8 | +if (!defined('ABSPATH')) { |
|
9 | 9 | exit; // Exit if accessed directly |
10 | 10 | } |
11 | 11 | |
@@ -19,16 +19,16 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @param WP_Post $post |
21 | 21 | */ |
22 | - public static function output( $post ) { |
|
22 | + public static function output($post) { |
|
23 | 23 | |
24 | 24 | // Fetch the invoice. |
25 | - $invoice = new WPInv_Invoice( $post ); |
|
25 | + $invoice = new WPInv_Invoice($post); |
|
26 | 26 | |
27 | 27 | // Fetch the subscription. |
28 | - $subscription = getpaid_get_invoice_subscription( $invoice ); |
|
28 | + $subscription = getpaid_get_invoice_subscription($invoice); |
|
29 | 29 | |
30 | 30 | echo '<div class="bsui">'; |
31 | - getpaid_admin_subscription_details_metabox( /** @scrutinizer ignore-type */$subscription ); |
|
31 | + getpaid_admin_subscription_details_metabox(/** @scrutinizer ignore-type */$subscription); |
|
32 | 32 | echo '</div>'; |
33 | 33 | |
34 | 34 | } |
@@ -38,16 +38,16 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @param WP_Post $post |
40 | 40 | */ |
41 | - public static function output_invoices( $post ) { |
|
41 | + public static function output_invoices($post) { |
|
42 | 42 | |
43 | 43 | // Fetch the invoice. |
44 | - $invoice = new WPInv_Invoice( $post ); |
|
44 | + $invoice = new WPInv_Invoice($post); |
|
45 | 45 | |
46 | 46 | // Fetch the subscription. |
47 | - $subscription = getpaid_get_invoice_subscription( $invoice ); |
|
47 | + $subscription = getpaid_get_invoice_subscription($invoice); |
|
48 | 48 | |
49 | 49 | echo '<div class="bsui">'; |
50 | - getpaid_admin_subscription_invoice_details_metabox( /** @scrutinizer ignore-type */$subscription, false ); |
|
50 | + getpaid_admin_subscription_invoice_details_metabox(/** @scrutinizer ignore-type */$subscription, false); |
|
51 | 51 | echo '</div>'; |
52 | 52 | |
53 | 53 | } |
@@ -57,16 +57,16 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @param WP_Post $post |
59 | 59 | */ |
60 | - public static function output_related( $post ) { |
|
60 | + public static function output_related($post) { |
|
61 | 61 | |
62 | 62 | // Fetch the invoice. |
63 | - $invoice = new WPInv_Invoice( $post ); |
|
63 | + $invoice = new WPInv_Invoice($post); |
|
64 | 64 | |
65 | 65 | // Fetch the subscription. |
66 | - $subscription = getpaid_get_invoice_subscription( $invoice ); |
|
66 | + $subscription = getpaid_get_invoice_subscription($invoice); |
|
67 | 67 | |
68 | 68 | echo '<div class="bsui">'; |
69 | - getpaid_admin_subscription_related_subscriptions_metabox( /** @scrutinizer ignore-type */$subscription, false ); |
|
69 | + getpaid_admin_subscription_related_subscriptions_metabox(/** @scrutinizer ignore-type */$subscription, false); |
|
70 | 70 | echo '</div>'; |
71 | 71 | |
72 | 72 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Uses MaxMind for Geolocation |
@@ -34,19 +34,19 @@ discard block |
||
34 | 34 | * @since 1.0.19 |
35 | 35 | * @return mixed|null The geolocation database service. |
36 | 36 | */ |
37 | - $this->database_service = apply_filters( 'getpaid_maxmind_geolocation_database_service', null ); |
|
38 | - if ( null === $this->database_service ) { |
|
39 | - $this->database_service = new GetPaid_MaxMind_Database_Service( $this->get_database_prefix() ); |
|
37 | + $this->database_service = apply_filters('getpaid_maxmind_geolocation_database_service', null); |
|
38 | + if (null === $this->database_service) { |
|
39 | + $this->database_service = new GetPaid_MaxMind_Database_Service($this->get_database_prefix()); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | // Bind to the scheduled updater action. |
43 | - add_action( 'getpaid_update_geoip_databases', array( $this, 'update_database' ) ); |
|
43 | + add_action('getpaid_update_geoip_databases', array($this, 'update_database')); |
|
44 | 44 | |
45 | 45 | // Bind to the geolocation filter for MaxMind database lookups. |
46 | - add_filter( 'getpaid_get_geolocation', array( $this, 'get_geolocation' ), 10, 2 ); |
|
46 | + add_filter('getpaid_get_geolocation', array($this, 'get_geolocation'), 10, 2); |
|
47 | 47 | |
48 | 48 | // Handle maxmind key updates. |
49 | - add_filter( 'wpinv_settings_sanitize_maxmind_license_key', array( $this, 'handle_key_updates' ) ); |
|
49 | + add_filter('wpinv_settings_sanitize_maxmind_license_key', array($this, 'handle_key_updates')); |
|
50 | 50 | |
51 | 51 | } |
52 | 52 | |
@@ -65,29 +65,29 @@ discard block |
||
65 | 65 | * @param string $license_key The new license key. |
66 | 66 | * @return string |
67 | 67 | */ |
68 | - public function handle_key_updates( $license_key ) { |
|
68 | + public function handle_key_updates($license_key) { |
|
69 | 69 | |
70 | 70 | // Trim whitespaces and strip slashes. |
71 | - $license_key = trim( $license_key ); |
|
71 | + $license_key = trim($license_key); |
|
72 | 72 | |
73 | 73 | // Abort if the license key is empty or unchanged. |
74 | - if ( empty( $license_key ) ) { |
|
74 | + if (empty($license_key)) { |
|
75 | 75 | return $license_key; |
76 | 76 | } |
77 | 77 | |
78 | 78 | // Abort if a database exists and the license key is unchaged. |
79 | - if ( file_exists( $this->database_service->get_database_path() && $license_key == wpinv_get_option( 'maxmind_license_key' ) ) ) { |
|
79 | + if (file_exists($this->database_service->get_database_path() && $license_key == wpinv_get_option('maxmind_license_key'))) { |
|
80 | 80 | return $license_key; |
81 | 81 | } |
82 | 82 | |
83 | 83 | // Check the license key by attempting to download the Geolocation database. |
84 | - $tmp_database_path = $this->database_service->download_database( $license_key ); |
|
85 | - if ( is_wp_error( $tmp_database_path ) ) { |
|
86 | - getpaid_admin()->show_error( $tmp_database_path->get_error_message() ); |
|
84 | + $tmp_database_path = $this->database_service->download_database($license_key); |
|
85 | + if (is_wp_error($tmp_database_path)) { |
|
86 | + getpaid_admin()->show_error($tmp_database_path->get_error_message()); |
|
87 | 87 | return $license_key; |
88 | 88 | } |
89 | 89 | |
90 | - $this->update_database( /** @scrutinizer ignore-type */ $tmp_database_path ); |
|
90 | + $this->update_database(/** @scrutinizer ignore-type */ $tmp_database_path); |
|
91 | 91 | |
92 | 92 | return $license_key; |
93 | 93 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @param string $tmp_database_path Temporary database path. |
99 | 99 | */ |
100 | - public function update_database( $tmp_database_path = null ) { |
|
100 | + public function update_database($tmp_database_path = null) { |
|
101 | 101 | |
102 | 102 | // Allow us to easily interact with the filesystem. |
103 | 103 | require_once ABSPATH . 'wp-admin/includes/file.php'; |
@@ -108,32 +108,32 @@ discard block |
||
108 | 108 | $target_database_path = $this->database_service->get_database_path(); |
109 | 109 | |
110 | 110 | // If there's no database path, we can't store the database. |
111 | - if ( empty( $target_database_path ) ) { |
|
111 | + if (empty($target_database_path)) { |
|
112 | 112 | return; |
113 | 113 | } |
114 | 114 | |
115 | - if ( $wp_filesystem->exists( $target_database_path ) ) { |
|
116 | - $wp_filesystem->delete( $target_database_path ); |
|
115 | + if ($wp_filesystem->exists($target_database_path)) { |
|
116 | + $wp_filesystem->delete($target_database_path); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | // We can't download a database if there's no license key configured. |
120 | - $license_key = wpinv_get_option( 'maxmind_license_key' ); |
|
121 | - if ( empty( $license_key ) ) { |
|
120 | + $license_key = wpinv_get_option('maxmind_license_key'); |
|
121 | + if (empty($license_key)) { |
|
122 | 122 | return; |
123 | 123 | } |
124 | 124 | |
125 | - if ( empty( $tmp_database_path ) ) { |
|
126 | - $tmp_database_path = $this->database_service->download_database( $license_key ); |
|
125 | + if (empty($tmp_database_path)) { |
|
126 | + $tmp_database_path = $this->database_service->download_database($license_key); |
|
127 | 127 | } |
128 | 128 | |
129 | - if ( is_wp_error( $tmp_database_path ) ) { |
|
130 | - wpinv_error_log( $tmp_database_path->get_error_message() ); |
|
129 | + if (is_wp_error($tmp_database_path)) { |
|
130 | + wpinv_error_log($tmp_database_path->get_error_message()); |
|
131 | 131 | return; |
132 | 132 | } |
133 | 133 | |
134 | 134 | // Move the new database into position. |
135 | - $wp_filesystem->move( $tmp_database_path, $target_database_path, true ); |
|
136 | - $wp_filesystem->delete( dirname( $tmp_database_path ) ); |
|
135 | + $wp_filesystem->move($tmp_database_path, $target_database_path, true); |
|
136 | + $wp_filesystem->delete(dirname($tmp_database_path)); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | * @param string $ip_address The IP address to geolocate. |
144 | 144 | * @return array Geolocation including country code, state, city and postcode based on an IP address. |
145 | 145 | */ |
146 | - public function get_geolocation( $data, $ip_address ) { |
|
146 | + public function get_geolocation($data, $ip_address) { |
|
147 | 147 | |
148 | - if ( ! empty( $data['country'] ) || empty( $ip_address ) ) { |
|
148 | + if (!empty($data['country']) || empty($ip_address)) { |
|
149 | 149 | return $data; |
150 | 150 | } |
151 | 151 | |
152 | - $country_code = $this->database_service->get_iso_country_code_for_ip( $ip_address ); |
|
152 | + $country_code = $this->database_service->get_iso_country_code_for_ip($ip_address); |
|
153 | 153 | |
154 | 154 | return array( |
155 | 155 | 'country' => $country_code, |
@@ -167,11 +167,11 @@ discard block |
||
167 | 167 | */ |
168 | 168 | private function get_database_prefix() { |
169 | 169 | |
170 | - $prefix = get_option( 'wpinv_maxmind_database_prefix' ); |
|
170 | + $prefix = get_option('wpinv_maxmind_database_prefix'); |
|
171 | 171 | |
172 | - if ( empty( $prefix ) ) { |
|
173 | - $prefix = md5( uniqid( 'wpinv' ) ); |
|
174 | - update_option( 'wpinv_maxmind_database_prefix', $prefix ); |
|
172 | + if (empty($prefix)) { |
|
173 | + $prefix = md5(uniqid('wpinv')); |
|
174 | + update_option('wpinv_maxmind_database_prefix', $prefix); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | return $prefix; |
@@ -14,13 +14,13 @@ |
||
14 | 14 | * Tested up to: 5.8 |
15 | 15 | */ |
16 | 16 | |
17 | -if ( ! defined( 'ABSPATH' ) ) { |
|
17 | +if (!defined('ABSPATH')) { |
|
18 | 18 | exit; |
19 | 19 | } |
20 | 20 | |
21 | -if ( ! class_exists( 'AyeCode_Deactivation_Survey' ) ) { |
|
21 | +if (!class_exists('AyeCode_Deactivation_Survey')) { |
|
22 | 22 | // include the class if needed |
23 | - include_once( dirname( __FILE__ ) . "/wp-deactivation-survey.php" ); |
|
23 | + include_once(dirname(__FILE__) . "/wp-deactivation-survey.php"); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 |