Closed dwainm closed 3 years ago
I've tested compatibility with PHP8 using Exakat
, PHPCompatibility
, and did some smoke tests with the plugin running WP 5.6-beta4-49590
, WC 4.7.0
and PHP 8.0.0rc1
. I didn't find any incompatibilities during my testing.
Exakat
I set it up using the instructions in pca54o-oV-p2#comment-716. The compatible PHP estimated versions are 7.1, 7.2, 7.3, 7.4, 8.0.
These warnings look like false positives, though:
// Check order amount
if ( ! $this->amounts_equal( $data['amount_gross'], self::get_order_prop( $order, 'order_total' ) )
&& ! $this->order_contains_pre_order( $order_id )
&& ! $this->order_contains_subscription( $order_id ) ) {
amounts_equal
takes two floats
and returns a bool
order_contains_pre_order
takes an object|int
and returns a bool
order_contains_subscription
takes an WC_Order
and also returns a bool
PHPCompatibility sniff
No warnings or errors found.
Smoke tests
I set up a new store using WP 5.6-beta4-49590
, WC 4.7.0
, and PHP 8.0.0rc1
and installed PayFast, Subscriptions, and Pre-orders. Then, I ran the following tests:
Simple product | Subscription product | Pre-order product | |
---|---|---|---|
Purchase | ✅ | ✅ | ✅ |
Refund | ✅ | ✅ | ✅ |
Renewal | N/A | ✅ | N/A |
Cancellation | N/A | ✅ | N/A |
Amount mismatch * | ✅ |
* An amount mismatch was triggered manually, to ensure the warnings raised by Exakat
in includes/class-wc-gateway-payfast.php:424-425
were false positives.
No warnings or errors were listed in the server logs after the smoke tests were run.
Is there anything else that's worth testing or that I might've missed?
Thanks for testing this plugin @luizreis. If you were able to do a checkout with PHP 8 I don't think we need to focus on anything else here.
It'll be a good idea to bump the plugin versions and compatibilities and do a release with those.
It'll be a good idea to bump the plugin versions and compatibilities and do a release with those.
Good call. I'll try to fix some of the issues and take a look at the existing PRs to include them in the next release. I'm closing this one as the compatibility bumps can be done as part of the release.
Ensure the plugin works correctly on hosts running PHP 8