Implement version 0.0.2 features

Add product version management:
- ProductVersion model and VersionManager class
- VersionAdminController with meta box on product edit page
- AJAX-based version CRUD (add, delete, toggle status)
- JavaScript for version management UI

Add email notifications:
- LicenseEmailController for order emails
- License keys included in order completed emails
- Support for both HTML and plain text emails

Add REST API rate limiting:
- 30 requests per minute per IP
- Cloudflare and proxy-aware IP detection
- HTTP 429 response with Retry-After header

Other changes:
- Bump version to 0.0.2
- Update CHANGELOG.md
- Add version status styles to admin.css

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 19:15:19 +01:00
parent 82c18633a1
commit dec4bd609b
10 changed files with 1269 additions and 4 deletions

View File

@@ -10,11 +10,14 @@ declare(strict_types=1);
namespace Jeremias\WcLicensedProduct;
use Jeremias\WcLicensedProduct\Admin\AdminController;
use Jeremias\WcLicensedProduct\Admin\VersionAdminController;
use Jeremias\WcLicensedProduct\Api\RestApiController;
use Jeremias\WcLicensedProduct\Checkout\CheckoutController;
use Jeremias\WcLicensedProduct\Email\LicenseEmailController;
use Jeremias\WcLicensedProduct\Frontend\AccountController;
use Jeremias\WcLicensedProduct\License\LicenseManager;
use Jeremias\WcLicensedProduct\Product\LicensedProductType;
use Jeremias\WcLicensedProduct\Product\VersionManager;
use Twig\Environment;
use Twig\Loader\FilesystemLoader;
@@ -38,6 +41,11 @@ final class Plugin
*/
private LicenseManager $licenseManager;
/**
* Version manager
*/
private VersionManager $versionManager;
/**
* Get singleton instance
*/
@@ -90,15 +98,18 @@ final class Plugin
private function initComponents(): void
{
$this->licenseManager = new LicenseManager();
$this->versionManager = new VersionManager();
// Initialize controllers
new LicensedProductType();
new CheckoutController($this->licenseManager);
new AccountController($this->twig, $this->licenseManager);
new RestApiController($this->licenseManager);
new LicenseEmailController($this->licenseManager);
if (is_admin()) {
new AdminController($this->twig, $this->licenseManager);
new VersionAdminController($this->versionManager);
}
}