Skip to content

Constants Reference

Gaurav Tiwari edited this page Aug 27, 2026 · 1 revision

Constants Reference

Set in wp-config.php. Constants always take precedence over values saved in the dashboard, which makes them the right tool for per-environment configuration and for keeping secrets out of the database.

All of these use the GTPERF_ prefix. Sites installed before 1.0.1 used GTP_, which is no longer read. See Upgrading.

Cloudflare

define( 'GTPERF_CLOUDFLARE_API_TOKEN', '' );
define( 'GTPERF_CLOUDFLARE_GLOBAL_API_KEY', '' );  // legacy
define( 'GTPERF_CLOUDFLARE_EMAIL', 'you@example.com' );  // with the global key
define( 'GTPERF_CLOUDFLARE_DOMAIN', 'example.com' );

xCloud

define( 'GTPERF_XCLOUD_API_TOKEN', '' );
define( 'GTPERF_XCLOUD_API_BASE_URL', 'https://app.xcloud.host' );

Redis

GT Performance's own constants take highest precedence:

define( 'GTPERF_REDIS_ENABLED', true );
define( 'GTPERF_REDIS_HOST', '127.0.0.1' );
define( 'GTPERF_REDIS_PORT', 6379 );
define( 'GTPERF_REDIS_DATABASE', 0 );
define( 'GTPERF_REDIS_USERNAME', 'user' );
define( 'GTPERF_REDIS_PASSWORD', 'secret' );
define( 'GTPERF_REDIS_TLS', true );
define( 'GTPERF_REDIS_PERSISTENT', true );
define( 'GTPERF_REDIS_PREFIX', 'gtperf:site:' );
define( 'GTPERF_REDIS_TIMEOUT', 0.5 );
define( 'GTPERF_REDIS_READ_TIMEOUT', 0.5 );

The WP_REDIS_* constants used by Till Krüss's Redis Object Cache are also honoured, so an existing configuration keeps working:

WP_REDIS_HOST, WP_REDIS_PORT, WP_REDIS_DATABASE, WP_REDIS_PASSWORD, WP_REDIS_PREFIX, WP_REDIS_TIMEOUT, WP_REDIS_READ_TIMEOUT, WP_REDIS_SCHEME, WP_REDIS_PATH, WP_REDIS_DISABLED

WP_REDIS_PATH with WP_REDIS_SCHEME set to unix selects a socket. tls and rediss schemes enable TLS. WP_REDIS_DISABLED is the emergency off switch.

Precedence: GTPERF_REDIS_*WP_REDIS_* → saved settings.

Fleet

define( 'GTPERF_FLEET_SIGNING_SECRET', 'one long passphrase shared across your sites' );

Takes precedence over the encrypted value saved in the dashboard.

Plugin internals

Defined by the plugin, not by you. Listed because they appear in stack traces and in the drop-in.

Constant Value
GTPERF_VERSION Current version
GTPERF_FILE Main plugin file
GTPERF_DIR Plugin directory
GTPERF_BASENAME gt-performance/gt-performance.php

WordPress constants that affect behaviour

Constant Effect
WP_CACHE Must be true for the drop-in to load. Managed for you when you install it
DONOTCACHEPAGE Any truthy value prevents the current response being stored
WP_CONTENT_DIR Where the cache directory and drop-ins live
DISABLE_WP_CRON Drive the queue from a real cron instead. See Diagnostics

Store build only

define( 'GTPERF_LICENSE_KEY', '' );

Not present in the WordPress.org build, which has no licensing code.

Related

Settings Reference · Redis Object Cache · Upgrading

Clone this wiki locally