Skip to content

Configuration Reference (config.json)

The config.json file located in the root of the plugin repository controls the automated renaming, build paths, and JavaScript identifiers for your plugin.


File Structure

{
  "name": "Xe Plugin",
  "jsObject": "xePlugin",
  "endpointsKeyPrefix": "xep",
  "build": "D:/Projects/Xe Plugin"
}

Properties Explained

name

  • Type: string
  • Description: The human-readable name of the plugin (e.g., "Apex CRM" or "Modern Shop").
  • Usage: Used during php xe init to derive:
  • Slug: Hyphenated lowercase version (apex-crm).
  • Namespace: PascalCase version (ApexCRM).
  • Constant prefix: Uppercase underscore version (APEX_CRM_).
  • Function & Hook prefix: Lowercase underscore version (_apex_crm_).
  • Text Domain: apex-crm.
  • Main plugin file: apex-crm.php.

jsObject

  • Type: string
  • Description: The name of the JavaScript object attached to window when localized scripts are enqueued with wp_localize_script().
  • Example: "apexCrm"
  • Result in JavaScript:
    // Access plugin data on frontend/admin scripts
    console.log(apexCrm.ajaxUrl);
    console.log(apexCrm.nonce);
    console.log(apexCrm.strings.pleaseWait);
    

endpointsKeyPrefix

  • Type: string
  • Description: A short unique prefix used for rewrite endpoint keys and virtual page template identifiers.
  • Example: "crm"
  • Resulting Endpoint Keys:
  • crm-login
  • crm-dashboard
  • crm-forgot-password

build

  • Type: string
  • Description: The target absolute directory path where production builds will be generated when running php xe build.
  • Example: "C:/Users/Developer/Desktop/Builds" or "/var/www/builds"
  • Output: A clean directory named after your plugin slug containing only distribution-ready files and freshly compiled .pot translation files.

Example Custom Configuration

{
  "name": "Inventory Manager Pro",
  "jsObject": "inventoryManager",
  "endpointsKeyPrefix": "imp",
  "build": "D:/Releases/WordPressPlugins"
}