Skip to content

Installation & Quickstart

This guide will walk you through setting up a new WordPress plugin using the Xe Plugin boilerplate.


Step 1: Download or Clone the Repository

Download the latest release or clone the repository directly into your WordPress installation's wp-content/plugins/ directory:

cd /path/to/wordpress/wp-content/plugins/
git clone https://github.com/XeCreators/xe-plugin.git my-plugin

Rename the folder from xe-plugin to your desired plugin slug (e.g., my-plugin or custom-crm).

cd my-plugin

Step 2: Install Composer Dependencies

Xe Plugin utilizes PSR-4 autoloading via Composer. Ensure your dependencies and autoloader are installed:

composer install

Step 3: Configure config.json

Open config.json located at the root of the plugin directory:

{
  "name": "My Plugin",
  "jsObject": "myPlugin",
  "endpointsKeyPrefix": "mp",
  "build": "D:/Projects/Builds"
}
  • name: The human-readable name of your plugin (e.g., "Custom CRM" or "Awesome Store").
  • jsObject: The global JavaScript object name for localized data (e.g., customCrm).
  • endpointsKeyPrefix: A unique prefix for rewrite endpoints and template IDs (e.g., crm or as).
  • build: Destination directory where production builds will be generated.

Step 4: Run the Initialization Command

Run the init command using the built-in PHP CLI runner:

php xe init

What php xe init does automatically:

  1. Replaces all instances of Xe Plugin, xe-plugin, _xe_plugin, XE_PLUGIN_, Xe_Plugin, xePlugin, and xep- across all .php, .js, .css, .json, .txt, and .stub files.
  2. Renames the main file from xe-plugin.php to your new slug (e.g., my-plugin.php).
  3. Updates the plugin header metadata (Text Domain, Plugin Name, etc.).
  4. Runs composer dump-autoload to re-index all renamed namespaces.

Step 5: Activate in WordPress

  1. Log in to your WordPress Admin Dashboard.
  2. Navigate to Plugins > Installed Plugins.
  3. Locate your newly named plugin and click Activate.

Step 6: Available CLI Commands

After initializing your plugin, you can use the built-in CLI to scaffold features rapidly:

# Display help and list all commands
php xe

# Generate a new CRUD module controller
php xe make:module Ticket

# Generate a custom database sequence table
php xe make:sequence Invoice

# Generate a new Elementor widget
php xe make:elementor PricingTable

# Compile a clean production release with POT translation file
php xe build