Constants are referable terms in the code that can not be altered.
Below you’ll find the constants as defined or used in the code as of Extension Manager v2.6.2.
To learn the basics, please read the PHP manual on using constants.
Last update: June 21st, 2023
API contents
User-definable constants
The following constants can be defined by the user in wp-config.php
or a mu-plugin. These constants should not be defined in theme-files. They shouldn’t be defined in a plugin either, as there might be load-sequence issues that will cause fatal errors.
Below you’ll find examples.
/**
* Forces TSFEM extensions to an activation state.
* When the slug is set, it won't allow the extension's state to be altered via the interface.
* When the slug is unset from this constant, the extensions' state is set to what it was before.
*
* PHP 7.0 or greater is required to use this.
* @since 2.0.0
* @param bool|array Must be false if not an array.
*/
define( 'TSF_EXTENSION_MANAGER_FORCED_EXTENSIONS', [
'local' => false, // forced deactivated.
'focus' => true, // forced activated.
] );
/**
* Hides an extension from the dashboard.
* This also prevents changing activation states.
*
* When an extension is activated by the user, but set to hidden, it may not
* be deactivated via the interface (unless the user disconnects the account).
* In such case, combine this with `TSF_EXTENSION_MANAGER_FORCED_EXTENSIONS`.
* However, it is unnecessary when this constant is defined prior to activating
* the plugin.
*
* PHP 7.0 or greater is required to use this.
* @since 2.0.0
* @param bool|array Must be false if not an array.
*/
define( 'TSF_EXTENSION_MANAGER_HIDDEN_EXTENSIONS', [ 'local', 'focus' ] );
/**
* The user role (or rather, capability) required to access the extension overview page.
*
* == WARNING ==
* When this constant is used incorrectly, you can expose your site to unforeseen
* security risks. We assume the role supplied here is lower than the webmaster;
* for example, in a WPMU environment. However, proceed with caution.
*
* @since 2.0.0
* @param string The rule. Default 'manage_options'.
*/
define( 'TSF_EXTENSION_MANAGER_MAIN_ADMIN_ROLE', 'manage_network' );
/**
* The user role (or rather, capability) required to access the extension settings.
*
* == WARNING ==
* When this constant is used incorrectly, you can expose your site to unforeseen
* security risks. We assume the role supplied here is lower than the webmaster;
* for example, in a WPMU environment. However, proceed with caution.
*
* @since 2.4.0
* @param string The rule. Default 'manage_options'.
*/
define( 'TSF_EXTENSION_MANAGER_EXTENSION_ADMIN_ROLE', 'edit_posts' );
/**
* Blocks manual API activation, and sets automatic API activation.
*
* When the input changes, it'll be switched automatically, too.
*
* A check is performed at most once every five minutes.
* When the license is invalid or expired, it'll attempt reconnecting indefinitely.
* The user is warned every time this happens.
*
* NOTE: Removing the definition will NOT immediately disconnect the site.
* The license's validity is checked at inconsistent intervals.
*
* To disconnect immediately, please use empty strings for the email and key values.
* After disconnection, a timeout of 5 minutes is imposed. To reconnect or switch a
* license, enter a valid email/key combo; the new license becomes active anywhere
* from 0 to 5 minutes.
*
* PHP 7.0 or greater is required to use this.
* @since 2.0.0
* @param bool|array False, or the key and email.
*/
define( 'TSF_EXTENSION_MANAGER_API_INFORMATION', [
'email' => 'j.doe@example.com',
'key' => '*****',
] );
/**
* This forces the plugin option verification instance version, which prevents users
* from sharing API information between sites.
* This will only affect the version when the site hasn't been activated yet.
*
* @since 2.6.2
* @param string The instance version to use.
* '1.0' relies on wp-config.php's AUTH_KEY and AUTH_SALT values.
* '2.0' relies on Extension Manager's folder location.
* '3.0' relies on the site URL.
*/
define( 'TSF_EXTENSION_MANAGER_INSTANCE_VERSION', '3.0' );
/**
* Changes the remote API version number.
* This is for development only; version numbers aren't available publicly.
*
* @since 2.1.0
* @param string The API version number.
*/
define( 'TSF_EXTENSION_MANAGER_API_VERSION', '2.0' );
/**
* Changes the API to the (insecure) development version.
* You must change this to a secret key to enable it, which is not available publicly.
* When the key doesn't match our system's, this value is essentially ignored,
* and our systems forward you to the public API.
*
* @since 2.1.0
* @param bool|string The secret key.
*/
define( 'TSF_EXTENSION_MANAGER_DEV_API', false );
Predefined constants
Extension Manager defines many constants itself. Although you can refer to these in your code, Extension Manager isn’t meant to be extended even further.
The extensions within Extension Manager define even more constants but those aren’t documented and are used internally only.
/**
* Tells the world the plugin is present and to be used.
*
* @since 2.5.0
*/
define( 'TSF_EXTENSION_MANAGER_PRESENT', true );
/**
* The plugin version.
*
* 3 point: x.x.y; x.x is major; y is minor.
*
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_VERSION', '2.1.0' );
/**
* The plugin database version.
*
* Used for upgrade comparing and as a key for environmental checking.
*
* @since 1.5.0
*/
define( 'TSF_EXTENSION_MANAGER_DB_VERSION', '1600' );
/**
* The plugin file, absolute unix path.
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_PLUGIN_BASE_FILE', __FILE__ );
/**
* The plugin basename relative to the plugins directory.
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_PLUGIN_BASENAME', plugin_basename( TSF_EXTENSION_MANAGER_PLUGIN_BASE_FILE ) );
/**
* The plugin's bootstrap folder location.
* @since 1.5.0
*/
define( 'TSF_EXTENSION_MANAGER_BOOTSTRAP_PATH', dirname( TSF_EXTENSION_MANAGER_PLUGIN_BASE_FILE ) . DIRECTORY_SEPARATOR . 'bootstrap' . DIRECTORY_SEPARATOR );
/**
* The plugin map URL. Used for calling browser files.
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_DIR_URL', plugin_dir_url( TSF_EXTENSION_MANAGER_PLUGIN_BASE_FILE ) );
/**
* The plugin map absolute path. Used for calling php files.
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_DIR_PATH', dirname( TSF_EXTENSION_MANAGER_PLUGIN_BASE_FILE ) . DIRECTORY_SEPARATOR );
/**
* The plugin class map absolute path.
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_DIR_PATH_CLASS', TSF_EXTENSION_MANAGER_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR );
/**
* The plugin trait map absolute path.
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_DIR_PATH_TRAIT', TSF_EXTENSION_MANAGER_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'traits' . DIRECTORY_SEPARATOR );
/**
* The plugin function map absolute path.
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_DIR_PATH_FUNCTION', TSF_EXTENSION_MANAGER_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'functions' . DIRECTORY_SEPARATOR );
/**
* The plugin function map absolute path.
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_DIR_PATH_COMPAT', TSF_EXTENSION_MANAGER_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'compat' . DIRECTORY_SEPARATOR );
/**
* The plugin extensions base path.
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_EXTENSIONS_PATH', TSF_EXTENSION_MANAGER_DIR_PATH . 'extensions' . DIRECTORY_SEPARATOR );
/**
* The plugin options base name.
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_SITE_OPTIONS', 'tsf-extension-manager-settings' );
/**
* The extension options base name.
* @since 1.0.0
*/
define( 'TSF_EXTENSION_MANAGER_EXTENSION_OPTIONS', 'tsf-extension-manager-extension-settings' );
/**
* The extension post meta options base name.
* Has an underscore to hide it from custom fields.
* @since 1.5.0
*/
define( 'TSF_EXTENSION_MANAGER_EXTENSION_POST_META', '_tsfem-extension-post-meta' );
/**
* The extension term meta options base name.
* Has an underscore to conform to TSF_EXTENSION_MANAGER_EXTENSION_POST_META.
* @since 1.5.0
*/
define( 'TSF_EXTENSION_MANAGER_EXTENSION_TERM_META', '_tsfem-extension-term-meta' );
/**
* The extension options stale base name.
* @since 1.3.0
*/
define( 'TSF_EXTENSION_MANAGER_EXTENSION_STALE_OPTIONS', 'tsf-extension-manager-extension-s-settings' );
/**
* The expected plugin slug.
* @since 2.0.0
*/
define( 'TSF_EXTENSION_MANAGER_PLUGIN_SLUG', 'the-seo-framework-extension-manager' );
/**
* The updater cache key.
* @since 2.0.0
*/
define( 'TSF_EXTENSION_MANAGER_UPDATER_CACHE', 'tsfem-updater-cache' );
/**
* The DL (download/update) URI.
* @since 2.0.0
*/
define( 'TSF_EXTENSION_MANAGER_DL_URI', 'https://dl.theseoframework.com/' );
/**
* The Premium URI (global).
* @since 2.0.0
*/
define( 'TSF_EXTENSION_MANAGER_PREMIUM_URI', 'https://premium.theseoframework.com/' );
/**
* The Premium URI (EU).
* @since 2.1.0
*/
define( 'TSF_EXTENSION_MANAGER_PREMIUM_EU_URI', 'https://eu.theseoframework.com/' );