stellarwp / harbor
A library that integrates a WordPress product with the Liquid Web licensing system.
Requires
- php: >=7.4
- ext-json: *
- nyholm/psr7: ^1.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.1
- stellarwp/container-contract: ^1.0
- symfony/http-client: ^5.4
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1
- dpanta94/phpstan-containers: ^0
- exussum12/coverage-checker: ^1.1
- lucatume/codeception-snapshot-assertions: *
- lucatume/di52: ^3
- lucatume/wp-browser: *
- php-stubs/wp-cli-stubs: ^2
- phpcompatibility/phpcompatibility-wp: ^2
- phpspec/prophecy: *
- phpspec/prophecy-phpunit: *
- phpstan/phpstan: ^2
- phpunit/phpunit: *
- stellarwp/coding-standards: ^2
- szepeviktor/phpstan-wordpress: >=1.0
- wp-cli/wp-cli: ^2
- dev-main
- dev-refactor/scon-496
- dev-improve_docs
- dev-fix/solid-plugin-data
- dev-SCON-484/fix-reame
- dev-refactor/scon-456
- dev-SCON-460/resolve-update-version-from-wp-update-transients
- dev-SCON-473/fix-small-issues
- dev-SCON-473/rename-css-and-js
- dev-SCON-473/fix-various-issues-after-renaming
- dev-SCON-473/fix-broken-store
- dev-base/SCON-455/feature-row-badges
- dev-refactor/remove-uplink-v2-prefix-code
- dev-SCON-473/rename-liquid-to-harbor
- dev-SCON-446/improve-catalog-caching
This package is auto-updated.
Last update: 2026-03-24 19:50:43 UTC
README
Installation
It's recommended that you install Harbor as a project dependency via Composer:
composer require liquidweb/harbor
We actually recommend that this library gets included in your project using Strauss.
Luckily, adding Strauss to your
composer.jsonis only slightly more complicated than adding a typical dependency, so checkout our strauss docs.
Initialize the library
Initializing the Harbor library should be done within the plugins_loaded action, preferably at priority 0.
use LiquidWeb\Harbor\Harbor; add_action( 'plugins_loaded', function() { /** * Configure the container. * * The container must be compatible with stellarwp/container-contract. * See here: https://github.com/stellarwp/container-contract#usage. * * If you do not have a container, we recommend https://github.com/lucatume/di52 * and the corresponding wrapper: * https://github.com/stellarwp/container-contract/blob/main/examples/di52/Container.php */ $container = new Container(); Config::set_container( $container ); Harbor::init(); }, 0 );
Translation
Package is using __( 'Invalid request: nonce field is expired. Please try again.', '%TEXTDOMAIN%' ) function for translation. In order to change domain placeholder '%TEXTDOMAIN%' to your plugin translation domain run
./bin/stellar-harbor domain=<your-plugin-domain>
or
./bin/stellar-harbor
and prompt the plugin domain You can also add lines below to your composer file in order to run command automatically
"scripts": { "stellar-harbor": [ "vendor/bin/stellar-harbor domain=<your-plugin-domain>" ], "post-install-cmd": [ "@stellar-harbor" ], "post-update-cmd": [ "@stellar-harbor" ] }
Registering a plugin
To register your plugin, you need to filter the lw-harbor/product_registry hook.
add_filter('lw-harbor/product_registry', function (array $products): array { $products[] = [ 'product' => 'your-product', // Product (brand) slug — all plugins in the same product share a unified license 'slug' => 'your-plugin', // Unique slug for this specific plugin 'name' => 'Your Plugin', // Human-readable product name 'version' => YOUR_PLUGIN_VERSION, // Current plugin version 'embedded_key' => getBundledLicenseKey(), // Optional: pre-embedded license key ]; return $products; });
Product array fields:
| Field | Required | Description |
|---|---|---|
product |
Yes | Product (brand) slug. All plugins in the same product share a unified license. |
slug |
Yes | Unique identifier for this plugin. Used in lw_harbor_is_product_license_active(). |
name |
Yes | Human-readable name shown in the license UI. |
version |
Yes | Current plugin version. |
embedded_key |
No | A license key bundled with the plugin. |
Changelog
This project uses @stellarwp/changelogger to manage its changelog. All notable changes are tracked via changelog entry files in the changelog/ directory.
To add a new changelog entry:
bunx @stellarwp/changelogger add
To compile changelog entries into changelog.txt:
bunx @stellarwp/changelogger write --overwrite-version <version>
Additional documentation
Harbor
- Harbor — Primary architecture document for v3 unified licensing.
- Licensing — Key discovery, API responses, validation workflows, caching.
- Catalog — Product families, tiers, features, the Commerce Portal API.
- Features — Feature types, resolution, strategies, Manager API, REST endpoints.
- Unified License Key — Key model, seat mechanics, system boundaries.
- Multi-Instance Architecture — Leader election, cross-instance hooks, thin instances.
General
- CLI Commands — WP-CLI commands for feature management.
- Testing — How to set up and run automated tests with Codeception and
slic.