Download the PHP package digital-nature/licence-verifier without Composer
On this page you can find all versions of the php package digital-nature/licence-verifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digital-nature/licence-verifier
More information about digital-nature/licence-verifier
Files in digital-nature/licence-verifier
Package licence-verifier
Short Description PHP client for the Digital Nature licence verification API
License MIT
Informations about the package licence-verifier
digital-nature/licence-verifier
PHP client for the Digital Nature licence verification API. Requires PHP 7.4+.
Installation
You also need a PSR-18 HTTP client and PSR-17 factories. With Guzzle:
Usage
Options
The fifth constructor argument is $cacheTtl in milliseconds (default 30000). Responses from verify() and info() are cached in-process for the duration of the request. Set to 0 to disable.
Note: PHP-FPM processes are request-scoped, so the cache only persists within a single HTTP request. It avoids redundant calls when
verify()is called multiple times in one execution.
Error handling
All methods throw typed exceptions that extend LicenceVerifierException:
WordPress plugin auto-updates
WordPress\Updater hooks a plugin into the WordPress update system so that new versions published to the Digital Nature store appear in Dashboard → Updates and can be installed with one click.
Installation
Include the library in your plugin's composer.json alongside a PSR-18 client:
Load Composer's autoloader from your plugin's main file (if not already done by the plugin framework):
Setup
Instantiate Updater once, early in your plugin's boot sequence (e.g. directly in the main plugin file or on the init hook):
The constructor registers all required WordPress hooks automatically — no further wiring is needed.
How it works
| WordPress hook | What it does |
|---|---|
pre_set_site_transient_update_plugins |
Checks for a newer version and injects it into the WP update transient |
plugins_api |
Supplies plugin name, version, and changelog for the "View version details" modal |
upgrader_process_complete |
Clears the cached update info after the plugin is updated |
Update checks are cached in WordPress transients for cache_hours to avoid hitting the API on every page load. The download URL passed to WordPress never expires — the verify service validates the licence key on each download request.
Errors (invalid licence, expired licence, network failure) are silently swallowed so they never break the WordPress admin.
Requirements
- PHP 7.4 or later
- PSR-18 HTTP client
- PSR-17 request and stream factories
All versions of licence-verifier with dependencies
psr/http-client Version ^1.0
psr/http-message Version ^1.0
psr/http-factory Version ^1.0