Platform Documentation
Complete reference for the WordPress License Client SDK and License REST API.
1. Customer Quickstart
After completing a purchase on Cairo Plugin Store, you will receive a unique license key formatted as:
- Download the plugin ZIP file from your Downloads page.
- Upload the ZIP file in WordPress via Plugins → Add New Plugin → Upload Plugin.
- Activate the plugin, navigate to Settings → [Plugin Name] License, and paste your license key.
- Click Activate License. Once verified, all premium features and automatic updates will unlock immediately.
2. WordPress License Client SDK
The official reusable SDK is located in packages/cairo-wordpress-sdk/CairoLicenseClient.php. It gives any WordPress plugin automatic licensing, domain validation, update hooks, and non-intrusive expiration banners.
<?php
require_once __DIR__ . '/CairoLicenseClient.php';
$cairoLicense = new CairoLicenseClient([
'api_url' => 'https://plugins.yourdomain.com/api/v1',
'plugin_file' => __FILE__,
'plugin_slug' => 'my-custom-plugin',
'plugin_version' => '1.0.0',
'plugin_name' => 'My Custom Plugin',
]);
// Check if license is currently valid:
if ($cairoLicense->isLicenseValid()) {
// Unlocked premium functionality
}
3. Strict Expiration Policy
- No Site Crashes: The WordPress website continues functioning with free/fallback logic intact.
- Protected Customer Data: No tables or user-generated data are deleted.
- Offline Verification Grace: Up to 72 hours of temporary network blips are permitted before false expiration triggers.
- Instant Renewal: As soon as the customer renews, the license returns to
activestatus immediately.
4. License REST API Endpoints
All licensing endpoints are located under /api/v1/ and return cryptographically-signed JSON responses with an HMAC-SHA256 signature.
/api/v1/license/activate
Activates a license key for a given domain and increments current activation counts.
/api/v1/license/validate
Validates license validity, checks expiration timestamps, and updates domain heartbeat.
/api/v1/license/deactivate
Deactivates a domain, freeing up an activation slot for the license.
/api/v1/plugin/check-update
Returns update metadata compatible with the WordPress update transient.