Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Waldstein committed Aug 22, 2024
2 parents 57cf989 + d7bb629 commit 4fd268e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 5 deletions.
4 changes: 2 additions & 2 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.15.0
* Version: 3.15.1
* Requires at least: 6.4
* Requires PHP: 7.2
* Text Domain: give
Expand Down Expand Up @@ -406,7 +406,7 @@ private function setup_constants()
{
// Plugin version.
if (!defined('GIVE_VERSION')) {
define('GIVE_VERSION', '3.15.0');
define('GIVE_VERSION', '3.15.1');
}

// Plugin Root File.
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: donation, donate, recurring donations, fundraising, crowdfunding
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.2
Stable tag: 3.15.0
Stable tag: 3.15.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -262,6 +262,9 @@ 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.15.1: Aug 22nd, 2024 =
* Fix: Resolved an issue with the Akismet integration preventing form submissions when settings are not yet configured

= 3.15.0: Aug 14th, 2024 =
* New: Added Akismet integration support to forms using the visual form builder
* New: Updated the onboarding wizard to create a new form with the visual form builder
Expand Down
3 changes: 2 additions & 1 deletion src/DonationSpam/EmailAddressWhiteList.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ class EmailAddressWhiteList
protected $whitelistEmails;

/**
* @since 3.15.1 Add array type to enforce type.
* @since 3.15.0
*/
public function __construct($whitelistEmails = [])
public function __construct(array $whitelistEmails = [])
{
$this->whitelistEmails = $whitelistEmails;
}
Expand Down
6 changes: 5 additions & 1 deletion src/DonationSpam/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ class ServiceProvider implements ServiceProviderInterface
*/
public function register(): void
{
/**
* @since 3.15.1 Case filtered value as an array to enforce type.
* @since 3.15.0
*/
give()->singleton(EmailAddressWhiteList::class, function () {
return new EmailAddressWhiteList(
apply_filters( 'give_akismet_whitelist_emails', give_akismet_get_whitelisted_emails() )
(array) apply_filters( 'give_akismet_whitelist_emails', give_akismet_get_whitelisted_emails() )
);
});
}
Expand Down
25 changes: 25 additions & 0 deletions tests/Unit/DonationSpam/ServiceProviderTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Give\Tests\Unit\DonationSpam;

use Give\DonationSpam\EmailAddressWhiteList;
use Give\Tests\TestCase;

/**
* @unreleased
*/
final class ServiceProviderTest extends TestCase
{
/**
* @unreleased
*/
public function testFilteredWhitelistIsArray()
{
add_filter('give_akismet_whitelist_emails', '__return_empty_string');

give(EmailAddressWhiteList::class)
->validate('[email protected]');

$this->assertTrue(true);
}
}

0 comments on commit 4fd268e

Please sign in to comment.