Constants
This page lists PHP constants you can use to configure UnBlock or detect its presence.
Configurable
Define these in wp-config.php to change plugin behavior.
| Constant | Type | Description |
|---|---|---|
UNBK_DEBUG | bool | Enable debug logging to files |
UNBK_LICENSE_KEY | string | License key (alternative to UI activation) |
UNBLOCK_REMOVE_ALL_DATA | bool | Remove all plugin data on uninstall |
UNBK_DEBUG
Enables the built-in debug logger. When set to true, log files are created in wp-content/uploads/unblock/logs/. See Debug Logging for details.
define( 'UNBK_DEBUG', true );
UNBK_LICENSE_KEY
Activate your license via constant instead of the admin UI. Useful for automated deployments or version-controlled configurations.
define( 'UNBK_LICENSE_KEY', 'your-license-key' );
UNBLOCK_REMOVE_ALL_DATA
When set to true, all plugin data (options, CSS variables, selectors, at-rules) is deleted on uninstall — even if the "Remove data" option is unchecked in settings.
define( 'UNBLOCK_REMOVE_ALL_DATA', true );
This constant takes effect on uninstall, not deactivation. Deactivating the plugin does not remove data regardless of this constant.
Read-Only
Defined by the plugin on load. Useful for feature detection and integrations.
| Constant | Description |
|---|---|
UNBK_VERSION | Current plugin version |
UNBK_SLUG | Plugin slug (unbk) |
UNBK_NAME | Plugin name (unblock) |
Example: Feature detection
if ( defined( 'UNBK_VERSION' ) && version_compare( UNBK_VERSION, '1.5.0', '>=' ) ) {
// Use a feature introduced in 1.5.0.
}
Next steps
- Actions — plugin lifecycle and form hooks
- Debug Logging — diagnose expression and query errors