Easy Digital Downloads - Version 2.9.25

Version Description

Download this release

Release Info

Developer cklosows
Plugin Icon 128x128 Easy Digital Downloads
Version 2.9.25
Comparing to
See all releases

Code changes from version 2.9.24 to 2.9.25

easy-digital-downloads.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Sandhills Development, LLC
7
  * Author URI: https://sandhillsdev.com
8
- * Version: 2.9.24
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
@@ -25,7 +25,7 @@
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
- * @version 2.9.24
29
  */
30
 
31
  // Exit if accessed directly.
@@ -206,7 +206,7 @@ final class Easy_Digital_Downloads {
206
 
207
  // Plugin version.
208
  if ( ! defined( 'EDD_VERSION' ) ) {
209
- define( 'EDD_VERSION', '2.9.24' );
210
  }
211
 
212
  // Plugin Folder Path.
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Sandhills Development, LLC
7
  * Author URI: https://sandhillsdev.com
8
+ * Version: 2.9.25
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
+ * @version 2.9.25
29
  */
30
 
31
  // Exit if accessed directly.
206
 
207
  // Plugin version.
208
  if ( ! defined( 'EDD_VERSION' ) ) {
209
+ define( 'EDD_VERSION', '2.9.25' );
210
  }
211
 
212
  // Plugin Folder Path.
includes/admin/discounts/class-discount-codes-table.php CHANGED
@@ -86,7 +86,7 @@ class EDD_Discount_Codes_Table extends WP_List_Table {
86
  * @param string $text Label for the search box
87
  * @param string $input_id ID of the search box
88
  *
89
- * @return svoid
90
  */
91
  public function search_box( $text, $input_id ) {
92
  if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
86
  * @param string $text Label for the search box
87
  * @param string $input_id ID of the search box
88
  *
89
+ * @return void
90
  */
91
  public function search_box( $text, $input_id ) {
92
  if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
includes/login-register.php CHANGED
@@ -148,9 +148,12 @@ function edd_log_user_in( $user_id, $user_login, $user_pass, $remember = false )
148
  '</a>'
149
  )
150
  );
151
- }
 
 
152
 
153
- do_action( 'edd_log_user_in', $user_id, $user_login, $user_pass );
 
154
 
155
  return $user;
156
 
@@ -166,64 +169,66 @@ function edd_log_user_in( $user_id, $user_login, $user_pass, $remember = false )
166
  */
167
  function edd_process_register_form( $data ) {
168
 
169
- if( is_user_logged_in() ) {
170
  return;
171
  }
172
 
173
- if( empty( $_POST['edd_register_submit'] ) ) {
174
  return;
175
  }
176
 
177
  do_action( 'edd_pre_process_register_form' );
178
 
179
- if( empty( $data['edd_user_login'] ) ) {
180
  edd_set_error( 'empty_username', __( 'Invalid username', 'easy-digital-downloads' ) );
181
  }
182
 
183
- if( username_exists( $data['edd_user_login'] ) ) {
184
  edd_set_error( 'username_unavailable', __( 'Username already taken', 'easy-digital-downloads' ) );
185
  }
186
 
187
- if( ! validate_username( $data['edd_user_login'] ) ) {
188
  edd_set_error( 'username_invalid', __( 'Invalid username', 'easy-digital-downloads' ) );
189
  }
190
 
191
- if( email_exists( $data['edd_user_email'] ) ) {
192
  edd_set_error( 'email_unavailable', __( 'Email address already taken', 'easy-digital-downloads' ) );
193
  }
194
 
195
- if( empty( $data['edd_user_email'] ) || ! is_email( $data['edd_user_email'] ) ) {
196
  edd_set_error( 'email_invalid', __( 'Invalid email', 'easy-digital-downloads' ) );
197
  }
198
 
199
- if( ! empty( $data['edd_payment_email'] ) && $data['edd_payment_email'] != $data['edd_user_email'] && ! is_email( $data['edd_payment_email'] ) ) {
200
  edd_set_error( 'payment_email_invalid', __( 'Invalid payment email', 'easy-digital-downloads' ) );
201
  }
202
 
203
- if( empty( $_POST['edd_user_pass'] ) ) {
204
  edd_set_error( 'empty_password', __( 'Please enter a password', 'easy-digital-downloads' ) );
205
  }
206
 
207
- if( ( ! empty( $_POST['edd_user_pass'] ) && empty( $_POST['edd_user_pass2'] ) ) || ( $_POST['edd_user_pass'] !== $_POST['edd_user_pass2'] ) ) {
208
  edd_set_error( 'password_mismatch', __( 'Passwords do not match', 'easy-digital-downloads' ) );
209
  }
210
 
211
  do_action( 'edd_process_register_form' );
212
 
213
- // Check for errors and redirect if none present
214
  $errors = edd_get_errors();
215
 
216
- if ( empty( $errors ) ) {
217
 
218
  $redirect = apply_filters( 'edd_register_redirect', $data['edd_redirect'] );
219
 
220
- edd_register_and_login_new_user( array(
221
- 'user_login' => $data['edd_user_login'],
222
- 'user_pass' => $data['edd_user_pass'],
223
- 'user_email' => $data['edd_user_email'],
224
- 'user_registered' => date( 'Y-m-d H:i:s' ),
225
- 'role' => get_option( 'default_role' )
226
- ) );
 
 
227
 
228
  wp_redirect( $redirect );
229
  edd_die();
148
  '</a>'
149
  )
150
  );
151
+ } else {
152
+ // Since wp_signon doesn't set the current user, we need to do this.
153
+ wp_set_current_user( $user->ID );
154
 
155
+ do_action( 'edd_log_user_in', $user_id, $user_login, $user_pass );
156
+ }
157
 
158
  return $user;
159
 
169
  */
