Easy Digital Downloads - Version 2.5.4

Version Description

Download this release

Release Info

Developer mordauk
Plugin Icon 128x128 Easy Digital Downloads
Version 2.5.4
Comparing to
See all releases

Code changes from version 2.5.3 to 2.5.4

easy-digital-downloads.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Serve Digital Downloads Through WordPress.
6
  * Author: Pippin Williamson and Company
7
  * Author URI: https://easydigitaldownloads.com
8
- * Version: 2.5.3
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.5.3
29
  */
30
 
31
  // Exit if accessed directly.
@@ -186,7 +186,7 @@ final class Easy_Digital_Downloads {
186
 
187
  // Plugin version.
188
  if ( ! defined( 'EDD_VERSION' ) ) {
189
- define( 'EDD_VERSION', '2.5.3' );
190
  }
191
 
192
  // Plugin Folder Path.
5
  * Description: Serve Digital Downloads Through WordPress.
6
  * Author: Pippin Williamson and Company
7
  * Author URI: https://easydigitaldownloads.com
8
+ * Version: 2.5.4
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
+ * @version 2.5.4
29
  */
30
 
31
  // Exit if accessed directly.
186
 
187
  // Plugin version.
188
  if ( ! defined( 'EDD_VERSION' ) ) {
189
+ define( 'EDD_VERSION', '2.5.4' );
190
  }
191
 
192
  // Plugin Folder Path.
includes/admin/payments/actions.php CHANGED
@@ -241,7 +241,7 @@ function edd_update_payment_details( $data ) {
241
  }
242
 
243
  // Set new status
244
- edd_update_payment_status( $payment_id, $status );
245
 
246
  // Adjust total store earnings if the payment total has been changed
247
  if ( $new_total !== $curr_total && ( 'publish' == $status || 'revoked' == $status ) ) {
241
  }
242
 
243
  // Set new status
244
+ $payment->status = $status;
245
 
246
  // Adjust total store earnings if the payment total has been changed
247
  if ( $new_total !== $curr_total && ( 'publish' == $status || 'revoked' == $status ) ) {
includes/admin/settings/register-settings.php CHANGED
@@ -906,10 +906,12 @@ function edd_settings_sanitize( $input = array() ) {
906
  $section = isset( $referrer['section'] ) ? $referrer['section'] : 'main';
907
 
908
  $input = $input ? $input : array();
909
- $legacy_inputs = apply_filters( 'edd_settings_' . $tab . '_sanitize', $input ); // Check for extensions that aren't using new sections
910
- $section_inputs = apply_filters( 'edd_settings_' . $tab . '-' . $section . '_sanitize', $input );
911
 
912
- $input = array_merge( $legacy_inputs, $section_inputs );
 
 
 
 
913
 
914
  // Loop through each setting being saved and pass it through a sanitization filter
915
  foreach ( $input as $key => $value ) {
906
  $section = isset( $referrer['section'] ) ? $referrer['section'] : 'main';
907
 
908
  $input = $input ? $input : array();
 
 
909
 
910
+ $input = apply_filters( 'edd_settings_' . $tab . '-' . $section . '_sanitize', $input );
911
+ if ( 'main' === $section ) {
912
+ // Check for extensions that aren't using new sections
913
+ $input = apply_filters( 'edd_settings_' . $tab . '_sanitize', $input );
914
+ }
915
 
916
  // Loop through each setting being saved and pass it through a sanitization filter
917
  foreach ( $input as $key => $value ) {
includes/admin/tools/class-edd-tools-recount-single-customer-stats.php CHANGED
@@ -253,7 +253,7 @@ class EDD_Tools_Recount_Single_Customer_Stats extends EDD_Batch_Export {
253
  */
254
  private function get_stored_data( $key ) {
255
  global $wpdb;
256
- $value = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = '%s'" ), $key );
257
 
258
  return empty( $value ) ? false : maybe_unserialize( $value );
259
  }
253
  */
254
  private function get_stored_data( $key ) {
255
  global $wpdb;
256
+ $value = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key ) );
257
 
258
  return empty( $value ) ? false : maybe_unserialize( $value );
259
  }
includes/cart/actions.php CHANGED
@@ -71,9 +71,9 @@ function edd_process_add_to_cart( $data ) {
71
  $options['quantity'] = absint( $data['edd_download_quantity'] );
72
  }
73
 
74
- if ( is_array( $options['price_id'] ) ) {
75
  foreach ( $options['price_id'] as $key => $price_id ) {
76
- $options['quantity'][ $key ] = absint( $data[ 'edd_download_quantity_' . $price_id ] );
77
  }
78
  }
79
 
71
  $options['quantity'] = absint( $data['edd_download_quantity'] );
72
  }
73
 
74
+ if ( isset( $options['price_id'] ) && is_array( $options['price_id'] ) ) {
75
  foreach ( $options['price_id'] as $key => $price_id ) {
76
+ $options['quantity'][ $key ] = isset( $data[ 'edd_download_quantity_' . $price_id ] ) ? absint( $data[ 'edd_download_quantity_' . $price_id ] ) : 1;
77
  }
78
  }
79
 
includes/class-edd-html-elements.php CHANGED
@@ -379,7 +379,7 @@ class EDD_HTML_Elements {
379
  foreach( $args['options'] as $key => $option ) {
380
 
381
  if( $args['multiple'] && is_array( $args['selected'] ) ) {
382
- $selected = selected( true, in_array( $key, $args['selected'] ), false );
383
  } else {
384
  $selected = selected( $args['selected'], $key, false );
385
  }
379
  foreach( $args['options'] as $key => $option ) {
380
 
381
  if( $args['multiple'] && is_array( $args['selected'] ) ) {
382
+ $selected = selected( true, in_array( $key, $args['selected'], true ), false );
383
  } else {
384
  $selected = selected( $args['selected'], $key, false );
385
  }
includes/gateways/functions.php CHANGED
@@ -280,7 +280,7 @@ function edd_build_straight_to_gateway_data( $download_id = 0, $options = array(
280
  'price' => $price * $quantity,
281
  'purchase_key' => strtolower( md5( uniqid() ) ),
282
  'user_email' => $user_info['email'],
283
- 'date' => date( 'Y-m-d H:i:s' ),
284
  'user_info' => $user_info,
285
  'post_data' => array(),
286
  'cart_details' => $cart_details,
280
  'price' => $price * $quantity,
281
  'purchase_key' => strtolower( md5( uniqid() ) ),
282
  'user_email' => $user_info['email'],
283
+ 'date' => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ),
284
  'user_info' => $user_info,
285
  'post_data' => array(),
286
  'cart_details' => $cart_details,
includes/payments/class-edd-payment.php CHANGED
@@ -770,6 +770,15 @@ final class EDD_Payment {
770
  $this->update_meta( '_edd_payment_number', $this->number );
771
  break;
772
 
 
 
 
 
 
 
 
 
 
773
  case 'completed_date':
774
  $this->update_meta( '_edd_completed_date', $this->completed_date );
775
  break;
770
  $this->update_meta( '_edd_payment_number', $this->number );
771
  break;
772
 
773
+ case 'date':
774
+ $args = array(
775
+ 'ID' => $this->ID,
776
+ 'post_date' => $this->date,
777
+ );
778
+
779
+ wp_update_post( $args );
780
+ break;
781
+
782
  case 'completed_date':
783
  $this->update_meta( '_edd_completed_date', $this->completed_date );
784
  break;
includes/payments/functions.php CHANGED
@@ -120,6 +120,9 @@ function edd_insert_payment( $payment_data = array() ) {
120
  return false;
121
  }
122
 
 
 
 
123
  $payment = new EDD_Payment();
124
 
125
  if( is_array( $payment_data['cart_details'] ) && ! empty( $payment_data['cart_details'] ) ) {
@@ -148,7 +151,7 @@ function edd_insert_payment( $payment_data = array() ) {
148
  $gateway = empty( $gateway ) && isset( $_POST['edd-gateway'] ) ? $_POST['edd-gateway'] : $gateway;
149
 
150
  $payment->status = ! empty( $payment_data['status'] ) ? $payment_data['status'] : 'pending';
151
- $payment->currency = $payment_data['currency'];
152
  $payment->user_info = $payment_data['user_info'];
153
  $payment->gateway = $gateway;
154
  $payment->user_id = $payment_data['user_info']['id'];
120
  return false;
121
  }
122
 
123
+ // Make sure the payment is inserted with the correct timezone
124
+ date_default_timezone_set( edd_get_timezone_id() );
125
+
126
  $payment = new EDD_Payment();
127
 
128
  if( is_array( $payment_data['cart_details'] ) && ! empty( $payment_data['cart_details'] ) ) {
151
  $gateway = empty( $gateway ) && isset( $_POST['edd-gateway'] ) ? $_POST['edd-gateway'] : $gateway;
152
 
153
  $payment->status = ! empty( $payment_data['status'] ) ? $payment_data['status'] : 'pending';
154
+ $payment->currency = ! empty( $payment_data['currency'] ) ? $payment_data['currency'] : edd_get_currency();
155
  $payment->user_info = $payment_data['user_info'];
156
  $payment->gateway = $gateway;
157
  $payment->user_id = $payment_data['user_info']['id'];
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://pippinsplugins.com/support-the-site
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-downloads, ecommerce, e commerce, e-commerce, selling, wp-ecommerce, wp ecommerce, mordauk, Pippin Williamson, pippinsplugins
7
  Requires at least: 4.0
8
  Tested up to: 4.5
9
- Stable Tag: 2.5.3
10
 
11
  License: GNU Version 2 or Any Later Version
12
 
@@ -214,6 +214,18 @@ Yes, through the addition of one or more of the add-on payment gateways, you can
214
 
215
  == Changelog ==
216
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  = 2.5.3, January 9, 2016 =
218
 
219
  * Fix: Status passed to edd_insert_payment() not respected. Caused subscription payments to be marked as pending
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-downloads, ecommerce, e commerce, e-commerce, selling, wp-ecommerce, wp ecommerce, mordauk, Pippin Williamson, pippinsplugins
7
  Requires at least: 4.0
8
  Tested up to: 4.5
9
+ Stable Tag: 2.5.4
10
 
11
  License: GNU Version 2 or Any Later Version
12
 
214
 
215
  == Changelog ==
216
 
217
+ = 2.5.4, January 12, 2016 =
218
+
219
+ * Fix: Timezones set improperly sometimes when payments are created
220
+ * Fix: PHP notices in edd_process_add_to_cart() when AJAX is disabled
221
+ * Fix: PHP warning in Recount Single Customer Stats tool
222
+ * Fix: Payment date cannot be changed in the admin
223
+ * Fix: Currency code not properly returned if payment is missing currency metadata
224
+ * Fix: "Sorry trouble retrieving payment receipt" error shown occasionally
225
+ * Fix: Sanitization process for settings breaks some extension's settings
226
+ * Fix: Download links blank for some customers
227
+ * Fix: Prevent default placeholder from showing as an option in multi-select fields
228
+
229
  = 2.5.3, January 9, 2016 =
230
 
231
  * Fix: Status passed to edd_insert_payment() not respected. Caused subscription payments to be marked as pending