Easy Digital Downloads - Version 2.4.9

Version Description

Download this release

Release Info

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

Code changes from version 2.4.8 to 2.4.9

easy-digital-downloads.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Serve Digital Downloads Through WordPress
6
  * Author: Pippin Williamson
7
  * Author URI: https://pippinsplugins.com
8
- * Version: 2.4.8
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
@@ -187,7 +187,7 @@ final class Easy_Digital_Downloads {
187
 
188
  // Plugin version
189
  if ( ! defined( 'EDD_VERSION' ) ) {
190
- define( 'EDD_VERSION', '2.4.8' );
191
  }
192
 
193
  // Plugin Folder Path
@@ -384,11 +384,11 @@ final class Easy_Digital_Downloads {
384
  } elseif ( file_exists( $mofile_global2 ) ) {
385
 
386
  load_textdomain( 'easy-digital-downloads', $mofile_global2 );
387
-
388
  } elseif ( file_exists( $mofile_global3 ) ) {
389
 
390
  load_textdomain( 'easy-digital-downloads', $mofile_global3 );
391
-
392
  } else {
393
 
394
  // Load the default language files
5
  * Description: Serve Digital Downloads Through WordPress
6
  * Author: Pippin Williamson
7
  * Author URI: https://pippinsplugins.com
8
+ * Version: 2.4.9
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
187
 
188
  // Plugin version
189
  if ( ! defined( 'EDD_VERSION' ) ) {
190
+ define( 'EDD_VERSION', '2.4.9' );
191
  }
192
 
193
  // Plugin Folder Path
384
  } elseif ( file_exists( $mofile_global2 ) ) {
385
 
386
  load_textdomain( 'easy-digital-downloads', $mofile_global2 );
387
+
388
  } elseif ( file_exists( $mofile_global3 ) ) {
389
 
390
  load_textdomain( 'easy-digital-downloads', $mofile_global3 );
391
+
392
  } else {
393
 
394
  // Load the default language files
includes/admin/customers/customers.php CHANGED
@@ -360,7 +360,7 @@ function edd_customers_view( $customer ) {
360
  <a title="<?php _e( 'View Details for Payment', 'easy-digital-downloads' ); echo ' ' . $payment->ID; ?>" href="<?php echo admin_url( 'edit.php?post_type=download&page=edd-payment-history&view=view-order-details&id=' . $payment->ID ); ?>">
361
  <?php _e( 'View Details', 'easy-digital-downloads' ); ?>
362
  </a>
363
- <?php do_action( 'edd_customer_recent_purcahses_actions', $customer, $payment ); ?>
364
  </td>
365
  </tr>
366
  <?php endforeach; ?>
360
  <a title="<?php _e( 'View Details for Payment', 'easy-digital-downloads' ); echo ' ' . $payment->ID; ?>" href="<?php echo admin_url( 'edit.php?post_type=download&page=edd-payment-history&view=view-order-details&id=' . $payment->ID ); ?>">
361
  <?php _e( 'View Details', 'easy-digital-downloads' ); ?>
362
  </a>
363
+ <?php do_action( 'edd_customer_recent_purchases_actions', $customer, $payment ); ?>
364
  </td>
365
  </tr>
366
  <?php endforeach; ?>
includes/payments/functions.php CHANGED
@@ -173,22 +173,26 @@ function edd_insert_payment( $payment_data = array() ) {
173
  $payment_data['price'] = '0.00';
174
  }
175
 
176
- // Create or update a customer
177
- $customer = new EDD_Customer( $payment_data['user_email'] );
178
 
179
- // If we didn't find a customer and the user is logged in, check by user_id #3881
180
- if ( empty( $customer->id ) && is_user_logged_in() ) {
181
  $customer = new EDD_customer( get_current_user_id(), true );
182
  }
183
 
184
- $customer_data = array(
185
- 'name' => $payment_data['user_info']['first_name'] . ' ' . $payment_data['user_info']['last_name'],
186
- 'email' => $payment_data['user_email'],
187
- 'user_id' => $payment_data['user_info']['id']
188
- );
189
 
190
  if ( empty( $customer->id ) ) {
 
 
 
 
 
 
 
191
  $customer->create( $customer_data );
 
192
  }
193
 
194
  $customer->attach_payment( $payment, false );
173
  $payment_data['price'] = '0.00';
174
  }
175
 
176
+ $customer = new stdClass;
 
177
 
178
+ if ( did_action( 'edd_pre_process_purchase' ) && is_user_logged_in() ) {
 
179
  $customer = new EDD_customer( get_current_user_id(), true );
180
  }
181
 
182
+ if ( empty( $customer->id ) ) {
183
+ $customer = new EDD_Customer( $payment_data['user_email'] );
184
+ }
 
 
185
 
186
  if ( empty( $customer->id ) ) {
187
+
188
+ $customer_data = array(
189
+ 'name' => $payment_data['user_info']['first_name'] . ' ' . $payment_data['user_info']['last_name'],
190
+ 'email' => $payment_data['user_email'],
191
+ 'user_id' => $payment_data['user_info']['id']
192
+ );
193
+
194
  $customer->create( $customer_data );
195
+
196
  }
197
 
198
  $customer->attach_payment( $payment, false );
readme.txt CHANGED
@@ -7,7 +7,7 @@ Tags: download, downloads, e-store, eshop, digital downloads, e-downloads, ecomm
7
  Requires at least: 3.9.2
8
  Tested up to: 4.4
9
 
10
- Stable Tag: 2.4.8
11
 
12
  License: GNU Version 2 or Any Later Version
13
 
@@ -191,6 +191,11 @@ Yes, through the addition of one or more of the add-on payment gateways, you can
191
 
192
  == Changelog ==
193
 
 
 
 
 
 
194
  = 2.4.8, October 12, 2015 =
195
 
196
  * New: Added option to manually verify a user account from the customer details screen
@@ -201,7 +206,7 @@ Yes, through the addition of one or more of the add-on payment gateways, you can
201
  * Fix: Corrected spelling error in EDD_Stats class
202
  * Fix: New customers improperly created when logged-in user completed purchases with a different email
203
  * Fix: User verification process should not run on the very first purchase by a customer
204
- * Fix: edd_get_current_page_url() returns improper URL when WordPress is installedin sub folder
205
  * Tweak: Improved formatting of the welcome screen to match the styles of WordPress core
206
 
207
  = 2.4.7, September 29, 2015 =
7
  Requires at least: 3.9.2
8
  Tested up to: 4.4
9
 
10
+ Stable Tag: 2.4.9
11
 
12
  License: GNU Version 2 or Any Later Version
13
 
191
 
192
  == Changelog ==
193
 
194
+ = 2.4.9, October 14, 2015 =
195
+
196
+ * Fix: Importing payments caused payments to be associated with customer of user doing the import
197
+ * Fix: Corrected spelling for edd_customer_recent_purchases_actions hook
198
+
199
  = 2.4.8, October 12, 2015 =
200
 
201
  * New: Added option to manually verify a user account from the customer details screen
206
  * Fix: Corrected spelling error in EDD_Stats class
207
  * Fix: New customers improperly created when logged-in user completed purchases with a different email
208
  * Fix: User verification process should not run on the very first purchase by a customer
209
+ * Fix: edd_get_current_page_url() returns improper URL when WordPress is installed in sub folder
210
  * Tweak: Improved formatting of the welcome screen to match the styles of WordPress core
211
 
212
  = 2.4.7, September 29, 2015 =