170
  function edd_process_register_form( $data ) {
171
 
172
+ if ( is_user_logged_in() ) {
173
  return;
174
  }
175
 
176
+ if ( empty( $_POST['edd_register_submit'] ) ) {
177
  return;
178
  }
179
 
180
  do_action( 'edd_pre_process_register_form' );
181
 
182
+ if ( empty( $data['edd_user_login'] ) ) {
183
  edd_set_error( 'empty_username', __( 'Invalid username', 'easy-digital-downloads' ) );
184
  }
185
 
186
+ if ( username_exists( $data['edd_user_login'] ) ) {
187
  edd_set_error( 'username_unavailable', __( 'Username already taken', 'easy-digital-downloads' ) );
188
  }
189
 
190
+ if ( ! validate_username( $data['edd_user_login'] ) ) {
191
  edd_set_error( 'username_invalid', __( 'Invalid username', 'easy-digital-downloads' ) );
192
  }
193
 
194
+ if ( email_exists( $data['edd_user_email'] ) ) {
195
  edd_set_error( 'email_unavailable', __( 'Email address already taken', 'easy-digital-downloads' ) );
196
  }
197
 
198
+ if ( empty( $data['edd_user_email'] ) || ! is_email( $data['edd_user_email'] ) ) {
199
  edd_set_error( 'email_invalid', __( 'Invalid email', 'easy-digital-downloads' ) );
200
  }
201
 
202
+ if ( ! empty( $data['edd_payment_email'] ) && $data['edd_payment_email'] != $data['edd_user_email'] && ! is_email( $data['edd_payment_email'] ) ) {
203
  edd_set_error( 'payment_email_invalid', __( 'Invalid payment email', 'easy-digital-downloads' ) );
204
  }
205
 
206
+ if ( empty( $_POST['edd_user_pass'] ) ) {
207
  edd_set_error( 'empty_password', __( 'Please enter a password', 'easy-digital-downloads' ) );
208
  }
209
 
210
+ if ( ( ! empty( $_POST['edd_user_pass'] ) && empty( $_POST['edd_user_pass2'] ) ) || ( $_POST['edd_user_pass'] !== $_POST['edd_user_pass2'] ) ) {
211
  edd_set_error( 'password_mismatch', __( 'Passwords do not match', 'easy-digital-downloads' ) );
212
  }
213
 
214
  do_action( 'edd_process_register_form' );
215
 
216
+ // Check for errors and redirect if none present.
217
  $errors = edd_get_errors();
218
 
219
+ if ( empty( $errors ) ) {
220
 
221
  $redirect = apply_filters( 'edd_register_redirect', $data['edd_redirect'] );
222
 
223
+ edd_register_and_login_new_user(
224
+ array(
225
+ 'user_login' => $data['edd_user_login'],
226
+ 'user_pass' => $data['edd_user_pass'],
227
+ 'user_email' => $data['edd_user_email'],
228
+ 'user_registered' => date( 'Y-m-d H:i:s' ),
229
+ 'role' => get_option( 'default_role' ),
230
+ )
231
+ );
232
 
233
  wp_redirect( $redirect );
234
  edd_die();
includes/process-purchase.php CHANGED
@@ -25,15 +25,15 @@ function edd_process_purchase_form() {
25
 
26
  do_action( 'edd_pre_process_purchase' );
27
 
28
- // Make sure the cart isn't empty
29
  if ( ! edd_get_cart_contents() && ! edd_cart_has_fees() ) {
30
  $valid_data = false;
31
  edd_set_error( 'empty_cart', __( 'Your cart is empty', 'easy-digital-downloads' ) );
32
  } else {
33
- // Validate the form $_POST data
34
  $valid_data = edd_purchase_form_validate_fields();
35
 
36
- // Allow themes and plugins to hook to errors
37
  do_action( 'edd_checkout_error_checks', $valid_data, $_POST );
38
  }
39
 
@@ -52,15 +52,15 @@ function edd_process_purchase_form() {
52
  }
53
  }
54
 
55
- // Process the login form
56
  if ( isset( $_POST['edd_login_submit'] ) ) {
57
  edd_process_purchase_login();
58
  }
59
 
60
- // Validate the user
61
  $user = edd_get_purchase_form_user( $valid_data );
62
 
63
- // Let extensions validate fields after user is logged in if user has used login/registration form
64
  do_action( 'edd_checkout_user_error_checks', $user, $valid_data, $_POST );
65
 
66
  if ( false === $valid_data || edd_get_errors() || ! $user ) {
@@ -77,7 +77,7 @@ function edd_process_purchase_form() {
77
  edd_die();
78
  }
79
 
80
- // Setup user information
81
  $user_info = array(
82
  'id' => $user['user_id'],
83
  'email' => $user['user_email'],
@@ -87,7 +87,7 @@ function edd_process_purchase_form() {
87
  'address' => ! empty( $user['address'] ) ? $user['address'] : array(),
88
  );
89
 
90
- // Update a customer record if they have added/updated information
91
  $customer = new EDD_Customer( $user_info['email'] );
92
 
93
  $name = $user_info['first_name'] . ' ' . $user_info['last_name'];
@@ -96,7 +96,7 @@ function edd_process_purchase_form() {
96
  'name' => $name
97
  );
98
 
99
- // Update the customer's name and update the user record too
100
  $customer->update( $update_data );
101
  wp_update_user( array(
102
  'ID' => get_current_user_id(),
@@ -105,7 +105,7 @@ function edd_process_purchase_form() {
105
  ) );
106
  }
107
 
108
- // Update the customer's address if different to what's in the database
109
  $address = get_user_meta( $customer->user_id, '_edd_user_address', true );
110
  if ( ! is_array( $address ) ) {
111
  $address = array();
@@ -127,20 +127,20 @@ function edd_process_purchase_form() {
127
 
128
  if ( ! empty( $existing_payment ) ) {
129
  $payment = new EDD_Payment( $existing_payment );
130
- if( $payment->is_recoverable() && ! empty( $payment->key ) ) {
131
  $purchase_key = $payment->key;
132
  }
133
  }
134
 
135
- // Setup purchase information
136
  $purchase_data = array(
137
  'downloads' => edd_get_cart_contents(),
138
- 'fees' => edd_get_cart_fees(), // Any arbitrary fees that have been added to the cart
139
- 'subtotal' => edd_get_cart_subtotal(), // Amount before taxes and discounts
140
- 'discount' => edd_get_cart_discounted_amount(), // Discounted amount
141
- 'tax' => edd_get_cart_tax(), // Taxed amount
142
- 'tax_rate' => edd_use_taxes() ? edd_get_cart_tax_rate( $card_country, $card_state, $card_zip ) : 0, // Tax rate
143
- 'price' => edd_get_cart_total(), // Amount after taxes
144
  'purchase_key' => $purchase_key,
145
  'user_email' => $user['user_email'],
146
  'date' => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ),
@@ -151,36 +151,37 @@ function edd_process_purchase_form() {
151
  'card_info' => $valid_data['cc_info']
152
  );
153
 
154
- // Add the user data for hooks
155
  $valid_data['user'] = $user;
156
 
157
- // Allow themes and plugins to hook before the gateway
158
  do_action( 'edd_checkout_before_gateway', $_POST, $user_info, $valid_data );
159
 
160
- // If the total amount in the cart is 0, send to the manual gateway. This emulates a free download purchase
161
- if ( !$purchase_data['price'] ) {
162
- // Revert to manual
 
163
  $purchase_data['gateway'] = 'manual';
164
  $_POST['edd-gateway'] = 'manual';
165
  }
166
 
167
- // Allow the purchase data to be modified before it is sent to the gateway
168
  $purchase_data = apply_filters(
169
  'edd_purchase_data_before_gateway',
170
  $purchase_data,
171
  $valid_data
172
  );
173
 
174
- // Setup the data we're storing in the purchase session
175
  $session_data = $purchase_data;
176
 
177
- // Make sure credit card numbers are never stored in sessions
178
  unset( $session_data['card_info']['card_number'] );
179
 
180
  // Used for showing download links to non logged-in users after purchase, and for other plugins needing purchase data.
181
  edd_set_purchase_session( $session_data );
182
 
183
- // Send info to the gateway for payment processing
184
  edd_send_to_gateway( $purchase_data['gateway'], $purchase_data );
185
  edd_die();
186
  }
@@ -277,54 +278,56 @@ add_action( 'wp_ajax_nopriv_edd_process_checkout_login', 'edd_process_purchase_l
277
  * @return bool|array
278
  */
279
  function edd_purchase_form_validate_fields() {
280
- // Check if there is $_POST
281
- if ( empty( $_POST ) ) return false;
 
 
282
 
283
- // Start an array to collect valid data
284
  $valid_data = array(
285
- 'gateway' => edd_purchase_form_validate_gateway(), // Gateway fallback
286
- 'discount' => edd_purchase_form_validate_discounts(), // Set default discount
287
- 'need_new_user' => false, // New user flag
288
- 'need_user_login' => false, // Login user flag
289
- 'logged_user_data' => array(), // Logged user collected data
290
- 'new_user_data' => array(), // New user collected data
291
- 'login_user_data' => array(), // Login user collected data
292
- 'guest_user_data' => array(), // Guest user collected data
293
- 'cc_info' => edd_purchase_form_validate_cc() // Credit card info
294
  );
295
 
296
- // Validate agree to terms
297
  if ( '1' === edd_get_option( 'show_agree_to_terms', false ) ) {
298
  edd_purchase_form_validate_agree_to_terms();
299
  }
300
 
301
- // Validate agree to privacy policy
302
  if ( '1' === edd_get_option( 'show_agree_to_privacy_policy', false ) ) {
303
  edd_purchase_form_validate_agree_to_privacy_policy();
304
  }
305
 
306
  if ( is_user_logged_in() ) {
307
- // Collect logged in user data
308
  $valid_data['logged_in_user'] = edd_purchase_form_validate_logged_in_user();
309
- } else if ( isset( $_POST['edd-purchase-var'] ) && $_POST['edd-purchase-var'] == 'needs-to-register' ) {
310
- // Set new user registration as required
311
  $valid_data['need_new_user'] = true;
312
 
313
- // Validate new user data
314
  $valid_data['new_user_data'] = edd_purchase_form_validate_new_user();
315
- // Check if login validation is needed
316
- } else if ( isset( $_POST['edd-purchase-var'] ) && $_POST['edd-purchase-var'] == 'needs-to-login' ) {
317
- // Set user login as required
318
  $valid_data['need_user_login'] = true;
319
 
320
- // Validate users login info
321
  $valid_data['login_user_data'] = edd_purchase_form_validate_user_login();
322
  } else {
323
- // Not registering or logging in, so setup guest user data
324
  $valid_data['guest_user_data'] = edd_purchase_form_validate_guest_user();
325
  }
326
 
327
- // Return collected data
328
  return $valid_data;
329
  }
330
 
@@ -562,47 +565,51 @@ function edd_purchase_form_validate_logged_in_user() {
562
  function edd_purchase_form_validate_new_user() {
563
  $registering_new_user = false;
564
 
565
- // Start an empty array to collect valid user data
566
  $valid_user_data = array(
567
- // Assume there will be errors
568
- 'user_id' => -1,
569
- // Get first name
570
- 'user_first' => isset( $_POST["edd_first"] ) ? sanitize_text_field( $_POST["edd_first"] ) : '',
571
- // Get last name
572
- 'user_last' => isset( $_POST["edd_last"] ) ? sanitize_text_field( $_POST["edd_last"] ) : '',
573
  );
574
 
575
- // Check the new user's credentials against existing ones
576
- $user_login = isset( $_POST["edd_user_login"] ) ? trim( $_POST["edd_user_login"] ) : false;
 
 
577
  $user_email = isset( $_POST['edd_email'] ) ? trim( $_POST['edd_email'] ) : false;
578
- $user_pass = isset( $_POST["edd_user_pass"] ) ? trim( $_POST["edd_user_pass"] ) : false;
579
- $pass_confirm = isset( $_POST["edd_user_pass_confirm"] ) ? trim( $_POST["edd_user_pass_confirm"] ) : false;
 
 
580
 
581
- // Loop through required fields and show error messages
582
  foreach ( edd_purchase_form_required_fields() as $field_name => $value ) {
 
583
  if ( in_array( $value, edd_purchase_form_required_fields() ) && empty( $_POST[ $field_name ] ) ) {
584
  edd_set_error( $value['error_id'], $value['error_message'] );
585
  }
586
  }
587
 
588
- // Check if we have an username to register
589
  if ( $user_login && strlen( $user_login ) > 0 ) {
590
  $registering_new_user = true;
591
 
592
- // We have an user name, check if it already exists
593
  if ( username_exists( $user_login ) ) {
594
- // Username already registered
595
  edd_set_error( 'username_unavailable', __( 'Username already taken', 'easy-digital-downloads' ) );
596
- // Check if it's valid
597
- } else if ( ! edd_validate_username( $user_login ) ) {
598
- // Invalid username
599
  if ( is_multisite() ) {
600
  edd_set_error( 'username_invalid', __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed', 'easy-digital-downloads' ) );
601
  } else {
602
  edd_set_error( 'username_invalid', __( 'Invalid username', 'easy-digital-downloads' ) );
603
  }
604
  } else {
605
- // All the checks have run and it's good to go
606
  $valid_user_data['user_login'] = $user_login;
607
  }
608
  } else {
@@ -611,43 +618,43 @@ function edd_purchase_form_validate_new_user() {
611
  }
612
  }
613
 
614
- // Check if we have an email to verify
615
  if ( $user_email && strlen( $user_email ) > 0 ) {
616
- // Validate email
617
  if ( ! is_email( $user_email ) ) {
618
  edd_set_error( 'email_invalid', __( 'Invalid email', 'easy-digital-downloads' ) );
619
- // Check if email exists
620
  } else {
621
  $customer = new EDD_Customer( $user_email );
622
  if ( $registering_new_user && email_exists( $user_email ) ) {
623
  edd_set_error( 'email_used', __( 'Email already used. Login or use a different email to complete your purchase.', 'easy-digital-downloads' ) );
624
  } else {
625
- // All the checks have run and it's good to go
626
  $valid_user_data['user_email'] = $user_email;
627
  }
628
  }
629
  } else {
630
- // No email
631
  edd_set_error( 'email_empty', __( 'Enter an email', 'easy-digital-downloads' ) );
632
  }
633
 
634
- // Check password
635
  if ( $user_pass && $pass_confirm ) {
636
- // Verify confirmation matches
637
- if ( $user_pass != $pass_confirm ) {
638
- // Passwords do not match
639
  edd_set_error( 'password_mismatch', __( 'Passwords don\'t match', 'easy-digital-downloads' ) );
640
  } else {
641
- // All is good to go
642
  $valid_user_data['user_pass'] = $user_pass;
643
  }
644
  } else {
645
- // Password or confirmation missing
646
  if ( ! $user_pass && $registering_new_user ) {
647
- // The password is invalid
648
  edd_set_error( 'password_empty', __( 'Enter a password', 'easy-digital-downloads' ) );
649
  } else if ( ! $pass_confirm && $registering_new_user ) {
650
- // Confirmation password is invalid
651
  edd_set_error( 'confirmation_empty', __( 'Enter the password confirmation', 'easy-digital-downloads' ) );
652
  }
653
  }
@@ -746,81 +753,101 @@ function edd_purchase_form_validate_guest_user() {
746
  }
747
 
748
  /**
749
- * Register And Login New User
750
  *
751
- * @param array $user_data
752
  *
753
- * @access private
754
- * @since 1.0.8.1
755
- * @return integer
756
  */
757
  function edd_register_and_login_new_user( $user_data = array() ) {
758
- // Verify the array
759
- if ( empty( $user_data ) )
 
760
  return -1;
 
761
 
762
- if ( edd_get_errors() )
763
  return -1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
764
 
765
- $user_args = apply_filters( 'edd_insert_user_args', array(
766
- 'user_login' => isset( $user_data['user_login'] ) ? $user_data['user_login'] : '',
767
- 'user_pass' => isset( $user_data['user_pass'] ) ? $user_data['user_pass'] : '',
768
- 'user_email' => isset( $user_data['user_email'] ) ? $user_data['user_email'] : '',
769
- 'first_name' => isset( $user_data['user_first'] ) ? $user_data['user_first'] : '',
770
- 'last_name' => isset( $user_data['user_last'] ) ? $user_data['user_last'] : '',
771
- 'user_registered' => date( 'Y-m-d H:i:s' ),
772
- 'role' => get_option( 'default_role' )
773
- ), $user_data );
774
-
775
- // Insert new user
776
  $user_id = wp_insert_user( $user_args );
777
 
778
- // Validate inserted user
779
- if ( is_wp_error( $user_id ) )
780
  return -1;
 
781
 
782
- // Allow themes and plugins to filter the user data
783
  $user_data = apply_filters( 'edd_insert_user_data', $user_data, $user_args );
784
 
785
- // Allow themes and plugins to hook
786
  do_action( 'edd_insert_user', $user_id, $user_data );
787
 
788
- // Login new user
789
- edd_log_user_in( $user_id, $user_data['user_login'], $user_data['user_pass'] );
790
 
791
- // Return user id
792
- return $user_id;
 
 
 
 
 
793
  }
794
 
795
  /**
796
  * Get Purchase Form User
797
  *
798
- * @param array $valid_data
799
- *
800
  * @access private
801
  * @since 1.0.8.1
 
 
802
  * @return array
803
  */
804
  function edd_get_purchase_form_user( $valid_data = array() ) {
805
- // Initialize user
806
  $user = false;
807
  $is_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
808
 
809
  if ( $is_ajax ) {
810
- // Do not create or login the user during the ajax submission (check for errors only)
 
811
  return true;
812
- } else if ( is_user_logged_in() ) {
813
- // Set the valid user as the logged in collected data
 
 
814
  $user = $valid_data['logged_in_user'];
815
- } else if ( $valid_data['need_new_user'] === true || $valid_data['need_user_login'] === true ) {
816
- // New user registration
817
- if ( $valid_data['need_new_user'] === true ) {
818
- // Set user
 
 
 
819
  $user = $valid_data['new_user_data'];
820
- // Register and login new user
 
821
  $user['user_id'] = edd_register_and_login_new_user( $user );
822
- // User login
823
- } else if ( $valid_data['need_user_login'] === true && ! $is_ajax ) {
 
824
  /*
825
  * The login form is now processed in the edd_process_purchase_login() function.
826
  * This is still here for backwards compatibility.
@@ -831,11 +858,11 @@ function edd_get_purchase_form_user( $valid_data = array() ) {
831
  * instead of submitting the login form, meaning the customer is logged in during the purchase process.
832
  */
833
 
834
- // Set user
835
  $user = $valid_data['login_user_data'];
836
 
837
- // Login user
838
- if ( empty( $user ) || $user['user_id'] == -1 ) {
839
  edd_set_error( 'invalid_user', __( 'The user information is invalid', 'easy-digital-downloads' ) );
840
  return false;
841
  } else {
@@ -844,29 +871,28 @@ function edd_get_purchase_form_user( $valid_data = array() ) {
844
  }
845
  }
846
 
847
- // Check guest checkout
848
  if ( false === $user && false === edd_no_guest_checkout() ) {
849
- // Set user
850
  $user = $valid_data['guest_user_data'];
851
  }
852
 
853
- // Verify we have an user
854
  if ( false === $user || empty( $user ) ) {
855
- // Return false
856
  return false;
857
  }
858
 
859
- // Get user first name
860
  if ( ! isset( $user['user_first'] ) || strlen( trim( $user['user_first'] ) ) < 1 ) {
861
  $user['user_first'] = isset( $_POST["edd_first"] ) ? strip_tags( trim( $_POST["edd_first"] ) ) : '';
862
  }
863
 
864
- // Get user last name
865
  if ( ! isset( $user['user_last'] ) || strlen( trim( $user['user_last'] ) ) < 1 ) {
866
  $user['user_last'] = isset( $_POST["edd_last"] ) ? strip_tags( trim( $_POST["edd_last"] ) ) : '';
867
  }
868
 
869
- // Get the user's billing address details
870
  $user['address'] = array();
871
  $user['address']['line1'] = ! empty( $_POST['card_address'] ) ? sanitize_text_field( $_POST['card_address'] ) : '';
872
  $user['address']['line2'] = ! empty( $_POST['card_address_2'] ) ? sanitize_text_field( $_POST['card_address_2'] ) : '';
@@ -875,15 +901,16 @@ function edd_get_purchase_form_user( $valid_data = array() ) {
875
  $user['address']['country'] = ! empty( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : '';
876
  $user['address']['zip'] = ! empty( $_POST['card_zip'] ) ? sanitize_text_field( $_POST['card_zip'] ) : '';
877
 
878
- if ( empty( $user['address']['country'] ) )
879
- $user['address'] = false; // Country will always be set if address fields are present
 
880
 
881
  if ( ! empty( $user['user_id'] ) && $user['user_id'] > 0 && ! empty( $user['address'] ) ) {
882
- // Store the address in the user's meta so the cart can be pre-populated with it on return purchases
883
  update_user_meta( $user['user_id'], '_edd_user_address', $user['address'] );
884
  }
885
 
886
- // Return valid user
887
  return $user;
888
  }
889
 
25
 
26
  do_action( 'edd_pre_process_purchase' );
27
 
28
+ // Make sure the cart isn't empty.
29
  if ( ! edd_get_cart_contents() && ! edd_cart_has_fees() ) {
30
  $valid_data = false;
31
  edd_set_error( 'empty_cart', __( 'Your cart is empty', 'easy-digital-downloads' ) );
32
  } else {
33
+ // Validate the form $_POST data.
34
  $valid_data = edd_purchase_form_validate_fields();
35
 
36
+ // Allow themes and plugins to hook to errors.
37
  do_action( 'edd_checkout_error_checks', $valid_data, $_POST );
38
  }
39
 
52
  }
53
  }
54
 
55
+ // Process the login form.
56
  if ( isset( $_POST['edd_login_submit'] ) ) {
57
  edd_process_purchase_login();
58
  }
59
 
60
+ // Validate the user.
61
  $user = edd_get_purchase_form_user( $valid_data );
62
 
63
+ // Let extensions validate fields after user is logged in if user has used login/registration form.
64
  do_action( 'edd_checkout_user_error_checks', $user, $valid_data, $_POST );
65
 
66
  if ( false === $valid_data || edd_get_errors() || ! $user ) {
77
  edd_die();
78
  }
79
 
80
+ // Setup user information.
81
  $user_info = array(
82
  'id' => $user['user_id'],
83
  'email' => $user['user_email'],
87
  'address' => ! empty( $user['address'] ) ? $user['address'] : array(),
88
  );
89
 
90
+ // Update a customer record if they have added/updated information.
91
  $customer = new EDD_Customer( $user_info['email'] );
92
 
93
  $name = $user_info['first_name'] . ' ' . $user_info['last_name'];
96
  'name' => $name
97
  );
98
 
99
+ // Update the customer's name and update the user record too.
100
  $customer->update( $update_data );
101
  wp_update_user( array(
102
  'ID' => get_current_user_id(),
105
  ) );
106
  }
107
 
108
+ // Update the customer's address if different to what's in the database.
109
  $address = get_user_meta( $customer->user_id, '_edd_user_address', true );
110
  if ( ! is_array( $address ) ) {
111
  $address = array();
127
 
128
  if ( ! empty( $existing_payment ) ) {
129
  $payment = new EDD_Payment( $existing_payment );
130
+ if ( $payment->is_recoverable() && ! empty( $payment->key ) ) {
131
  $purchase_key = $payment->key;
132
  }
133
  }
134
 
135
+ // Setup purchase information.
136
  $purchase_data = array(
137
  'downloads' => edd_get_cart_contents(),
138
+ 'fees' => edd_get_cart_fees(), // Any arbitrary fees that have been added to the cart.
139
+ 'subtotal' => edd_get_cart_subtotal(), // Amount before taxes and discounts.
140
+ 'discount' => edd_get_cart_discounted_amount(), // Discounted amount.
141
+ 'tax' => edd_get_cart_tax(), // Taxed amount.
142
+ 'tax_rate' => edd_use_taxes() ? edd_get_cart_tax_rate( $card_country, $card_state, $card_zip ) : 0, // Tax rate.
143
+ 'price' => edd_get_cart_total(), // Amount after taxes.
144
  'purchase_key' => $purchase_key,
145
  'user_email' => $user['user_email'],
146
  'date' => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ),
151
  'card_info' => $valid_data['cc_info']
152
  );
153
 
154
+ // Add the user data for hooks.
155
  $valid_data['user'] = $user;
156
 
157
+ // Allow themes and plugins to hook before the gateway.
158
  do_action( 'edd_checkout_before_gateway', $_POST, $user_info, $valid_data );
159
 
160
+ // If the total amount in the cart is 0, send to the manual gateway. This emulates a free download purchase.
161
+ if ( ! $purchase_data['price'] ) {
162
+
163
+ // Revert to manual.
164
  $purchase_data['gateway'] = 'manual';
165
  $_POST['edd-gateway'] = 'manual';
166
  }
167
 
168
+ // Allow the purchase data to be modified before it is sent to the gateway.
169
  $purchase_data = apply_filters(
170
  'edd_purchase_data_before_gateway',
171
  $purchase_data,
172
  $valid_data
173
  );
174
 
175
+ // Setup the data we're storing in the purchase session.
176
  $session_data = $purchase_data;
177
 
178
+ // Make sure credit card numbers are never stored in sessions.
179
  unset( $session_data['card_info']['card_number'] );
180
 
181
  // Used for showing download links to non logged-in users after purchase, and for other plugins needing purchase data.
182
  edd_set_purchase_session( $session_data );
183
 
184
+ // Send info to the gateway for payment processing.
185
  edd_send_to_gateway( $purchase_data['gateway'], $purchase_data );
186
  edd_die();
187
  }
278
  * @return bool|array
279
  */
280
  function edd_purchase_form_validate_fields() {
281
+ // Check if there is $_POST.
282
+ if ( empty( $_POST ) ) {
283
+ return false;
284
+ }
285
 
286
+ // Start an array to collect valid data.
287
  $valid_data = array(
288
+ 'gateway' => edd_purchase_form_validate_gateway(), // Gateway fallback.
289
+ 'discount' => edd_purchase_form_validate_discounts(), // Set default discount.
290
+ 'need_new_user' => false, // New user flag.
291
+ 'need_user_login' => false, // Login user flag.
292
+ 'logged_user_data' => array(), // Logged user collected data.
293
+ 'new_user_data' => array(), // New user collected data.
294
+ 'login_user_data' => array(), // Login user collected data.
295
+ 'guest_user_data' => array(), // Guest user collected data.
296
+ 'cc_info' => edd_purchase_form_validate_cc(), // Credit card info.
297
  );
298
 
299
+ // Validate agree to terms.
300
  if ( '1' === edd_get_option( 'show_agree_to_terms', false ) ) {
301
  edd_purchase_form_validate_agree_to_terms();
302
  }
303
 
304
+ // Validate agree to privacy policy.
305
  if ( '1' === edd_get_option( 'show_agree_to_privacy_policy', false ) ) {
306
  edd_purchase_form_validate_agree_to_privacy_policy();
307
  }
308
 
309
  if ( is_user_logged_in() ) {
310
+ // Collect logged in user data.
311
  $valid_data['logged_in_user'] = edd_purchase_form_validate_logged_in_user();
312
+ } elseif ( isset( $_POST['edd-purchase-var'] ) && 'needs-to-register' === $_POST['edd-purchase-var'] ) {
313
+ // Set new user registration as required.
314
  $valid_data['need_new_user'] = true;
315
 
316
+ // Validate new user data.
317
  $valid_data['new_user_data'] = edd_purchase_form_validate_new_user();
318
+ // Check if login validation is needed.
319
+ } elseif ( isset( $_POST['edd-purchase-var'] ) && 'needs-to-login' === $_POST['edd-purchase-var'] ) {
320
+ // Set user login as required.
321
  $valid_data['need_user_login'] = true;
322
 
323
+ // Validate users login info.
324
  $valid_data['login_user_data'] = edd_purchase_form_validate_user_login();
325
  } else {
326
+ // Not registering or logging in, so setup guest user data.
327
  $valid_data['guest_user_data'] = edd_purchase_form_validate_guest_user();
328
  }
329
 
330
+ // Return collected data.
331
  return $valid_data;
332
  }
333
 
565
  function edd_purchase_form_validate_new_user() {
566
  $registering_new_user = false;
567
 
568
+ // Start an empty array to collect valid user data.
569
  $valid_user_data = array(
570
+ 'user_id' => -1, // Assume there will be errors.
571
+ // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce check happens earlier.
572
+ 'user_first' => isset( $_POST['edd_first'] ) ? sanitize_text_field( $_POST['edd_first'] ) : '', // Get first name.
573
+ // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce check happens earlier.
574
+ 'user_last' => isset( $_POST['edd_last'] ) ? sanitize_text_field( $_POST['edd_last'] ) : '', // Get last name.
 
575
  );
576
 
577
+ // Check the new user's credentials against existing ones.
578
+ // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce check happens earlier.
579
+ $user_login = isset( $_POST['edd_user_login'] ) ? trim( $_POST['edd_user_login'] ) : false;
580
+ // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce check happens earlier.
581
  $user_email = isset( $_POST['edd_email'] ) ? trim( $_POST['edd_email'] ) : false;
582
+ // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce check happens earlier.
583
+ $user_pass = isset( $_POST['edd_user_pass'] ) ? trim( $_POST['edd_user_pass'] ) : false;
584
+ // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce check happens earlier.
585
+ $pass_confirm = isset( $_POST['edd_user_pass_confirm'] ) ? trim( $_POST['edd_user_pass_confirm'] ) : false;
586
 
587
+ // Loop through required fields and show error messages.
588
  foreach ( edd_purchase_form_required_fields() as $field_name => $value ) {
589
+ // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce check happens earlier.
590
  if ( in_array( $value, edd_purchase_form_required_fields() ) && empty( $_POST[ $field_name ] ) ) {
591
  edd_set_error( $value['error_id'], $value['error_message'] );
592
  }
593
  }
594
 
595
+ // Check if we have an username to register.
596
  if ( $user_login && strlen( $user_login ) > 0 ) {
597
  $registering_new_user = true;
598
 
599
+ // We have an user name, check if it already exists.
600
  if ( username_exists( $user_login ) ) {
601
+ // Username already registered.
602
  edd_set_error( 'username_unavailable', __( 'Username already taken', 'easy-digital-downloads' ) );
603
+ // Check if it's valid.
604
+ } elseif ( ! edd_validate_username( $user_login ) ) {
605
+ // Invalid username.
606
  if ( is_multisite() ) {
607
  edd_set_error( 'username_invalid', __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed', 'easy-digital-downloads' ) );
608
  } else {
609
  edd_set_error( 'username_invalid', __( 'Invalid username', 'easy-digital-downloads' ) );
610
  }
611
  } else {
612
+ // All the checks have run and it's good to go.
613
  $valid_user_data['user_login'] = $user_login;
614
  }
615
  } else {
618
  }
619
  }
620
 
621
+ // Check if we have an email to verify.
622
  if ( $user_email && strlen( $user_email ) > 0 ) {
623
+ // Validate email.
624
  if ( ! is_email( $user_email ) ) {
625
  edd_set_error( 'email_invalid', __( 'Invalid email', 'easy-digital-downloads' ) );
626
+ // Check if email exists.
627
  } else {
628
  $customer = new EDD_Customer( $user_email );
629
  if ( $registering_new_user && email_exists( $user_email ) ) {
630
  edd_set_error( 'email_used', __( 'Email already used. Login or use a different email to complete your purchase.', 'easy-digital-downloads' ) );
631
  } else {
632
+ // All the checks have run and it's good to go.
633
  $valid_user_data['user_email'] = $user_email;
634
  }
635
  }
636
  } else {
637
+ // No email.
638
  edd_set_error( 'email_empty', __( 'Enter an email', 'easy-digital-downloads' ) );
639
  }
640
 
641
+ // Check password.
642
  if ( $user_pass && $pass_confirm ) {
643
+ // Verify confirmation matches.
644
+ if ( $user_pass !== $pass_confirm ) {
645
+ // Passwords do not match.
646
  edd_set_error( 'password_mismatch', __( 'Passwords don\'t match', 'easy-digital-downloads' ) );
647
  } else {
648
+ // All is good to go.
649
  $valid_user_data['user_pass'] = $user_pass;
650
  }
651
  } else {
652
+ // Password or confirmation missing.
653
  if ( ! $user_pass && $registering_new_user ) {
654
+ // The password is invalid.
655
  edd_set_error( 'password_empty', __( 'Enter a password', 'easy-digital-downloads' ) );
656
  } else if ( ! $pass_confirm && $registering_new_user ) {
657
+ // Confirmation password is invalid.
658
  edd_set_error( 'confirmation_empty', __( 'Enter the password confirmation', 'easy-digital-downloads' ) );
659
  }
660
  }
753
  }
754
 
755
  /**
756
+ * Register And Login New User.
757
  *
758
+ * @since 1.0.8.1
759
  *
760
+ * @param array $user_data The data provided by the checkout page's registration form.
761
+ * @return integer
 
762
  */
763
  function edd_register_and_login_new_user( $user_data = array() ) {
764
+
765
+ // Verify the array.
766
+ if ( empty( $user_data ) ) {
767
  return -1;
768
+ }
769
 
770
+ if ( edd_get_errors() ) {
771
  return -1;
772
+ }
773
+
774
+ $user_args = apply_filters(
775
+ 'edd_insert_user_args',
776
+ array(
777
+ 'user_login' => isset( $user_data['user_login'] ) ? $user_data['user_login'] : '',
778
+ 'user_pass' => isset( $user_data['user_pass'] ) ? $user_data['user_pass'] : '',
779
+ 'user_email' => isset( $user_data['user_email'] ) ? $user_data['user_email'] : '',
780
+ 'first_name' => isset( $user_data['user_first'] ) ? $user_data['user_first'] : '',
781
+ 'last_name' => isset( $user_data['user_last'] ) ? $user_data['user_last'] : '',
782
+ 'user_registered' => date( 'Y-m-d H:i:s' ),
783
+ 'role' => get_option( 'default_role' ),
784
+ ),
785
+ $user_data
786
+ );
787
 
788
+ // Insert new user.
 
 
 
 
 
 
 
 
 
 
789
  $user_id = wp_insert_user( $user_args );
790
 
791
+ // Validate inserted user.
792
+ if ( is_wp_error( $user_id ) ) {
793
  return -1;
794
+ }
795
 
796
+ // Allow themes and plugins to filter the user data.
797
  $user_data = apply_filters( 'edd_insert_user_data', $user_data, $user_args );
798
 
799
+ // Allow themes and plugins to hook.
800
  do_action( 'edd_insert_user', $user_id, $user_data );
801
 
802
+ // Login new user.
803
+ $user = edd_log_user_in( $user_id, $user_data['user_login'], $user_data['user_pass'] );
804
 
805
+ // If we have errors after trying to use wp_signon, return -1.
806
+ if ( edd_get_errors() ) {
807
+ return -1;
808
+ }
809
+
810
+ // Return user id.
811
+ return $user->ID;
812
  }
813
 
814
  /**
815
  * Get Purchase Form User
816
  *
 
 
817
  * @access private
818
  * @since 1.0.8.1
819
+ *
820
+ * @param array $valid_data The validated data from the checkout form validation.
821
  * @return array
822
  */
823
  function edd_get_purchase_form_user( $valid_data = array() ) {
824
+ // Initialize user.
825
  $user = false;
826
  $is_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
827
 
828
  if ( $is_ajax ) {
829
+
830
+ // Do not create or login the user during the ajax submission (check for errors only).
831
  return true;
832
+
833
+ } elseif ( is_user_logged_in() ) {
834
+
835
+ // Set the valid user as the logged in collected data.
836
  $user = $valid_data['logged_in_user'];
837
+
838
+ } elseif ( true === $valid_data['need_new_user'] || true === $valid_data['need_user_login'] ) {
839
+
840
+ // New user registration.
841
+ if ( true === $valid_data['need_new_user'] ) {
842
+
843
+ // Set user.
844
  $user = $valid_data['new_user_data'];
845
+
846
+ // Register and login new user.
847
  $user['user_id'] = edd_register_and_login_new_user( $user );
848
+
849
+ } elseif ( true === $valid_data['need_user_login'] && ! $is_ajax ) { // User login.
850
+
851
  /*
852
  * The login form is now processed in the edd_process_purchase_login() function.
853
  * This is still here for backwards compatibility.
858
  * instead of submitting the login form, meaning the customer is logged in during the purchase process.
859
  */
860
 
861
+ // Set user.
862
  $user = $valid_data['login_user_data'];
863
 
864
+ // Login user.
865
+ if ( empty( $user ) || -1 === $user['user_id'] ) {
866
  edd_set_error( 'invalid_user', __( 'The user information is invalid', 'easy-digital-downloads' ) );
867
  return false;
868
  } else {
871
  }
872
  }
873
 
874
+ // Check guest checkout.
875
  if ( false === $user && false === edd_no_guest_checkout() ) {
876
+ // Set user.
877
  $user = $valid_data['guest_user_data'];
878
  }
879
 
880
+ // Verify we have an user.
881
  if ( false === $user || empty( $user ) ) {
 
882
  return false;
883
  }
884
 
885
+ // Get user first name.
886
  if ( ! isset( $user['user_first'] ) || strlen( trim( $user['user_first'] ) ) < 1 ) {
887
  $user['user_first'] = isset( $_POST["edd_first"] ) ? strip_tags( trim( $_POST["edd_first"] ) ) : '';
888
  }
889
 
890
+ // Get user last name.
891
  if ( ! isset( $user['user_last'] ) || strlen( trim( $user['user_last'] ) ) < 1 ) {
892
  $user['user_last'] = isset( $_POST["edd_last"] ) ? strip_tags( trim( $_POST["edd_last"] ) ) : '';
893
  }
894
 
895
+ // Get the user's billing address details.
896
  $user['address'] = array();
897
  $user['address']['line1'] = ! empty( $_POST['card_address'] ) ? sanitize_text_field( $_POST['card_address'] ) : '';
898
  $user['address']['line2'] = ! empty( $_POST['card_address_2'] ) ? sanitize_text_field( $_POST['card_address_2'] ) : '';
901
  $user['address']['country'] = ! empty( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : '';
902
  $user['address']['zip'] = ! empty( $_POST['card_zip'] ) ? sanitize_text_field( $_POST['card_zip'] ) : '';
903
 
904
+ if ( empty( $user['address']['country'] ) ) {
905
+ $user['address'] = false; // Country will always be set if address fields are present.
906
+ }
907
 
908
  if ( ! empty( $user['user_id'] ) && $user['user_id'] > 0 && ! empty( $user['address'] ) ) {
909
+ // Store the address in the user's meta so the cart can be pre-populated with it on return purchases.
910
  update_user_meta( $user['user_id'], '_edd_user_address', $user['address'] );
911
  }
912
 
913
+ // Return valid user.
914
  return $user;
915
  }
916
 
languages/easy-digital-downloads.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Easy Digital Downloads package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Easy Digital Downloads 2.9.24\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
- "POT-Creation-Date: 2020-08-21 22:14:00+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -5608,7 +5608,7 @@ msgstr ""
5608
  msgid "Enter a coupon code if you have one."
5609
  msgstr ""
5610
 
5611
- #: includes/checkout/template.php:754 includes/process-purchase.php:386
5612
  #: includes/scripts.php:67
5613
  msgid "Enter discount"
5614
  msgstr ""
@@ -7070,33 +7070,33 @@ msgstr ""
7070
  msgid "Invalid username or password. %1$sReset Password%2$s"
7071
  msgstr ""
7072
 
7073
- #: includes/login-register.php:180 includes/login-register.php:188
7074
- #: includes/process-purchase.php:602
7075
  msgid "Invalid username"
7076
  msgstr ""
7077
 
7078
- #: includes/login-register.php:184 includes/process-purchase.php:595
7079
  msgid "Username already taken"
7080
  msgstr ""
7081
 
7082
- #: includes/login-register.php:192
7083
  msgid "Email address already taken"
7084
  msgstr ""
7085
 
7086
- #: includes/login-register.php:196 includes/process-purchase.php:542
7087
- #: includes/process-purchase.php:618 includes/process-purchase.php:727
7088
  msgid "Invalid email"
7089
  msgstr ""
7090
 
7091
- #: includes/login-register.php:200
7092
  msgid "Invalid payment email"
7093
  msgstr ""
7094
 
7095
- #: includes/login-register.php:204
7096
  msgid "Please enter a password"
7097
  msgstr ""
7098
 
7099
- #: includes/login-register.php:208
7100
  msgid "Passwords do not match"
7101
  msgstr ""
7102
 
@@ -7827,11 +7827,11 @@ msgstr ""
7827
  msgid "Error processing purchase. Please reload the page and try again."
7828
  msgstr ""
7829
 
7830
- #: includes/process-purchase.php:211
7831
  msgid "The email address %s is already in use."
7832
  msgstr ""
7833
 
7834
- #: includes/process-purchase.php:233
7835
  msgid ""
7836
  "Missing nonce when processing login during checkout. Please read the "
7837
  "following for more information: "
@@ -7839,101 +7839,101 @@ msgid ""
7839
  "ajax-requests-in-easy-digital-downloads-2-9-4"
7840
  msgstr ""
7841
 
7842
- #: includes/process-purchase.php:239
7843
  msgid "Error processing login. Nonce failed."
7844
  msgstr ""
7845
 
7846
- #: includes/process-purchase.php:353
7847
  msgid "The selected payment gateway is not enabled"
7848
  msgstr ""
7849
 
7850
- #: includes/process-purchase.php:413
7851
  msgid "One or more of the discounts you entered is invalid"
7852
  msgstr ""
7853
 
7854
- #: includes/process-purchase.php:430
7855
  msgid "You must agree to the terms of use"
7856
  msgstr ""
7857
 
7858
- #: includes/process-purchase.php:444
7859
  msgid "You must agree to the privacy policy"
7860
  msgstr ""
7861
 
7862
- #: includes/process-purchase.php:459
7863
  msgid "Please enter a valid email address"
7864
  msgstr ""
7865
 
7866
- #: includes/process-purchase.php:463
7867
  msgid "Please enter your first name"
7868
  msgstr ""
7869
 
7870
- #: includes/process-purchase.php:473
7871
  msgid "Please enter your zip / postal code"
7872
  msgstr ""
7873
 
7874
- #: includes/process-purchase.php:477
7875
  msgid "Please enter your billing city"
7876
  msgstr ""
7877
 
7878
- #: includes/process-purchase.php:481
7879
  msgid "Please select your billing country"
7880
  msgstr ""
7881
 
7882
- #: includes/process-purchase.php:485
7883
  msgid "Please enter billing state / province"
7884
  msgstr ""
7885
 
7886
- #: includes/process-purchase.php:547 includes/process-purchase.php:839
7887
  msgid "The user information is invalid"
7888
  msgstr ""
7889
 
7890
- #: includes/process-purchase.php:600
7891
  msgid "Invalid username. Only lowercase letters (a-z) and numbers are allowed"
7892
  msgstr ""
7893
 
7894
- #: includes/process-purchase.php:610
7895
  msgid "You must register or login to complete your purchase"
7896
  msgstr ""
7897
 
7898
- #: includes/process-purchase.php:623
7899
  msgid ""
7900
  "Email already used. Login or use a different email to complete your "
7901
  "purchase."
7902
  msgstr ""
7903
 
7904
- #: includes/process-purchase.php:631 includes/process-purchase.php:735
7905
  msgid "Enter an email"
7906
  msgstr ""
7907
 
7908
- #: includes/process-purchase.php:639
7909
  msgid "Passwords don't match"
7910
  msgstr ""
7911
 
7912
- #: includes/process-purchase.php:648
7913
  msgid "Enter a password"
7914
  msgstr ""
7915
 
7916
- #: includes/process-purchase.php:651
7917
  msgid "Enter the password confirmation"
7918
  msgstr ""
7919
 
7920
- #: includes/process-purchase.php:677
7921
  msgid "You must log in or register to complete your purchase"
7922
  msgstr ""
7923
 
7924
- #: includes/process-purchase.php:716
7925
  msgid "You must be logged into an account to purchase"
7926
  msgstr ""
7927
 
7928
- #: includes/process-purchase.php:903
7929
  msgid "The zip / postal code you entered for your billing address is invalid"
7930
  msgstr ""
7931
 
7932
- #: includes/process-purchase.php:1152
7933
  msgid "An internal error has occurred, please try again or contact support."
7934
  msgstr ""
7935
 
7936
- #: includes/process-purchase.php:1188
7937
  msgid "There was an error completing your purchase. Please try again."
7938
  msgstr ""
7939
 
2
  # This file is distributed under the same license as the Easy Digital Downloads package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Easy Digital Downloads 2.9.25\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
+ "POT-Creation-Date: 2020-09-03 23:31:35+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
5608
  msgid "Enter a coupon code if you have one."
5609
  msgstr ""
5610
 
5611
+ #: includes/checkout/template.php:754 includes/process-purchase.php:389
5612
  #: includes/scripts.php:67
5613
  msgid "Enter discount"
5614
  msgstr ""
7070
  msgid "Invalid username or password. %1$sReset Password%2$s"
7071
  msgstr ""
7072
 
7073
+ #: includes/login-register.php:183 includes/login-register.php:191
7074
+ #: includes/process-purchase.php:609
7075
  msgid "Invalid username"
7076
  msgstr ""
7077
 
7078
+ #: includes/login-register.php:187 includes/process-purchase.php:602
7079
  msgid "Username already taken"
7080
  msgstr ""
7081
 
7082
+ #: includes/login-register.php:195
7083
  msgid "Email address already taken"
7084
  msgstr ""
7085
 
7086
+ #: includes/login-register.php:199 includes/process-purchase.php:545
7087
+ #: includes/process-purchase.php:625 includes/process-purchase.php:734
7088
  msgid "Invalid email"
7089
  msgstr ""
7090
 
7091
+ #: includes/login-register.php:203
7092
  msgid "Invalid payment email"
7093
  msgstr ""
7094
 
7095
+ #: includes/login-register.php:207
7096
  msgid "Please enter a password"
7097
  msgstr ""
7098
 
7099
+ #: includes/login-register.php:211
7100
  msgid "Passwords do not match"
7101
  msgstr ""
7102
 
7827
  msgid "Error processing purchase. Please reload the page and try again."
7828
  msgstr ""
7829
 
7830
+ #: includes/process-purchase.php:212
7831
  msgid "The email address %s is already in use."
7832
  msgstr ""
7833
 
7834
+ #: includes/process-purchase.php:234
7835
  msgid ""
7836
  "Missing nonce when processing login during checkout. Please read the "
7837
  "following for more information: "
7839
  "ajax-requests-in-easy-digital-downloads-2-9-4"
7840
  msgstr ""
7841
 
7842
+ #: includes/process-purchase.php:240
7843
  msgid "Error processing login. Nonce failed."
7844
  msgstr ""
7845
 
7846
+ #: includes/process-purchase.php:356
7847
  msgid "The selected payment gateway is not enabled"
7848
  msgstr ""
7849
 
7850
+ #: includes/process-purchase.php:416
7851
  msgid "One or more of the discounts you entered is invalid"
7852
  msgstr ""
7853
 
7854
+ #: includes/process-purchase.php:433
7855
  msgid "You must agree to the terms of use"
7856
  msgstr ""
7857
 
7858
+ #: includes/process-purchase.php:447
7859
  msgid "You must agree to the privacy policy"
7860
  msgstr ""
7861
 
7862
+ #: includes/process-purchase.php:462
7863
  msgid "Please enter a valid email address"
7864
  msgstr ""
7865
 
7866
+ #: includes/process-purchase.php:466
7867
  msgid "Please enter your first name"
7868
  msgstr ""
7869
 
7870
+ #: includes/process-purchase.php:476
7871
  msgid "Please enter your zip / postal code"
7872
  msgstr ""
7873
 
7874
+ #: includes/process-purchase.php:480
7875
  msgid "Please enter your billing city"
7876
  msgstr ""
7877
 
7878
+ #: includes/process-purchase.php:484
7879
  msgid "Please select your billing country"
7880
  msgstr ""
7881
 
7882
+ #: includes/process-purchase.php:488
7883
  msgid "Please enter billing state / province"
7884
  msgstr ""
7885
 
7886
+ #: includes/process-purchase.php:550 includes/process-purchase.php:866
7887
  msgid "The user information is invalid"
7888
  msgstr ""
7889
 
7890
+ #: includes/process-purchase.php:607
7891
  msgid "Invalid username. Only lowercase letters (a-z) and numbers are allowed"
7892
  msgstr ""
7893
 
7894
+ #: includes/process-purchase.php:617
7895
  msgid "You must register or login to complete your purchase"
7896
  msgstr ""
7897
 
7898
+ #: includes/process-purchase.php:630
7899
  msgid ""
7900
  "Email already used. Login or use a different email to complete your "
7901
  "purchase."
7902
  msgstr ""
7903
 
7904
+ #: includes/process-purchase.php:638 includes/process-purchase.php:742
7905
  msgid "Enter an email"
7906
  msgstr ""
7907
 
7908
+ #: includes/process-purchase.php:646
7909
  msgid "Passwords don't match"
7910
  msgstr ""
7911
 
7912
+ #: includes/process-purchase.php:655
7913
  msgid "Enter a password"
7914
  msgstr ""
7915
 
7916
+ #: includes/process-purchase.php:658
7917
  msgid "Enter the password confirmation"
7918
  msgstr ""
7919
 
7920
+ #: includes/process-purchase.php:684
7921
  msgid "You must log in or register to complete your purchase"
7922
  msgstr ""
7923
 
7924
+ #: includes/process-purchase.php:723
7925
  msgid "You must be logged into an account to purchase"
7926
  msgstr ""
7927
 
7928
+ #: includes/process-purchase.php:930
7929
  msgid "The zip / postal code you entered for your billing address is invalid"
7930
  msgstr ""
7931
 
7932
+ #: includes/process-purchase.php:1179
7933
  msgid "An internal error has occurred, please try again or contact support."
7934
  msgstr ""
7935
 
7936
+ #: includes/process-purchase.php:1215
7937
  msgid "There was an error completing your purchase. Please try again."
7938
  msgstr ""
7939
 
readme.txt CHANGED
@@ -7,14 +7,14 @@ Tags: ecommerce, sell, checkout, payments, stripe
7
  Requires at least: 4.4
8
  Tested up to: 5.5
9
  Requires PHP: 5.3
10
- Stable Tag: 2.9.24
11
  License: GNU Version 2 or Any Later Version
12
 
13
  Sell your digital products the simple way. Easily build an online store complete with a cart system, checkout forms, reports, coupons, and more!
14
 
15
  == Description ==
16
 
17
- Easy Digital Downloads is a complete eCommerce solution for selling digital products on WordPress. Learn more at [Easy Digital Downloads.com](https://easydigitaldownloads.com/?utm_source=home&utm_medium=description_tab&utm_content=home&utm_campaign=readme).
18
 
19
  = Sell effortlessly =
20
 
@@ -43,7 +43,7 @@ Here are some of the features supported out-of-the-box:
43
 
44
  = Localized for your language =
45
 
46
- Easy Digital Downloads has been translated into more than two dozen languages and new translation are being added all the time, letting you have a natural, native experience, regardless of where you live. If your language is not available, we welcome translation contributions! See our [FAQ](http://docs.easydigitaldownloads.com/article/1082-what-spoken-languages-does-easy-digital-downloads-support?utm_source=docs&utm_medium=description_tab&utm_content=languages&utm_campaign=readme).
47
 
48
  = Support for many payment gateways, including Stripe and PayPal =
49
 
@@ -54,7 +54,7 @@ Payment gateways supported in the core, free plugin:
54
  * PayPal Standard
55
  * Amazon Payments
56
 
57
- Payment gateways supported through free or premium extension:
58
 
59
  * Stripe
60
  * PayPal Pro
@@ -68,7 +68,7 @@ Payment gateways supported through free or premium extension:
68
  * BitPay
69
  * Coinbase
70
 
71
- > What can I say? Stripe is my go-to payment processor and without this add-on I don't know what I would do. Connect EDD to your Stripe account in seconds and you're done! Having a simple toggle in to test mode is also a valuable development tool. This is another one of my go-to EDD extensions.
72
  > Matt Whiteley - Whiteley Designs
73
 
74
  See our [payment gateways category](https://easydigitaldownloads.com/downloads/category/gateways/?utm_source=extensions&utm_medium=description_tab&utm_content=gateways&utm_campaign=readme) in the extensions catalogue for a complete list of supported merchant processors. There are also a large number of additional payment gateways developed and supported by [3rd party developers](https://easydigitaldownloads.com/3rd-party-extensions/#gateways).
@@ -111,6 +111,10 @@ The Easy Digital Downloads API makes it possible for developers to make customiz
111
  > As a developer, Easy Digital Downloads is very pleasant to work with since you can absolutely extend anything available within EDD.
112
  > Yudhistira Mauris - WP House
113
 
 
 
 
 
114
  = Meet the team =
115
 
116
  Easy Digital Downloads is built by [Sandhills Development](https://sandhillsdev.com/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=sandhills&utm_term=description). We make [popular WordPress plugins](https://sandhillsdev.com/projects/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=popular&utm_term=description) used by hundreds of thousands of people just like you. [Get to know us here](https://sandhillsdev.com/about/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=about&utm_term=description)!
@@ -138,10 +142,10 @@ Development for this plugin happens in a public GitHub repository to better faci
138
 
139
  If Easy Digital Downloads doesn’t quite fit your needs, take a look at some of our other projects.
140
 
141
- - [WP Simple Pay](https://wpsimplepay.com/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=something-else&utm_term=description) – Sell digital products with WordPress
142
  - [AffiliateWP](https://affiliatewp.com/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=something-else&utm_term=description) – A full-featured affiliate marketing solution
143
  - [Sugar Calendar](https://sugarcalendar.com?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=something-else&utm_term=description) – WordPress event management made simple
144
- - [Restrict Content Pro](https://restrictcontentpro.com/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=something-else&utm_term=description) – A lightweight Stripe payments plugin
145
 
146
  == Installation ==
147
 
@@ -249,6 +253,9 @@ For most stores, we recommend using the Stripe Payment Gateway.
249
  9. Checkout screen
250
 
251
  == Changelog ==
 
 
 
252
  = 2.9.24, August 21, 2020 =
253
  * Security Fix: Prevent users with 'view_shop_reports' capability from running an arbitrary class execution with the exports tool.
254
  * Fix: Removing downloads from the view order details screen caused a JavaScript error on WordPress 5.5+.
7
  Requires at least: 4.4
8
  Tested up to: 5.5
9
  Requires PHP: 5.3
10
+ Stable Tag: 2.9.25
11
  License: GNU Version 2 or Any Later Version
12
 
13
  Sell your digital products the simple way. Easily build an online store complete with a cart system, checkout forms, reports, coupons, and more!
14
 
15
  == Description ==
16
 
17
+ Easy Digital Downloads is a complete eCommerce solution for selling digital products on WordPress. Learn more at [EasyDigitalDownloads.com](https://easydigitaldownloads.com/?utm_source=home&utm_medium=description_tab&utm_content=home&utm_campaign=readme).
18
 
19
  = Sell effortlessly =
20
 
43
 
44
  = Localized for your language =
45
 
46
+ Easy Digital Downloads has been translated into more than two dozen languages and new translations are being added all the time, letting you have a natural, native experience, regardless of where you live. If your language is not available, we welcome translation contributions! See our [FAQ](http://docs.easydigitaldownloads.com/article/1082-what-spoken-languages-does-easy-digital-downloads-support?utm_source=docs&utm_medium=description_tab&utm_content=languages&utm_campaign=readme).
47
 
48
  = Support for many payment gateways, including Stripe and PayPal =
49
 
54
  * PayPal Standard
55
  * Amazon Payments
56
 
57
+ Payment gateways supported through free or premium extensions:
58
 
59
  * Stripe
60
  * PayPal Pro
68
  * BitPay
69
  * Coinbase
70
 
71
+ > What can I say? Stripe is my go-to payment processor and without this add-on I don't know what I would do. Connect EDD to your Stripe account in seconds and you're done! Having a simple test mode toggle is also a valuable development tool. This is another one of my go-to EDD extensions.
72
  > Matt Whiteley - Whiteley Designs
73
 
74
  See our [payment gateways category](https://easydigitaldownloads.com/downloads/category/gateways/?utm_source=extensions&utm_medium=description_tab&utm_content=gateways&utm_campaign=readme) in the extensions catalogue for a complete list of supported merchant processors. There are also a large number of additional payment gateways developed and supported by [3rd party developers](https://easydigitaldownloads.com/3rd-party-extensions/#gateways).
111
  > As a developer, Easy Digital Downloads is very pleasant to work with since you can absolutely extend anything available within EDD.
112
  > Yudhistira Mauris - WP House
113
 
114
+ = Get help =
115
+
116
+ Easy Digital Downloads is backed by top-notch technical support from our globally distributed full-time support team. We also have an [extensive documentation site available](https://docs.easydigitaldownloads.com/?utm_medium=readme&utm_source=wporg&utm_campaign=lite-plugin&utm_content=docs&utm_term=description). If you’re looking for faster support via email, we encourage you to [purchase an Easy Digital Downloads pass](https://easydigitaldownloads.com/pricing/?utm_medium=readme&utm_source=wporg&utm_campaign=lite-plugin&utm_content=upgrade&utm_term=description) or premium extension.
117
+
118
  = Meet the team =
119
 
120
  Easy Digital Downloads is built by [Sandhills Development](https://sandhillsdev.com/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=sandhills&utm_term=description). We make [popular WordPress plugins](https://sandhillsdev.com/projects/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=popular&utm_term=description) used by hundreds of thousands of people just like you. [Get to know us here](https://sandhillsdev.com/about/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=about&utm_term=description)!
142
 
143
  If Easy Digital Downloads doesn’t quite fit your needs, take a look at some of our other projects.
144
 
145
+ - [WP Simple Pay](https://wpsimplepay.com/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=something-else&utm_term=description) – A lightweight Stripe payments plugin
146
  - [AffiliateWP](https://affiliatewp.com/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=something-else&utm_term=description) – A full-featured affiliate marketing solution
147
  - [Sugar Calendar](https://sugarcalendar.com?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=something-else&utm_term=description) – WordPress event management made simple
148
+ - [Restrict Content Pro](https://restrictcontentpro.com/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_content=something-else&utm_term=description) – A powerful membership plugin for WordPress
149
 
150
  == Installation ==
151
 
253
  9. Checkout screen
254
 
255
  == Changelog ==
256
+ = 2.9.25, September 3, 2020 =
257
+ * Fix: Using the registration form on checkout with guest checkout disabled, could result in errors when attempting to purchase.
258
+
259
  = 2.9.24, August 21, 2020 =
260
  * Security Fix: Prevent users with 'view_shop_reports' capability from running an arbitrary class execution with the exports tool.
261
  * Fix: Removing downloads from the view order details screen caused a JavaScript error on WordPress 5.5+.