PHP 8.5 Warning

I understand it’s a warning, but imagine it could be fatal in 8.6 which is going to be out in November.

2026/11/03 20:11:56 [error] 361360#361360: *80 FastCGI sent in stderr: “PHP message: PHP Warning: Undefined array key “x_subscription_id” in /path/to/mydomain.com/public_html/wp-content/plugins/s2member-pro/src/includes/classes/gateways/authnet/authnet-notify-in.inc.php on line 70; PHP message: PHP Warning: Undefined array key “x_subscription_id” in /path/to/mydomain.com/public_html/wp-content/plugins/s2member-pro/src/includes/classes/gateways/authnet/authnet-notify-in.inc.php on line 122” while reading response header from upstream, client: 1.1.1.1., server: mydomain.com, request: “POST /?s2member_pro_authnet_notify=1 HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php8.5-fpm.sock:”, host: “mydomain.com”

Hi!

I understand it’s a warning, but imagine it could be fatal in 8.6 which is going to be out in November.

Thanks for reporting this!

I checked the code and found the cause.

Authorize.Net sends notifications for both regular payments and recurring subscription payments. The x_subscription_id field is only included with recurring subscription payments, but s2Member isn’t checking whether it exists before accessing it.

That’s why you’re getting the warnings. They’re not specific to PHP 8.5; PHP has reported undefined array keys as warnings since PHP 8.0.

I haven’t seen any indication that PHP 8.6 will make this particular warning fatal, but the code should handle the missing field correctly regardless.

I’ve now fixed it, and it’ll will be in the next release.

Thanks again for bringing it to my attention!

:slight_smile:

  • (Pro) Fix: Fixed PHP warnings in Authorize.Net payment notifications when recurring subscription fields are missing. Thanks to bcolflesh for reporting this. See thread #13725

:slight_smile: