Subscriptions Pro injects context-sensitive action buttons into the subscription detail view. Which buttons appear depends on the current subscription status and available features.
📌 What This Extension Adds: All action buttons and their underlying AJAX handlers are provided by Subscriptions Pro. Core DDLS does not include portal action buttons.
Button Reference #
| Button | Status Required | Feature Required | Action |
|---|---|---|---|
| Pause Subscription | active | Pause enabled | Opens pause duration modal |
| Resume Now | paused | Pause enabled | Immediately resumes paused subscription |
| Change Plan | active | Plan switching enabled | Opens plan selector |
| Cancel Subscription | active, paused, grace_period | — | Opens cancellation modal |
| Reactivate | cancelled, suspended | — | Opens reactivation confirmation modal |
| Retry Payment | grace_period | — | Triggers immediate payment retry |
Retry Payment Button Shortcode #
The retry payment button can also be embedded outside of the standard subscription detail view using the shortcode:
“
`
This shortcode renders a retry button for the current customer's most recent subscription in grace period status. It is useful for embedding in dunning emails or custom portal pages.
Shortcode attributes:
| Attribute | Default | Description |
|---|---|---|
subscription_id | Auto-detected | Specific subscription ID to retry |
label | "Retry Payment" | Button label text |
class | dmsilm-retry-btn | CSS class(es) to apply to the button |
AJAX Actions #
All portal button actions are handled via WordPress AJAX. The following AJAX action hooks are registered:
| AJAX Action | Handler | Description |
|---|---|---|
dmsilm_sp_pause | Portal_Handler::handle_pause() | Initiates a subscription pause |
dmsilm_sp_resume | Portal_Handler::handle_resume() | Resumes a paused subscription |
dmsilm_sp_retry | Portal_Handler::handle_retry() | Triggers a manual payment retry |
dmsilm_sp_reactivate | Portal_Handler::handle_reactivate() | Reactivates a cancelled/suspended subscription |
dmsilm_sp_plan_switch | Portal_Handler::handle_plan_switch()` | Processes a plan switch request |
All AJAX actions require nonce verification and user authentication. Requests from unauthenticated users or with invalid nonces return a 403 error.
Loading States #
When an AJAX action is in progress, the button enters a loading state (spinner replaces button label, button disabled). This prevents duplicate submissions and gives clear visual feedback.
