From 5f319f37c23d29e2c860f3f371ad5ccab74b0d89 Mon Sep 17 00:00:00 2001 From: Angela Blake <35241639+angelablake@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:55:49 -0600 Subject: [PATCH 1/5] Revert "chore: prepare for 3.1.2 release" This reverts commit 6c6831f6963cf2be3e90e6fb11578e50d1a5d362. --- .../js/frontend/paypal-commerce/AdvancedCardFields.js | 4 ++-- give.php | 4 ++-- readme.txt | 6 +----- src/DonationForms/Actions/GetOrCreateDonor.php | 4 ++-- .../Controllers/BlockRenderController.php | 2 +- .../resources/app/Components/ModalForm.tsx | 2 +- .../Blocks/DonationFormBlock/resources/app/index.tsx | 2 +- .../Blocks/DonationFormBlock/resources/editor/Edit.tsx | 2 +- .../editor/components/DonationFormBlockControls.tsx | 2 +- .../editor/components/DonationFormBlockPreview.tsx | 2 +- .../editor/components/DonationFormSelector.tsx | 2 +- .../resources/editor/components/ModalPreview.tsx | 2 +- src/DonationForms/Controllers/DonateController.php | 6 +++--- .../Migrations/CleanMultipleSlashesOnDB.php | 6 +++--- src/DonationForms/Properties/FormSettings.php | 8 ++++---- src/DonationForms/Shortcodes/GiveFormShortcode.php | 2 +- src/Donors/Actions/CreateUserFromDonor.php | 2 +- .../Actions/SendDonorUserRegistrationNotification.php | 2 +- .../Exceptions/FailedDonorUserCreationException.php | 2 +- src/Donors/ServiceProvider.php | 2 +- .../form-builder/src/components/ClassicEditor/index.js | 2 +- .../Adapters/LegacyPaymentGatewayAdapter.php | 4 ++-- .../Actions/RegisterPaymentGateways.php | 2 +- .../Gateways/PayPalCommerce/payPalCommerceGateway.tsx | 2 +- .../PayPalCommerce/AjaxRequestHandler.php | 4 ++-- .../PayPalCheckoutSdk/ProcessorResponseError.php | 10 +++++----- src/PaymentGateways/PayPalCommerce/ScriptLoader.php | 2 +- .../DonationForms/Actions/TestGetOrCreateDonor.php | 10 +++++----- 28 files changed, 48 insertions(+), 52 deletions(-) diff --git a/assets/src/js/frontend/paypal-commerce/AdvancedCardFields.js b/assets/src/js/frontend/paypal-commerce/AdvancedCardFields.js index e318233fd6..6b4c1d31cd 100644 --- a/assets/src/js/frontend/paypal-commerce/AdvancedCardFields.js +++ b/assets/src/js/frontend/paypal-commerce/AdvancedCardFields.js @@ -243,7 +243,7 @@ class AdvancedCardFields extends PaymentMethod { /** * Handle PayPal payment on approve event. * - * @since 3.1.2 Hide processing state upon error. + * @unreleased Hide processing state upon error. * @since 2.9.0 * * @param {object} payload PayPal response object after payment completion. @@ -413,7 +413,7 @@ class AdvancedCardFields extends PaymentMethod { /** * Handle hosted fields on submit errors. * - * @since 3.1.2 Handle custom error. + * @unreleased Handle custom error. * @since 2.9.0 * * @param {object} error Collection of hosted field on submit error diff --git a/give.php b/give.php index 4f3773a4d0..8ea076fbab 100644 --- a/give.php +++ b/give.php @@ -6,7 +6,7 @@ * Description: The most robust, flexible, and intuitive way to accept donations on WordPress. * Author: GiveWP * Author URI: https://givewp.com/ - * Version: 3.1.2 + * Version: 3.1.1 * Requires at least: 6.0 * Requires PHP: 7.2 * Text Domain: give @@ -391,7 +391,7 @@ private function setup_constants() { // Plugin version. if (!defined('GIVE_VERSION')) { - define('GIVE_VERSION', '3.1.2'); + define('GIVE_VERSION', '3.1.1'); } // Plugin Root File. diff --git a/readme.txt b/readme.txt index 82991b5b12..14b18f46ab 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: donation, donate, recurring donations, fundraising, crowdfunding Requires at least: 6.0 Tested up to: 6.4 Requires PHP: 7.2 -Stable tag: 3.1.2 +Stable tag: 3.1.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -262,10 +262,6 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri 10. Use almost any payment gateway integration with GiveWP through our add-ons or by creating your own add-on. == Changelog == -= 3.1.1: November 27th, 2023 = -* Fix: PayPal Donations displays a helpful error message when incorrect credit card information is entered -* Fix: Visual Donation Form Builder loading is improved by preventing the formBuilderSettings meta from becoming too large - = 3.1.1: November 3rd, 2023 = * Fix: Embedded forms created with the Visual Builder now redirect to the confirmation page after a completed donation. * Fix: Donor title prefixes are now formatted as strings (like Mr or Ms) instead of numbers. diff --git a/src/DonationForms/Actions/GetOrCreateDonor.php b/src/DonationForms/Actions/GetOrCreateDonor.php index cb775fbcf5..b2ae0b1bc8 100644 --- a/src/DonationForms/Actions/GetOrCreateDonor.php +++ b/src/DonationForms/Actions/GetOrCreateDonor.php @@ -6,14 +6,14 @@ use Give\Donors\Models\Donor; /** - * @since 3.1.2 + * @unreleased */ class GetOrCreateDonor { public $donorCreated = false; /** - * @since 3.1.2 + * @unreleased * * @throws Exception */ diff --git a/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php b/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php index 85b810c9ff..88533b767d 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php +++ b/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php @@ -13,7 +13,7 @@ class BlockRenderController { /** - * @since 3.1.2 include form url for new tab format. + * @unreleased include form url for new tab format. * @since 3.0.0 * * @return string|null diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx index 7475028a37..29f6a125ac 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx @@ -11,7 +11,7 @@ type ModalFormProps = { }; /** - * @since 3.1.2 include types. update BEM classnames. + * @unreleased include types. update BEM classnames. * @since 3.0.0 */ export default function ModalForm({dataSrc, embedId, openFormButton}: ModalFormProps) { diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx index 318f78a75a..91d093b2b0 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx @@ -13,7 +13,7 @@ type DonationFormBlockAppProps = { }; /** - * @since 3.1.2 replace form format reveal with new tab. + * @unreleased replace form format reveal with new tab. * @since 3.0.0 */ function DonationFormBlockApp({formFormat, dataSrc, embedId, openFormButton, formUrl}: DonationFormBlockAppProps) { diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/Edit.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/Edit.tsx index 6f35b3d711..cbffaec581 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/Edit.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/Edit.tsx @@ -10,7 +10,7 @@ import DonationFormBlockPreview from './components/DonationFormBlockPreview'; import './styles/index.scss'; /** - * @since 3.1.2 updated to handle v2 forms. + * @unreleased updated to handle v2 forms. * @since 3.0.0 */ export default function Edit({attributes, isSelected, setAttributes, className, clientId}: BlockEditProps) { diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockControls.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockControls.tsx index 5779a94299..5d8bc05e53 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockControls.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockControls.tsx @@ -13,7 +13,7 @@ interface DonationFormBlockControls { } /** - * @since 3.1.2 + * @unreleased */ export default function DonationFormBlockControls({ attributes, diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockPreview.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockPreview.tsx index fa621fb5e3..41c501d516 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockPreview.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockPreview.tsx @@ -13,7 +13,7 @@ interface BlockPreviewProps { } /** - * @since 3.1.2 replace reveal for newTab display. + * @unreleased replace reveal for newTab display. * @since 3.0.0 */ export default function DonationFormBlockPreview({ diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormSelector.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormSelector.tsx index 912f91e39c..f9fd3211d2 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormSelector.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormSelector.tsx @@ -12,7 +12,7 @@ import '../styles/index.scss'; const savePost = () => dispatch('core/editor').savePost(); /** - * @since 3.1.2 + * @unreleased */ export default function DonationFormSelector({formOptions, isResolving, handleSelect}) { const [selectedForm, setSelectedForm] = useState(null); diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/ModalPreview.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/ModalPreview.tsx index aed6953bfb..44550085d8 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/ModalPreview.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/ModalPreview.tsx @@ -11,7 +11,7 @@ type ModalPreviewProps = { }; /** - * @since 3.1.2 updated BEM classnames and included button component. + * @unreleased updated BEM classnames and included button component. * @since 3.0.0 */ export default function ModalPreview({enableIframe, formId, openFormButton}: ModalPreviewProps) { diff --git a/src/DonationForms/Controllers/DonateController.php b/src/DonationForms/Controllers/DonateController.php index b69166df50..48c1044a09 100644 --- a/src/DonationForms/Controllers/DonateController.php +++ b/src/DonationForms/Controllers/DonateController.php @@ -20,7 +20,7 @@ class DonateController /** * First we create a donation and/or subscription, then move on to the gateway processing * - * @since 3.1.2 Pass the form ID to match updated signature for getOrCreateDonor(). + * @unreleased Pass the form ID to match updated signature for getOrCreateDonor(). * @since 3.0.0 * * @return void @@ -79,7 +79,7 @@ public function donate(DonateControllerData $formData, PaymentGateway $gateway) } /** - * @since 3.1.2 Added $formId to the signature for passing to do_action hooks. Added honorific and use GetOrCreateDonor action + * @unreleased Added $formId to the signature for passing to do_action hooks. Added honorific and use GetOrCreateDonor action * @since 3.0.0 * * @throws Exception @@ -104,7 +104,7 @@ private function getOrCreateDonor( if ($getOrCreateDonorAction->donorCreated) { /** - * @since 3.1.2 Add a new do_action hook to differentiate when a v3 form creates a new donor. + * @unreleased Add a new do_action hook to differentiate when a v3 form creates a new donor. * @param Donor $donor * @param int $formId */ diff --git a/src/DonationForms/Migrations/CleanMultipleSlashesOnDB.php b/src/DonationForms/Migrations/CleanMultipleSlashesOnDB.php index 9e6e01404d..9e017f8f2a 100644 --- a/src/DonationForms/Migrations/CleanMultipleSlashesOnDB.php +++ b/src/DonationForms/Migrations/CleanMultipleSlashesOnDB.php @@ -7,12 +7,12 @@ use Give\Framework\Migrations\Contracts\Migration; /** - * @since 3.1.2 + * @unreleased */ class CleanMultipleSlashesOnDB extends Migration { /** - * @since 3.1.2 + * @unreleased */ public function run() { @@ -65,7 +65,7 @@ public static function timestamp() } /** - * @since 3.1.2 + * @unreleased */ public function cleanMultipleSlashes($var) { diff --git a/src/DonationForms/Properties/FormSettings.php b/src/DonationForms/Properties/FormSettings.php index 0a701471bf..d85720c18e 100644 --- a/src/DonationForms/Properties/FormSettings.php +++ b/src/DonationForms/Properties/FormSettings.php @@ -8,7 +8,7 @@ use Give\Framework\Support\Contracts\Jsonable; /** - * @since 3.1.2 Remove addSlashesRecursive method + * @unreleased Remove addSlashesRecursive method * @since 3.0.0 */ class FormSettings implements Arrayable, Jsonable @@ -66,7 +66,7 @@ class FormSettings implements Arrayable, Jsonable */ public $goalAmount; /** - * @since 3.1.2 Added registrationNotification property. + * @unreleased Added registrationNotification property. * @var string */ public $registrationNotification; @@ -179,7 +179,7 @@ class FormSettings implements Arrayable, Jsonable public $pdfSettings; /** - * @since 3.1.2 Added registrationNotification + * @unreleased Added registrationNotification * @since 3.0.0 */ public static function fromArray(array $array): self @@ -275,7 +275,7 @@ public function toArray(): array } /** - * @since 3.1.2 Remove call to addSlashesRecursive method for emailTemplateOptions in favor of SanitizeDonationFormPreviewRequest class + * @unreleased Remove call to addSlashesRecursive method for emailTemplateOptions in favor of SanitizeDonationFormPreviewRequest class * @since 3.0.0 */ public function toJson($options = 0): string diff --git a/src/DonationForms/Shortcodes/GiveFormShortcode.php b/src/DonationForms/Shortcodes/GiveFormShortcode.php index f369952ba1..e76e54871d 100644 --- a/src/DonationForms/Shortcodes/GiveFormShortcode.php +++ b/src/DonationForms/Shortcodes/GiveFormShortcode.php @@ -13,7 +13,7 @@ class GiveFormShortcode public static $instance = 0; /** - * @since 3.1.2 include v3 block attributes for shortcode. + * @unreleased include v3 block attributes for shortcode. * @since 3.1.1 use static instance ID to simulate blockId attribute * @since 3.0.0 */ diff --git a/src/Donors/Actions/CreateUserFromDonor.php b/src/Donors/Actions/CreateUserFromDonor.php index 46ffac2cda..52a198afee 100644 --- a/src/Donors/Actions/CreateUserFromDonor.php +++ b/src/Donors/Actions/CreateUserFromDonor.php @@ -6,7 +6,7 @@ use Give\Donors\Models\Donor; /** - * @since 3.1.2 + * @unreleased */ class CreateUserFromDonor { diff --git a/src/Donors/Actions/SendDonorUserRegistrationNotification.php b/src/Donors/Actions/SendDonorUserRegistrationNotification.php index 6eb6e0d8d9..4ab8ba552e 100644 --- a/src/Donors/Actions/SendDonorUserRegistrationNotification.php +++ b/src/Donors/Actions/SendDonorUserRegistrationNotification.php @@ -6,7 +6,7 @@ use Give_Donor_Register_Email; /** - * @since 3.1.2 + * @unreleased */ class SendDonorUserRegistrationNotification { diff --git a/src/Donors/Exceptions/FailedDonorUserCreationException.php b/src/Donors/Exceptions/FailedDonorUserCreationException.php index ce4714b908..3665c64fea 100644 --- a/src/Donors/Exceptions/FailedDonorUserCreationException.php +++ b/src/Donors/Exceptions/FailedDonorUserCreationException.php @@ -8,7 +8,7 @@ use Give\Framework\Exceptions\Primitives\Exception; /** - * @since 3.1.2 + * @unreleased */ class FailedDonorUserCreationException extends Exception { diff --git a/src/Donors/ServiceProvider.php b/src/Donors/ServiceProvider.php index d84b4d0894..6d1ec658ec 100644 --- a/src/Donors/ServiceProvider.php +++ b/src/Donors/ServiceProvider.php @@ -72,7 +72,7 @@ private function addCustomFieldsToDonorDetails() /** * Hook into the donor creation process to ensure that donors are also users. - * @since 3.1.2 + * @unreleased */ protected function enforceDonorsAsUsers() { diff --git a/src/FormBuilder/resources/js/form-builder/src/components/ClassicEditor/index.js b/src/FormBuilder/resources/js/form-builder/src/components/ClassicEditor/index.js index 878f2f800d..1e8255cbaa 100644 --- a/src/FormBuilder/resources/js/form-builder/src/components/ClassicEditor/index.js +++ b/src/FormBuilder/resources/js/form-builder/src/components/ClassicEditor/index.js @@ -35,7 +35,7 @@ function isTmceEmpty(editor) { } /** - * @since 3.1.2 + * @unreleased */ export default function ClassicEditor({id, label, content, setContent, rows = 20}) { const didMount = useRef(false); diff --git a/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php b/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php index 7c5f476ca8..e2da040168 100644 --- a/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php +++ b/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php @@ -49,7 +49,7 @@ public function getLegacyFormFieldMarkup( /** * First we create a payment, then move on to the gateway processing * - * @since 3.1.2 Capture exceptions when get gateway data. + * @unreleased Capture exceptions when get gateway data. * @since 3.0.0 Catch and handle errors from the gateway here * @since 2.30.0 Add success, cancel and failed URLs to gateway data. This will be used in both v2 and v3 forms so gateways can just refer to the gateway data. * @since 2.24.0 add support for payment mode @@ -283,7 +283,7 @@ private function setSession($donationId) } /** - * @since 3.1.2 add honorific and use GetOrCreateDonor action + * @unreleased add honorific and use GetOrCreateDonor action * @since 2.21.0 * * @throws Exception diff --git a/src/PaymentGateways/Actions/RegisterPaymentGateways.php b/src/PaymentGateways/Actions/RegisterPaymentGateways.php index 9f4dbb2a1d..42843b9c86 100644 --- a/src/PaymentGateways/Actions/RegisterPaymentGateways.php +++ b/src/PaymentGateways/Actions/RegisterPaymentGateways.php @@ -132,7 +132,7 @@ function ($gatewayData, Donation $donation) { } /** - * @since 3.1.2 Prevent undefined index notice when getting payPalOrderId from gateway data. + * @unreleased Prevent undefined index notice when getting payPalOrderId from gateway data. * @since 2.26.0 Add support for the updated PayPal Commerce gateway data. * @since 2.21.2 * diff --git a/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx b/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx index 63f7b9cea1..bc100fce35 100644 --- a/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx +++ b/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx @@ -427,7 +427,7 @@ import {PayPalSubscriber} from "./types"; }, /** * Before create payment. - * @since 3.1.2 Handle error response in approveOrderCallback. + * @unreleased Handle error response in approveOrderCallback. * @param {Object} values */ beforeCreatePayment: async function (values): Promise { diff --git a/src/PaymentGateways/PayPalCommerce/AjaxRequestHandler.php b/src/PaymentGateways/PayPalCommerce/AjaxRequestHandler.php index 217d1e83c5..130bf4115d 100644 --- a/src/PaymentGateways/PayPalCommerce/AjaxRequestHandler.php +++ b/src/PaymentGateways/PayPalCommerce/AjaxRequestHandler.php @@ -279,7 +279,7 @@ public function createOrder() * * @todo: handle payment capture error on frontend. * - * @since 3.1.2 Discover error by checking capture status. + * @unreleased Discover error by checking capture status. * @since 2.9.0 */ public function approveOrder() @@ -389,7 +389,7 @@ private function getDonorAddressFromPostedDataForPaypalOrder(array $postedData): /** * This function should validate PayPal ApproveOrder response and respond to ajax request on error. * - * @since 3.1.2 + * @unreleased */ private function returnErrorOnFailedApproveOrderResponse(\stdClass $response) { diff --git a/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/ProcessorResponseError.php b/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/ProcessorResponseError.php index 9fd9c0cd9b..777c09a8f3 100644 --- a/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/ProcessorResponseError.php +++ b/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/ProcessorResponseError.php @@ -8,13 +8,13 @@ * Source of errors * - https://developer.paypal.com/docs/api/orders/v2/#definition-processor_response * - * @since 3.1.2 + * @unreleased */ class ProcessorResponseError { /** * This function decode the error code from PayPal. - * @since 3.1.2 + * @unreleased * @param \stdClass $processorResponse */ public static function getError(\stdClass $processorResponse): string @@ -66,7 +66,7 @@ public static function getError(\stdClass $processorResponse): string } /** - * @since 3.1.2 + * @unreleased */ private function avsCode(): array { @@ -193,7 +193,7 @@ private function cvvCode(): array } /** - * @since 3.1.2 + * @unreleased */ private function responseCode(): array { @@ -368,7 +368,7 @@ private function responseCode(): array } /** - * @since 3.1.2 + * @unreleased */ private function paymentAdviceCode(): array { diff --git a/src/PaymentGateways/PayPalCommerce/ScriptLoader.php b/src/PaymentGateways/PayPalCommerce/ScriptLoader.php index e73f21f869..5969e16852 100644 --- a/src/PaymentGateways/PayPalCommerce/ScriptLoader.php +++ b/src/PaymentGateways/PayPalCommerce/ScriptLoader.php @@ -188,7 +188,7 @@ function givePayPalOnBoardedCallback(mode, authCode, sharedId) { /** * Load public assets. * - * @since 3.1.2 Use EnqueueScript to register and enqueue script. + * @unreleased Use EnqueueScript to register and enqueue script. * @since 2.32.0 Handle exception if client token is not generated. * @since 2.9.0 */ diff --git a/tests/Unit/DonationForms/Actions/TestGetOrCreateDonor.php b/tests/Unit/DonationForms/Actions/TestGetOrCreateDonor.php index cf40b24ecc..026fbfe945 100644 --- a/tests/Unit/DonationForms/Actions/TestGetOrCreateDonor.php +++ b/tests/Unit/DonationForms/Actions/TestGetOrCreateDonor.php @@ -13,7 +13,7 @@ class TestGetOrCreateDonor extends TestCase use RefreshDatabase; /** - * @since 3.1.2 + * @unreleased * * @throws Exception */ @@ -28,7 +28,7 @@ public function testShouldReturnExistingDonorWithMatchingEmail(): void } /** - * @since 3.1.2 + * @unreleased * * @throws Exception */ @@ -43,7 +43,7 @@ public function testShouldReturnExistingDonorWithMatchingUserId(): void } /** - * @since 3.1.2 + * @unreleased * @throws Exception */ public function testShouldReturnExistingDonorWithUserIdAndUpdateAdditionalEmails(): void @@ -59,7 +59,7 @@ public function testShouldReturnExistingDonorWithUserIdAndUpdateAdditionalEmails } /** - * @since 3.1.2 + * @unreleased * * @throws Exception */ @@ -75,7 +75,7 @@ public function testShouldReturnExistingDonorWithUserIdAndNotUpdateAdditionalEma } /** - * @since 3.1.2 + * @unreleased * * @throws Exception */ From 076aeb4d0d502b9274d12fcc267d5a6b4f96218c Mon Sep 17 00:00:00 2001 From: Ravinder Kumar Date: Wed, 6 Dec 2023 21:44:02 +0530 Subject: [PATCH 2/5] Hotfix: PayPal Donations payment methods should render in donation form (#7121) --- .../PayPalCommerce/ScriptLoader.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/PaymentGateways/PayPalCommerce/ScriptLoader.php b/src/PaymentGateways/PayPalCommerce/ScriptLoader.php index 5969e16852..ab675688ce 100644 --- a/src/PaymentGateways/PayPalCommerce/ScriptLoader.php +++ b/src/PaymentGateways/PayPalCommerce/ScriptLoader.php @@ -188,6 +188,7 @@ function givePayPalOnBoardedCallback(mode, authCode, sharedId) { /** * Load public assets. * + * @unreleased Get form id from post content if form id is not available. * @unreleased Use EnqueueScript to register and enqueue script. * @since 2.32.0 Handle exception if client token is not generated. * @since 2.9.0 @@ -196,6 +197,10 @@ public function loadPublicAssets() { $formId = FrontendFormTemplateUtils::getFormId(); + if (! $formId) { + $formId = $this->getFormIdFromPostContent(); + } + if ( ! $formId || \Give\Helpers\Form\Utils::isV3Form($formId) @@ -282,4 +287,56 @@ private function getPartnerJsUrl() { return 'https://www.paypal.com/webapps/merchantboarding/js/lib/lightbox/partner.js'; } + + /** + * This function should return form id from page, post content. + * + * + * @unreleased + */ + private function getFormIdFromPostContent(): ?int + { + global $post; + $formId = null; + + if (!$post) { + return null; + } + + + // Donation form can be in page, post content as shortcode. + $has_shortcode = $post && has_shortcode($post->post_content, 'give_form'); + if ($has_shortcode) { + $pattern = get_shortcode_regex(['give_form']); + + if ( + preg_match('/' . $pattern . '/s', $post->post_content, $matches) + && array_key_exists(2, $matches) + && 'give_form' === $matches[2] + ) { + $attributes = shortcode_parse_atts($matches[3]); + + if (array_key_exists('id', $attributes)) { + $formId = $attributes['id']; + } + } + } + + // Donation form can be in page, post content as Donation Form block. + if (!$formId) { + $blocks = parse_blocks($post->post_content); + + foreach ($blocks as $block) { + if ( + $block['blockName'] === 'give/donation-form' + && array_key_exists('id', $block['attrs']) + ) { + $formId = $block['attrs']['id']; + break; + } + } + } + + return absint($formId); + } } From e799fb2ce7d8562b7ef22ba622a9cf5ded962447 Mon Sep 17 00:00:00 2001 From: Ravinder Kumar Date: Wed, 6 Dec 2023 21:46:29 +0530 Subject: [PATCH 3/5] Fix: add fee to donation amount if any (#7111) --- .../PayPalCommerce/payPalCommerceGateway.tsx | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx b/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx index 63f7b9cea1..f4606ef30f 100644 --- a/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx +++ b/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx @@ -24,6 +24,7 @@ import {PayPalSubscriber} from "./types"; * a component, so it cannot use hooks to access the form field values. */ let amount; + let feeRecovery; let firstName; let lastName; let email; @@ -92,6 +93,20 @@ import {PayPalSubscriber} from "./types"; return paypalScriptOptions; } + /** + * Get amount with fee (if any). + * + * @unreleased + * @return {number} Amount with fee. + */ + const getAmount = () => { + const feeAmount = feeRecovery ? feeRecovery : 0; + let amountWithFee = amount + feeAmount + amountWithFee = Math.round(amountWithFee * 100) / 100; + + return amountWithFee; + } + const getFormData = () => { const formData = new FormData(); @@ -100,7 +115,7 @@ import {PayPalSubscriber} from "./types"; formData.append('give_payment_mode', 'paypal-commerce'); - formData.append('give-amount', amount); + formData.append('give-amount', getAmount() ); formData.append('give-recurring-period', subscriptionPeriod); formData.append('period', subscriptionPeriod); @@ -229,6 +244,7 @@ import {PayPalSubscriber} from "./types"; const {useWatch} = window.givewp.form.hooks; amount = useWatch({name: 'amount'}); + feeRecovery = useWatch({name: 'feeRecovery'}); firstName = useWatch({name: 'firstName'}); lastName = useWatch({name: 'lastName'}); email = useWatch({name: 'email'}); @@ -260,7 +276,7 @@ import {PayPalSubscriber} from "./types"; const props = { style: buttonsStyle, disabled: isSubmitting || isSubmitSuccessful, - forceReRender: debounce(() => [amount, firstName, lastName, email, currency], 500), + forceReRender: debounce(() => [amount, feeRecovery, firstName, lastName, email, currency], 500), onClick: async (data, actions) => { // Validate whether payment gateway support subscriptions. if (donationType === 'subscription' && !gateway.supportsSubscriptions) { From 10a46db81a4dc6bbcc8feaed23236839ca806754 Mon Sep 17 00:00:00 2001 From: Jon Waldstein Date: Wed, 6 Dec 2023 11:40:33 -0500 Subject: [PATCH 4/5] chore: update version to 3.2.0, update since tags, update readme changelog --- .../paypal-commerce/AdvancedCardFields.js | 4 ++-- give.php | 4 ++-- readme.txt | 15 +++++++++++---- src/DonationForms/Actions/GetOrCreateDonor.php | 4 ++-- .../Controllers/BlockRenderController.php | 2 +- .../resources/app/Components/ModalForm.tsx | 2 +- .../DonationFormBlock/resources/app/index.tsx | 2 +- .../DonationFormBlock/resources/editor/Edit.tsx | 2 +- .../components/DonationFormBlockControls.tsx | 2 +- .../components/DonationFormBlockPreview.tsx | 2 +- .../editor/components/DonationFormSelector.tsx | 2 +- .../resources/editor/components/ModalPreview.tsx | 2 +- .../Controllers/DonateController.php | 6 +++--- .../DataTransferObjects/DonateControllerData.php | 2 +- .../Migrations/CleanMultipleSlashesOnDB.php | 6 +++--- src/DonationForms/Properties/FormSettings.php | 8 ++++---- .../Shortcodes/GiveFormShortcode.php | 2 +- src/DonationForms/V2/DonationFormsAdminPage.php | 2 +- .../V2/Endpoints/ListDonationForms.php | 2 +- .../DataTransferObjects/DonationQueryData.php | 4 ++-- src/Donations/Endpoints/ListDonations.php | 2 +- src/Donations/Repositories/DonationRepository.php | 2 +- src/Donations/ValueObjects/DonationMetaKeys.php | 2 +- src/Donors/Actions/CreateUserFromDonor.php | 2 +- .../SendDonorUserRegistrationNotification.php | 2 +- .../FailedDonorUserCreationException.php | 2 +- src/Donors/ServiceProvider.php | 2 +- .../ViewModels/FormBuilderViewModel.php | 2 +- .../src/components/ClassicEditor/index.js | 2 +- .../src/components/EmbedForm/index.tsx | 2 +- .../Adapters/LegacyPaymentGatewayAdapter.php | 4 ++-- .../Actions/RegisterPaymentGateways.php | 2 +- .../DataTransferObjects/FormData.php | 2 +- .../PayPalCommerce/payPalCommerceGateway.tsx | 4 ++-- .../PayPalCommerce/AjaxRequestHandler.php | 4 ++-- .../PayPalCheckoutSdk/ProcessorResponseError.php | 10 +++++----- .../PayPalCommerce/ScriptLoader.php | 6 +++--- .../DonateControllerDataTest.php | 2 +- .../Actions/TestGetOrCreateDonor.php | 10 +++++----- .../Repositories/TestDonationRepository.php | 2 +- .../Unit/ViewModels/FormBuilderViewModelTest.php | 2 +- 41 files changed, 75 insertions(+), 68 deletions(-) diff --git a/assets/src/js/frontend/paypal-commerce/AdvancedCardFields.js b/assets/src/js/frontend/paypal-commerce/AdvancedCardFields.js index 6b4c1d31cd..811185e4fa 100644 --- a/assets/src/js/frontend/paypal-commerce/AdvancedCardFields.js +++ b/assets/src/js/frontend/paypal-commerce/AdvancedCardFields.js @@ -243,7 +243,7 @@ class AdvancedCardFields extends PaymentMethod { /** * Handle PayPal payment on approve event. * - * @unreleased Hide processing state upon error. + * @since 3.2.0 Hide processing state upon error. * @since 2.9.0 * * @param {object} payload PayPal response object after payment completion. @@ -413,7 +413,7 @@ class AdvancedCardFields extends PaymentMethod { /** * Handle hosted fields on submit errors. * - * @unreleased Handle custom error. + * @since 3.2.0 Handle custom error. * @since 2.9.0 * * @param {object} error Collection of hosted field on submit error diff --git a/give.php b/give.php index 8ea076fbab..5c8d68c49b 100644 --- a/give.php +++ b/give.php @@ -6,7 +6,7 @@ * Description: The most robust, flexible, and intuitive way to accept donations on WordPress. * Author: GiveWP * Author URI: https://givewp.com/ - * Version: 3.1.1 + * Version: 3.2.0 * Requires at least: 6.0 * Requires PHP: 7.2 * Text Domain: give @@ -391,7 +391,7 @@ private function setup_constants() { // Plugin version. if (!defined('GIVE_VERSION')) { - define('GIVE_VERSION', '3.1.1'); + define('GIVE_VERSION', '3.2.0'); } // Plugin Root File. diff --git a/readme.txt b/readme.txt index 65798eb7ee..52b330b449 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: donation, donate, recurring donations, fundraising, crowdfunding Requires at least: 6.0 Tested up to: 6.4 Requires PHP: 7.2 -Stable tag: 3.1.2 +Stable tag: 3.2.0 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -262,15 +262,22 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri 10. Use almost any payment gateway integration with GiveWP through our add-ons or by creating your own add-on. == Changelog == -= 3.1.2: November 27th, 2023 = += 3.2.0: Dec 6th, 2023 = * Enhancement: Updated parts of the Form Builder text areas to Text Editors to provide more formatting options * Enhancement: Improved compatibility with the donation block and Visual Builder forms * Enhancement: All donors are connected with a user for improved security and caching compatibility +* Enhancement: Improve the Name, and Terms and Conditions blocks with global settings +* New: Embed form button added to the Visual Donation Form Builder +* New: Pre-publish confirmation panel added to the Visual Donation Form Builder * Fix: Resolved some strange behaviors when using the Amount Levels setting in the Form Builder * Fix: Removed WP_Background_Process and WP_Async_Request to avoid conflicts with other plugins * Fix: Donor honorific (Mr, Mrs, etc) is now properly saved as part of the donor record -* Fix: PayPal Donations displays a helpful error message when incorrect credit card information is entered -* Fix: Visual Donation Form Builder loading is improved by preventing the formBuilderSettings meta from becoming too large +* Fix: PayPal Donations displays a helpful error message when incorrect credit card information is entered +* Fix: Visual Donation Form Builder loading is improved by preventing the formBuilderSettings meta from becoming too large +* Fix: Resolved an issue where some donations list tables were failing to load due to missing donation mode meta +* Fix: Resolved an issue where the donation forms list tables were resulting in duplicate forms +* Fix: Resolved an issue where PayPal smart buttons were not being displayed on embedded forms using legacy template +* Fix: Resolved an issue with PayPal donations and fee recovery where the fee was not being added to the donation total = 3.1.1: November 3rd, 2023 = * Fix: Embedded forms created with the Visual Builder now redirect to the confirmation page after a completed donation. diff --git a/src/DonationForms/Actions/GetOrCreateDonor.php b/src/DonationForms/Actions/GetOrCreateDonor.php index b2ae0b1bc8..37872770a2 100644 --- a/src/DonationForms/Actions/GetOrCreateDonor.php +++ b/src/DonationForms/Actions/GetOrCreateDonor.php @@ -6,14 +6,14 @@ use Give\Donors\Models\Donor; /** - * @unreleased + * @since 3.2.0 */ class GetOrCreateDonor { public $donorCreated = false; /** - * @unreleased + * @since 3.2.0 * * @throws Exception */ diff --git a/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php b/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php index c236c3e839..55e6194b4e 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php +++ b/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php @@ -13,7 +13,7 @@ class BlockRenderController { /** - * @unreleased include form url for new tab format. + * @since 3.2.0 include form url for new tab format. * @since 3.0.0 * * @return string|null diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx index 29f6a125ac..154d0a240d 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx @@ -11,7 +11,7 @@ type ModalFormProps = { }; /** - * @unreleased include types. update BEM classnames. + * @since 3.2.0 include types. update BEM classnames. * @since 3.0.0 */ export default function ModalForm({dataSrc, embedId, openFormButton}: ModalFormProps) { diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx index 91d093b2b0..1fbc859a9b 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx @@ -13,7 +13,7 @@ type DonationFormBlockAppProps = { }; /** - * @unreleased replace form format reveal with new tab. + * @since 3.2.0 replace form format reveal with new tab. * @since 3.0.0 */ function DonationFormBlockApp({formFormat, dataSrc, embedId, openFormButton, formUrl}: DonationFormBlockAppProps) { diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/Edit.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/Edit.tsx index cbffaec581..51f7295207 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/Edit.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/Edit.tsx @@ -10,7 +10,7 @@ import DonationFormBlockPreview from './components/DonationFormBlockPreview'; import './styles/index.scss'; /** - * @unreleased updated to handle v2 forms. + * @since 3.2.0 updated to handle v2 forms. * @since 3.0.0 */ export default function Edit({attributes, isSelected, setAttributes, className, clientId}: BlockEditProps) { diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockControls.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockControls.tsx index 5d8bc05e53..2376aea0b7 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockControls.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockControls.tsx @@ -13,7 +13,7 @@ interface DonationFormBlockControls { } /** - * @unreleased + * @since 3.2.0 */ export default function DonationFormBlockControls({ attributes, diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockPreview.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockPreview.tsx index 41c501d516..3d5f7cf8d2 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockPreview.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormBlockPreview.tsx @@ -13,7 +13,7 @@ interface BlockPreviewProps { } /** - * @unreleased replace reveal for newTab display. + * @since 3.2.0 replace reveal for newTab display. * @since 3.0.0 */ export default function DonationFormBlockPreview({ diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormSelector.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormSelector.tsx index f9fd3211d2..3765715582 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormSelector.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/DonationFormSelector.tsx @@ -12,7 +12,7 @@ import '../styles/index.scss'; const savePost = () => dispatch('core/editor').savePost(); /** - * @unreleased + * @since 3.2.0 */ export default function DonationFormSelector({formOptions, isResolving, handleSelect}) { const [selectedForm, setSelectedForm] = useState(null); diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/ModalPreview.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/ModalPreview.tsx index 44550085d8..07d5a05387 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/ModalPreview.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/editor/components/ModalPreview.tsx @@ -11,7 +11,7 @@ type ModalPreviewProps = { }; /** - * @unreleased updated BEM classnames and included button component. + * @since 3.2.0 updated BEM classnames and included button component. * @since 3.0.0 */ export default function ModalPreview({enableIframe, formId, openFormButton}: ModalPreviewProps) { diff --git a/src/DonationForms/Controllers/DonateController.php b/src/DonationForms/Controllers/DonateController.php index 48c1044a09..e1f284af7d 100644 --- a/src/DonationForms/Controllers/DonateController.php +++ b/src/DonationForms/Controllers/DonateController.php @@ -20,7 +20,7 @@ class DonateController /** * First we create a donation and/or subscription, then move on to the gateway processing * - * @unreleased Pass the form ID to match updated signature for getOrCreateDonor(). + * @since 3.2.0 Pass the form ID to match updated signature for getOrCreateDonor(). * @since 3.0.0 * * @return void @@ -79,7 +79,7 @@ public function donate(DonateControllerData $formData, PaymentGateway $gateway) } /** - * @unreleased Added $formId to the signature for passing to do_action hooks. Added honorific and use GetOrCreateDonor action + * @since 3.2.0 Added $formId to the signature for passing to do_action hooks. Added honorific and use GetOrCreateDonor action * @since 3.0.0 * * @throws Exception @@ -104,7 +104,7 @@ private function getOrCreateDonor( if ($getOrCreateDonorAction->donorCreated) { /** - * @unreleased Add a new do_action hook to differentiate when a v3 form creates a new donor. + * @since 3.2.0 Add a new do_action hook to differentiate when a v3 form creates a new donor. * @param Donor $donor * @param int $formId */ diff --git a/src/DonationForms/DataTransferObjects/DonateControllerData.php b/src/DonationForms/DataTransferObjects/DonateControllerData.php index a1cade06b1..4c4976c00f 100644 --- a/src/DonationForms/DataTransferObjects/DonateControllerData.php +++ b/src/DonationForms/DataTransferObjects/DonateControllerData.php @@ -126,7 +126,7 @@ class DonateControllerData public $comment; /** - * @unreleased added honorific property + * @since 3.2.0 added honorific property * @since 3.0.0 */ public function toDonation(int $donorId): Donation diff --git a/src/DonationForms/Migrations/CleanMultipleSlashesOnDB.php b/src/DonationForms/Migrations/CleanMultipleSlashesOnDB.php index 9e017f8f2a..5aec819639 100644 --- a/src/DonationForms/Migrations/CleanMultipleSlashesOnDB.php +++ b/src/DonationForms/Migrations/CleanMultipleSlashesOnDB.php @@ -7,12 +7,12 @@ use Give\Framework\Migrations\Contracts\Migration; /** - * @unreleased + * @since 3.2.0 */ class CleanMultipleSlashesOnDB extends Migration { /** - * @unreleased + * @since 3.2.0 */ public function run() { @@ -65,7 +65,7 @@ public static function timestamp() } /** - * @unreleased + * @since 3.2.0 */ public function cleanMultipleSlashes($var) { diff --git a/src/DonationForms/Properties/FormSettings.php b/src/DonationForms/Properties/FormSettings.php index d85720c18e..9fc46b7ba3 100644 --- a/src/DonationForms/Properties/FormSettings.php +++ b/src/DonationForms/Properties/FormSettings.php @@ -8,7 +8,7 @@ use Give\Framework\Support\Contracts\Jsonable; /** - * @unreleased Remove addSlashesRecursive method + * @since 3.2.0 Remove addSlashesRecursive method * @since 3.0.0 */ class FormSettings implements Arrayable, Jsonable @@ -66,7 +66,7 @@ class FormSettings implements Arrayable, Jsonable */ public $goalAmount; /** - * @unreleased Added registrationNotification property. + * @since 3.2.0 Added registrationNotification property. * @var string */ public $registrationNotification; @@ -179,7 +179,7 @@ class FormSettings implements Arrayable, Jsonable public $pdfSettings; /** - * @unreleased Added registrationNotification + * @since 3.2.0 Added registrationNotification * @since 3.0.0 */ public static function fromArray(array $array): self @@ -275,7 +275,7 @@ public function toArray(): array } /** - * @unreleased Remove call to addSlashesRecursive method for emailTemplateOptions in favor of SanitizeDonationFormPreviewRequest class + * @since 3.2.0 Remove call to addSlashesRecursive method for emailTemplateOptions in favor of SanitizeDonationFormPreviewRequest class * @since 3.0.0 */ public function toJson($options = 0): string diff --git a/src/DonationForms/Shortcodes/GiveFormShortcode.php b/src/DonationForms/Shortcodes/GiveFormShortcode.php index 1f01735f08..0a011efe68 100644 --- a/src/DonationForms/Shortcodes/GiveFormShortcode.php +++ b/src/DonationForms/Shortcodes/GiveFormShortcode.php @@ -13,7 +13,7 @@ class GiveFormShortcode public static $instance = 0; /** - * @unreleased include v3 block attributes for shortcode. + * @since 3.2.0 include v3 block attributes for shortcode. * @since 3.1.1 use static instance ID to simulate blockId attribute * @since 3.0.0 */ diff --git a/src/DonationForms/V2/DonationFormsAdminPage.php b/src/DonationForms/V2/DonationFormsAdminPage.php index 9492f88875..796f52d234 100644 --- a/src/DonationForms/V2/DonationFormsAdminPage.php +++ b/src/DonationForms/V2/DonationFormsAdminPage.php @@ -125,7 +125,7 @@ public function loadScripts() /** * Load migration onboarding scripts - * @unreleased + * @since 3.2.0 * * @return void */ diff --git a/src/DonationForms/V2/Endpoints/ListDonationForms.php b/src/DonationForms/V2/Endpoints/ListDonationForms.php index 22b07f4d8c..ad8004c40f 100644 --- a/src/DonationForms/V2/Endpoints/ListDonationForms.php +++ b/src/DonationForms/V2/Endpoints/ListDonationForms.php @@ -149,7 +149,7 @@ public function handleRequest(WP_REST_Request $request): WP_REST_Response } /** - * @unreleased added distinct() to the query + * @since 3.2.0 added distinct() to the query * @since 2.24.0 Refactor to query through the ModelQueryBuilder * * @return array diff --git a/src/Donations/DataTransferObjects/DonationQueryData.php b/src/Donations/DataTransferObjects/DonationQueryData.php index 55c811f578..5b53b5956c 100644 --- a/src/Donations/DataTransferObjects/DonationQueryData.php +++ b/src/Donations/DataTransferObjects/DonationQueryData.php @@ -15,7 +15,7 @@ /** * Class DonationData * - * @unreleased added honorific property + * @since 3.2.0 added honorific property * @since 2.23.0 remove parentId property * @since 2.19.6 */ @@ -129,7 +129,7 @@ final class DonationQueryData /** * Convert data from object to Donation * - * @unreleased add fallback for donation mode + * @since 3.2.0 add fallback for donation mode * @since 2.23.0 remove parentId property * @since 2.22.0 add support for company field * @since 2.20.0 update for new amount property, fee amount recovered, and exchange rate diff --git a/src/Donations/Endpoints/ListDonations.php b/src/Donations/Endpoints/ListDonations.php index a82728ea45..96e7519858 100644 --- a/src/Donations/Endpoints/ListDonations.php +++ b/src/Donations/Endpoints/ListDonations.php @@ -209,7 +209,7 @@ public function getTotalDonationsCount(): int } /** - * @unreleased Updated query to account for possible null and empty values for _give_payment_mode meta + * @since 3.2.0 Updated query to account for possible null and empty values for _give_payment_mode meta * @since 2.24.0 Remove joins as it uses ModelQueryBuilder and change clauses to use attach_meta * @since 2.21.0 * diff --git a/src/Donations/Repositories/DonationRepository.php b/src/Donations/Repositories/DonationRepository.php index f2c4110a80..84fb6d85e7 100644 --- a/src/Donations/Repositories/DonationRepository.php +++ b/src/Donations/Repositories/DonationRepository.php @@ -316,7 +316,7 @@ public function delete(Donation $donation): bool } /** - * @unreleased added meta for honorific property + * @since 3.2.0 added meta for honorific property * @since 2.20.0 update amount to use new type, and add currency and exchange rate * @since 2.19.6 */ diff --git a/src/Donations/ValueObjects/DonationMetaKeys.php b/src/Donations/ValueObjects/DonationMetaKeys.php index 811ce603ec..b5645d3213 100644 --- a/src/Donations/ValueObjects/DonationMetaKeys.php +++ b/src/Donations/ValueObjects/DonationMetaKeys.php @@ -6,7 +6,7 @@ use Give\Framework\Support\ValueObjects\EnumInteractsWithQueryBuilder; /** - * @unreleased added HONORIFIC + * @since 3.2.0 added HONORIFIC * @since 2.20.0 add fee amount recovered and exchange rate * @since 2.19.6 * diff --git a/src/Donors/Actions/CreateUserFromDonor.php b/src/Donors/Actions/CreateUserFromDonor.php index 52a198afee..704807ae09 100644 --- a/src/Donors/Actions/CreateUserFromDonor.php +++ b/src/Donors/Actions/CreateUserFromDonor.php @@ -6,7 +6,7 @@ use Give\Donors\Models\Donor; /** - * @unreleased + * @since 3.2.0 */ class CreateUserFromDonor { diff --git a/src/Donors/Actions/SendDonorUserRegistrationNotification.php b/src/Donors/Actions/SendDonorUserRegistrationNotification.php index 4ab8ba552e..1f9da9a315 100644 --- a/src/Donors/Actions/SendDonorUserRegistrationNotification.php +++ b/src/Donors/Actions/SendDonorUserRegistrationNotification.php @@ -6,7 +6,7 @@ use Give_Donor_Register_Email; /** - * @unreleased + * @since 3.2.0 */ class SendDonorUserRegistrationNotification { diff --git a/src/Donors/Exceptions/FailedDonorUserCreationException.php b/src/Donors/Exceptions/FailedDonorUserCreationException.php index 3665c64fea..cb15092d99 100644 --- a/src/Donors/Exceptions/FailedDonorUserCreationException.php +++ b/src/Donors/Exceptions/FailedDonorUserCreationException.php @@ -8,7 +8,7 @@ use Give\Framework\Exceptions\Primitives\Exception; /** - * @unreleased + * @since 3.2.0 */ class FailedDonorUserCreationException extends Exception { diff --git a/src/Donors/ServiceProvider.php b/src/Donors/ServiceProvider.php index 6d1ec658ec..1b0eabb364 100644 --- a/src/Donors/ServiceProvider.php +++ b/src/Donors/ServiceProvider.php @@ -72,7 +72,7 @@ private function addCustomFieldsToDonorDetails() /** * Hook into the donor creation process to ensure that donors are also users. - * @unreleased + * @since 3.2.0 */ protected function enforceDonorsAsUsers() { diff --git a/src/FormBuilder/ViewModels/FormBuilderViewModel.php b/src/FormBuilder/ViewModels/FormBuilderViewModel.php index c495e468b2..c44708feb7 100644 --- a/src/FormBuilder/ViewModels/FormBuilderViewModel.php +++ b/src/FormBuilder/ViewModels/FormBuilderViewModel.php @@ -20,7 +20,7 @@ class FormBuilderViewModel { /** - * @unreleased Add nameTitlePrefixes key to the returned array + * @since 3.2.0 Add nameTitlePrefixes key to the returned array * @since 3.0.0 */ public function storageData(int $donationFormId): array diff --git a/src/FormBuilder/resources/js/form-builder/src/components/ClassicEditor/index.js b/src/FormBuilder/resources/js/form-builder/src/components/ClassicEditor/index.js index 1e8255cbaa..81c5ad3fb7 100644 --- a/src/FormBuilder/resources/js/form-builder/src/components/ClassicEditor/index.js +++ b/src/FormBuilder/resources/js/form-builder/src/components/ClassicEditor/index.js @@ -35,7 +35,7 @@ function isTmceEmpty(editor) { } /** - * @unreleased + * @since 3.2.0 */ export default function ClassicEditor({id, label, content, setContent, rows = 20}) { const didMount = useRef(false); diff --git a/src/FormBuilder/resources/js/form-builder/src/components/EmbedForm/index.tsx b/src/FormBuilder/resources/js/form-builder/src/components/EmbedForm/index.tsx index 125a5b9812..b86663f06a 100644 --- a/src/FormBuilder/resources/js/form-builder/src/components/EmbedForm/index.tsx +++ b/src/FormBuilder/resources/js/form-builder/src/components/EmbedForm/index.tsx @@ -43,7 +43,7 @@ interface StateProps { } /** - * @unreleased + * @since 3.2.0 */ export default function EmbedFormModal({handleClose}: EmbedFormModalProps) { diff --git a/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php b/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php index e2da040168..35ddbba7e3 100644 --- a/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php +++ b/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php @@ -49,7 +49,7 @@ public function getLegacyFormFieldMarkup( /** * First we create a payment, then move on to the gateway processing * - * @unreleased Capture exceptions when get gateway data. + * @since 3.2.0 Capture exceptions when get gateway data. * @since 3.0.0 Catch and handle errors from the gateway here * @since 2.30.0 Add success, cancel and failed URLs to gateway data. This will be used in both v2 and v3 forms so gateways can just refer to the gateway data. * @since 2.24.0 add support for payment mode @@ -283,7 +283,7 @@ private function setSession($donationId) } /** - * @unreleased add honorific and use GetOrCreateDonor action + * @since 3.2.0 add honorific and use GetOrCreateDonor action * @since 2.21.0 * * @throws Exception diff --git a/src/PaymentGateways/Actions/RegisterPaymentGateways.php b/src/PaymentGateways/Actions/RegisterPaymentGateways.php index 42843b9c86..8d1ec7624a 100644 --- a/src/PaymentGateways/Actions/RegisterPaymentGateways.php +++ b/src/PaymentGateways/Actions/RegisterPaymentGateways.php @@ -132,7 +132,7 @@ function ($gatewayData, Donation $donation) { } /** - * @unreleased Prevent undefined index notice when getting payPalOrderId from gateway data. + * @since 3.2.0 Prevent undefined index notice when getting payPalOrderId from gateway data. * @since 2.26.0 Add support for the updated PayPal Commerce gateway data. * @since 2.21.2 * diff --git a/src/PaymentGateways/DataTransferObjects/FormData.php b/src/PaymentGateways/DataTransferObjects/FormData.php index e8e50d9572..2f816001e9 100644 --- a/src/PaymentGateways/DataTransferObjects/FormData.php +++ b/src/PaymentGateways/DataTransferObjects/FormData.php @@ -170,7 +170,7 @@ public static function fromRequest(array $request): FormData } /** - * @unreleased added support for honorific field + * @since 3.2.0 added support for honorific field * @since 2.22.0 add support for company field * @since 2.19.6 * @throws Exception diff --git a/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx b/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx index b8fb6058df..6f7064093d 100644 --- a/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx +++ b/src/PaymentGateways/Gateways/PayPalCommerce/payPalCommerceGateway.tsx @@ -96,7 +96,7 @@ import {PayPalSubscriber} from "./types"; /** * Get amount with fee (if any). * - * @unreleased + * @since 3.2.0 * @return {number} Amount with fee. */ const getAmount = () => { @@ -443,7 +443,7 @@ import {PayPalSubscriber} from "./types"; }, /** * Before create payment. - * @unreleased Handle error response in approveOrderCallback. + * @since 3.2.0 Handle error response in approveOrderCallback. * @param {Object} values */ beforeCreatePayment: async function (values): Promise { diff --git a/src/PaymentGateways/PayPalCommerce/AjaxRequestHandler.php b/src/PaymentGateways/PayPalCommerce/AjaxRequestHandler.php index 130bf4115d..f059a0a49a 100644 --- a/src/PaymentGateways/PayPalCommerce/AjaxRequestHandler.php +++ b/src/PaymentGateways/PayPalCommerce/AjaxRequestHandler.php @@ -279,7 +279,7 @@ public function createOrder() * * @todo: handle payment capture error on frontend. * - * @unreleased Discover error by checking capture status. + * @since 3.2.0 Discover error by checking capture status. * @since 2.9.0 */ public function approveOrder() @@ -389,7 +389,7 @@ private function getDonorAddressFromPostedDataForPaypalOrder(array $postedData): /** * This function should validate PayPal ApproveOrder response and respond to ajax request on error. * - * @unreleased + * @since 3.2.0 */ private function returnErrorOnFailedApproveOrderResponse(\stdClass $response) { diff --git a/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/ProcessorResponseError.php b/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/ProcessorResponseError.php index 777c09a8f3..cfb0e1af93 100644 --- a/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/ProcessorResponseError.php +++ b/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/ProcessorResponseError.php @@ -8,13 +8,13 @@ * Source of errors * - https://developer.paypal.com/docs/api/orders/v2/#definition-processor_response * - * @unreleased + * @since 3.2.0 */ class ProcessorResponseError { /** * This function decode the error code from PayPal. - * @unreleased + * @since 3.2.0 * @param \stdClass $processorResponse */ public static function getError(\stdClass $processorResponse): string @@ -66,7 +66,7 @@ public static function getError(\stdClass $processorResponse): string } /** - * @unreleased + * @since 3.2.0 */ private function avsCode(): array { @@ -193,7 +193,7 @@ private function cvvCode(): array } /** - * @unreleased + * @since 3.2.0 */ private function responseCode(): array { @@ -368,7 +368,7 @@ private function responseCode(): array } /** - * @unreleased + * @since 3.2.0 */ private function paymentAdviceCode(): array { diff --git a/src/PaymentGateways/PayPalCommerce/ScriptLoader.php b/src/PaymentGateways/PayPalCommerce/ScriptLoader.php index ab675688ce..a45223822c 100644 --- a/src/PaymentGateways/PayPalCommerce/ScriptLoader.php +++ b/src/PaymentGateways/PayPalCommerce/ScriptLoader.php @@ -188,8 +188,8 @@ function givePayPalOnBoardedCallback(mode, authCode, sharedId) { /** * Load public assets. * - * @unreleased Get form id from post content if form id is not available. - * @unreleased Use EnqueueScript to register and enqueue script. + * @since 3.2.0 Get form id from post content if form id is not available. + * @since 3.2.0 Use EnqueueScript to register and enqueue script. * @since 2.32.0 Handle exception if client token is not generated. * @since 2.9.0 */ @@ -292,7 +292,7 @@ private function getPartnerJsUrl() * This function should return form id from page, post content. * * - * @unreleased + * @since 3.2.0 */ private function getFormIdFromPostContent(): ?int { diff --git a/tests/Unit/DataTransferObjects/DonateControllerDataTest.php b/tests/Unit/DataTransferObjects/DonateControllerDataTest.php index 601e26871b..72313aa08e 100644 --- a/tests/Unit/DataTransferObjects/DonateControllerDataTest.php +++ b/tests/Unit/DataTransferObjects/DonateControllerDataTest.php @@ -24,7 +24,7 @@ class DonateControllerDataTest extends TestCase { /** - * @unreleased added honorific property + * @since 3.2.0 added honorific property * @since 3.0.0 */ public function testToDonationShouldReturnDonationModel() diff --git a/tests/Unit/DonationForms/Actions/TestGetOrCreateDonor.php b/tests/Unit/DonationForms/Actions/TestGetOrCreateDonor.php index 026fbfe945..7b24f52f6a 100644 --- a/tests/Unit/DonationForms/Actions/TestGetOrCreateDonor.php +++ b/tests/Unit/DonationForms/Actions/TestGetOrCreateDonor.php @@ -13,7 +13,7 @@ class TestGetOrCreateDonor extends TestCase use RefreshDatabase; /** - * @unreleased + * @since 3.2.0 * * @throws Exception */ @@ -28,7 +28,7 @@ public function testShouldReturnExistingDonorWithMatchingEmail(): void } /** - * @unreleased + * @since 3.2.0 * * @throws Exception */ @@ -43,7 +43,7 @@ public function testShouldReturnExistingDonorWithMatchingUserId(): void } /** - * @unreleased + * @since 3.2.0 * @throws Exception */ public function testShouldReturnExistingDonorWithUserIdAndUpdateAdditionalEmails(): void @@ -59,7 +59,7 @@ public function testShouldReturnExistingDonorWithUserIdAndUpdateAdditionalEmails } /** - * @unreleased + * @since 3.2.0 * * @throws Exception */ @@ -75,7 +75,7 @@ public function testShouldReturnExistingDonorWithUserIdAndNotUpdateAdditionalEma } /** - * @unreleased + * @since 3.2.0 * * @throws Exception */ diff --git a/tests/Unit/Donations/Repositories/TestDonationRepository.php b/tests/Unit/Donations/Repositories/TestDonationRepository.php index 87dd5002d0..092c6cb8a8 100644 --- a/tests/Unit/Donations/Repositories/TestDonationRepository.php +++ b/tests/Unit/Donations/Repositories/TestDonationRepository.php @@ -145,7 +145,7 @@ public function testUpdateShouldFailValidationAndThrowException() } /** - * @unreleased added honorific property + * @since 3.2.0 added honorific property * @since 2.23.1 add company to test to catch cases where missing meta was not updated * @since 2.19.6 * diff --git a/tests/Unit/ViewModels/FormBuilderViewModelTest.php b/tests/Unit/ViewModels/FormBuilderViewModelTest.php index 7c6b026e72..597a53200c 100644 --- a/tests/Unit/ViewModels/FormBuilderViewModelTest.php +++ b/tests/Unit/ViewModels/FormBuilderViewModelTest.php @@ -23,7 +23,7 @@ class FormBuilderViewModelTest extends TestCase use RefreshDatabase; /** - * @unreleased Add support to nameTitlePrefixes key in the compared array + * @since 3.2.0 Add support to nameTitlePrefixes key in the compared array * @since 3.0.0 * * @return void From 584621b2f31302ed48da8b959276ec00fc0aa884 Mon Sep 17 00:00:00 2001 From: Jon Waldstein Date: Wed, 6 Dec 2023 11:43:20 -0500 Subject: [PATCH 5/5] docs: update min requirements --- readme.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/readme.txt b/readme.txt index 52b330b449..52e1d2a923 100644 --- a/readme.txt +++ b/readme.txt @@ -27,15 +27,15 @@ Free donor tools also help keep your donors happy. The donor dashboard helps you **[Powerful Donation Forms](https://go.givewp.com/features-forms "See how powerful our fundraising forms can be")** -GiveWP has taken inspiration from Gutenberg blocks to create an even better form-building experience. The Visual Donation Form Builder uses sections and blocks to provide a more intuitive way to build and configure your donation forms. +GiveWP has taken inspiration from Gutenberg blocks to create an even better form-building experience. The Visual Donation Form Builder uses sections and blocks to provide a more intuitive way to build and configure your donation forms. -In this builder, you’ll see your design in real time. Watch as your form takes shape as you select custom colors, fields, elements, and more. For those with a flair for customization, you can add Custom CSS directly into the builder. +In this builder, you’ll see your design in real time. Watch as your form takes shape as you select custom colors, fields, elements, and more. For those with a flair for customization, you can add Custom CSS directly into the builder. * Build custom donation forms in your WordPress admin * Customize donation form templates without any code * Add goals, multiple giving amounts, custom amounts, terms and conditions and more with just a couple clicks -Never used blocks before? No worries - [we’ve got you covered with our guide](https://go.givewp.com/visual-builder). +Never used blocks before? No worries - [we’ve got you covered with our guide](https://go.givewp.com/visual-builder). **[Actionable Fundraising Reporting](https://go.givewp.com/features-reports "See our gorgeous and helpful reports dashboards")** @@ -67,8 +67,8 @@ With more than 100,000+ active installs of GiveWP, we hear more and more success * [A local neighborhood watch program](https://go.givewp.com/memstory) switched from using GoFundMe to GiveWP and raised $40,000 in five days for a memorial fundraiser. * [Fans of Ivan the Gorilla have kept his memory alive](https://go.givewp.com/readivan) by fundraising for a conservancy program in his name. * [A hospital raised money](https://go.givewp.com/twiststory) through a community-wide virtual dance party during the pandemic. -* [Quiltlove](https://go.givewp.com/quiltlove), which provides personalized quilts for different life events (like new babies, extended hospital stays, and more), uses GiveWP to create a sustainable business model. -* [Niels Vink, a Dutch wheelchair tennis player](https://go.givewp.com/niels-vink), uses GiveWP to raise money to train, travel, and participate in competitions. At the 2021 Tokyo Paralympics, Vink earned a gold medal in doubles and a bronze medal in singles. +* [Quiltlove](https://go.givewp.com/quiltlove), which provides personalized quilts for different life events (like new babies, extended hospital stays, and more), uses GiveWP to create a sustainable business model. +* [Niels Vink, a Dutch wheelchair tennis player](https://go.givewp.com/niels-vink), uses GiveWP to raise money to train, travel, and participate in competitions. At the 2021 Tokyo Paralympics, Vink earned a gold medal in doubles and a bronze medal in singles. In addition to nonprofit organizations, GiveWP is widely used for individual or creative purposes. We’ve seen tip jars for blogs or musicians, live streams, and more. Our [Donation Upsells for WooCommerce Add-on](https://go.givewp.com/wooread) is even used in some eCommerce stores to collect donations for a cause, or ask for tips in the cart or checkout. @@ -167,8 +167,8 @@ Here’s a few ways you can contribute to GiveWP: = Minimum Requirements = -* WordPress 5.0 or greater -* PHP version 7.0 or greater +* WordPress 6.0 or greater +* PHP version 7.2 or greater * MySQL version 5.7 or greater * MariaDB version 10 or later * Some payment gateways require fsockopen support (for IPN access) @@ -263,12 +263,12 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri == Changelog == = 3.2.0: Dec 6th, 2023 = +* New: Embed form button added to the Visual Donation Form Builder +* New: Pre-publish confirmation panel added to the Visual Donation Form Builder * Enhancement: Updated parts of the Form Builder text areas to Text Editors to provide more formatting options * Enhancement: Improved compatibility with the donation block and Visual Builder forms * Enhancement: All donors are connected with a user for improved security and caching compatibility * Enhancement: Improve the Name, and Terms and Conditions blocks with global settings -* New: Embed form button added to the Visual Donation Form Builder -* New: Pre-publish confirmation panel added to the Visual Donation Form Builder * Fix: Resolved some strange behaviors when using the Amount Levels setting in the Form Builder * Fix: Removed WP_Background_Process and WP_Async_Request to avoid conflicts with other plugins * Fix: Donor honorific (Mr, Mrs, etc) is now properly saved as part of the donor record @@ -338,8 +338,8 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri = 2.33.0: August 28th, 2023 = * New: Admins can now select standard or advanced connection type during setup -* New: Added a new SubscriptionSynced command class -* New: Added PayPal Standard to PayPal Donations migration information banners +* New: Added a new SubscriptionSynced command class +* New: Added PayPal Standard to PayPal Donations migration information banners * Security: Remove uses of payment intent secret and existing meta = 2.32.0: August 11th, 2023 =