Download the PHP package closemarketing/wp-plugin-license-manager without Composer
On this page you can find all versions of the php package closemarketing/wp-plugin-license-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download closemarketing/wp-plugin-license-manager
More information about closemarketing/wp-plugin-license-manager
Files in closemarketing/wp-plugin-license-manager
Package wp-plugin-license-manager
Short Description WordPress Plugin License Manager Library - A reusable library for managing WordPress plugin licenses with Enwikuna License Manager
License GPL-2.0-or-later
Informations about the package wp-plugin-license-manager
WordPress Plugin License Manager
A reusable Composer library for managing WordPress plugin licenses with Enwikuna License Manager.
Features
- ✅ Easy integration with any WordPress plugin
- ✅ License activation/deactivation
- ✅ Automatic plugin updates
- ✅ Configurable text domain for translations
- ✅ Flexible settings integration with customizable page and tabs
- ✅ Automatic settings UI generation with Settings class
- ✅ Improved license deactivation handling
- ✅ Enwikuna License Manager compatible
- ✅ WordPress Coding Standards compliant
Requirements
- PHP 7.4 or higher
- WordPress 5.0 or higher
- Enwikuna License Manager (server-side)
Installation
Install via Composer:
Or manually add to your composer.json:
Usage
Basic Integration
Add this code to your main plugin file:
Using the Settings Class (Recommended)
The Settings class provides automatic UI generation and form handling. This is the easiest way to integrate license management:
Settings Class Options
The Settings class accepts the following options:
| Option | Type | Default | Description |
|---|---|---|---|
title |
string | 'License Management' | Title displayed in the license card |
description |
string | 'Manage your license...' | Description text |
plugin_name |
string | Auto from License | Plugin name for display |
purchase_url |
string | 'https://close.technology/' | URL to purchase page |
renew_url |
string | 'https://close.technology/my-account/' | URL to renew license |
benefits |
array | Default list | Array of benefit strings |
settings_page |
string | 'connect_ecommerce' | Settings page slug where form is submitted |
default_tab |
string | '' | Default tab for redirects after form submission |
tab_param |
string | 'tab' | URL parameter name for tabs |
Custom Settings Page Integration
If you want to handle the license UI yourself, you can still use the License class without the Settings class:
Then in your settings page, create a form that submits to options.php with:
Configuration Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
api_url |
string | Yes | - | Your Enwikuna License Manager URL |
rest_api_key |
string | Yes | - | REST API Consumer Key (ck_xxx) |
rest_api_secret |
string | Yes | - | REST API Consumer Secret (cs_xxx) |
product_uuid |
string | Yes | - | Product UUID from Enwikuna |
file |
string | Yes | - | Main plugin file path (__FILE__) |
version |
string | Yes | - | Plugin version |
slug |
string | Yes | - | Plugin slug (used for option keys) |
name |
string | Yes | - | Plugin name (display) |
text_domain |
string | No | 'default' | Text domain for translations |
plugin_slug |
string | No | Same as slug |
Plugin slug for updates |
plugin_name |
string | No | Auto-generated | Plugin basename |
settings_page |
string | No | {slug}_settings |
Settings page slug |
settings_tabs |
string | No | {slug}_settings_tabs |
Action hook for tabs |
settings_content |
string | No | {slug}_settings_tabs_content |
Action hook for content |
option_group |
string | No | {slug}_license |
Settings option group |
settings_section |
string | No | {slug}_settings_admin_license |
Settings section ID |
capabilities |
string | No | 'manage_options' | Required user capability |
Enwikuna License Manager Setup
Server Requirements
- Install Enwikuna License Manager on your store
- Create a product with a UUID
- Create REST API credentials:
- Go to Enwikuna License Manager → Settings → REST API
- Click Add Key
- Set Permission to Read/Write
- Enable routes: 104, 106, 107 (for licenses) and 301-304 (for updates)
- Copy the Consumer Key and Consumer Secret
Required Routes
| Route | Description |
|---|---|
| 104 | Validate License |
| 106 | Activate License |
| 107 | Deactivate License |
| 301-304 | Release/Update info |
Public Methods
License Class Methods
is_license_active()
Check if the license is currently active:
get_api_key_status( $live = false )
Get license status:
get_option_key( $key )
Get the full option key with slug prefix:
get_option_value( $key )
Get an option value:
validate_license( $input )
Validate and process license activation/deactivation:
Settings Class Methods
render()
Render the complete license settings UI:
The Settings class automatically:
- Handles form submission
- Validates nonces
- Processes license activation/deactivation
- Redirects after form submission
- Displays success/error messages
Database Options
The library creates the following options in the WordPress database:
{slug}_license_apikey- License key{slug}_license_activated- Activation status ('Activated', 'Deactivated', or 'Expired'){slug}_license_deactivate_checkbox- Deactivation checkbox status
Replace {slug} with your plugin slug.
Changelog
1.2.2 2026-04-30
- Add cache to check license.
- Fix updates and now brings the download directly.
1.2.1
- New: Added configurable options to Settings class (
settings_page,default_tab,tab_param) - Improved: Enhanced license deactivation handling with better fallback mechanisms
- Improved: Settings class now works with any plugin's settings page structure
- Fixed: License deactivation now properly handles readonly fields
- Fixed: License key is properly retrieved when deactivating from readonly input fields
- Documentation: Updated README with comprehensive Settings class usage examples
1.2.0
- Clean code.
- Unify Libraries and have styles.
1.1.1-1.1.2
- Add support to FormsCRM plugins.
1.1.0
- Breaking Change: Migrated from WooCommerce API Manager to Enwikuna License Manager
- New required options:
rest_api_key,rest_api_secret,product_uuid - Removed
product_idoption (replaced byproduct_uuid) - Updated API endpoints to use Enwikuna REST API
- Simplified license field (removed Product ID field)
1.0.1
- Added Settings class for automatic settings page generation
- Improved UI and styling
1.0.0
- Initial release with WooCommerce API Manager support
Important: Library vs Application
🔔 This is a LIBRARY, not an application
- ❌ DO NOT commit
composer.lock- ✅ DO use
composer updatein CI/CD- 📖 Read Composer Lock Policy for details
This ensures compatibility across PHP 7.4 to 8.3 by allowing each PHP version to resolve its own compatible dependencies.
Development
Running Tests
This library includes PHPUnit tests to ensure code quality and compatibility across PHP versions 7.4 to 8.3.
Setup Test Environment
-
Install development dependencies:
- Install WordPress test suite:
This will set up WordPress and its test suite in your system's temporary directory.
Run Tests
Continuous Integration
Tests run automatically via GitHub Actions on:
- Pull requests to
mainordevelopbranches - Push to
mainordevelopbranches - Matrix testing with PHP 8.3, 8.2, 8.1, and 7.4
Important: This is a library, so composer.lock is intentionally not versioned. Each PHP version will resolve dependencies appropriately during CI/CD, ensuring compatibility with older PHP versions. See Composer Lock Policy for detailed explanation.
Code Quality
The library uses:
- PHP CodeSniffer with WordPress Coding Standards
- PHPStan Level 5 with WordPress stubs for accurate type checking
- PHPCompatibilityWP for PHP 7.4+ compatibility checks
Contributing Guidelines
- Follow WordPress Coding Standards
- Write tests for new features
- Ensure all tests pass before submitting PR
- Update documentation as needed
- Test with multiple PHP versions (7.4, 8.1, 8.2, 8.3)
Support
For support, please visit:
License
GPL-2.0-or-later
Credits
Developed by Close Marketing
Author: David Perez [email protected]