Download the PHP package license-bridge/wordpress-sdk without Composer
On this page you can find all versions of the php package license-bridge/wordpress-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download license-bridge/wordpress-sdk
More information about license-bridge/wordpress-sdk
Files in license-bridge/wordpress-sdk
Package wordpress-sdk
Short Description License Bridge WordPress SDK
License GPL-3.0-only
Homepage https://license-bridge.com
Informations about the package wordpress-sdk
WordPress-SDK
Official License Bridge WordPress SDK. Add it to your plugin or theme to enable:
- License storage and validation
- Secure checkout landing page (hosted by License Bridge)
- Automatic upgrade from free to premium after purchase
- Recurring payments (subscriptions)
- Automatic plugin updates for licensed customers
Requirements
- PHP 7.2 or higher
- WordPress 6.4 or higher (tested up to 6.7+)
- Composer (recommended)
Installation
Commit composer.json and composer.lock. Do not edit files inside vendor/ directly.
Quick integration
Create a helper function in your main plugin file (rename my_license to something unique to your plugin):
Loader::register() automatically wires:
- Hidden admin callback page (post-purchase license storage)
- Premium plugin upgrade
- WordPress update API integration
You do not need to manually instantiate internal SDK classes.
Configuration
Pass these keys to Loader::register() (merged with SDK defaults):
| Key | Required | Default | Description |
|---|---|---|---|
plugin-slug |
Yes | — | plugin_basename(__FILE__) |
license-product-slug |
Yes | — | Product slug on License Bridge |
license-bridge-url |
No | https://licensebridge.com |
Market / checkout base URL |
license-bridge-api-url |
No | https://app.licensebridge.com |
API base URL (OAuth, license, updates) |
license-bridge-oauth-token-uri |
No | /oauth/token |
OAuth token path |
provisioning-key |
For imported-license migration | — | Product provisioning key from License Bridge admin (import page). Required for automatic OAuth provisioning when only a license key is stored locally |
plugin-transient-cache-expire |
No | 43200 (12h) |
Plugin details cache (seconds) |
cache-expire |
No | 3600 (1h) |
General cache (seconds) |
Local / staging example
Usage
Access the SDK via your helper or global:
Purchase link
Use in a button:
Inline checkout (wp-admin modal) — SDK 2.0+
Keep customers inside WordPress admin with a billing modal. Supports Paddle overlay and Stripe Elements. PayPal still uses the hosted purchase link (redirect).
Fixed plan on the button:
Let the customer pick a plan:
| Key | Description |
|---|---|
plugin-file |
Main plugin file path (__FILE__) so SDK assets load from vendor/license-bridge/wordpress-sdk/assets |
gateway |
paddle or stripe |
plan-slug |
Fixed plan slug (optional when allow-plan-selection is true) |
plan-type |
month, annual, or life (optional; inferred from API when omitted) |
allow-plan-selection |
Show plan / billing-cycle selectors |
label |
Button text |
The hosted market link remains available as a fallback via purchase_link().
Check license
License details
Example fields: full_name, email, plan_type, active, subscribed, subscription, etc.
Cancel subscription
Post-purchase flow
After checkout, License Bridge redirects the customer to your WordPress admin. The SDK:
- Verifies the nonce
- Stores
lk,client_id,client_secret - Runs premium plugin upgrade (if a newer package is available)
- Redirects to Plugins screen:
wp-admin/plugins.php?license_upgraded=1— upgrade ranwp-admin/plugins.php?license_saved=1— license saved, no newer version
Show admin feedback:
Important: Premium version on License Bridge must be higher than the installed free version for auto-upgrade to run.
Imported license migration (Freemius and other platforms)
When you import licenses from another platform, License Bridge preserves each customer's original license key. OAuth credentials are not created during import and do not need to be distributed manually.
Embed your product provisioning key (shown on the License Bridge import page) in the plugin SDK config:
When a site already stores the imported license key but has no OAuth credentials yet, the SDK automatically provisions credentials on the first connection. The customer does not configure OAuth manually.
If OAuth credentials were already stored (for example after checkout), the SDK continues using them and does not call provisioning again.
OAuth provisioning happens once per license. Existing credentials are never rotated or re-exposed through the provisioning endpoint.
This feature does not migrate subscription billing, payment-provider subscriptions, activation history, or remote renewal. Imported licenses keep their local entitlement dates only.
Hooks
Example plugin
See license-example-plugin for a full working integration.
License
Copyright (c) License Bridge.
Licensed under the GNU General Public License v3.0.