Customer Portal
The Customer Portal is a front-end interface that allows your customers to manage their own licences without contacting support. It is rendered via a WordPress shortcode and can be placed on any page or post.
Shortcode
Add the portal to any WordPress page using either of the two supported shortcodes:
[wplf_portal]
An alias is also available for backward compatibility:
[licence_relay_portal]
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
show_activations |
yes | no |
yes |
Whether to display the list of activated sites for each licence. Set to no to hide the activations section. |
Example with activations hidden:
[wplf_portal show_activations="no"]
Authentication
The portal requires the visitor to be logged in to WordPress. If a logged-out user visits the page containing the shortcode, the portal renders nothing. Combine the shortcode page with a login form or redirect to ensure users are authenticated before reaching the portal.
Tip
Place the portal on a page restricted by your membership plugin or use the built-in WordPress wp_login_url() redirect to guide unauthenticated visitors to the login screen.
Features
Once logged in, customers can perform the following actions from the portal:
Licence Overview
- View all licences associated with their account.
- See licence status (active, expired, trial, revoked) with colour-coded badges.
- Check activation limits (e.g., "3 of 5 sites activated") and expiry dates.
Downloads
Customers with active licences can download the latest version of the associated product directly from the portal. The download link respects rollout settings -- if a staggered rollout is in progress, the customer receives the version assigned to their licence bucket.
Renewals
Licences that are expired or approaching expiry display a Renew button. Clicking it redirects the customer to the appropriate checkout page (Stripe or WooCommerce) to process the renewal payment.
Key Rotation
Customers can rotate (replace) their licence key if they suspect it has been compromised. Rotating a key generates a new key and invalidates the previous one. All existing site activations are preserved under the new key.
Site Management
When show_activations="yes", each licence card displays a list of activated sites. Customers can deactivate individual sites to free up activation slots without needing to contact support.
GDPR Data Export
A Export My Data button allows customers to download a JSON file containing all of their personal data held by LicenceForge: licence records, activation history, and associated metadata. This supports GDPR right-of-access requirements.
Actions and Nonces
All portal actions are protected by WordPress nonces to prevent CSRF attacks. Each action has a unique nonce pattern:
| Action | Nonce Pattern | Description |
|---|---|---|
rotate_key |
wplf_rotate_key_{id} |
Replaces the current licence key with a new one. {id} is the licence ID. |
deactivate_site |
wplf_deactivate_{id} |
Removes a specific site activation. {id} is the activation ID. |
export_data |
wplf_export_data |
Generates and downloads a JSON export of the customer's personal data. |
Key rotation is irreversible
Once a licence key is rotated, the old key is permanently invalidated. Customers should update the key in all their activated sites promptly after rotation. Existing activations continue to work under the new key.
CSS Classes
The portal output uses BEM-style CSS classes, making it straightforward to override styles in your theme. The key classes are:
| Class | Element |
|---|---|
.wplf-portal |
The outermost wrapper of the entire portal. |
.wplf-license-card |
Each individual licence block. |
.wplf-license-status-{status} |
Status-specific modifier on the licence card (e.g., .wplf-license-status-active, .wplf-license-status-expired). |
.wplf-btn |
Action buttons within the portal (rotate, deactivate, renew, export). |
Example of a custom style override:
/* Change active licence card border colour */
.wplf-license-status-active {
border-left: 4px solid #22c55e;
}
/* Style the portal buttons to match your theme */
.wplf-btn {
background-color: #1e40af;
color: #ffffff;
border-radius: 6px;
padding: 8px 16px;
}
Branding Settings
Two settings control the portal's branding:
| Setting | Default | Description |
|---|---|---|
wplf_portal_title |
My Licenses |
The heading displayed at the top of the portal. Change this to match your brand language (e.g., "Your Subscriptions", "My Account"). |
wplf_hide_branding |
false |
When set to true, removes the "Powered by LicenceForge" footer from the portal output. |
Both settings can be configured in LicenceForge > Settings or set programmatically:
update_option( 'wplf_portal_title', 'Your Subscriptions' );
update_option( 'wplf_hide_branding', true );