Closed remcotolsma closed 1 month ago
It appears that Restrict Content itself works with 23:59:59
in:
https://github.com/stellarwp/restrict-content/blob/1b7914806e9703b6820d9073f0e6d965ebee7337/core/includes/admin/members/member-actions.php#L41
$expiration = 'none' !== $expiration ? date( 'Y-m-d 23:59:59', strtotime( $_POST['expiration'], current_time( 'timestamp' ) ) ) : $expiration;
We can also work with the time of the phases.
Restrict Content Pro does not have the ability to set a time on the expiration date, so we set the time to 00:00:00.
https://github.com/pronamic/wp-pronamic-pay-restrict-content-pro/blob/f8c50a8d7dc82e6f306851499699d435cc6ac9bf/src/SubscriptionUpdater.php#L113-L120
This can go wrong when determining the phase in which the next new period should be started:
For example, with a subscription with the following initial phase:
And a regular phase:
A next payment date on 31-07-2024 (00:00:00) falls under the initial phase, while it should actually fall under the regular phase?
We discovered this via an internal HelpScout ticket: https://secure.helpscout.net/conversation/2665799921/27549?viewId=1425710.
Related issues: