WordPress v2.0.0

WordPress Plugin SDK

Official WordPress Plugin SDK for Traffic Orchestrator. Validate licenses, manage keys, and integrate license management into your application in minutes.

wp plugin install traffic-orchestrator

Quick Start

Initialize the client and start validating licenses.

php
// In your theme's functions.php or plugin
// The plugin auto-registers and provides:
// 1. Admin settings page (Settings → Traffic Orchestrator)
// 2. [to_license_check] shortcode
// 3. REST endpoint at /wp-json/traffic-orchestrator/v1/validate

License Validation

Validate a license key against a domain with a single call.

php
// Use the shortcode in any post/page
[to_license_check key="TO-XXXX-XXXX-XXXX"]

// Or validate programmatically
$to = TrafficOrchestrator::getInstance();
$result = $to->validate('TO-XXXX-XXXX-XXXX');

if ($result['valid']) {
    // License is active
}

Offline Verification

Verify licenses offline using Ed25519 cryptographic signatures — no network required.

php
// Offline verification via plugin API
$isValid = $to->verifyOffline(
    'TO-XXXX-XXXX-XXXX',
    $signature,
    $publicKey
);

Management API

Create licenses, list existing keys, and monitor usage with authenticated API calls.

php
// Configure via WordPress Admin UI
// Settings → Traffic Orchestrator
// - API URL
// - API Key (for management endpoints)
// - Default Product
// - Enable/Disable auto-validation

Available Methods

validateLicense()
Validate a license key against a domain
verifyOffline()
Cryptographic offline verification (Ed25519)
listLicenses()
List all licenses (requires API key)
createLicense()
Create a new license key (requires API key)
getUsage()
Retrieve usage statistics (requires API key)
healthCheck()
Check API health and connectivity
gracePeriod
Cache validation results for resilience during API outages (v2.1.0+)
clearCache()
Clear cached validation results immediately