From 9da2f1ea3aa73b8db02ab196ada715f9ad7496dc Mon Sep 17 00:00:00 2001 From: Chris Klosowski Date: Fri, 22 Nov 2024 02:20:28 -0700 Subject: [PATCH] Adding Release 3.3.5.2 changes --- easy-digital-downloads.php | 4 ++-- includes/class-easy-digital-downloads.php | 2 +- includes/process-purchase.php | 4 ++-- languages/easy-digital-downloads.pot | 4 ++-- readme.txt | 7 ++++++- src/Sessions/PurchaseData.php | 4 ++++ tests/sessions/tests-purchase-data.php | 4 ++++ 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/easy-digital-downloads.php b/easy-digital-downloads.php index a0b817da00..d45d7bce3a 100755 --- a/easy-digital-downloads.php +++ b/easy-digital-downloads.php @@ -5,7 +5,7 @@ * Description: The easiest way to sell digital products with WordPress. * Author: Easy Digital Downloads * Author URI: https://easydigitaldownloads.com - * Version: 3.3.5.1 + * Version: 3.3.5.2 * Text Domain: easy-digital-downloads * Domain Path: /languages * Requires at least: 6.0 @@ -27,7 +27,7 @@ * @package EDD * @category Core * @author Easy Digital Downloads - * @version 3.3.5.1 + * @version 3.3.5.2 */ // Exit if accessed directly. diff --git a/includes/class-easy-digital-downloads.php b/includes/class-easy-digital-downloads.php index fd7a1ea5c0..4b036c6be8 100644 --- a/includes/class-easy-digital-downloads.php +++ b/includes/class-easy-digital-downloads.php @@ -364,7 +364,7 @@ private function setup_constants() { // Plugin version. if ( ! defined( 'EDD_VERSION' ) ) { - define( 'EDD_VERSION', '3.3.5.1' ); + define( 'EDD_VERSION', '3.3.5.2' ); } // Make sure CAL_GREGORIAN is defined. diff --git a/includes/process-purchase.php b/includes/process-purchase.php index 06c15fa326..6a79be5240 100755 --- a/includes/process-purchase.php +++ b/includes/process-purchase.php @@ -746,8 +746,8 @@ function edd_register_and_login_new_user( $user_data = array() ) { 'user_login' => '', 'user_pass' => '', 'user_email' => '', - 'first_name' => '', - 'last_name' => '', + 'first_name' => isset( $user_data['user_first'] ) ? $user_data['user_first'] : '', + 'last_name' => isset( $user_data['user_last'] ) ? $user_data['user_last'] : '', 'role' => get_option( 'default_role' ), ); $user_args = wp_parse_args( $user_data, $defaults ); diff --git a/languages/easy-digital-downloads.pot b/languages/easy-digital-downloads.pot index 8fb9129874..0faae7be0c 100644 --- a/languages/easy-digital-downloads.pot +++ b/languages/easy-digital-downloads.pot @@ -2,14 +2,14 @@ # This file is distributed under the same license as the Easy Digital Downloads plugin. msgid "" msgstr "" -"Project-Id-Version: Easy Digital Downloads 3.3.5.1\n" +"Project-Id-Version: Easy Digital Downloads 3.3.5.2\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/easy-digital-downloads-public\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-11-14T23:08:35+00:00\n" +"POT-Creation-Date: 2024-11-22T09:18:08+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.11.0\n" diff --git a/readme.txt b/readme.txt index 4d93791c95..3562592879 100755 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Tags: ecommerce, payments, sell, digital store, stripe Requires at least: 6.0 Tested up to: 6.7 Requires PHP: 7.4 -Stable Tag: 3.3.5.1 +Stable Tag: 3.3.5.2 License: GPLv2 or later The #1 eCommerce plugin to sell digital products & subscriptions. Accept credit card payments with Stripe & PayPal and start your store today. @@ -237,6 +237,11 @@ Check out some of our popular posts for actionable advice for running your busin 8. Checkout Form Block - Default Theme == Changelog == + += 3.3.5.2 = +* Checkout: Fixed a user's first/last name not saving to their WordPress account when registering during checkout. +* Checkout: Fixed purchase data being sent to some gateways which process credit cards from form data. + = 3.3.5.1 = * Stripe: Fixed issues with displaying and saving Stripe settings. diff --git a/src/Sessions/PurchaseData.php b/src/Sessions/PurchaseData.php index b951445d25..fd49fd999e 100644 --- a/src/Sessions/PurchaseData.php +++ b/src/Sessions/PurchaseData.php @@ -109,6 +109,10 @@ public static function set( $valid_data, $user ) { edd_set_purchase_session( $purchase_data ); + // Send the card info and post data back to the purchase data, even though it's not stored in the session. + $purchase_data['card_info'] = $valid_data['cc_info'] ?? array(); + $purchase_data['post_data'] = $_POST; + return $purchase_data; } diff --git a/tests/sessions/tests-purchase-data.php b/tests/sessions/tests-purchase-data.php index 819018fb6e..24d553d89c 100644 --- a/tests/sessions/tests-purchase-data.php +++ b/tests/sessions/tests-purchase-data.php @@ -31,6 +31,8 @@ public function test_edd_get_purchase_session_logged_in_user() { 'edd_email' => 'john@doe.example', ); $purchase_session = \EDD\Sessions\PurchaseData::start( false ); + unset( $purchase_session['card_info'] ); + unset( $purchase_session['post_data'] ); $this->assertEquals( $user_id, $purchase_session['user_info']['id'] ); $this->assertEquals( $_POST['edd_email'], $purchase_session['user_info']['email'] ); @@ -48,6 +50,8 @@ public function test_edd_get_purchase_session_guest() { ); $purchase_session = \EDD\Sessions\PurchaseData::start(); + unset( $purchase_session['card_info'] ); + unset( $purchase_session['post_data'] ); $this->assertEmpty( $purchase_session['user_info']['id'] ); $this->assertEquals( $_POST['edd_email'], $purchase_session['user_info']['email'] );