Constants

Available Constants

The following constants are available globally and can be safely used within your WordPress theme or plugin. They are automatically defined by the Geo Controller plugin when active.

Constant Description
CFGP_VERSION Current plugin version
CFGP_URL Direct URL to the plugin folder
CFGP_ASSETS URL path to plugin assets (CSS, JS, etc.)
CFGP_NAME Plugin text domain (locale)
CFGP_SESSION Session expiration time in minutes (default is 30)
CFGP_MULTISITE True if WordPress is installed in Multisite mode
CFGP_IP Detected IP address of the current visitor
CFGP_SERVER_IP Server IP address
CFGP_PROXY True if the visitor is using a proxy connection
CFGP_ACTIVATED True if the plugin license is active
CFGP_DEV_MODE True if developer mode is enabled

How to use constants in your theme or plugin:

You can safely check and use constants inside any PHP file in your theme or plugin, for example:

if ( defined('CFGP_IP') ) {
    echo 'User IP: ' . CFGP_IP;
}

if ( defined('CFGP_SESSION') && CFGP_SESSION > 15 ) {
    echo 'Custom session timeout: ' . CFGP_SESSION . ' minutes';
}

How to override constants in wp-config.php

Some constants such as CFGP_SESSION or CFGP_DEV_MODE can be customized before the plugin is loaded. You can do this by defining the constant in your wp-config.php file, above the line that says /* That's all, stop editing! */.

// Change Geo Controller session timeout to 60 minutes
define('CFGP_SESSION', 60);

// Enable developer mode for debugging
define('CFGP_DEV_MODE', true);

Important: Do not edit plugin files directly. Always define constants in wp-config.php or use WordPress filters.

More on defining constants in WordPress: Editing wp-config.php


⚠️ Internal Plugin Constants

The following constants are used internally and should not be modified or relied on. They may change without notice and are not considered stable for public usage.

  • CFGP_FILE – Full path to main plugin file
  • CFGP_ROOT – Root directory of the plugin
  • CFGP_INCLUDES – Path to internal includes folder
  • CFGP_ADMIN – Path to admin-specific files
  • CFGP_PREFIX – Meta/session prefix (for internal use)
  • CFGP_METABOX – Metabox field prefix
  • W3TC_DYNAMIC_SECURITY – Compatibility flag for W3 Total Cache

If you attempt to modify internal constants, the plugin may stop working as expected. These values are managed and required by the core system of Geo Controller.

Was this page helpful?