Currency Switcher v0.7.0 — Manage your subscription from the plugin
The License tab now has a Manage Subscription button that opens the Polar customer portal in a new tab. Cancel auto-renewal, update your card, switch plans, or resubscribe — all without leaving WordPress admin. Snake-case + REST/React parity to MHM Rentiva v4.32.0.
What changed
Inside the License tab's License Management zone (visible when a Pro license is active), a third button joins the existing two:
- Manage Subscription — opens Polar customer portal (this release)
- Re-validate Now
- Deactivate License
The plugin reaches Polar through the same license server already in use. No new external services contacted from your site's perspective. Schema and signature integrity remain RSA-protected (v0.6.0+ pipeline).
State-driven emphasis
The button changes color based on how close your subscription is to renewal:
| Days remaining | Color | Intent |
|---|---|---|
| > 30 | Standard primary blue | "Plenty of runway" |
| ≤ 30 | Yellow | "Heads up — renewal is coming" |
| ≤ 7 | Amber + glow | "Decide now" |
| Expired (0) | Amber + glow | "Resubscribe to keep Pro" |
While the portal session is being minted (a brief async call), the button text becomes "Opening…" and the styling dims to communicate the click registered.
Failure handling
If the portal session can't be minted (server error, network blip, license revoked between page load and click), the button surfaces an in-tab notice instead of breaking:
Subscription management is not available right now. Please try again later or contact support@wpalemi.com.
No raw technical strings ever leak to end users.
Architecture
- New public method
LicenseManager::create_customer_portal_session(string $return_url): array(snake_case parity to Rentiva's camelCase) - New REST endpoint
POST /mhm-currency/v1/license/manage-subscription(manage_options gated) - New React state + callback in
License.jsx, button rendered before Deactivate whenisActive && license.maskedKey - New CSS rules using compound selectors (
.button.mhm-cs-license-warning/.mhm-cs-license-urgent) to avoid colliding with the existing.mhm-cs-license-warningalert pill - 4 new translatable strings, all translated to Turkish
Compatibility
| Component | Required version |
|---|---|
mhm-license-server | v1.11.0+ (new /customer-portal-session endpoint) |
mhm-polar-bridge | v1.9.0+ (renewal reminder cron) |
| WordPress | 6.0+ |
| PHP | 7.4+ |
Older license-server versions without the customer-portal endpoint return a graceful in-tab notice instead of breaking.
Out of scope (not in this release)
- Past-due / dunning notifications — Polar handles these directly via email.
- Yearly subscription renewal reminders — Polar sends these 7 days before renewal automatically.
Monthly subscribers receive an additional 7-day-out reminder email from mhm-polar-bridge v1.9.0+, since Polar doesn't generate these for short billing cycles.
Tests
- 148 → 158 PHPUnit (+10 new across 2 test files)
- PHPCS new files: 0 errors (after PHPCBF)
- PHPStan level 6: 0 errors
- npm run build: success
- i18n: 0 fuzzy on new strings, all 4 translated
