Black Friday: 40% off everything with code BF40 Ends in 4d 06h 15m See the deals →

Aluleth License Manager documentation

Everything you need to set up Aluleth License Manager, the plugin that turns WooCommerce into a licence and update server for the plugins, themes and software you sell: licence keys, sites per key, renewals, bundles, updates in WordPress and security fixes. Want to see it first? Open the live demo, its demo admin and a sample customer’s licences.

Contents

Requirements

WordPress 6.5 or later, PHP 7.4 or later and WooCommerce 8.0 or later. The classic cart and checkout and the Cart and Checkout blocks both work, and so does WooCommerce’s order storage (HPOS) as well as the older one.

Installation

Upload the zip in Plugins › Add New › Upload Plugin, then activate it. A Licences screen appears under WooCommerce, a Licence tab appears on your products and a Licences page appears in My account.

Then, for each product you sell: tick Licence keys in its Licence tab, publish the zip of the current version in WooCommerce › Licences › Versions, and add the licence client to your plugin.

Licence and updates

Open the Plugins screen and click Licence under Aluleth License Manager. Paste the licence key from your Market account and click Activate. Updates then come to your Plugins screen like any other plugin. The three Annual licences (single site, 5 sites, unlimited sites) include one year of updates and support; after that the plugin keeps working and you renew only if you want new versions. The three Lifetime licences (single site, 5 sites, unlimited sites) have no end date. To move a licence to another site, deactivate it on the old site first.

Licensed products

Open a product and its Licence tab, then tick Licence keys. The settings:

  • Type: WordPress plugin, WordPress theme or other software.
  • Sites: the number of sites a key can be activated on. 0 means unlimited. Local and staging sites never count.
  • Valid for: a number of days, weeks, months or years, or Lifetime.
  • Key prefix: letters, digits, – and _ put before each new key (FWBK-…).
  • One key per unit: a customer who buys 3 gets 3 keys. Otherwise they get one key with 3 times the sites.
  • Renewal discount: the percent taken off the price when a customer renews from My account.
  • Plugin slug, Requires WordPress, Requires PHP, Tested up to, Icon and Banner: what WordPress shows in the update and in the details window of your plugin. The slug is the folder name of your plugin or theme.
  • Also covers: makes the product a bundle (see below).

Variations

On a variable product, each variation has its own Sites and Valid for fields in the Variations tab. This is how you sell 1 site, 5 sites and unlimited sites, yearly or for life, from one product. A variation without values uses those of the Licence tab.

Keys and orders

A key is created when the order is paid, that is when it becomes Processing or Completed, before WooCommerce sends its emails. With cash on delivery, the key waits for Completed. There is one key per order line, or one per unit if you ticked One key per unit, and an order never gets the same key twice.

The key shows under the item in the order emails, on the thank-you page, on the order screen and in My account. The emails sent to the shop show only its last four characters.

Keys are stored hashed and encrypted: the database never holds them in clear. Only an administrator can show a full key in the admin, and each time is written to the licence’s history.

Refunds

A full refund turns the key off. A partial refund turns off one key per unit refunded, the keys without a site first. When the refunded order was a renewal, the end date goes back to where it was instead.

My account › Licences

Customers see each key with a copy button, its end date and its sites. A Remove button next to each site frees its place, for example when they move a plugin to a new site. The last three versions are there to download, and a Renew button adds one more period.

Renewals and reminders

Renew puts the same product and variation in the cart, with your renewal discount. It works with the classic checkout and the Checkout block. Once the renewal is paid, the end date moves by one period (from today if the licence has already ended). A customer can only renew a licence of their own account.

The Licence renewal reminder email goes 30 and 7 days before the end, on the end date and 14 days after, at most one a day per customer. Edit or turn it off in WooCommerce › Settings › Emails.

Versions and updates

In WooCommerce › Licences › Versions, pick the product, upload the zip of the new version, write the notes and tick, if needed:

  • Security fix: it also reaches the licences that have ended, when they were bought less than 24 months ago;
  • Critical security fix: it reaches every licence, whatever its age;
  • Beta: the version is kept for your testers and is never offered as an update or in My account.

Every site with a valid key then sees the update on its Plugins screen and installs it in one click. The download link is signed for that site, expires after 72 hours and never holds the key. The list of versions shows how many sites run each one.

After the end date, updates go on for a grace period: 15 days by default, set in Settings.

Test and staging sites

