-
Notifications
You must be signed in to change notification settings - Fork 381
Description
A customer using PayPal Express with their site set to UTC+9 noticed that subscriptions are starting approximately 9 hours earlier than expected. They suspect the issue lies in the pmpro_calculate_profile_start_date() function, where the site's local time may be treated as UTC when passed to PayPal, causing a timezone mismatch.
I recreated this issue on a test site using PayPal Express and can confirm that the subscription start time sent to PayPal appears to be offset by the site's timezone (+9 hours in this case), causing the first billing cycle to be shortened.
This misalignment only appears with PayPal Express and does not occur when using Stripe.
To Reproduce
Steps to reproduce the behavior:
- Set the site timezone to UTC+9 in WordPress (Settings > General).
- Ensure PHP is also configured to use UTC+9 (via php.ini or similar).
- Use PayPal Express Checkout as the payment gateway.
- Create a daily recurring subscription level in PMPro.
- Perform a checkout as a test user at your site’s local time (e.g., 17:53:31 on July 4, 2025).
- After checkout: View the subscription in PayPal dashboard.
- Note that the start date is shown as July 5, 2025 (midnight UTC).
- Inside PMPro, observe that the next payment date shows July 5, 2025 at 6:00 PM, confirming a ~9-hour offset between what PMPro expects and what PayPal processed.
Expected behavior
When a user checks out using PayPal Express, the profile_start_date sent to PayPal should be properly converted to UTC. As a result, the subscription should begin exactly at the correct local time on the site, with no time offset or shortened billing period.
Isolating the problem (mark completed items with an [x]):
- I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
- This bug happens with a default WordPress theme active, or Memberlite.
- I can reproduce this bug consistently using the steps above.
WordPress Environment