You've already forked wc-licensed-product
Implement versions 0.0.4-0.0.7 features
v0.0.4: - Add WooCommerce settings tab for default license settings - Per-product settings override global defaults v0.0.5: - Add bulk license operations (activate, deactivate, revoke, extend, delete) - Add license renewal/extension and lifetime functionality - Add quick action buttons per license row v0.0.6: - Add license dashboard with statistics and analytics - Add license transfer functionality (admin) - Add CSV export for licenses - Add OpenAPI 3.1 specification - Remove /deactivate API endpoint v0.0.7: - Move license dashboard to WooCommerce Reports section - Add license search and filtering in admin - Add customer-facing license transfer with AJAX modal - Add email notifications for license expiration warnings - Add bulk import licenses from CSV - Update README with comprehensive documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
133
README.md
133
README.md
@@ -8,14 +8,34 @@ WC Licensed Product adds a new product type "Licensed Product" to WooCommerce, e
|
||||
|
||||
## Features
|
||||
|
||||
### Core Features
|
||||
|
||||
- **Licensed Product Type**: New WooCommerce product type for software sales
|
||||
- **Automatic License Generation**: License keys generated on order completion
|
||||
- **Automatic License Generation**: License keys generated on order completion (format: XXXX-XXXX-XXXX-XXXX)
|
||||
- **Domain Binding**: Licenses are bound to customer-specified domains
|
||||
- **REST API**: Public endpoints for license validation and management
|
||||
- **Customer Account**: Customers can view their licenses in My Account
|
||||
- **Admin Management**: Full CRUD interface for license management
|
||||
- **Version Binding**: Optional binding to major software versions
|
||||
- **Expiration Support**: Set license validity periods or lifetime licenses
|
||||
- **Rate Limiting**: API endpoints protected with rate limiting (30 requests/minute)
|
||||
|
||||
### Customer Features
|
||||
|
||||
- **My Account Licenses**: Customers can view their licenses in My Account
|
||||
- **License Transfers**: Customers can transfer licenses to new domains
|
||||
- **Secure Downloads**: Download purchased software versions with license verification
|
||||
- **Copy to Clipboard**: Easy license key copying
|
||||
|
||||
### Admin Features
|
||||
|
||||
- **License Management**: Full CRUD interface for license management
|
||||
- **License Dashboard**: Statistics and analytics (WooCommerce > Reports > Licenses)
|
||||
- **Search & Filtering**: Search by license key, domain, status, or product
|
||||
- **Bulk Operations**: Activate, deactivate, revoke, extend, or delete multiple licenses
|
||||
- **License Transfer**: Transfer licenses to new domains
|
||||
- **CSV Export/Import**: Export and import licenses via CSV
|
||||
- **Expiration Warnings**: Automatic email notifications before license expiration
|
||||
- **Version Management**: Manage multiple versions per product with file attachments
|
||||
- **Global Settings**: Default license settings via WooCommerce settings tab
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -42,6 +62,19 @@ WC Licensed Product adds a new product type "Licensed Product" to WooCommerce, e
|
||||
- **Bind to Major Version**: Lock license to current major version
|
||||
- **Current Version**: Your software's current version
|
||||
|
||||
### Managing Product Versions
|
||||
|
||||
1. Edit a Licensed Product
|
||||
2. Use the "Product Versions" meta box to add versions
|
||||
3. Upload version files via WordPress Media Library
|
||||
4. Version numbers are auto-detected from filenames (e.g., `plugin-v1.2.3.zip`)
|
||||
|
||||
### Global Default Settings
|
||||
|
||||
1. Go to WooCommerce > Settings > Licensed Products
|
||||
2. Set default values for Max Activations, License Validity, and Version Binding
|
||||
3. Per-product settings override these defaults
|
||||
|
||||
### Customer Checkout
|
||||
|
||||
When a customer purchases a licensed product, they must enter the domain where they will use the license during checkout.
|
||||
@@ -50,11 +83,30 @@ When a customer purchases a licensed product, they must enter the domain where t
|
||||
|
||||
- **Customers**: My Account > Licenses
|
||||
- **Administrators**: WooCommerce > Licenses
|
||||
- **Dashboard**: WooCommerce > Reports > Licenses (for statistics)
|
||||
|
||||
### Exporting & Importing Licenses
|
||||
|
||||
**Export:**
|
||||
|
||||
1. Go to WooCommerce > Licenses
|
||||
2. Click "Export CSV" to download all licenses
|
||||
|
||||
**Import:**
|
||||
|
||||
1. Go to WooCommerce > Licenses
|
||||
2. Click "Import CSV"
|
||||
3. Upload a CSV file (supports exported format or simplified format)
|
||||
4. Choose options: skip header row, update existing licenses
|
||||
|
||||
## REST API
|
||||
|
||||
Full API documentation available in `openapi.json` (OpenAPI 3.1 specification).
|
||||
|
||||
### Validate License
|
||||
|
||||
Validate a license key for a specific domain.
|
||||
|
||||
```http
|
||||
POST /wp-json/wc-licensed-product/v1/validate
|
||||
Content-Type: application/json
|
||||
@@ -65,8 +117,33 @@ Content-Type: application/json
|
||||
}
|
||||
```
|
||||
|
||||
**Success Response (200):**
|
||||
|
||||
```json
|
||||
{
|
||||
"valid": true,
|
||||
"license": {
|
||||
"product_id": 123,
|
||||
"expires_at": "2027-01-21",
|
||||
"version_id": 5
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Error Response (403):**
|
||||
|
||||
```json
|
||||
{
|
||||
"valid": false,
|
||||
"error": "domain_mismatch",
|
||||
"message": "This license is not valid for this domain."
|
||||
}
|
||||
```
|
||||
|
||||
### Check Status
|
||||
|
||||
Get detailed license status information.
|
||||
|
||||
```http
|
||||
POST /wp-json/wc-licensed-product/v1/status
|
||||
Content-Type: application/json
|
||||
@@ -76,8 +153,23 @@ Content-Type: application/json
|
||||
}
|
||||
```
|
||||
|
||||
**Response (200):**
|
||||
|
||||
```json
|
||||
{
|
||||
"valid": true,
|
||||
"status": "active",
|
||||
"domain": "example.com",
|
||||
"expires_at": "2027-01-21",
|
||||
"activations_count": 1,
|
||||
"max_activations": 3
|
||||
}
|
||||
```
|
||||
|
||||
### Activate License
|
||||
|
||||
Activate a license on a domain.
|
||||
|
||||
```http
|
||||
POST /wp-json/wc-licensed-product/v1/activate
|
||||
Content-Type: application/json
|
||||
@@ -88,18 +180,27 @@ Content-Type: application/json
|
||||
}
|
||||
```
|
||||
|
||||
### Deactivate License
|
||||
|
||||
```http
|
||||
POST /wp-json/wc-licensed-product/v1/deactivate
|
||||
Content-Type: application/json
|
||||
**Response (200):**
|
||||
|
||||
```json
|
||||
{
|
||||
"license_key": "XXXX-XXXX-XXXX-XXXX",
|
||||
"domain": "example.com"
|
||||
"success": true,
|
||||
"message": "License activated successfully."
|
||||
}
|
||||
```
|
||||
|
||||
### Error Codes
|
||||
|
||||
| Code | Description |
|
||||
| ---- | ----------- |
|
||||
| `license_not_found` | License key does not exist |
|
||||
| `license_revoked` | License has been revoked |
|
||||
| `license_expired` | License has expired |
|
||||
| `license_inactive` | License is inactive |
|
||||
| `domain_mismatch` | License not valid for this domain |
|
||||
| `max_activations_reached` | Maximum activations reached |
|
||||
| `rate_limit_exceeded` | Too many requests (wait and retry) |
|
||||
|
||||
## License Statuses
|
||||
|
||||
- **Active**: License is valid and usable
|
||||
@@ -107,6 +208,18 @@ Content-Type: application/json
|
||||
- **Expired**: License validity period has ended
|
||||
- **Revoked**: License has been manually revoked by admin
|
||||
|
||||
## Email Notifications
|
||||
|
||||
The plugin sends automatic email notifications:
|
||||
|
||||
- **Order Completion**: License keys included in order confirmation emails
|
||||
- **Expiration Warning (7 days)**: Reminder sent 7 days before expiration
|
||||
- **Expiration Warning (1 day)**: Urgent reminder sent 1 day before expiration
|
||||
|
||||
## Changelog
|
||||
|
||||
See [CHANGELOG.md](CHANGELOG.md) for version history and changes.
|
||||
|
||||
## Support
|
||||
|
||||
For issues and feature requests, please visit:
|
||||
|
||||
Reference in New Issue
Block a user