=== OneEuroLabs License Key Manager ===
Contributors: oneeurolabs
Tags: license manager, license key, stripe, paypal, software licensing
Donate link: https://oneeurolabs.com/donate/
Requires at least: 6.0
Tested up to: 7.0
Stable tag: 1.0.8
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Universal License Manager for WordPress. Generate, validate and manage software license keys. Supports Stripe or PayPal. Free for up to 50 licenses.

== Description ==

OneEuroLabs License Key Manager is a **free, fully functional** license key management plugin for WordPress. Issue, validate, and manage license keys for your software products.

**External services used:**
* **Stripe** – Payment processing. [Terms](https://stripe.com/legal) | [Privacy](https://stripe.com/privacy)
* **PayPal** – Payment processing. [Terms](https://www.paypal.com/us/legalhub/useragreement-full) | [Privacy](https://www.paypal.com/us/webapps/mpp/ua/privacy-full)

Data sent: payment event data from Stripe/PayPal to this plugin via webhook. No personal data is sent from this plugin to external services.



**LicenseHub** is the easiest way to sell and manage software license keys directly from WordPress. Connect your payment provider, and license keys are generated and delivered automatically by email.

= Free Version =
* Generate & manage license keys (up to 50)
* REST API: validate, activate, deactivate
* Admin dashboard with live stats
* Automatic license email delivery
* 1 payment provider: Stripe **or** PayPal
* Webhook log

= Pro Version – from €149/year =
* **Unlimited licenses**
* **8 payment providers**: Stripe, PayPal, Paddle, LemonSqueezy, WooCommerce, EDD, Gumroad, Mollie
* Demo license system (24h trial, countdown starts on first activation)
* Expiry reminder emails (7 days before)
* CSV export & reports
* Custom external database (MySQL/MariaDB)
* Multi-site shared database
* White-label email templates
* Priority support

= REST API =
* `POST /wp-json/licensehub/v1/validate`
* `POST /wp-json/licensehub/v1/activate`
* `POST /wp-json/licensehub/v1/deactivate`
* `GET  /wp-json/licensehub/v1/plans`
* `POST /wp-json/licensehub/v1/resend`
* `POST /wp-json/licensehub/v1/webhook/stripe`
* `POST /wp-json/licensehub/v1/webhook/paypal`

= License Key Format =
Keys are generated in the format `LH-XXXX-XXXX-XXXX-XXXX` using cryptographically secure random characters.

== Installation ==

1. Upload to `/wp-content/plugins/oneeurolabs-license-key-manager/`
2. Activate via **Plugins** in WordPress admin
3. Go to **License Manager → Settings** to configure Stripe and/or PayPal
4. Copy your webhook URL and add it in your Stripe or PayPal dashboard
5. Add your plans with the correct Price IDs under **License Manager → Plans**

== Frequently Asked Questions ==

= Which payment providers are supported? =
The free version supports Stripe or PayPal (one active at a time). The Pro version supports all 8 providers simultaneously: Stripe, PayPal, Paddle, LemonSqueezy, WooCommerce, EDD, Gumroad and Mollie.

= What happens when a customer pays? =
The webhook fires → LicenseHub generates a unique license key → sends it by email to the customer automatically.

= Can I use this for desktop apps, plugins or themes? =
Yes. The REST API works with any application that can make HTTP requests. The key format and validation endpoint are language-agnostic.

= How do I upgrade to Pro? =
Purchase at oneeurolabs.com/licensehub. Enter your license key and email under **LicenseHub → Einstellungen** to unlock all Pro features instantly.

= Is there a demo mode? =
Yes (Pro only). Create a 24-hour demo license for a customer's email. The countdown starts only when they first activate it.

== Screenshots ==

1. Dashboard with license statistics and recent licenses overview
2. License list with search, status filters and quick actions
3. Plans & Pricing – configure Stripe Price-ID and PayPal Plan-ID per plan
4. Settings – Stripe and PayPal webhook configuration with copy-to-clipboard URLs


== Privacy Policy ==

This plugin contacts `oneeurolabs.com` only when a Pro license key is entered in Settings. No data is sent without the administrator explicitly entering a key. Data sent: license key, email, anonymised site ID.


== External Services ==

This plugin optionally connects to the following third-party services when configured by the site administrator. No data is transmitted unless the respective payment provider is enabled in the plugin settings.

= Stripe =
When Stripe is selected as the payment provider, this plugin sends an API request to the Stripe API to test connectivity (admin settings only). It also receives webhook events from Stripe at the registered webhook endpoint to create and manage license keys automatically.

* Data sent: Stripe API key (for connection test only, initiated manually by admin)
* Data received: Payment and subscription events via webhook
* When: Only when Stripe is configured and a payment event occurs
* Stripe Terms of Service: https://stripe.com/terms
* Stripe Privacy Policy: https://stripe.com/privacy

= PayPal =
When PayPal is selected as the payment provider, this plugin sends an API request to the PayPal API to obtain an OAuth token for connection testing (admin settings only). It also receives webhook events from PayPal at the registered webhook endpoint.

* Data sent: PayPal Client ID and Secret (for connection test only, initiated manually by admin)
* Data received: Payment and subscription events via webhook
* When: Only when PayPal is configured and a payment event occurs
* PayPal Terms of Service: https://www.paypal.com/us/legalhub/useragreement-full
* PayPal Privacy Policy: https://www.paypal.com/us/legalhub/privacy-full

== Changelog ==

= 1.0.6 =
* Fix: All remaining lhf- submenu page slugs renamed to oelkm-
* Fix: REST namespace changed from licensehub/v1 to oelkm/v1
* Fix: JS/HTML element ID mismatches corrected (banner, settings)
* Fix: Enqueue hook check updated to oelkm- prefix

= 1.0.5 =
* Fix: Renamed remaining lhf-upgrade slug and LHF JS global to OELKM prefix
* Security: Resend endpoint now requires matching license key + rate limiting (3 requests/hour)
* Security: PayPal webhook verifies Webhook-ID header against stored value to prevent spoofing

= 1.0.4 =
* Fix: Renamed all prefixes to OELKM (min. 5 chars) per WordPress.org requirements
* Fix: Nonce validation now covers all $_POST reads in new-license form
* Fix: Added wp_unslash() to $_GET sanitization in licenses view
* Fix: uninstall.php uses prepared SQL; hardcoded table names

= 1.0.3 =
* Security: Stripe webhook no longer creates licenses for donations or unrelated payments
* Security: PayPal webhook requires verified plan before issuing any license
* Security: Removed dangerous fallback plan keys that granted licenses without valid purchase

= 1.0.2 =
* Complete English translation: plans page, settings page, new license page, documentation
* Documentation now available in English and German based on WordPress language setting
* Added all missing i18n strings for settings labels, hints, and button texts
* Billing cycle labels, table headers and action buttons are now fully translated

= 1.0.1 =
* Plans page now shows Stripe Price-ID or PayPal Plan-ID depending on the active payment provider
* Added paypal_plan_id field to plans database table
* Improved PayPal webhook: plan lookup via Plan-ID, subscription renewal handling
* Migration: existing installations automatically receive the new paypal_plan_id column

= 1.0.0 =
* Initial release
* Stripe & PayPal webhook support
* REST API (validate, activate, deactivate)
* Dismissible StripeDeck info banner (permanently dismissed per user)

== Upgrade Notice ==

= 1.0.0 =
Initial release.
