Deprecated Warning with GiveWP: str_contains() and str_replace() Errors in PHP 8
-
Hi everyone,
I’m encountering a deprecated warning when I install the GiveWP plugin on my site running PHP 8. Here are the specific errors:
Deprecated: Return type of Money\Currencies\AggregateCurrencies::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in wp-content/plugins/give/vendor/moneyphp/money/src/Currencies/AggregateCurrencies.php on line 66
Deprecated: Return type of Money\Currencies\ISOCurrencies::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in wp-content/plugins/give/vendor/moneyphp/money/src/Currencies/ISOCurrencies.php on line 64
Deprecated: Return type of Money\Currencies\BitcoinCurrencies::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in wp-content/plugins/give/vendor/moneyphp/money/src/Currencies/BitcoinCurrencies.php on line 43
Deprecated: Return type of Money\Currency::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in wp-content/plugins/give/vendor/moneyphp/money/src/Currency.php on line 86
Deprecated: Return type of Money\Money::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in wp-content/plugins/give/vendor/moneyphp/money/src/Money.php on line 521
These warnings appear to be due to deprecated return type compatibility in the
moneyphp/money
library that GiveWP uses, especially with PHP 8 and above.2.“Form is Not Published” Error
When I try to add the shortcode for my published form, I get an error saying that the form is “not published” even though the form is definitely set to “Published” in the GiveWP dashboard. I’ve checked the following:
- Form Status: I verified that the form is published (not in draft or scheduled mode).
- Correct Shortcode: I’m using the correct shortcode format for the form ID, like
[give_form id="1234"]
, where1234
is the form’s actual ID.
I’ve tried the following troubleshooting steps:
- Confirmed that WordPress and GiveWP are both up to date.
- Checked my PHP version (currently PHP 8.0).
- The warnings do not appear when GiveWP is deactivated.
I’d appreciate any guidance on:
- Whether others have encountered this with GiveWP in PHP 8.
- Any suggested fixes or workarounds (e.g., PHP version compatibility, settings adjustments, or suppressing warnings).
- If this is something that needs to be reported to GiveWP directly.
Thanks in advance for your help!
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.