Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error after upgrading to PHP 8.0 #26

Open
3 tasks done
michaelbeil opened this issue Sep 20, 2022 · 3 comments
Open
3 tasks done

Error after upgrading to PHP 8.0 #26

michaelbeil opened this issue Sep 20, 2022 · 3 comments

Comments

@michaelbeil
Copy link
Contributor

michaelbeil commented Sep 20, 2022

Describe the bug
A customer (ticket 447938) 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 Auto-Renewal Checkbox 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 “edit” in /usr/www/users/x/y.x.com/wp-content/plugins/pmpro-auto-renewal-checkbox/pmpro-auto-renewal-checkbox.php on line 38

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 Auto-Renewal Checkbox Add On is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • 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, Auto-Renewal Checkbox 0.3.0, WordPress 6.0.2, PHP 8.0.22
@ipokkel
Copy link
Member

ipokkel commented Mar 15, 2023

Another fatal error was encountered while running PHP8 (8.1.9)

An error of type E_ERROR was caused in line 127 of the file /wp-content/plugins/pmpro-auto-renewal-checkbox/includes/cancel-on-next-payment-date.php. Error message: Uncaught TypeError: date(): Argument #2 ($timestamp) must be of type ?int, string given.

$expiration_date = date( 'Y-m-d H:i:s', $pmpro_next_payment_timestamp );

To Reproduce

  1. Activate Paid Memberships Pro, and Auto-Renewal Checkbox Add On
  2. Set the PHP version to PHP 8.1.9 or higher
  3. Navigate to Users > All Users
  4. Select a user(s) that belongs to a recurring payment subscription.
  5. Select Delete from the Bulk Actions drop-down and click on Apply button
  6. Check both Cancel any related membership levels first. This may trigger cancellations at the gateway or other third party services and Delete any related membership history. Order history will be retained options
  7. Confirm Deletion
  8. See error.

@JarrydLong
Copy link

@ipokkel and I have tested this again but haven't been able to consistently replicate the issue.

We'll keep an eye on this and apply a fix when we can replicate the issue consistently.

@britwylie
Copy link

Similar error?

[error] 2699860#2699860: *467369 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: date(): Argument #2 ($timestamp) must be of type ?int, string given in /var/www/sitename.com/wp-content/plugins/paid-memberships-pro/classes/gateways/class.pmprogateway_paypalexpress.php:829

PHP version 8.3
User checkout in Paypal, with or without recurring payments.
On "complete payment" redirect, transaction fails.
Wordpress and PMPro updated today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants