Configuration
Configuration
Section titled “Configuration”Colvor plugins are configurable via the WordPress admin UI and via code using WordPress hooks and filters.
Settings Panel
Section titled “Settings Panel”After activation, navigate to WooCommerce → Colvor Settings to access:
| Setting | Description |
|---|---|
| License Key | Your plugin license key |
| API Mode | live or test (for development) |
| Cache TTL | License validation cache duration (default: 3600s) |
| Debug Mode | Enables verbose logging to WooCommerce status log |
Hooks & Filters
Section titled “Hooks & Filters”Colvor exposes a clean PHP API for developers who need programmatic control.
Filter: colvor/license/validate
Section titled “Filter: colvor/license/validate”Called before each license validation attempt. Return false to bypass validation (e.g., for staging environments).
add_filter( 'colvor/license/validate', function( bool $should_validate ): bool { // Skip license check on local/staging environments if ( defined('WP_ENV') && WP_ENV !== 'production' ) { return false; } return $should_validate;} );Filter: colvor/license/cache_ttl
Section titled “Filter: colvor/license/cache_ttl”Override the license validation cache duration (in seconds).
add_filter( 'colvor/license/cache_ttl', fn() => 7200 ); // Cache for 2 hoursAction: colvor/license/activated
Section titled “Action: colvor/license/activated”Fires after a license is successfully activated.
add_action( 'colvor/license/activated', function( string $license_key, string $domain ): void { // e.g., log to your monitoring system error_log( "Colvor license activated: {$license_key} for {$domain}" );}, 10, 2 );Environment Variables (Optional)
Section titled “Environment Variables (Optional)”For headless/CI environments, you can set your license key via a PHP constant in wp-config.php:
define( 'COLVOR_LICENSE_KEY', 'your-license-key-here' );When this constant is defined, the Settings UI field is hidden and the constant value is used automatically.