How to add license checks to a WordPress plugin in 15 minutes

To license a WordPress plugin you need three things: a license server that issues and validates keys (Lisensio does this inside your WooCommerce store), a client library in your plugin that talks to it, and an update integration so paying customers get wp-admin updates. The integration below takes about 15 minutes.

What you’ll build

By the end of this tutorial your plugin will: ask the customer for a license key, validate it against your store, record the activation domain, and receive one-click automatic updates โ€” exactly like a WordPress.org plugin, except every update is gated on a valid license.

Step 1 โ€” Install the license server (5 min)

On your store: install WooCommerce, install Lisensio, and mark your product as a licensed product. Set the license type (single site, multi-site, etc.) and you’re done โ€” keys are generated automatically on every sale.

Step 2 โ€” Drop the integration library into your plugin (5 min)

Download the integration library from your Lisensio account and include it in your plugin’s main file:

require_once plugin_dir_path( __FILE__ ) . 'lisensio-integration.php';

lisensio_register_product( array(
    'store_url'    => 'https://your-store.com',
    'product_slug' => 'your-plugin-slug',
    'version'      => '1.0.0',
) );

That’s the whole integration. The library registers a settings field for the license key, handles validation and activation against your store, and hooks into WordPress’s update system.

Step 3 โ€” Gate your premium code (5 min)

Wrap anything license-dependent in a status check:

if ( lisensio_is_active( 'your-plugin-slug' ) ) {
    // Premium features, pro templates, etc.
} else {
    // Show the activation prompt
}

What happens from here

  • Customer buys โ†’ key generated and emailed automatically, visible in their account dashboard
  • Customer activates โ†’ domain recorded, activation limits enforced on your store
  • You release an update โ†’ upload the new version; licensed customers see it in wp-admin. Update URLs are obfuscated, so download links can’t be shared
  • License expires โ†’ the plugin keeps working, but updates stop โ€” a natural, honest renewal incentive

Common mistakes to avoid

  • Don’t phone home on every page load โ€” cache the validation result (the library does this for you)
  • Don’t hard-fail if your store is briefly unreachable โ€” degrade gracefully
  • Don’t forget staging domains โ€” Lisensio license types include staging by default, so local/dev/test sites don’t burn activations