Billing & Lifecycle
WPLM ships a complete recurring-billing engine — you do not need the paid WooCommerce Subscriptions extension. WooCommerce provides only the cart, checkout, and stored payment token; WPLM owns the schedule, status, and lifecycle.
Status model
Section titled “Status model”| Subscription status | License effect |
|---|---|
| pending | Awaiting first payment — license pending. |
| trial | In the free-trial window — license active, no charge yet. |
| active | Paid and current — license active. |
| on-hold | Payment failed or manually paused — license suspended. |
| pending-cancel | Cancelled by the user but paid through period end — license active until end_date, then revoked. |
| cancelled | Ended — license revoked. |
| expired | Reached a fixed end date — license revoked. |
The license status always tracks the subscription, so access turns on and off automatically.
Billing schedule
Section titled “Billing schedule”The next-payment date is computed from the license type’s interval + period, anchored
to the start (or to the trial end). All schedule math runs in UTC. Override the
computed date with the wplm_subscription_next_payment filter.
- Trials defer the first recurring charge until the trial ends.
- Sign-up fees are charged once, on the parent order.
Automatic renewals
Section titled “Automatic renewals”An hourly WP-Cron job (wplm_process_renewals) finds subscriptions due for
renewal and charges the stored WooCommerce payment token:
- On success → creates a paid WooCommerce renewal order, records a renewal row,
advances the next-payment date, extends the bound license, and fires
wplm_subscription_renewed. - On failure → increments the failure counter and hands off to dunning.
Dunning (failed-payment retries)
Section titled “Dunning (failed-payment retries)”The dunning manager retries failed charges on a configurable schedule (default
days 1, 3, 5 after failure — see Settings → Dunning). While retrying, the
subscription goes on-hold and the license is suspended. A successful
retry reactivates both; exhausting all retries cancels the subscription and
revokes the license, firing wplm_subscription_payment_failed_final.
Customise the retry offsets:
add_filter( 'wplm_dunning_retry_schedule', fn() => array( 2, 5, 9 ) );Subscription emails
Section titled “Subscription emails”WPLM sends lifecycle emails (created, renewal processed, payment failed, cancelled, expired, trial ending). Bodies are filterable:
add_filter( 'wplm_subscription_email_content', function ( $html, $template, $sub ) { return $html; // customise per template}, 10, 3 );Managing subscriptions
Section titled “Managing subscriptions”License Manager → Subscriptions lists every subscription with status, next
payment, and amount. Open one to change the schedule/amount, pause, resume,
cancel, or view its renewal history. The same operations are available via the
PHP API (wplm_pause_subscription(), wplm_cancel_subscription(), …) and REST.