LW Enable
Enable WordPress features - SVG uploads and more.
Overview
| Requires WordPress | 6.0+ |
| Requires PHP | 8.2+ |
| Tested up to | 6.7 |
| License | GPL-2.0-or-later |
| GitHub | lwplugins/lw-enable |
Installation
composer require lwplugins/lw-enableOr upload the lw-enable folder to /wp-content/plugins/ and activate through the Plugins menu.
Features
SVG Uploads
Allow SVG file uploads with comprehensive security sanitization:
- MIME type registration for SVG files
- Script/XSS detection and blocking
- XXE (XML External Entity) protection
- Event handler detection
- Obfuscation detection (Unicode/hex escapes, entity encoding)
- Automatic SVG dimension extraction (width/height and viewBox)
- 5MB file size limit
- Post-upload re-validation
Settings
Configure under LW Plugins > Enable. Each feature is a simple checkbox toggle. Currently available:
| Feature | Description |
|---|---|
| SVG Uploads | Allow SVG file uploads with security sanitization |
WP-CLI Commands
# List all features and their status
wp lw-enable list
# Enable a feature
wp lw-enable enable svg
# Disable a feature
wp lw-enable disable svg
# Enable all features at once
wp lw-enable enable-all
# Disable all features (restore defaults)
wp lw-enable disable-allAvailable Features
| Feature Key | Description |
|---|---|
svg | SVG file uploads |
AI Abilities
When used with LW Site Manager, the following abilities are available for AI agents. All abilities require manage_options capability. These abilities are only active when LW Site Manager is also installed and activated - no hard dependency.
lw-enable/get-options (readonly)
Retrieve the current state of all LW Enable feature toggles.
Method: GET
curl -u "user:app-password" \
"https://example.com/wp-json/wp-abilities/v1/abilities/lw-enable/get-options/run"Response:
{
"success": true,
"options": {
"svg": true
}
}Available fields:
| Field | Type | Description |
|---|---|---|
svg | bool | Whether SVG uploads are enabled |
lw-enable/set-options (write)
Toggle one or more LW Enable features. Only the provided keys are updated; others remain unchanged.
Method: POST
curl -u "user:app-password" \
-X POST -H "Content-Type: application/json" \
-d '{
"input": {
"options": {
"svg": true
}
}
}' \
"https://example.com/wp-json/wp-abilities/v1/abilities/lw-enable/set-options/run"Response:
{
"success": true,
"message": "1 option(s) updated.",
"options": {
"svg": true
}
}Disabling SVG uploads:
curl -u "user:app-password" \
-X POST -H "Content-Type: application/json" \
-d '{"input": {"options": {"svg": false}}}' \
"https://example.com/wp-json/wp-abilities/v1/abilities/lw-enable/set-options/run"Permissions
| Ability | Required capability |
|---|---|
lw-enable/get-options | manage_options |
lw-enable/set-options | manage_options |
FAQ
Is SVG upload safe?
The plugin performs comprehensive sanitization: script detection, XSS prevention, XXE protection, event handler blocking, and obfuscation detection. Only clean SVGs pass validation.
What is the maximum SVG file size?
5MB per file.