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).
Step 2: Install Composer Dependencies
Xe Plugin utilizes PSR-4 autoloading via Composer. Ensure your dependencies and autoloader are installed:
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.,crmoras).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:
What php xe init does automatically:
- Replaces all instances of
Xe Plugin,xe-plugin,_xe_plugin,XE_PLUGIN_,Xe_Plugin,xePlugin, andxep-across all.php,.js,.css,.json,.txt, and.stubfiles. - Renames the main file from
xe-plugin.phpto your new slug (e.g.,my-plugin.php). - Updates the plugin header metadata (
Text Domain,Plugin Name, etc.). - Runs
composer dump-autoloadto re-index all renamed namespaces.
Step 5: Activate in WordPress
- Log in to your WordPress Admin Dashboard.
- Navigate to Plugins > Installed Plugins.
- 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