A key is activated on test sites without taking a place: localhost, the .test and .local addresses, the addresses that start with staging., stage., dev., test., qa., sandbox., preview., uat. or development., and the staging domains of WP Engine, Kinsta, SiteGround, Cloudways, Flywheel, Pantheon, DreamHost, Pressable, WPMU DEV, Liquid Web and RunCloud. My account marks them as test sites.

Bundles

Fill Also covers in the Licence tab of a product to make it a bundle: its key also activates those licensed products. A site counts once, whatever the number of products of the bundle on it. Change the list later and the bundle keys follow.

The licence client for your plugins

In WooCommerce › Licences › Versions, pick the product: the Licence client for your plugin section gives you one PHP file made for that product, with the lines to add to your plugin:

  • copy the file into your plugin and load it from its main file with require_once;
  • call Your_Class::init( __FILE__, '1.0.0' ) with your plugin’s version;
  • add Update URI: with your shop’s address to the plugin header, so WordPress.org never offers an update for it.

The client adds a Licence screen reached from the Plugins screen, checks the key once a week (with a grace period if your shop cannot be reached), shows your updates and the details window. Your plugins sold on the same shop can share one key on a site, and those without a key are listed in one notice.

The licence API

The API answers at ?allm-api=activate_license, check_license, deactivate_license, get_license_version and download_license_package, and in REST at /wp-json/allm/v1/. The fields are license_key, item_id (the product ID), site_url and, for versions, current_version.

It also answers the FluentCart form (?fluent-cart=activate_license…) when no other licence server on the site does, so plugins that moved from a FluentCart store keep their update client. You can turn this off or force it in Settings.

A wrong key is refused, and too many wrong keys from one address or for one key are slowed down. An error on the shop’s side is answered “try again later”, never “invalid licence”, so a database hiccup never turns off a customer’s plugin.

Shop screens

WooCommerce › Licences has these tabs:

  • Licences: search by key, its last four characters, email, order or licence number, filter by status and product, export the list as CSV (keys masked).
  • One licence: show the key, change its sites, end date or account, turn it off or on, remove a site, see its history. The account field links a licence to a customer who bought without an account.
  • Add a licence: a gift, a replacement or a sale made elsewhere.
  • Versions, Statistics (active licences, renewals, versions in use), Log, Import and Settings.

Each order screen also has a Licences box with the keys of that order.

Who can do what

Shop managers see and change licences. Versions, settings, imports, the licence client and showing a full key are for administrators. The filter allm_admin_capability changes that capability.

Import

Licences › Import moves your licences from another plugin. An import never changes the other plugin’s tables, and a key already here is skipped, so you can run it again.

  • License Manager for WooCommerce: its sold licences, with their keys, end dates, numbers of sites and the activations whose label is a site address. It must stay active during the import, as its keys are encrypted with its own key.
  • WooCommerce Software Add-on: its licences and activations.
  • CSV file: the columns key, product_id or sku, variation_id, email, sites, expires, status, activated_sites and order_id.

Your plugins then need one update with the licence client of this plugin.

Where the zips are kept

The zips of your versions go to a private folder of the uploads, closed to the web by .htaccess and web.config. On Nginx, the Settings tab checks that the folder is closed and shows the rule to add. You can also set ALLM_PRIVATE_DIR in wp-config.php to keep the files outside the website.

For developers

Actions: allm_license_created, allm_license_activated, allm_license_deactivated, allm_license_renewed, allm_license_expired, allm_license_revoked, allm_release_published, allm_daily_after and allm_loaded.

Filters: allm_admin_capability, allm_grace_days, allm_security_months, allm_staging_domains, allm_staging_words, allm_is_local, allm_site_url, allm_api_body, allm_version_body, allm_client_ip, allm_wait_for_completed and allm_sdk_code.

Languages

English, French, Spanish and Filipino are included. The plugin uses its own text domain, aluleth-license-manager, so you can translate it with Loco Translate or a .po file.

Uninstalling

Deleting the plugin keeps your licences, unless you ticked “Also delete every licence, site and version file” in Settings. Your customers’ plugins keep working either way; only their updates stop.

Troubleshooting

  • The Licences page of My account shows a 404: open Settings › Permalinks and click Save once.
  • A site does not see the update: check that the version is published for the right product, that the key is active and valid on that site, and that the plugin’s slug in the Licence tab is its folder name.
  • The download is refused: the link is valid 72 hours, ask WordPress to check for updates again.
  • Does it work with WooCommerce Subscriptions? Not yet: renewals go through the Renew button of My account.