=== PBJ License Manager ===
Contributors: pbj
Tags: license, license key, updates, plugin updates, selling plugins
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Turn any WordPress site into a license server for plugins and themes you sell: issue keys, gate update downloads, serve update manifests.

== Description ==

PBJ License Manager is a self-hosted license server. Install it on your own site, register your commercial plugins as products, and it will:

* Issue license keys (manually, via a PHP hook, via an authenticated REST endpoint, or automatically from paid PBJ Form Builder submissions)
* Track per-key site activations with a configurable per-product limit
* Serve WordPress-native update manifests: customers with a valid key get updates; everyone else keeps a working plugin but receives no packages
* Sign download links with an expiring HMAC token so package URLs cannot be shared
* Email keys to buyers automatically
* Export all keys to CSV

The license model is update-and-support gating: a key never disables a customer's plugin. One key = one product, one major version, N sites.

A single-file GPL client class (sdk/class-pbj-license-client.php) is included for bundling in the plugins you sell.

The optional feedback form on the settings screen emails your message (and, only if you tick the box, basic site info) to the plugin author. Nothing is sent automatically.

== Installation ==

1. Upload pbj-license-manager.zip via Plugins → Add New → Upload Plugin.
2. Activate.
3. Open License Manager in the admin menu and read the User Guide tab.

== Frequently Asked Questions ==

= Does a missing or expired key break my customer's site? =

No. Keys gate updates and support only. The customer's plugin keeps working forever.

= Where is license data stored? =

In one table on your own site. No third-party services are contacted.

== Upgrade Notice ==

= 1.1.0 =
Packages tab (protected zip storage + version management), download link in key emails, resend-key button.

== Changelog ==

= 1.2.0 =
* Guided admin: the Keys tab now opens with a live "Getting started" checklist (products, current-release package, email delivery, first key - each row shows done/to-do with a link to the right tab) and a numbered "How selling works" walkthrough.
* Every tab (Keys, Products, Packages, Settings) gained a plain-English intro and numbered how-to steps explaining each form, field, and button - including what Revoke really does (blocks updates, never breaks the customer's site) and the signing-secret regeneration warning.
* No functional changes.

= 1.1.3 =
* License Manager now licenses itself: a License section in Settings where you enter your key to receive updates (it is product #7 in the storefront). Replaces its old self-hosted updater with the bundled client SDK. On the license server's own site no key is needed.

= 1.1.2 =
* Client SDK v1.1.0: self-contained License settings section (status banner + key field + Save via a shared handler), on-own-server detection (no key needed when the plugin runs on the license server itself), an upgrade-path status for major-version upgrades, and a status() helper. Bundle the updated sdk/ file into the plugins you sell.

= 1.1.1 =
* Security hardening: the packages folder's deny-all protection (`.htaccess` + `index.php`) now self-heals on plugin activation and before every signed download is served. Previously it was only written when the Packages tab stored an upload, so package zips that arrived any other way (site sync, FTP, manual copy) were publicly downloadable at a guessable URL until an admin opened the Packages tab.

= 1.1.0 =
* Packages tab: upload/store/delete plugin zips per product in a deny-all protected uploads folder; "Make current" updates the manifest and latest version in one step.
* Key emails: new {download_url} placeholder - a signed link (72h default, configurable) to the current release of the purchased major version. Feature updates still flow through WordPress updates only.
* Keys tab: "Resend email" action per key.
* Settings: email download link lifetime. Schema v2 migration upgrades default email templates in place.
* Uninstall (opt-in data delete) now also removes stored package files.

= 1.0.0 =
* Initial release: products registry, key issuing (manual / hook / REST / PBJ Form Builder), site activations, key-aware update manifests, signed expiring downloads, key delivery emails, CSV export, User Guide + Feedback tabs, bundled GPL client SDK.
