strangerstudios/pmpro-affiliates

PHP 8.0 causes error

Closed this issue · 1 comments

Describe the bug
A customer (ticket 448247) ran into this error after upgrading to PHP 8.0:

Warning: Undefined array key “edit” in /usr/www/users/x/y.x.com/wp-content/plugins/pmpro-auto-renewal-checkbox/pmpro-auto-renewal-checkbox.php on line 38

To Reproduce
Steps to reproduce the behavior on customer site:

  1. Activate Paid Memberships Pro, and Affiliates Add On Add On
  2. Set PHP version to PHP 8.0 or higher, see the following error on the main (paid) checkout page:

Warning: Undefined array key “pmpro_affiliates_recurring” in /usr/www/users/x/y.x.com/wp-content/plugins/pmpro-affiliates/pmpro-affiliates.php on line 187 Warning: Cannot modify header information – headers already sent by (output started at /usr/www/users/x/y.x.com/wp-content/plugins/pmpro-affiliates/pmpro-affiliates.php:187) in /usr/www/users/x/y.x.com/wp-includes/pluggable.php on line 1421 Warning: Cannot modify header information – headers already sent by (output started at /usr/www/users/x/y.x.com/wp-content/plugins/pmpro-affiliates/pmpro-affiliates.php:187) in /usr/www/users/x/y.x.com/wp-includes/pluggable.php on line 1424

Expected behavior
There should not be an error.

Isolating the problem:

  • Deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro, and Affiliates Add On 0.5 is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • Can reproduce this bug consistently using the steps above.

This came up in ticket 441951, but I have not been able to replicate this.

WordPress Environment

Paid Memberships Pro 2.9.5, Affiliates Add On 0.5, WordPress 6.0.2, PHP 8.0.22

I wasn't able to replicate this issue with the latest version (dev branch).