Skip to main content

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.

ConstantTypeDescription
UNBK_DEBUGboolEnable debug logging to files
UNBK_LICENSE_KEYstringLicense key (alternative to UI activation)
UNBLOCK_REMOVE_ALL_DATAboolRemove 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 );
Common mistake

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.

ConstantDescription
UNBK_VERSIONCurrent plugin version
UNBK_SLUGPlugin slug (unbk)
UNBK_NAMEPlugin 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