@@ -7,47 +7,47 @@ discard block |
||
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 | <small class='form-text text-muted mb-2'> |
15 | - <?php esc_html_e( 'The amount that users add to this field will be added to the total amount for this form', 'invoicing' ); ?> |
|
15 | + <?php esc_html_e('The amount that users add to this field will be added to the total amount for this form', 'invoicing'); ?> |
|
16 | 16 | </small> |
17 | 17 | |
18 | 18 | <div class='form-group'> |
19 | 19 | <label class="d-block"> |
20 | - <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span> |
|
20 | + <span><?php esc_html_e('Field Label', 'invoicing'); ?></span> |
|
21 | 21 | <input v-model='active_form_element.label' class='form-control' type="text"/> |
22 | 22 | </label> |
23 | 23 | </div> |
24 | 24 | |
25 | 25 | <div class='form-group'> |
26 | 26 | <label class="d-block"> |
27 | - <span><?php esc_html_e( 'Default Amount', 'invoicing' ); ?></span> |
|
27 | + <span><?php esc_html_e('Default Amount', 'invoicing'); ?></span> |
|
28 | 28 | <input v-model='active_form_element.value' class='form-control' type="text"/> |
29 | 29 | </label> |
30 | 30 | </div> |
31 | 31 | |
32 | 32 | <div class='form-group'> |
33 | 33 | <label class="d-block"> |
34 | - <span><?php esc_html_e( 'Minimum Amount', 'invoicing' ); ?></span> |
|
34 | + <span><?php esc_html_e('Minimum Amount', 'invoicing'); ?></span> |
|
35 | 35 | <input v-model='active_form_element.minimum' class='form-control' type="text"/> |
36 | 36 | </label> |
37 | 37 | </div> |
38 | 38 | |
39 | 39 | <div class='form-group'> |
40 | 40 | <label class="d-block"> |
41 | - <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span> |
|
41 | + <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span> |
|
42 | 42 | <input v-model='active_form_element.placeholder' class='form-control' type="text"/> |
43 | 43 | </label> |
44 | 44 | </div> |
45 | 45 | |
46 | 46 | <div class='form-group'> |
47 | 47 | <label class="d-block"> |
48 | - <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span> |
|
49 | - <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> |
|
50 | - <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small> |
|
48 | + <span><?php esc_html_e('Help Text', 'invoicing'); ?></span> |
|
49 | + <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> |
|
50 | + <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small> |
|
51 | 51 | </label> |
52 | 52 | </div> |
53 | 53 | |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | |
56 | 56 | <div class='form-group'> |
57 | 57 | <label class="d-block"> |
58 | - <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span> |
|
58 | + <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span> |
|
59 | 59 | <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" /> |
60 | - <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span> |
|
60 | + <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span> |
|
61 | 61 | </label> |
62 | 62 | </div> |
63 | 63 |
@@ -16,165 +16,165 @@ |
||
16 | 16 | */ |
17 | 17 | class GetPaid_MaxMind_Geolocation { |
18 | 18 | |
19 | - /** |
|
20 | - * The service responsible for interacting with the MaxMind database. |
|
21 | - * |
|
22 | - * @var GetPaid_MaxMind_Database_Service |
|
23 | - */ |
|
24 | - private $database_service; |
|
25 | - |
|
26 | - /** |
|
27 | - * Initialize the integration. |
|
28 | - */ |
|
29 | - public function __construct() { |
|
30 | - |
|
31 | - /** |
|
32 | - * Supports overriding the database service to be used. |
|
33 | - * |
|
34 | - * @since 1.0.19 |
|
35 | - * @return mixed|null The geolocation database service. |
|
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() ); |
|
40 | - } |
|
41 | - |
|
42 | - // Bind to the scheduled updater action. |
|
43 | - add_action( 'getpaid_update_geoip_databases', array( $this, 'update_database' ) ); |
|
44 | - |
|
45 | - // Bind to the geolocation filter for MaxMind database lookups. |
|
46 | - add_filter( 'getpaid_get_geolocation', array( $this, 'get_geolocation' ), 10, 2 ); |
|
47 | - |
|
48 | - // Handle maxmind key updates. |
|
49 | - add_filter( 'wpinv_settings_sanitize_maxmind_license_key', array( $this, 'handle_key_updates' ) ); |
|
50 | - |
|
51 | - } |
|
52 | - |
|
53 | - /** |
|
54 | - * Get database service. |
|
55 | - * |
|
56 | - * @return GetPaid_MaxMind_Database_Service|null |
|
57 | - */ |
|
58 | - public function get_database_service() { |
|
59 | - return $this->database_service; |
|
60 | - } |
|
61 | - |
|
62 | - /** |
|
63 | - * Checks to make sure that the license key is valid. |
|
64 | - * |
|
65 | - * @param string $license_key The new license key. |
|
66 | - * @return string |
|
67 | - */ |
|
68 | - public function handle_key_updates( $license_key ) { |
|
69 | - |
|
70 | - // Trim whitespaces and strip slashes. |
|
71 | - $license_key = trim( $license_key ); |
|
72 | - |
|
73 | - // Abort if the license key is empty or unchanged. |
|
74 | - if ( empty( $license_key ) ) { |
|
75 | - return $license_key; |
|
76 | - } |
|
77 | - |
|
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' ) ) ) { |
|
80 | - return $license_key; |
|
81 | - } |
|
82 | - |
|
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() ); |
|
87 | - return $license_key; |
|
88 | - } |
|
89 | - |
|
90 | - $this->update_database( /** @scrutinizer ignore-type */ $tmp_database_path ); |
|
91 | - |
|
92 | - return $license_key; |
|
93 | - } |
|
94 | - |
|
95 | - /** |
|
96 | - * Updates the database used for geolocation queries. |
|
97 | - * |
|
98 | - * @param string $tmp_database_path Temporary database path. |
|
99 | - */ |
|
100 | - public function update_database( $tmp_database_path = null ) { |
|
101 | - |
|
102 | - // Allow us to easily interact with the filesystem. |
|
103 | - require_once ABSPATH . 'wp-admin/includes/file.php'; |
|
104 | - WP_Filesystem(); |
|
105 | - global $wp_filesystem; |
|
106 | - |
|
107 | - // Remove any existing archives to comply with the MaxMind TOS. |
|
108 | - $target_database_path = $this->database_service->get_database_path(); |
|
109 | - |
|
110 | - // If there's no database path, we can't store the database. |
|
111 | - if ( empty( $target_database_path ) ) { |
|
112 | - return; |
|
113 | - } |
|
114 | - |
|
115 | - if ( $wp_filesystem->exists( $target_database_path ) ) { |
|
116 | - $wp_filesystem->delete( $target_database_path ); |
|
117 | - } |
|
118 | - |
|
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 ) ) { |
|
122 | - return; |
|
123 | - } |
|
124 | - |
|
125 | - if ( empty( $tmp_database_path ) ) { |
|
126 | - $tmp_database_path = $this->database_service->download_database( $license_key ); |
|
127 | - } |
|
128 | - |
|
129 | - if ( is_wp_error( $tmp_database_path ) ) { |
|
130 | - wpinv_error_log( $tmp_database_path->get_error_message() ); |
|
131 | - return; |
|
132 | - } |
|
133 | - |
|
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 ) ); |
|
137 | - } |
|
138 | - |
|
139 | - /** |
|
140 | - * Performs a geolocation lookup against the MaxMind database for the given IP address. |
|
141 | - * |
|
142 | - * @param array $data Geolocation data. |
|
143 | - * @param string $ip_address The IP address to geolocate. |
|
144 | - * @return array Geolocation including country code, state, city and postcode based on an IP address. |
|
145 | - */ |
|
146 | - public function get_geolocation( $data, $ip_address ) { |
|
147 | - |
|
148 | - if ( ! empty( $data['country'] ) || empty( $ip_address ) ) { |
|
149 | - return $data; |
|
150 | - } |
|
151 | - |
|
152 | - $country_code = $this->database_service->get_iso_country_code_for_ip( $ip_address ); |
|
153 | - |
|
154 | - return array( |
|
155 | - 'country' => $country_code, |
|
156 | - 'state' => '', |
|
157 | - 'city' => '', |
|
158 | - 'postcode' => '', |
|
159 | - ); |
|
160 | - |
|
161 | - } |
|
162 | - |
|
163 | - /** |
|
164 | - * Fetches the prefix for the MaxMind database file. |
|
165 | - * |
|
166 | - * @return string |
|
167 | - */ |
|
168 | - private function get_database_prefix() { |
|
169 | - |
|
170 | - $prefix = get_option( 'wpinv_maxmind_database_prefix' ); |
|
171 | - |
|
172 | - if ( empty( $prefix ) ) { |
|
173 | - $prefix = md5( uniqid( 'wpinv' ) ); |
|
174 | - update_option( 'wpinv_maxmind_database_prefix', $prefix ); |
|
175 | - } |
|
176 | - |
|
177 | - return $prefix; |
|
178 | - } |
|
19 | + /** |
|
20 | + * The service responsible for interacting with the MaxMind database. |
|
21 | + * |
|
22 | + * @var GetPaid_MaxMind_Database_Service |
|
23 | + */ |
|
24 | + private $database_service; |
|
25 | + |
|
26 | + /** |
|
27 | + * Initialize the integration. |
|
28 | + */ |
|
29 | + public function __construct() { |
|
30 | + |
|
31 | + /** |
|
32 | + * Supports overriding the database service to be used. |
|
33 | + * |
|
34 | + * @since 1.0.19 |
|
35 | + * @return mixed|null The geolocation database service. |
|
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() ); |
|
40 | + } |
|
41 | + |
|
42 | + // Bind to the scheduled updater action. |
|
43 | + add_action( 'getpaid_update_geoip_databases', array( $this, 'update_database' ) ); |
|
44 | + |
|
45 | + // Bind to the geolocation filter for MaxMind database lookups. |
|
46 | + add_filter( 'getpaid_get_geolocation', array( $this, 'get_geolocation' ), 10, 2 ); |
|
47 | + |
|
48 | + // Handle maxmind key updates. |
|
49 | + add_filter( 'wpinv_settings_sanitize_maxmind_license_key', array( $this, 'handle_key_updates' ) ); |
|
50 | + |
|
51 | + } |
|
52 | + |
|
53 | + /** |
|
54 | + * Get database service. |
|
55 | + * |
|
56 | + * @return GetPaid_MaxMind_Database_Service|null |
|
57 | + */ |
|
58 | + public function get_database_service() { |
|
59 | + return $this->database_service; |
|
60 | + } |
|
61 | + |
|
62 | + /** |
|
63 | + * Checks to make sure that the license key is valid. |
|
64 | + * |
|
65 | + * @param string $license_key The new license key. |
|
66 | + * @return string |
|
67 | + */ |
|
68 | + public function handle_key_updates( $license_key ) { |
|
69 | + |
|
70 | + // Trim whitespaces and strip slashes. |
|
71 | + $license_key = trim( $license_key ); |
|
72 | + |
|
73 | + // Abort if the license key is empty or unchanged. |
|
74 | + if ( empty( $license_key ) ) { |
|
75 | + return $license_key; |
|
76 | + } |
|
77 | + |
|
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' ) ) ) { |
|
80 | + return $license_key; |
|
81 | + } |
|
82 | + |
|
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() ); |
|
87 | + return $license_key; |
|
88 | + } |
|
89 | + |
|
90 | + $this->update_database( /** @scrutinizer ignore-type */ $tmp_database_path ); |
|
91 | + |
|
92 | + return $license_key; |
|
93 | + } |
|
94 | + |
|
95 | + /** |
|
96 | + * Updates the database used for geolocation queries. |
|
97 | + * |
|
98 | + * @param string $tmp_database_path Temporary database path. |
|
99 | + */ |
|
100 | + public function update_database( $tmp_database_path = null ) { |
|
101 | + |
|
102 | + // Allow us to easily interact with the filesystem. |
|
103 | + require_once ABSPATH . 'wp-admin/includes/file.php'; |
|
104 | + WP_Filesystem(); |
|
105 | + global $wp_filesystem; |
|
106 | + |
|
107 | + // Remove any existing archives to comply with the MaxMind TOS. |
|
108 | + $target_database_path = $this->database_service->get_database_path(); |
|
109 | + |
|
110 | + // If there's no database path, we can't store the database. |
|
111 | + if ( empty( $target_database_path ) ) { |
|
112 | + return; |
|
113 | + } |
|
114 | + |
|
115 | + if ( $wp_filesystem->exists( $target_database_path ) ) { |
|
116 | + $wp_filesystem->delete( $target_database_path ); |
|
117 | + } |
|
118 | + |
|
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 ) ) { |
|
122 | + return; |
|
123 | + } |
|
124 | + |
|
125 | + if ( empty( $tmp_database_path ) ) { |
|
126 | + $tmp_database_path = $this->database_service->download_database( $license_key ); |
|
127 | + } |
|
128 | + |
|
129 | + if ( is_wp_error( $tmp_database_path ) ) { |
|
130 | + wpinv_error_log( $tmp_database_path->get_error_message() ); |
|
131 | + return; |
|
132 | + } |
|
133 | + |
|
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 ) ); |
|
137 | + } |
|
138 | + |
|
139 | + /** |
|
140 | + * Performs a geolocation lookup against the MaxMind database for the given IP address. |
|
141 | + * |
|
142 | + * @param array $data Geolocation data. |
|
143 | + * @param string $ip_address The IP address to geolocate. |
|
144 | + * @return array Geolocation including country code, state, city and postcode based on an IP address. |
|
145 | + */ |
|
146 | + public function get_geolocation( $data, $ip_address ) { |
|
147 | + |
|
148 | + if ( ! empty( $data['country'] ) || empty( $ip_address ) ) { |
|
149 | + return $data; |
|
150 | + } |
|
151 | + |
|
152 | + $country_code = $this->database_service->get_iso_country_code_for_ip( $ip_address ); |
|
153 | + |
|
154 | + return array( |
|
155 | + 'country' => $country_code, |
|
156 | + 'state' => '', |
|
157 | + 'city' => '', |
|
158 | + 'postcode' => '', |
|
159 | + ); |
|
160 | + |
|
161 | + } |
|
162 | + |
|
163 | + /** |
|
164 | + * Fetches the prefix for the MaxMind database file. |
|
165 | + * |
|
166 | + * @return string |
|
167 | + */ |
|
168 | + private function get_database_prefix() { |
|
169 | + |
|
170 | + $prefix = get_option( 'wpinv_maxmind_database_prefix' ); |
|
171 | + |
|
172 | + if ( empty( $prefix ) ) { |
|
173 | + $prefix = md5( uniqid( 'wpinv' ) ); |
|
174 | + update_option( 'wpinv_maxmind_database_prefix', $prefix ); |
|
175 | + } |
|
176 | + |
|
177 | + return $prefix; |
|
178 | + } |
|
179 | 179 | |
180 | 180 | } |
@@ -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; |
@@ -13,30 +13,30 @@ discard block |
||
13 | 13 | class GetPaid_Manual_Gateway extends GetPaid_Payment_Gateway { |
14 | 14 | |
15 | 15 | /** |
16 | - * Payment method id. |
|
17 | - * |
|
18 | - * @var string |
|
19 | - */ |
|
16 | + * Payment method id. |
|
17 | + * |
|
18 | + * @var string |
|
19 | + */ |
|
20 | 20 | public $id = 'manual'; |
21 | 21 | |
22 | 22 | /** |
23 | - * An array of features that this gateway supports. |
|
24 | - * |
|
25 | - * @var array |
|
26 | - */ |
|
23 | + * An array of features that this gateway supports. |
|
24 | + * |
|
25 | + * @var array |
|
26 | + */ |
|
27 | 27 | protected $supports = array( 'subscription', 'addons', 'single_subscription_group', 'multiple_subscription_groups' ); |
28 | 28 | |
29 | 29 | /** |
30 | - * Payment method order. |
|
31 | - * |
|
32 | - * @var int |
|
33 | - */ |
|
34 | - public $order = 11; |
|
30 | + * Payment method order. |
|
31 | + * |
|
32 | + * @var int |
|
33 | + */ |
|
34 | + public $order = 11; |
|
35 | 35 | |
36 | 36 | /** |
37 | - * Class constructor. |
|
38 | - */ |
|
39 | - public function __construct() { |
|
37 | + * Class constructor. |
|
38 | + */ |
|
39 | + public function __construct() { |
|
40 | 40 | parent::__construct(); |
41 | 41 | |
42 | 42 | $this->title = __( 'Test Gateway', 'invoicing' ); |
@@ -46,15 +46,15 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
49 | - * Process Payment. |
|
50 | - * |
|
51 | - * |
|
52 | - * @param WPInv_Invoice $invoice Invoice. |
|
53 | - * @param array $submission_data Posted checkout fields. |
|
54 | - * @param GetPaid_Payment_Form_Submission $submission Checkout submission. |
|
55 | - * @return array |
|
56 | - */ |
|
57 | - public function process_payment( $invoice, $submission_data, $submission ) { |
|
49 | + * Process Payment. |
|
50 | + * |
|
51 | + * |
|
52 | + * @param WPInv_Invoice $invoice Invoice. |
|
53 | + * @param array $submission_data Posted checkout fields. |
|
54 | + * @param GetPaid_Payment_Form_Submission $submission Checkout submission. |
|
55 | + * @return array |
|
56 | + */ |
|
57 | + public function process_payment( $invoice, $submission_data, $submission ) { |
|
58 | 58 | |
59 | 59 | // Mark it as paid. |
60 | 60 | $invoice->mark_paid(); |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | - * (Maybe) renews a manual subscription profile. |
|
89 | - * |
|
90 | - * |
|
88 | + * (Maybe) renews a manual subscription profile. |
|
89 | + * |
|
90 | + * |
|
91 | 91 | * @param WPInv_Subscription $subscription |
92 | - */ |
|
93 | - public function maybe_renew_subscription( $subscription ) { |
|
92 | + */ |
|
93 | + public function maybe_renew_subscription( $subscription ) { |
|
94 | 94 | |
95 | 95 | // Ensure its our subscription && it's active. |
96 | 96 | if ( $this->id == $subscription->get_gateway() && $subscription->has_status( 'active trialling' ) ) { |
@@ -110,13 +110,13 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
113 | - * Processes invoice addons. |
|
114 | - * |
|
115 | - * @param WPInv_Invoice $invoice |
|
116 | - * @param GetPaid_Form_Item[] $items |
|
117 | - * @return WPInv_Invoice |
|
118 | - */ |
|
119 | - public function process_addons( $invoice, $items ) { |
|
113 | + * Processes invoice addons. |
|
114 | + * |
|
115 | + * @param WPInv_Invoice $invoice |
|
116 | + * @param GetPaid_Form_Item[] $items |
|
117 | + * @return WPInv_Invoice |
|
118 | + */ |
|
119 | + public function process_addons( $invoice, $items ) { |
|
120 | 120 | |
121 | 121 | foreach ( $items as $item ) { |
122 | 122 | $invoice->add_item( $item ); |
@@ -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 | * Manual Payment Gateway class. |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @var array |
26 | 26 | */ |
27 | - protected $supports = array( 'subscription', 'addons', 'single_subscription_group', 'multiple_subscription_groups' ); |
|
27 | + protected $supports = array('subscription', 'addons', 'single_subscription_group', 'multiple_subscription_groups'); |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Payment method order. |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | public function __construct() { |
40 | 40 | parent::__construct(); |
41 | 41 | |
42 | - $this->title = __( 'Test Gateway', 'invoicing' ); |
|
43 | - $this->method_title = __( 'Test Gateway', 'invoicing' ); |
|
42 | + $this->title = __('Test Gateway', 'invoicing'); |
|
43 | + $this->method_title = __('Test Gateway', 'invoicing'); |
|
44 | 44 | |
45 | - add_action( 'getpaid_should_renew_subscription', array( $this, 'maybe_renew_subscription' ) ); |
|
45 | + add_action('getpaid_should_renew_subscription', array($this, 'maybe_renew_subscription')); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -54,32 +54,32 @@ discard block |
||
54 | 54 | * @param GetPaid_Payment_Form_Submission $submission Checkout submission. |
55 | 55 | * @return array |
56 | 56 | */ |
57 | - public function process_payment( $invoice, $submission_data, $submission ) { |
|
57 | + public function process_payment($invoice, $submission_data, $submission) { |
|
58 | 58 | |
59 | 59 | // Mark it as paid. |
60 | 60 | $invoice->mark_paid(); |
61 | 61 | |
62 | 62 | // (Maybe) activate subscriptions. |
63 | - $subscriptions = getpaid_get_invoice_subscriptions( $invoice ); |
|
63 | + $subscriptions = getpaid_get_invoice_subscriptions($invoice); |
|
64 | 64 | |
65 | - if ( ! empty( $subscriptions ) ) { |
|
66 | - $subscriptions = is_array( $subscriptions ) ? $subscriptions : array( $subscriptions ); |
|
65 | + if (!empty($subscriptions)) { |
|
66 | + $subscriptions = is_array($subscriptions) ? $subscriptions : array($subscriptions); |
|
67 | 67 | |
68 | - foreach ( $subscriptions as $subscription ) { |
|
69 | - if ( $subscription->exists() ) { |
|
70 | - $duration = strtotime( $subscription->get_expiration() ) - strtotime( $subscription->get_date_created() ); |
|
71 | - $expiry = date( 'Y-m-d H:i:s', ( current_time( 'timestamp' ) + $duration ) ); |
|
68 | + foreach ($subscriptions as $subscription) { |
|
69 | + if ($subscription->exists()) { |
|
70 | + $duration = strtotime($subscription->get_expiration()) - strtotime($subscription->get_date_created()); |
|
71 | + $expiry = date('Y-m-d H:i:s', (current_time('timestamp') + $duration)); |
|
72 | 72 | |
73 | - $subscription->set_next_renewal_date( $expiry ); |
|
74 | - $subscription->set_date_created( current_time( 'mysql' ) ); |
|
75 | - $subscription->set_profile_id( $invoice->generate_key( 'manual_sub_' . $invoice->get_id() . '_' . $subscription->get_id() ) ); |
|
73 | + $subscription->set_next_renewal_date($expiry); |
|
74 | + $subscription->set_date_created(current_time('mysql')); |
|
75 | + $subscription->set_profile_id($invoice->generate_key('manual_sub_' . $invoice->get_id() . '_' . $subscription->get_id())); |
|
76 | 76 | $subscription->activate(); |
77 | 77 | } |
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
81 | 81 | // Send to the success page. |
82 | - wpinv_send_to_success_page( array( 'invoice_key' => $invoice->get_key() ) ); |
|
82 | + wpinv_send_to_success_page(array('invoice_key' => $invoice->get_key())); |
|
83 | 83 | |
84 | 84 | } |
85 | 85 | |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @param WPInv_Subscription $subscription |
91 | 91 | */ |
92 | - public function maybe_renew_subscription( $subscription ) { |
|
92 | + public function maybe_renew_subscription($subscription) { |
|
93 | 93 | |
94 | 94 | // Ensure its our subscription && it's active. |
95 | - if ( $this->id == $subscription->get_gateway() && $subscription->has_status( 'active trialling' ) ) { |
|
95 | + if ($this->id == $subscription->get_gateway() && $subscription->has_status('active trialling')) { |
|
96 | 96 | |
97 | 97 | // Renew the subscription. |
98 | 98 | $subscription->add_payment( |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | * @param GetPaid_Form_Item[] $items |
116 | 116 | * @return WPInv_Invoice |
117 | 117 | */ |
118 | - public function process_addons( $invoice, $items ) { |
|
118 | + public function process_addons($invoice, $items) { |
|
119 | 119 | |
120 | - foreach ( $items as $item ) { |
|
121 | - $invoice->add_item( $item ); |
|
120 | + foreach ($items as $item) { |
|
121 | + $invoice->add_item($item); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | $invoice->recalculate_total(); |
@@ -20,13 +20,13 @@ |
||
20 | 20 | <title><?php esc_html_e( 'GetPaid › Setup Wizard', 'invoicing' ); ?></title> |
21 | 21 | <?php |
22 | 22 | getpaid_admin()->enqeue_scripts(); |
23 | - wp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.13.0/css/all.css', array(), 'v5.13.0' ); |
|
24 | - wp_print_styles( 'select2' ); |
|
23 | + wp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.13.0/css/all.css', array(), 'v5.13.0' ); |
|
24 | + wp_print_styles( 'select2' ); |
|
25 | 25 | wp_print_scripts( 'select2' ); |
26 | - wp_print_scripts( 'wpinv-admin-script' ); |
|
26 | + wp_print_scripts( 'wpinv-admin-script' ); |
|
27 | 27 | do_action( 'admin_print_styles' ); |
28 | 28 | do_action( 'admin_head' ); |
29 | - ?> |
|
29 | + ?> |
|
30 | 30 | <style> |
31 | 31 | body, p{ |
32 | 32 | font-size: 16px; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * |
5 | 5 | */ |
6 | 6 | |
7 | -defined( 'ABSPATH' ) || exit; |
|
7 | +defined('ABSPATH') || exit; |
|
8 | 8 | |
9 | 9 | $aui_settings = AyeCode_UI_Settings::instance(); |
10 | 10 | $aui_settings->enqueue_scripts(); |
@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | <head> |
18 | 18 | <meta name="viewport" content="width=device-width"/> |
19 | 19 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
20 | - <title><?php esc_html_e( 'GetPaid › Setup Wizard', 'invoicing' ); ?></title> |
|
20 | + <title><?php esc_html_e('GetPaid › Setup Wizard', 'invoicing'); ?></title> |
|
21 | 21 | <?php |
22 | 22 | getpaid_admin()->enqeue_scripts(); |
23 | - wp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.13.0/css/all.css', array(), 'v5.13.0' ); |
|
24 | - wp_print_styles( 'select2' ); |
|
25 | - wp_print_scripts( 'select2' ); |
|
26 | - wp_print_scripts( 'wpinv-admin-script' ); |
|
27 | - do_action( 'admin_print_styles' ); |
|
28 | - do_action( 'admin_head' ); |
|
23 | + wp_enqueue_style('font-awesome', 'https://use.fontawesome.com/releases/v5.13.0/css/all.css', array(), 'v5.13.0'); |
|
24 | + wp_print_styles('select2'); |
|
25 | + wp_print_scripts('select2'); |
|
26 | + wp_print_scripts('wpinv-admin-script'); |
|
27 | + do_action('admin_print_styles'); |
|
28 | + do_action('admin_head'); |
|
29 | 29 | ?> |
30 | 30 | <style> |
31 | 31 | body, p{ |
@@ -37,23 +37,23 @@ discard block |
||
37 | 37 | font-weight: 500; |
38 | 38 | margin-bottom: .1rem; |
39 | 39 | } |
40 | - <?php echo $aui_settings::css_primary( '#009874', true ); ?> |
|
40 | + <?php echo $aui_settings::css_primary('#009874', true); ?> |
|
41 | 41 | </style> |
42 | 42 | </head> |
43 | 43 | |
44 | 44 | <body class="gp-setup wp-core-ui bg-lightx mx-auto text-dark scrollbars-ios" style="background: #f3f6ff;"> |
45 | 45 | |
46 | - <?php if ( isset( $_REQUEST['step'] ) ) : ?> |
|
46 | + <?php if (isset($_REQUEST['step'])) : ?> |
|
47 | 47 | <ol class="gp-setup-steps mb-0 pb-4 mw-100 list-group list-group-horizontal text-center"> |
48 | - <?php foreach ( $steps as $step => $data ) : ?> |
|
48 | + <?php foreach ($steps as $step => $data) : ?> |
|
49 | 49 | <li class="list-group-item flex-fill rounded-0 |
50 | 50 | <?php |
51 | 51 | echo $step == $current ? 'active' : 'd-none d-md-block'; |
52 | - echo array_search( $current, array_keys( $steps ) ) > array_search( $step, array_keys( $steps ) ) ? ' done' : ''; |
|
52 | + echo array_search($current, array_keys($steps)) > array_search($step, array_keys($steps)) ? ' done' : ''; |
|
53 | 53 | ?> |
54 | 54 | "> |
55 | - <i class="far fa-check-circle <?php echo array_search( $current, array_keys( $steps ) ) > array_search( $step, array_keys( $steps ) ) ? 'text-success' : ''; ?>"></i> |
|
56 | - <?php echo esc_html( $data['name'] ); ?> |
|
55 | + <i class="far fa-check-circle <?php echo array_search($current, array_keys($steps)) > array_search($step, array_keys($steps)) ? 'text-success' : ''; ?>"></i> |
|
56 | + <?php echo esc_html($data['name']); ?> |
|
57 | 57 | </li> |
58 | 58 | <?php endforeach; ?> |
59 | 59 | </ol> |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | <div class="text-center pb-3 mt-5"> |
65 | 65 | <a class=" text-decoration-none" href="https://wpgetpaid.com/"> |
66 | 66 | <span class="text-black-50"> |
67 | - <img class="ml-n3x" src="<?php echo esc_url( WPINV_PLUGIN_URL . 'assets/images/getpaid-logo.png' ); ?>" /> |
|
67 | + <img class="ml-n3x" src="<?php echo esc_url(WPINV_PLUGIN_URL . 'assets/images/getpaid-logo.png'); ?>" /> |
|
68 | 68 | </span> |
69 | 69 | </a> |
70 | 70 | </div> |
@@ -57,9 +57,12 @@ |
||
57 | 57 | </li> |
58 | 58 | <?php endforeach; ?> |
59 | 59 | </ol> |
60 | - <?php else : ?> |
|
60 | + <?php else { |
|
61 | + : ?> |
|
61 | 62 | <div class='mb-3'> </div> |
62 | - <?php endif; ?> |
|
63 | + <?php endif; |
|
64 | +} |
|
65 | +?> |
|
63 | 66 | |
64 | 67 | <div class="text-center pb-3 mt-5"> |
65 | 68 | <a class=" text-decoration-none" href="https://wpgetpaid.com/"> |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
11 | - exit; // Exit if accessed directly |
|
11 | + exit; // Exit if accessed directly |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | /** |
@@ -319,10 +319,10 @@ discard block |
||
319 | 319 | } |
320 | 320 | |
321 | 321 | /** |
322 | - * Output the metabox. |
|
323 | - * |
|
324 | - * @param WP_Post $post |
|
325 | - */ |
|
322 | + * Output the metabox. |
|
323 | + * |
|
324 | + * @param WP_Post $post |
|
325 | + */ |
|
326 | 326 | public static function output2( $post ) { |
327 | 327 | |
328 | 328 | // Prepare the invoice. |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
10 | +if (!defined('ABSPATH')) { |
|
11 | 11 | exit; // Exit if accessed directly |
12 | 12 | } |
13 | 13 | |
@@ -16,82 +16,82 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class GetPaid_Meta_Box_Invoice_Items { |
18 | 18 | |
19 | - public static function get_columns( $invoice ) { |
|
19 | + public static function get_columns($invoice) { |
|
20 | 20 | $use_taxes = $invoice->is_taxable() && wpinv_use_taxes(); |
21 | 21 | $columns = array( |
22 | - 'id' => __( 'ID', 'invoicing' ), |
|
23 | - 'title' => __( 'Item', 'invoicing' ), |
|
22 | + 'id' => __('ID', 'invoicing'), |
|
23 | + 'title' => __('Item', 'invoicing'), |
|
24 | 24 | 'price' => sprintf( |
25 | 25 | '<span class="getpaid-hide-if-hours getpaid-hide-if-quantity">%s</span> |
26 | 26 | <span class="getpaid-hide-if-hours hide-if-amount">%s</span> |
27 | 27 | <span class="getpaid-hide-if-quantity hide-if-amount">%s</span>', |
28 | - __( 'Amount', 'invoicing' ), |
|
29 | - __( 'Price', 'invoicing' ), |
|
30 | - __( 'Rate', 'invoicing' ) |
|
28 | + __('Amount', 'invoicing'), |
|
29 | + __('Price', 'invoicing'), |
|
30 | + __('Rate', 'invoicing') |
|
31 | 31 | ), |
32 | 32 | 'qty' => sprintf( |
33 | 33 | '<span class="getpaid-hide-if-hours">%s</span><span class="getpaid-hide-if-quantity">%s</span>', |
34 | - __( 'Quantity', 'invoicing' ), |
|
35 | - __( 'Hours', 'invoicing' ) |
|
34 | + __('Quantity', 'invoicing'), |
|
35 | + __('Hours', 'invoicing') |
|
36 | 36 | ), |
37 | - 'total' => __( 'Total', 'invoicing' ), |
|
38 | - 'tax' => __( 'Tax (%)', 'invoicing' ), |
|
37 | + 'total' => __('Total', 'invoicing'), |
|
38 | + 'tax' => __('Tax (%)', 'invoicing'), |
|
39 | 39 | 'action' => '', |
40 | 40 | ); |
41 | 41 | |
42 | - if ( ! $use_taxes ) { |
|
43 | - unset( $columns['tax'] ); |
|
42 | + if (!$use_taxes) { |
|
43 | + unset($columns['tax']); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return $columns; |
47 | 47 | } |
48 | 48 | |
49 | - public static function output( $post, $invoice = false ) { |
|
49 | + public static function output($post, $invoice = false) { |
|
50 | 50 | |
51 | - if ( apply_filters( 'getpaid_use_new_invoice_items_metabox', false ) ) { |
|
52 | - return self::output2( $post ); |
|
51 | + if (apply_filters('getpaid_use_new_invoice_items_metabox', false)) { |
|
52 | + return self::output2($post); |
|
53 | 53 | } |
54 | 54 | |
55 | - $post_id = !empty( $post->ID ) ? $post->ID : 0; |
|
56 | - $invoice = $invoice instanceof WPInv_Invoice ? $invoice : new WPInv_Invoice( $post_id ); |
|
55 | + $post_id = !empty($post->ID) ? $post->ID : 0; |
|
56 | + $invoice = $invoice instanceof WPInv_Invoice ? $invoice : new WPInv_Invoice($post_id); |
|
57 | 57 | $use_taxes = $invoice->is_taxable() && wpinv_use_taxes(); |
58 | - $item_types = apply_filters( 'wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post ); |
|
59 | - $columns = self::get_columns( $invoice ); |
|
60 | - $cols = count( $columns ); |
|
58 | + $item_types = apply_filters('wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post); |
|
59 | + $columns = self::get_columns($invoice); |
|
60 | + $cols = count($columns); |
|
61 | 61 | $class = ''; |
62 | 62 | |
63 | - unset( $item_types['adv'] ); |
|
64 | - unset( $item_types['package'] ); |
|
63 | + unset($item_types['adv']); |
|
64 | + unset($item_types['package']); |
|
65 | 65 | |
66 | - if ( $invoice->is_paid() ) { |
|
66 | + if ($invoice->is_paid()) { |
|
67 | 67 | $class .= ' wpinv-paid'; |
68 | 68 | } |
69 | 69 | |
70 | - if ( $invoice->is_refunded() ) { |
|
70 | + if ($invoice->is_refunded()) { |
|
71 | 71 | $class .= ' wpinv-refunded'; |
72 | 72 | } |
73 | 73 | |
74 | - if ( $invoice->is_recurring() ) { |
|
74 | + if ($invoice->is_recurring()) { |
|
75 | 75 | $class .= ' wpi-recurring'; |
76 | 76 | } |
77 | 77 | |
78 | 78 | ?> |
79 | 79 | |
80 | - <div class="wpinv-items-wrap<?php echo esc_attr( $class ); ?>" id="wpinv_items_wrap" data-status="<?php echo esc_attr( $invoice->get_status() ); ?>"> |
|
80 | + <div class="wpinv-items-wrap<?php echo esc_attr($class); ?>" id="wpinv_items_wrap" data-status="<?php echo esc_attr($invoice->get_status()); ?>"> |
|
81 | 81 | <table id="wpinv_items" class="wpinv-items" cellspacing="0" cellpadding="0"> |
82 | 82 | |
83 | 83 | <thead> |
84 | 84 | <tr> |
85 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
86 | - <th class="<?php echo esc_attr( $key ); echo 'total' == $key || 'qty' == $key ? ' hide-if-amount' : '' ?>"><?php echo wp_kses_post( $label ); ?></th> |
|
85 | + <?php foreach ($columns as $key => $label) : ?> |
|
86 | + <th class="<?php echo esc_attr($key); echo 'total' == $key || 'qty' == $key ? ' hide-if-amount' : '' ?>"><?php echo wp_kses_post($label); ?></th> |
|
87 | 87 | <?php endforeach; ?> |
88 | 88 | </tr> |
89 | 89 | </thead> |
90 | 90 | |
91 | 91 | <tbody class="wpinv-line-items"> |
92 | 92 | <?php |
93 | - foreach ( $invoice->get_items() as $int => $item ) { |
|
94 | - self::output_row( $columns, $item, $invoice, $int % 2 == 0 ? 'even' : 'odd' ); |
|
93 | + foreach ($invoice->get_items() as $int => $item) { |
|
94 | + self::output_row($columns, $item, $invoice, $int % 2 == 0 ? 'even' : 'odd'); |
|
95 | 95 | } |
96 | 96 | ?> |
97 | 97 | </tbody> |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | <div class="wp-clearfix"> |
109 | 109 | <label class="wpi-item-name"> |
110 | 110 | <span class="input-text-wrap"> |
111 | - <input type="text" style="width: 100%" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' );?>" class="wpinv-quick-item-name" name="_wpinv_quick[name]"> |
|
111 | + <input type="text" style="width: 100%" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="wpinv-quick-item-name" name="_wpinv_quick[name]"> |
|
112 | 112 | </span> |
113 | 113 | </label> |
114 | 114 | </div> |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | <div class="wp-clearfix"> |
117 | 117 | <label class="wpi-item-price"> |
118 | 118 | <span class="input-text-wrap"> |
119 | - <input type="text" style="width: 200px" placeholder="<?php esc_attr_e( 'Item Price', 'invoicing' );?>" class="wpinv-quick-item-price" name="_wpinv_quick[price]"> |
|
120 | - × <input type="text" style="width: 140px" placeholder="<?php esc_attr_e( 'Item Quantity', 'invoicing' );?>" class="wpinv-quick-item-qty" name="_wpinv_quick[qty]"> |
|
119 | + <input type="text" style="width: 200px" placeholder="<?php esc_attr_e('Item Price', 'invoicing'); ?>" class="wpinv-quick-item-price" name="_wpinv_quick[price]"> |
|
120 | + × <input type="text" style="width: 140px" placeholder="<?php esc_attr_e('Item Quantity', 'invoicing'); ?>" class="wpinv-quick-item-qty" name="_wpinv_quick[qty]"> |
|
121 | 121 | </span> |
122 | 122 | </label> |
123 | 123 | </div> |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | <div class="wp-clearfix"> |
126 | 126 | <label class="wpi-item-name"> |
127 | 127 | <span class="input-text-wrap"> |
128 | - <textarea rows="4" style="width: 100%" placeholder="<?php esc_attr_e( 'Item Description', 'invoicing' );?>" class="wpinv-quick-item-description" name="_wpinv_quick[description]"></textarea> |
|
128 | + <textarea rows="4" style="width: 100%" placeholder="<?php esc_attr_e('Item Description', 'invoicing'); ?>" class="wpinv-quick-item-description" name="_wpinv_quick[description]"></textarea> |
|
129 | 129 | </span> |
130 | 130 | </label> |
131 | 131 | </div> |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | <div class="wp-clearfix"> |
134 | 134 | <label class="wpi-item-type"> |
135 | 135 | <span class="input-text-wrap"> |
136 | - <?php echo wpinv_html_select( array( |
|
136 | + <?php echo wpinv_html_select(array( |
|
137 | 137 | 'options' => $item_types, |
138 | 138 | 'name' => '_wpinv_quick[type]', |
139 | 139 | 'id' => '_wpinv_quick_type', |
@@ -141,19 +141,19 @@ discard block |
||
141 | 141 | 'show_option_all' => false, |
142 | 142 | 'show_option_none' => false, |
143 | 143 | 'class' => 'gdmbx2-text-medium wpinv-quick-type', |
144 | - ) ); ?> |
|
144 | + )); ?> |
|
145 | 145 | </span> |
146 | 146 | </label> |
147 | 147 | </div> |
148 | 148 | |
149 | - <?php if ( $use_taxes ) : ?> |
|
149 | + <?php if ($use_taxes) : ?> |
|
150 | 150 | <div class="wp-clearfix"> |
151 | 151 | <label class="wpi-vat-rule"> |
152 | 152 | <span class="input-text-wrap"> |
153 | 153 | <?php |
154 | - echo wpinv_html_select( array( |
|
154 | + echo wpinv_html_select(array( |
|
155 | 155 | 'options' => array_merge( |
156 | - array( '' => __( 'Select VAT Rule', 'invoicing' ) ), |
|
156 | + array('' => __('Select VAT Rule', 'invoicing')), |
|
157 | 157 | getpaid_get_tax_rules() |
158 | 158 | ), |
159 | 159 | 'name' => '_wpinv_quick[vat_rule]', |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | 'show_option_all' => false, |
162 | 162 | 'show_option_none' => false, |
163 | 163 | 'class' => 'gdmbx2-text-medium wpinv-quick-vat-rule', |
164 | - ) ); |
|
164 | + )); |
|
165 | 165 | ?> |
166 | 166 | </span> |
167 | 167 | </label> |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | <label class="wpi-vat-class"> |
171 | 171 | <span class="input-text-wrap"> |
172 | 172 | <?php |
173 | - echo wpinv_html_select( array( |
|
173 | + echo wpinv_html_select(array( |
|
174 | 174 | 'options' => array_merge( |
175 | - array( '' => __( 'Select VAT Class', 'invoicing' ) ), |
|
175 | + array('' => __('Select VAT Class', 'invoicing')), |
|
176 | 176 | getpaid_get_tax_classes() |
177 | 177 | ), |
178 | 178 | 'name' => '_wpinv_quick[vat_class]', |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | 'show_option_all' => false, |
181 | 181 | 'show_option_none' => false, |
182 | 182 | 'class' => 'gdmbx2-text-medium wpinv-quick-vat-class', |
183 | - ) ); |
|
183 | + )); |
|
184 | 184 | ?> |
185 | 185 | </span> |
186 | 186 | </label> |
@@ -201,29 +201,29 @@ discard block |
||
201 | 201 | </td> |
202 | 202 | </tr> |
203 | 203 | <tr class="totals"> |
204 | - <td colspan="<?php echo ( (int) $cols - 4 ); ?>"></td> |
|
204 | + <td colspan="<?php echo ((int) $cols - 4); ?>"></td> |
|
205 | 205 | <td colspan="4"> |
206 | 206 | <table cellspacing="0" cellpadding="0"> |
207 | 207 | <tr class="subtotal"> |
208 | - <td class="name"><?php _e( 'Sub Total:', 'invoicing' );?></td> |
|
209 | - <td class="total"><?php echo wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() );?></td> |
|
208 | + <td class="name"><?php _e('Sub Total:', 'invoicing'); ?></td> |
|
209 | + <td class="total"><?php echo wpinv_price($invoice->get_subtotal(), $invoice->get_currency()); ?></td> |
|
210 | 210 | <td class="action"></td> |
211 | 211 | </tr> |
212 | 212 | <tr class="discount"> |
213 | - <td class="name"><?php _e( 'Discount:', 'invoicing' ) ; ?></td> |
|
214 | - <td class="total"><?php echo wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() );?></td> |
|
213 | + <td class="name"><?php _e('Discount:', 'invoicing'); ?></td> |
|
214 | + <td class="total"><?php echo wpinv_price($invoice->get_total_discount(), $invoice->get_currency()); ?></td> |
|
215 | 215 | <td class="action"></td> |
216 | 216 | </tr> |
217 | - <?php if ( $use_taxes ) : ?> |
|
217 | + <?php if ($use_taxes) : ?> |
|
218 | 218 | <tr class="tax"> |
219 | - <td class="name"><?php _e( 'Tax:', 'invoicing' );?></td> |
|
220 | - <td class="total"><?php echo wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() );?></td> |
|
219 | + <td class="name"><?php _e('Tax:', 'invoicing'); ?></td> |
|
220 | + <td class="total"><?php echo wpinv_price($invoice->get_total_tax(), $invoice->get_currency()); ?></td> |
|
221 | 221 | <td class="action"></td> |
222 | 222 | </tr> |
223 | 223 | <?php endif; ?> |
224 | 224 | <tr class="total"> |
225 | - <td class="name"><?php _e( 'Total:', 'invoicing' );?></td> |
|
226 | - <td class="total"><?php echo wpinv_price( $invoice->get_total(), $invoice->get_currency() );?></td> |
|
225 | + <td class="name"><?php _e('Total:', 'invoicing'); ?></td> |
|
226 | + <td class="total"><?php echo wpinv_price($invoice->get_total(), $invoice->get_currency()); ?></td> |
|
227 | 227 | <td class="action"></td> |
228 | 228 | </tr> |
229 | 229 | </table> |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | </table> |
235 | 235 | <div class="wpinv-actions"> |
236 | 236 | <?php |
237 | - if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) { |
|
237 | + if (!$invoice->is_paid() && !$invoice->is_refunded()) { |
|
238 | 238 | echo wpinv_item_dropdown( |
239 | 239 | array( |
240 | 240 | 'name' => 'wpinv_invoice_item', |
@@ -244,61 +244,61 @@ discard block |
||
244 | 244 | ) |
245 | 245 | ); |
246 | 246 | |
247 | - echo " " . '<button class="button button-primary" id="wpinv-add-item">' . sprintf( esc_html__( 'Add item to %s', 'invoicing' ), $invoice->get_label() ) . '</button>'; |
|
248 | - echo " " . '<button class="button button-primary" id="wpinv-new-item">' . esc_html__( 'Create new item', 'invoicing' ) . '</button>'; |
|
249 | - echo " " . '<button class="button button-primary wpinv-flr" id="wpinv-recalc-totals">' . esc_html__( 'Recalculate Totals', 'invoicing' ) . '</button>'; |
|
247 | + echo " " . '<button class="button button-primary" id="wpinv-add-item">' . sprintf(esc_html__('Add item to %s', 'invoicing'), $invoice->get_label()) . '</button>'; |
|
248 | + echo " " . '<button class="button button-primary" id="wpinv-new-item">' . esc_html__('Create new item', 'invoicing') . '</button>'; |
|
249 | + echo " " . '<button class="button button-primary wpinv-flr" id="wpinv-recalc-totals">' . esc_html__('Recalculate Totals', 'invoicing') . '</button>'; |
|
250 | 250 | |
251 | 251 | } |
252 | 252 | ?> |
253 | - <?php do_action( 'wpinv_invoice_items_actions', $invoice ); ?> |
|
253 | + <?php do_action('wpinv_invoice_items_actions', $invoice); ?> |
|
254 | 254 | </div> |
255 | 255 | </div> |
256 | 256 | <?php |
257 | 257 | } |
258 | 258 | |
259 | - public static function output_row( $columns, $item, $invoice, $class='even' ) { |
|
259 | + public static function output_row($columns, $item, $invoice, $class = 'even') { |
|
260 | 260 | |
261 | 261 | ?> |
262 | - <tr class="item item-<?php echo esc_attr( $class ); ?>" data-item-id="<?php echo esc_attr( $item->get_id() ); ?>"> |
|
263 | - <?php foreach ( array_keys( $columns ) as $column ) : ?> |
|
264 | - <td class="<?php echo esc_attr( $column ); echo 'total' == $column || 'qty' == $column ? ' hide-if-amount' : '' ?>"> |
|
262 | + <tr class="item item-<?php echo esc_attr($class); ?>" data-item-id="<?php echo esc_attr($item->get_id()); ?>"> |
|
263 | + <?php foreach (array_keys($columns) as $column) : ?> |
|
264 | + <td class="<?php echo esc_attr($column); echo 'total' == $column || 'qty' == $column ? ' hide-if-amount' : '' ?>"> |
|
265 | 265 | <?php |
266 | - switch ( $column ) { |
|
266 | + switch ($column) { |
|
267 | 267 | case 'id': |
268 | 268 | echo (int) $item->get_id(); |
269 | 269 | break; |
270 | 270 | case 'title': |
271 | 271 | printf( |
272 | 272 | '<a href="%s" target="_blank">%s</a>', |
273 | - get_edit_post_link( $item->get_id() ), |
|
274 | - esc_html( $item->get_raw_name() ) |
|
273 | + get_edit_post_link($item->get_id()), |
|
274 | + esc_html($item->get_raw_name()) |
|
275 | 275 | ); |
276 | 276 | |
277 | - $summary = apply_filters( 'getpaid_admin_invoice_line_item_summary', $item->get_description(), $item, $invoice ); |
|
278 | - if ( $summary !== '' ) { |
|
277 | + $summary = apply_filters('getpaid_admin_invoice_line_item_summary', $item->get_description(), $item, $invoice); |
|
278 | + if ($summary !== '') { |
|
279 | 279 | printf( |
280 | 280 | '<span class="meta">%s</span>', |
281 | - wpautop( wp_kses_post( $summary ) ) |
|
281 | + wpautop(wp_kses_post($summary)) |
|
282 | 282 | ); |
283 | 283 | } |
284 | 284 | |
285 | 285 | printf( |
286 | 286 | '<input type="hidden" value="%s" name="getpaid_items[%s][name]" class="getpaid-recalculate-prices-on-change" />', |
287 | - esc_attr( $item->get_raw_name() ), |
|
287 | + esc_attr($item->get_raw_name()), |
|
288 | 288 | (int) $item->get_id() |
289 | 289 | ); |
290 | 290 | |
291 | 291 | printf( |
292 | 292 | '<textarea style="display: none;" name="getpaid_items[%s][description]" class="getpaid-recalculate-prices-on-change">%s</textarea>', |
293 | 293 | (int) $item->get_id(), |
294 | - esc_attr( $item->get_description() ) |
|
294 | + esc_attr($item->get_description()) |
|
295 | 295 | ); |
296 | 296 | |
297 | 297 | break; |
298 | 298 | case 'price': |
299 | 299 | printf( |
300 | 300 | '<input type="text" value="%s" name="getpaid_items[%s][price]" style="width: 100px;" class="getpaid-admin-invoice-item-price getpaid-recalculate-prices-on-change" />', |
301 | - esc_attr( getpaid_unstandardize_amount( $item->get_price() ) ), |
|
301 | + esc_attr(getpaid_unstandardize_amount($item->get_price())), |
|
302 | 302 | (int) $item->get_id() |
303 | 303 | ); |
304 | 304 | |
@@ -306,26 +306,26 @@ discard block |
||
306 | 306 | case 'qty': |
307 | 307 | printf( |
308 | 308 | '<input type="text" style="width: 100px;" value="%s" name="getpaid_items[%s][quantity]" class="getpaid-admin-invoice-item-quantity getpaid-recalculate-prices-on-change" />', |
309 | - floatval( $item->get_quantity() ), |
|
309 | + floatval($item->get_quantity()), |
|
310 | 310 | (int) $item->get_id() |
311 | 311 | ); |
312 | 312 | |
313 | 313 | break; |
314 | 314 | case 'total': |
315 | - echo wpinv_price( $item->get_sub_total(), $invoice->get_currency() ); |
|
315 | + echo wpinv_price($item->get_sub_total(), $invoice->get_currency()); |
|
316 | 316 | |
317 | 317 | break; |
318 | 318 | case 'tax': |
319 | - echo wpinv_round_amount( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) . '%'; |
|
319 | + echo wpinv_round_amount(getpaid_get_invoice_tax_rate($invoice, $item), 2) . '%'; |
|
320 | 320 | |
321 | 321 | break; |
322 | 322 | case 'action': |
323 | - if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) { |
|
323 | + if (!$invoice->is_paid() && !$invoice->is_refunded()) { |
|
324 | 324 | echo '<i class="fa fa-trash wpinv-item-remove"></i>'; |
325 | 325 | } |
326 | 326 | break; |
327 | 327 | } |
328 | - do_action( 'getpaid_admin_edit_invoice_item_' . $column, $item, $invoice ); |
|
328 | + do_action('getpaid_admin_edit_invoice_item_' . $column, $item, $invoice); |
|
329 | 329 | ?> |
330 | 330 | </td> |
331 | 331 | <?php endforeach; ?> |
@@ -338,10 +338,10 @@ discard block |
||
338 | 338 | * |
339 | 339 | * @param WP_Post $post |
340 | 340 | */ |
341 | - public static function output2( $post ) { |
|
341 | + public static function output2($post) { |
|
342 | 342 | |
343 | 343 | // Prepare the invoice. |
344 | - $invoice = new WPInv_Invoice( $post ); |
|
344 | + $invoice = new WPInv_Invoice($post); |
|
345 | 345 | |
346 | 346 | // Invoice items. |
347 | 347 | $items = $invoice->get_items(); |
@@ -349,28 +349,28 @@ discard block |
||
349 | 349 | $totals = array( |
350 | 350 | |
351 | 351 | 'subtotal' => array( |
352 | - 'label' => __( 'Items Subtotal', 'invoicing' ), |
|
353 | - 'value' => wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() ), |
|
352 | + 'label' => __('Items Subtotal', 'invoicing'), |
|
353 | + 'value' => wpinv_price($invoice->get_subtotal(), $invoice->get_currency()), |
|
354 | 354 | ), |
355 | 355 | |
356 | 356 | 'discount' => array( |
357 | - 'label' => __( 'Total Discount', 'invoicing' ), |
|
358 | - 'value' => wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() ), |
|
357 | + 'label' => __('Total Discount', 'invoicing'), |
|
358 | + 'value' => wpinv_price($invoice->get_total_discount(), $invoice->get_currency()), |
|
359 | 359 | ), |
360 | 360 | |
361 | 361 | 'tax' => array( |
362 | - 'label' => __( 'Total Tax', 'invoicing' ), |
|
363 | - 'value' => wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() ), |
|
362 | + 'label' => __('Total Tax', 'invoicing'), |
|
363 | + 'value' => wpinv_price($invoice->get_total_tax(), $invoice->get_currency()), |
|
364 | 364 | ), |
365 | 365 | |
366 | 366 | 'total' => array( |
367 | - 'label' => __( 'Invoice Total', 'invoicing' ), |
|
368 | - 'value' => wpinv_price( $invoice->get_total(), $invoice->get_currency() ), |
|
367 | + 'label' => __('Invoice Total', 'invoicing'), |
|
368 | + 'value' => wpinv_price($invoice->get_total(), $invoice->get_currency()), |
|
369 | 369 | ) |
370 | 370 | ); |
371 | 371 | |
372 | - if ( ! wpinv_use_taxes() ) { |
|
373 | - unset( $totals['tax'] ); |
|
372 | + if (!wpinv_use_taxes()) { |
|
373 | + unset($totals['tax']); |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | $item_args = array( |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | 'orderby' => 'title', |
379 | 379 | 'order' => 'ASC', |
380 | 380 | 'posts_per_page' => -1, |
381 | - 'post_status' => array( 'publish' ), |
|
381 | + 'post_status' => array('publish'), |
|
382 | 382 | 'meta_query' => array( |
383 | 383 | array( |
384 | 384 | 'key' => '_wpinv_type', |
@@ -402,10 +402,10 @@ discard block |
||
402 | 402 | } |
403 | 403 | </style> |
404 | 404 | |
405 | - <div class="bsui getpaid-invoice-items-inner <?php echo empty( $items ) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem; padding: 0 12px 12px;"> |
|
405 | + <div class="bsui getpaid-invoice-items-inner <?php echo empty($items) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem; padding: 0 12px 12px;"> |
|
406 | 406 | |
407 | - <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?> |
|
408 | - <?php do_action( 'wpinv_meta_box_before_invoice_template_row', $invoice->get_id() ); ?> |
|
407 | + <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?> |
|
408 | + <?php do_action('wpinv_meta_box_before_invoice_template_row', $invoice->get_id()); ?> |
|
409 | 409 | |
410 | 410 | <div class="row"> |
411 | 411 | <div class="col-12 col-sm-6"> |
@@ -414,15 +414,15 @@ discard block |
||
414 | 414 | array( |
415 | 415 | 'id' => 'wpinv_template', |
416 | 416 | 'name' => 'wpinv_template', |
417 | - 'label' => __( 'Template', 'invoicing' ), |
|
417 | + 'label' => __('Template', 'invoicing'), |
|
418 | 418 | 'label_type' => 'vertical', |
419 | - 'placeholder' => __( 'Choose a template', 'invoicing' ), |
|
419 | + 'placeholder' => __('Choose a template', 'invoicing'), |
|
420 | 420 | 'class' => 'form-control-sm', |
421 | - 'value' => $invoice->get_template( 'edit' ), |
|
421 | + 'value' => $invoice->get_template('edit'), |
|
422 | 422 | 'options' => array( |
423 | - 'quantity' => __( 'Quantity', 'invoicing' ), |
|
424 | - 'hours' => __( 'Hours', 'invoicing' ), |
|
425 | - 'amount' => __( 'Amount Only', 'invoicing' ), |
|
423 | + 'quantity' => __('Quantity', 'invoicing'), |
|
424 | + 'hours' => __('Hours', 'invoicing'), |
|
425 | + 'amount' => __('Amount Only', 'invoicing'), |
|
426 | 426 | ), |
427 | 427 | 'data-allow-clear' => 'false', |
428 | 428 | 'select2' => true, |
@@ -438,11 +438,11 @@ discard block |
||
438 | 438 | array( |
439 | 439 | 'id' => 'wpinv_currency', |
440 | 440 | 'name' => 'wpinv_currency', |
441 | - 'label' => __( 'Currency', 'invoicing' ), |
|
441 | + 'label' => __('Currency', 'invoicing'), |
|
442 | 442 | 'label_type' => 'vertical', |
443 | - 'placeholder' => __( 'Select Invoice Currency', 'invoicing' ), |
|
443 | + 'placeholder' => __('Select Invoice Currency', 'invoicing'), |
|
444 | 444 | 'class' => 'form-control-sm', |
445 | - 'value' => $invoice->get_currency( 'edit' ), |
|
445 | + 'value' => $invoice->get_currency('edit'), |
|
446 | 446 | 'required' => false, |
447 | 447 | 'data-allow-clear' => 'false', |
448 | 448 | 'select2' => true, |
@@ -454,24 +454,24 @@ discard block |
||
454 | 454 | </div> |
455 | 455 | </div> |
456 | 456 | |
457 | - <?php do_action( 'wpinv_meta_box_invoice_template_row', $invoice->get_id() ); ?> |
|
457 | + <?php do_action('wpinv_meta_box_invoice_template_row', $invoice->get_id()); ?> |
|
458 | 458 | <?php endif; ?> |
459 | 459 | |
460 | 460 | <table cellpadding="0" cellspacing="0" class="getpaid_invoice_items"> |
461 | 461 | <thead> |
462 | 462 | <tr> |
463 | - <th class="getpaid-item" colspan="2"><?php _e( 'Item', 'invoicing' ) ?></th> |
|
463 | + <th class="getpaid-item" colspan="2"><?php _e('Item', 'invoicing') ?></th> |
|
464 | 464 | <th class="getpaid-quantity hide-if-amount text-right"> |
465 | - <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span> |
|
466 | - <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span> |
|
465 | + <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span> |
|
466 | + <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span> |
|
467 | 467 | </th> |
468 | 468 | <th class="getpaid-price hide-if-amount text-right"> |
469 | - <span class="getpaid-hide-if-hours"><?php _e( 'Price', 'invoicing' ) ?></span> |
|
470 | - <span class="getpaid-hide-if-quantity"><?php _e( 'Rate', 'invoicing' ) ?></span> |
|
469 | + <span class="getpaid-hide-if-hours"><?php _e('Price', 'invoicing') ?></span> |
|
470 | + <span class="getpaid-hide-if-quantity"><?php _e('Rate', 'invoicing') ?></span> |
|
471 | 471 | </th> |
472 | 472 | <th class="getpaid-item-subtotal text-right"> |
473 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e( 'Amount', 'invoicing' ) ?></span> |
|
474 | - <span class="hide-if-amount"><?php _e( 'Total', 'invoicing' ) ?></span> |
|
473 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e('Amount', 'invoicing') ?></span> |
|
474 | + <span class="hide-if-amount"><?php _e('Total', 'invoicing') ?></span> |
|
475 | 475 | </th> |
476 | 476 | <th class="getpaid-item-actions hide-if-not-editable" width="70px"> </th> |
477 | 477 | </tr> |
@@ -479,8 +479,8 @@ discard block |
||
479 | 479 | <tbody class="getpaid_invoice_line_items"> |
480 | 480 | <tr class="hide-if-has-items hide-if-not-editable"> |
481 | 481 | <td colspan="2" class="pt-4 pb-4"> |
482 | - <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Items', 'invoicing' ) ?></button> |
|
483 | - <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php _e( 'Create New Item', 'invoicing' ) ?></button> |
|
482 | + <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Items', 'invoicing') ?></button> |
|
483 | + <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php _e('Create New Item', 'invoicing') ?></button> |
|
484 | 484 | </td> |
485 | 485 | <td class="hide-if-amount"> </th> |
486 | 486 | <td class="hide-if-amount"> </th> |
@@ -512,11 +512,11 @@ discard block |
||
512 | 512 | <div class="col-12 col-sm-6 offset-sm-6"> |
513 | 513 | <table class="getpaid-invoice-totals text-right w-100"> |
514 | 514 | <tbody> |
515 | - <?php foreach ( apply_filters( 'getpaid_invoice_subtotal_rows', $totals, $invoice ) as $key => $data ) : ?> |
|
516 | - <tr class="getpaid-totals-<?php echo sanitize_html_class( $key ); ?>"> |
|
517 | - <td class="label"><?php echo esc_html( $data['label'] ) ?>:</td> |
|
515 | + <?php foreach (apply_filters('getpaid_invoice_subtotal_rows', $totals, $invoice) as $key => $data) : ?> |
|
516 | + <tr class="getpaid-totals-<?php echo sanitize_html_class($key); ?>"> |
|
517 | + <td class="label"><?php echo esc_html($data['label']) ?>:</td> |
|
518 | 518 | <td width="1%"></td> |
519 | - <td class="value"><?php echo wp_kses_post( $data['value'] ) ?></td> |
|
519 | + <td class="value"><?php echo wp_kses_post($data['value']) ?></td> |
|
520 | 520 | </tr> |
521 | 521 | <?php endforeach; ?> |
522 | 522 | </tbody> |
@@ -529,18 +529,18 @@ discard block |
||
529 | 529 | <div class="getpaid-invoice-item-actions hide-if-no-items hide-if-not-editable"> |
530 | 530 | <div class="row"> |
531 | 531 | <div class="text-left col-12 col-sm-8"> |
532 | - <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Item', 'invoicing' ) ?></button> |
|
533 | - <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php _e( 'Create New Item', 'invoicing' ) ?></button> |
|
534 | - <?php do_action( 'getpaid-invoice-items-actions', $invoice ); ?> |
|
532 | + <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Item', 'invoicing') ?></button> |
|
533 | + <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php _e('Create New Item', 'invoicing') ?></button> |
|
534 | + <?php do_action('getpaid-invoice-items-actions', $invoice); ?> |
|
535 | 535 | </div> |
536 | 536 | <div class="text-right col-12 col-sm-4"> |
537 | - <button type="button" class="button button-primary recalculate-totals-button"><?php _e( 'Recalculate Totals', 'invoicing' ) ?></button> |
|
537 | + <button type="button" class="button button-primary recalculate-totals-button"><?php _e('Recalculate Totals', 'invoicing') ?></button> |
|
538 | 538 | </div> |
539 | 539 | </div> |
540 | 540 | </div> |
541 | 541 | |
542 | 542 | <div class="getpaid-invoice-item-actions hide-if-editable"> |
543 | - <p class="description m-2 text-right text-muted"><?php _e( 'This invoice is no longer editable', 'invoicing' ); ?></p> |
|
543 | + <p class="description m-2 text-right text-muted"><?php _e('This invoice is no longer editable', 'invoicing'); ?></p> |
|
544 | 544 | </div> |
545 | 545 | |
546 | 546 | <!-- Add items to an invoice --> |
@@ -548,8 +548,8 @@ discard block |
||
548 | 548 | <div class="modal-dialog modal-dialog-centered" role="document"> |
549 | 549 | <div class="modal-content"> |
550 | 550 | <div class="modal-header"> |
551 | - <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e( "Add Item(s)", 'invoicing' ); ?></h5> |
|
552 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>"> |
|
551 | + <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e("Add Item(s)", 'invoicing'); ?></h5> |
|
552 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>"> |
|
553 | 553 | <span aria-hidden="true">×</span> |
554 | 554 | </button> |
555 | 555 | </div> |
@@ -557,10 +557,10 @@ discard block |
||
557 | 557 | <table class="widefat"> |
558 | 558 | <thead> |
559 | 559 | <tr> |
560 | - <th class="pl-0 text-left"><?php _e( 'Item', 'invoicing' ) ?></th> |
|
560 | + <th class="pl-0 text-left"><?php _e('Item', 'invoicing') ?></th> |
|
561 | 561 | <th class="pr-0 text-right hide-if-amount"> |
562 | - <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span> |
|
563 | - <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span> |
|
562 | + <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span> |
|
563 | + <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span> |
|
564 | 564 | </th> |
565 | 565 | </tr> |
566 | 566 | </thead> |
@@ -568,9 +568,9 @@ discard block |
||
568 | 568 | <tr> |
569 | 569 | <td class="pl-0 text-left"> |
570 | 570 | <select class="regular-text getpaid-add-invoice-item-select"> |
571 | - <option value="" selected="selected" disabled><?php esc_html_e( 'Select an item…', 'invoicing' ); ?></option> |
|
572 | - <?php foreach ( get_posts( $item_args ) as $item ) : ?> |
|
573 | - <option value="<?php echo (int) $item->ID; ?>"><?php echo esc_html( $item->post_title ); ?></option> |
|
571 | + <option value="" selected="selected" disabled><?php esc_html_e('Select an item…', 'invoicing'); ?></option> |
|
572 | + <?php foreach (get_posts($item_args) as $item) : ?> |
|
573 | + <option value="<?php echo (int) $item->ID; ?>"><?php echo esc_html($item->post_title); ?></option> |
|
574 | 574 | <?php endforeach; ?> |
575 | 575 | </select> |
576 | 576 | </td> |
@@ -582,8 +582,8 @@ discard block |
||
582 | 582 | </table> |
583 | 583 | </div> |
584 | 584 | <div class="modal-footer"> |
585 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button> |
|
586 | - <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e( 'Add', 'invoicing' ); ?></button> |
|
585 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button> |
|
586 | + <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e('Add', 'invoicing'); ?></button> |
|
587 | 587 | </div> |
588 | 588 | </div> |
589 | 589 | </div> |
@@ -594,8 +594,8 @@ discard block |
||
594 | 594 | <div class="modal-dialog modal-dialog-centered" role="document"> |
595 | 595 | <div class="modal-content"> |
596 | 596 | <div class="modal-header"> |
597 | - <h5 class="modal-title" id="getpaid-create-invoice-item-label"><?php _e( "Create Item", 'invoicing' ); ?></h5> |
|
598 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>"> |
|
597 | + <h5 class="modal-title" id="getpaid-create-invoice-item-label"><?php _e("Create Item", 'invoicing'); ?></h5> |
|
598 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>"> |
|
599 | 599 | <span aria-hidden="true">×</span> |
600 | 600 | </button> |
601 | 601 | </div> |
@@ -603,27 +603,27 @@ discard block |
||
603 | 603 | <div class="getpaid-create-item-div"> |
604 | 604 | <input type="hidden" name="id" value="new" class="form-control form-control-sm item-id"> |
605 | 605 | <label class="form-group w-100"> |
606 | - <span><?php _e( 'Name', 'invoicing' ); ?></span> |
|
607 | - <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name"> |
|
606 | + <span><?php _e('Name', 'invoicing'); ?></span> |
|
607 | + <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name"> |
|
608 | 608 | </label> |
609 | 609 | <label class="form-group w-100"> |
610 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e( 'Amount', 'invoicing' ); ?></span> |
|
611 | - <span class="hide-if-amount"><?php _e( 'Price', 'invoicing' ); ?></span> |
|
612 | - <input type="text" name="price" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control form-control-sm item-price"> |
|
610 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e('Amount', 'invoicing'); ?></span> |
|
611 | + <span class="hide-if-amount"><?php _e('Price', 'invoicing'); ?></span> |
|
612 | + <input type="text" name="price" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control form-control-sm item-price"> |
|
613 | 613 | </label> |
614 | 614 | <label class="form-group w-100 hide-if-amount"> |
615 | - <span><?php _e( 'Quantity', 'invoicing' ); ?></span> |
|
615 | + <span><?php _e('Quantity', 'invoicing'); ?></span> |
|
616 | 616 | <input type="text" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity"> |
617 | 617 | </label> |
618 | 618 | <label class="form-group w-100"> |
619 | - <span><?php _e( 'Item Description', 'invoicing' ); ?></span> |
|
620 | - <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea> |
|
619 | + <span><?php _e('Item Description', 'invoicing'); ?></span> |
|
620 | + <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea> |
|
621 | 621 | </label> |
622 | 622 | </div> |
623 | 623 | </div> |
624 | 624 | <div class="modal-footer"> |
625 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button> |
|
626 | - <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e( 'Create', 'invoicing' ); ?></button> |
|
625 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button> |
|
626 | + <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e('Create', 'invoicing'); ?></button> |
|
627 | 627 | </div> |
628 | 628 | </div> |
629 | 629 | </div> |
@@ -634,8 +634,8 @@ discard block |
||
634 | 634 | <div class="modal-dialog modal-dialog-centered" role="document"> |
635 | 635 | <div class="modal-content"> |
636 | 636 | <div class="modal-header"> |
637 | - <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e( "Edit Item", 'invoicing' ); ?></h5> |
|
638 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>"> |
|
637 | + <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e("Edit Item", 'invoicing'); ?></h5> |
|
638 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>"> |
|
639 | 639 | <span aria-hidden="true">×</span> |
640 | 640 | </button> |
641 | 641 | </div> |
@@ -643,27 +643,27 @@ discard block |
||
643 | 643 | <div class="getpaid-edit-item-div"> |
644 | 644 | <input type="hidden" name="id" class="form-control form-control-sm item-id"> |
645 | 645 | <label class="form-group w-100"> |
646 | - <span><?php _e( 'Name', 'invoicing' ); ?></span> |
|
647 | - <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name"> |
|
646 | + <span><?php _e('Name', 'invoicing'); ?></span> |
|
647 | + <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name"> |
|
648 | 648 | </label> |
649 | 649 | <label class="form-group w-100"> |
650 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e( 'Amount', 'invoicing' ); ?></span> |
|
651 | - <span class="hide-if-amount"><?php _e( 'Price', 'invoicing' ); ?></span> |
|
652 | - <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount( 0 ); ?>" class="form-control form-control-sm item-price"> |
|
650 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e('Amount', 'invoicing'); ?></span> |
|
651 | + <span class="hide-if-amount"><?php _e('Price', 'invoicing'); ?></span> |
|
652 | + <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount(0); ?>" class="form-control form-control-sm item-price"> |
|
653 | 653 | </label> |
654 | 654 | <label class="form-group w-100 hide-if-amount"> |
655 | - <span><?php _e( 'Quantity', 'invoicing' ); ?></span> |
|
655 | + <span><?php _e('Quantity', 'invoicing'); ?></span> |
|
656 | 656 | <input type="text" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity"> |
657 | 657 | </label> |
658 | 658 | <label class="form-group w-100"> |
659 | - <span><?php _e( 'Item Description', 'invoicing' ); ?></span> |
|
660 | - <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea> |
|
659 | + <span><?php _e('Item Description', 'invoicing'); ?></span> |
|
660 | + <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea> |
|
661 | 661 | </label> |
662 | 662 | </div> |
663 | 663 | </div> |
664 | 664 | <div class="modal-footer"> |
665 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button> |
|
666 | - <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e( 'Save', 'invoicing' ); ?></button> |
|
665 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button> |
|
666 | + <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e('Save', 'invoicing'); ?></button> |
|
667 | 667 | </div> |
668 | 668 | </div> |
669 | 669 | </div> |
@@ -4,68 +4,68 @@ |
||
4 | 4 | * |
5 | 5 | */ |
6 | 6 | |
7 | -defined( 'ABSPATH' ) || exit; |
|
7 | +defined('ABSPATH') || exit; |
|
8 | 8 | |
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <div class="card shadow-sm my-5"> |
12 | 12 | <div class="text-center card-body"> |
13 | - <h1 class="h3"><?php esc_html_e( 'Awesome, you are ready to Get Paid', 'invoicing' ); ?></h1> |
|
13 | + <h1 class="h3"><?php esc_html_e('Awesome, you are ready to Get Paid', 'invoicing'); ?></h1> |
|
14 | 14 | |
15 | 15 | <div class="geodirectory-message geodirectory-tracker"> |
16 | - <p><?php _e( 'Thank you for choosing GetPaid!', 'invoicing' ); ?> <i class="far fa-smile-beam"></i></p> |
|
16 | + <p><?php _e('Thank you for choosing GetPaid!', 'invoicing'); ?> <i class="far fa-smile-beam"></i></p> |
|
17 | 17 | </div> |
18 | 18 | |
19 | 19 | <div class="gp-setup-next-steps"> |
20 | 20 | <div class="gp-setup-next-steps-first mb-4"> |
21 | 21 | <div> |
22 | - <h2 class="h3"><i class="fas fa-arrow-down"></i> <?php esc_html_e( 'Watch This', 'invoicing' ); ?> <i class="fas fa-arrow-down"></i></h2> |
|
22 | + <h2 class="h3"><i class="fas fa-arrow-down"></i> <?php esc_html_e('Watch This', 'invoicing'); ?> <i class="fas fa-arrow-down"></i></h2> |
|
23 | 23 | <div class="embed-responsive embed-responsive-16by9 mb-4"> |
24 | 24 | <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/TXZuPXHjt9E?rel=0" allowfullscreen></iframe> |
25 | 25 | </div> |
26 | 26 | </div> |
27 | - <h2 class="h3"><?php esc_html_e( 'Next steps', 'invoicing' ); ?></h2> |
|
27 | + <h2 class="h3"><?php esc_html_e('Next steps', 'invoicing'); ?></h2> |
|
28 | 28 | |
29 | 29 | <div class="d-flex justify-content-between"> |
30 | 30 | <a |
31 | 31 | class="btn btn-outline-primary btn-sm" |
32 | - href="<?php echo esc_url( admin_url( 'post-new.php?post_type=wpi_item' ) ); ?>"> |
|
32 | + href="<?php echo esc_url(admin_url('post-new.php?post_type=wpi_item')); ?>"> |
|
33 | 33 | <span class="h1 d-block"><i class="fas fa-box-open"></i></span> |
34 | - <?php esc_html_e( 'Create Item', 'invoicing' ); ?> |
|
34 | + <?php esc_html_e('Create Item', 'invoicing'); ?> |
|
35 | 35 | </a> |
36 | 36 | <a |
37 | 37 | class="btn btn-outline-primary btn-sm" |
38 | - href="<?php echo esc_url( admin_url( 'post-new.php?post_type=wpi_payment_form' ) ); ?>"> |
|
38 | + href="<?php echo esc_url(admin_url('post-new.php?post_type=wpi_payment_form')); ?>"> |
|
39 | 39 | <span class="h1 d-block"><i class="fas fa-align-justify"></i></span> |
40 | - <?php esc_html_e( 'Create Payment Form', 'invoicing' ); ?> |
|
40 | + <?php esc_html_e('Create Payment Form', 'invoicing'); ?> |
|
41 | 41 | </a> |
42 | 42 | <a |
43 | 43 | class="btn btn-outline-primary btn-sm" |
44 | - href="<?php echo esc_url( admin_url( 'post-new.php?post_type=wpi_invoice' ) ); ?>"> |
|
44 | + href="<?php echo esc_url(admin_url('post-new.php?post_type=wpi_invoice')); ?>"> |
|
45 | 45 | <span class="h1 d-block"><i class="fas fa-file-alt"></i></span> |
46 | - <?php esc_html_e( 'Create Invoice', 'invoicing' ); ?> |
|
46 | + <?php esc_html_e('Create Invoice', 'invoicing'); ?> |
|
47 | 47 | </a> |
48 | 48 | </div> |
49 | 49 | |
50 | 50 | |
51 | 51 | |
52 | - <h2 class="h3 mt-4"><?php _e( 'Learn more', 'invoicing' ); ?></h2> |
|
52 | + <h2 class="h3 mt-4"><?php _e('Learn more', 'invoicing'); ?></h2> |
|
53 | 53 | <div class="gp-setup-next-steps-last mt-2 d-flex justify-content-between"> |
54 | 54 | <a |
55 | 55 | class="btn btn-outline-primary btn-sm" href="https://docs.wpgetpaid.com/collection/114-getting-started?utm_source=setupwizard&utm_medium=product&utm_content=getting-started&utm_campaign=invoicingplugin" |
56 | - target="_blank"><?php esc_html_e( 'Getting Started', 'invoicing' ); ?></a> |
|
56 | + target="_blank"><?php esc_html_e('Getting Started', 'invoicing'); ?></a> |
|
57 | 57 | <a |
58 | 58 | class="btn btn-outline-primary btn-sm" |
59 | 59 | href="https://docs.wpgetpaid.com/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=invoicingplugin" |
60 | - target="_blank"><?php esc_html_e( 'Documentation', 'invoicing' ); ?></a> |
|
60 | + target="_blank"><?php esc_html_e('Documentation', 'invoicing'); ?></a> |
|
61 | 61 | <a |
62 | 62 | class="btn btn-outline-primary btn-sm" |
63 | 63 | href="https://wpgetpaid.com/support/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=invoicingyplugin" |
64 | - target="_blank"><?php esc_html_e( 'Support', 'invoicing' ); ?></a> |
|
64 | + target="_blank"><?php esc_html_e('Support', 'invoicing'); ?></a> |
|
65 | 65 | <a |
66 | 66 | class="btn btn-outline-primary btn-sm" |
67 | 67 | href="https://demos.ayecode.io/getpaid/?utm_source=setupwizard&utm_medium=product&utm_content=demos&utm_campaign=invoicingyplugin" |
68 | - target="_blank"><?php esc_html_e( 'Demos', 'invoicing' ); ?></a> |
|
68 | + target="_blank"><?php esc_html_e('Demos', 'invoicing'); ?></a> |
|
69 | 69 | </div> |
70 | 70 | </div> |
71 | 71 | </div> |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | */ |
16 | 16 | |
17 | 17 | if ( ! defined( 'ABSPATH' ) ) { |
18 | - exit; |
|
18 | + exit; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | if ( ! class_exists( 'AyeCode_Deactivation_Survey' ) ) { |
22 | - // include the class if needed |
|
23 | - include_once( dirname( __FILE__ ) . "/wp-deactivation-survey.php" ); |
|
22 | + // include the class if needed |
|
23 | + include_once( dirname( __FILE__ ) . "/wp-deactivation-survey.php" ); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
@@ -36,6 +36,6 @@ discard block |
||
36 | 36 | //}); |
37 | 37 | |
38 | 38 | AyeCode_Deactivation_Survey::instance(array( |
39 | - 'slug' => 'ayecode-deactivation-survey-testing', |
|
40 | - 'version' => '1.0.0' |
|
39 | + 'slug' => 'ayecode-deactivation-survey-testing', |
|
40 | + 'version' => '1.0.0' |
|
41 | 41 | )); |
42 | 42 | \ No newline at end of file |
@@ -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 |
@@ -7,33 +7,33 @@ |
||
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( 'Field Label', 'invoicing' ); ?></span> |
|
16 | + <span><?php esc_html_e('Field Label', 'invoicing'); ?></span> |
|
17 | 17 | <input v-model='active_form_element.label' class='form-control' type="text"/> |
18 | 18 | </label> |
19 | 19 | </div> |
20 | 20 | |
21 | 21 | <div class='form-group'> |
22 | 22 | <label class="d-block"> |
23 | - <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span> |
|
23 | + <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span> |
|
24 | 24 | <input v-model='active_form_element.placeholder' class='form-control' type="text"/> |
25 | 25 | </label> |
26 | 26 | </div> |
27 | 27 | |
28 | 28 | <div class='form-group'> |
29 | 29 | <label class="d-block"> |
30 | - <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span> |
|
31 | - <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 | - <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small> |
|
30 | + <span><?php esc_html_e('Help Text', 'invoicing'); ?></span> |
|
31 | + <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 | + <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small> |
|
33 | 33 | </label> |
34 | 34 | </div> |
35 | 35 | |
36 | 36 | <div class='form-group form-check'> |
37 | 37 | <input :id="active_form_element.id + '_edit_hide'" v-model='active_form_element.hide_billing_email' type='checkbox' class='form-check-input' /> |
38 | - <label class='form-check-label' :for="active_form_element.id + '_edit_hide'"><?php esc_html_e( 'Hide if the user is logged in', 'invoicing' ); ?></label> |
|
38 | + <label class='form-check-label' :for="active_form_element.id + '_edit_hide'"><?php esc_html_e('Hide if the user is logged in', 'invoicing'); ?></label> |
|
39 | 39 | </div> |
@@ -7,49 +7,49 @@ |
||
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( 'Field Label', 'invoicing' ); ?></span> |
|
16 | + <span><?php esc_html_e('Field Label', 'invoicing'); ?></span> |
|
17 | 17 | <input v-model='active_form_element.label' class='form-control' type="text"/> |
18 | 18 | </label> |
19 | 19 | </div> |
20 | 20 | |
21 | 21 | <div class='form-group'> |
22 | 22 | <label class="d-block"> |
23 | - <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span> |
|
23 | + <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span> |
|
24 | 24 | <input v-model='active_form_element.placeholder' class='form-control' type="text"/> |
25 | 25 | </label> |
26 | 26 | </div> |
27 | 27 | |
28 | 28 | <div class='form-group'> |
29 | 29 | <label class="d-block"> |
30 | - <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span> |
|
31 | - <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 | - <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small> |
|
30 | + <span><?php esc_html_e('Help Text', 'invoicing'); ?></span> |
|
31 | + <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 | + <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small> |
|
33 | 33 | </label> |
34 | 34 | </div> |
35 | 35 | |
36 | 36 | <div class='form-group form-check'> |
37 | 37 | <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' /> |
38 | - <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label> |
|
38 | + <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label> |
|
39 | 39 | </div> |
40 | 40 | |
41 | 41 | <div class='form-group form-check'> |
42 | 42 | <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' /> |
43 | - <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label> |
|
43 | + <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label> |
|
44 | 44 | </div> |
45 | 45 | |
46 | 46 | <hr class='featurette-divider mt-4'> |
47 | 47 | |
48 | 48 | <div class='form-group'> |
49 | 49 | <label class="d-block"> |
50 | - <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span> |
|
50 | + <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span> |
|
51 | 51 | <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" /> |
52 | - <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span> |
|
52 | + <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span> |
|
53 | 53 | </label> |
54 | 54 | </div> |
55 | 55 |