A cross-platform CLI tool for generating WordPress plugins from WordPress Plugin Boilerplate
🇮🇷 راهنمای فارسی · ⬇️ Download · 📦 Releases · ⚙️ Actions
WPForge is a cross-platform command-line tool for quickly generating WordPress plugins using the structure of the WordPress Plugin Boilerplate (WPPB).
It is designed to make starting a new WordPress plugin faster and easier by automatically creating the plugin structure and replacing common boilerplate information such as:
- Plugin name
- Plugin slug
- Plugin URL
- Author information
- Author email
- Author URL
- Plugin description
WPForge is written in Python and provides pre-built executables for:
- 🪟 Windows
- 🐧 Linux
- 🍎 macOS
Python does not need to be installed when using the pre-built releases.
- 🛠️ Generate WordPress plugins from WordPress Plugin Boilerplate
- 🪟 Windows support
- 🐧 Linux support
- 🍎 macOS support
- ⚡ Interactive CLI
- 🤖 Non-interactive CLI mode
- 📝 Automatic plugin metadata replacement
- 🔤 Automatic plugin slug conversion
- 📁 Automatic template file and directory renaming
- 👤 Author configuration support
- 🌐 Cross-platform configuration file
- 📦 Standalone executables
- 🔧 Works with the WordPress CLI (
wp) - 🚀 No Python installation required for pre-built releases
- 🔄 Available for multiple operating systems and architectures
Download the latest Windows executable and run it from PowerShell or Command Prompt.
For example:
C:\Tools\WPForge\wpforge.exeYou should see:
WPForge - WordPress Plugin Generator
If you want to run:
wpforgefrom any directory, add the WPForge directory to your Windows PATH.
After adding it, restart PowerShell or Command Prompt.
Then run:
wpforge --versionOpen the latest release and download the Linux binary.
For example:
wpforge-linux-x64
Open Terminal:
chmod +x wpforge-linux-x64./wpforge-linux-x64You can move the executable to a directory in your PATH:
sudo mv wpforge-linux-x64 /usr/local/bin/wpforgeThen:
wpforge --versionYou can now run WPForge from any directory.
Open the latest release and download the macOS build matching your Mac.
Available builds may include:
- Apple Silicon (ARM64)
- Intel (x64)
Open Terminal:
chmod +x wpforge-macos-arm64./wpforge-macos-arm64sudo mv wpforge-macos-arm64 /usr/local/bin/wpforgeThen:
wpforge --versionIf you prefer running WPForge directly from source, Python is required.
- Python 3.10+
- pip
git clone https://github.com/alirezasayadi/WPForge.gitEnter the directory:
cd WPForgepython -m venv .venvActivate it:
.venv\Scripts\activatepython3 -m venv .venvActivate it:
source .venv/bin/activatepip install -r requirements.txtpython main.pyWPForge supports both:
- Interactive mode
- Non-interactive mode
Interactive mode is recommended for beginners.
Simply run:
wpforgeor:
wpforge newWPForge will ask you for the required information.
Plugin name: My Awesome Plugin
Plugin slug: my-awesome-plugin
Plugin URL: https://example.com/my-plugin
Author name: John Doe
Author email: john@example.com
Author URL: https://example.com
Plugin description: My awesome WordPress plugin
After entering the information, WPForge generates the plugin automatically.
WPForge creates the plugin inside the current directory.
For example:
wordpress/
└── wp-content/
└── plugins/
└── my-awesome-plugin/
If you run:
cd /path/to/wordpress/wp-content/pluginsthen:
wpforge newwill create:
wp-content/
└── plugins/
└── my-awesome-plugin/
WPForge also checks whether the current directory looks like:
wp-content/plugins
If it does not, WPForge displays a warning.
Non-interactive mode is useful for:
- Scripts
- Automation
- CI/CD
- GitHub Actions
- Developers who already know the required values
Use:
wpforge new --non-interactive \
--plugin-name "My Plugin" \
--plugin-slug my-plugin \
--plugin-url https://example.com/my-plugin \
--author-name "John Doe" \
--author-email john@example.com \
--author-url https://example.com \
--plugin-description "My WordPress plugin"Use backticks:
wpforge new --non-interactive `
--plugin-name "My Plugin" `
--plugin-slug my-plugin `
--plugin-url https://example.com/my-plugin `
--author-name "John Doe" `
--author-email john@example.com `
--author-url https://example.com `
--plugin-description "My WordPress plugin"Or simply use one line:
wpforge new --non-interactive --plugin-name "My Plugin" --plugin-slug my-plugin --plugin-url https://example.com/my-plugin --author-name "John Doe" --author-email john@example.com --author-url https://example.com --plugin-description "My WordPress plugin"Run:
wpforge new --helpAvailable options:
| Option | Description |
|---|---|
--plugin-name |
Plugin name |
--plugin-slug |
Plugin slug |
--plugin-url |
Plugin URL |
--author-name |
Author name |
--author-email |
Author email |
--author-url |
Author URL |
--plugin-description |
Plugin description |
--non-interactive |
Disable interactive prompts |
The plugin slug must contain:
- Lowercase letters
- Numbers
- Hyphens
my-plugin
woocommerce-tools
plugin123
my-plugin-123
advanced-discount
My Plugin
my_plugin
My-Plugin
-my-plugin
my--plugin
The slug is also used to generate PHP naming conventions.
For example:
my-awesome-plugin
becomes:
my_awesome_plugin
and:
MyAwesomePlugin
WPForge supports a configuration file named:
.wpforge
The file is stored in the user's home directory.
Usually:
C:\Users\YourName\.wpforge
Usually:
~/.wpforge
Create:
.wpforge
with:
author=John Doe
authorEmail=john@example.com
authorUrl=https://example.comWPForge will automatically use these values as defaults.
This is especially useful if you create plugins frequently.
Suppose you run:
wpforge newand enter:
Plugin name: Advanced Security
Plugin slug: advanced-security
Plugin URL: https://example.com/advanced-security
Author name: John Doe
Author email: john@example.com
Author URL: https://example.com
Plugin description: Advanced security tools for WordPress.
WPForge creates:
advanced-security/
with the WordPress Plugin Boilerplate structure.
The generated files are automatically updated with the provided information.
After generating the plugin, you can activate it using WP-CLI:
wp plugin activate my-pluginFor example:
wp plugin activate advanced-securityMake sure WP-CLI is installed and you are running the command from your WordPress installation.
WPForge releases are published on GitHub.
Each release may contain builds for:
- 🪟 Windows
- 🐧 Linux
- 🍎 macOS
- 🐍 Python/source
For most users, download the latest stable release.
You do not need to download the source code unless you want to develop WPForge itself.
WPForge uses Git tags to create new releases.
When a new version tag such as v1.0.0 is pushed to GitHub, GitHub Actions automatically:
- 🪟 Builds Windows x64
- 🐧 Builds Linux x64
- 🍎 Builds macOS ARM64
- 🍎 Builds macOS Intel x64
- 🔐 Generates SHA-256 checksums
- 📦 Creates a GitHub Release
- ⬆️ Uploads all compiled binaries to the release
- 📝 Generates release notes
You do not need to manually build the application for each operating system.
Before creating a release, make sure:
- Your working tree is clean.
- All changes have been committed.
- You are on the correct branch.
- The project builds successfully.
- The version number is correct.
Check your Git status:
git statusYou should ideally see:
nothing to commit, working tree clean
WPForge includes:
scripts/release.bat
This script is intended for Windows users.
Open Command Prompt (CMD) and go to the WPForge directory:
cd D:\WPForgeYou can also use another directory if WPForge is located elsewhere.
For example, to release version 1.0.0:
scripts\release.bat 1.0.0The script will create and push:
v1.0.0
to GitHub.
After the tag is pushed:
release.bat
↓
Git commit
↓
Git tag v1.0.0
↓
Push tag to GitHub
↓
GitHub Actions starts
↓
Build Windows
Build Linux
Build macOS ARM64
Build macOS x64
↓
Generate SHA256SUMS.txt
↓
Create GitHub Release
↓
Upload release files
You can monitor the build from:
GitHub → Actions
WPForge also includes:
scripts/release.sh
The same script can be used on Linux and macOS.
Go to the WPForge directory:
cd /path/to/WPForgeFor example:
cd ~/WPForgeYou only need to do this once:
chmod +x scripts/release.shFor example:
./scripts/release.sh 1.0.0This creates:
v1.0.0
and pushes the tag to GitHub.
GitHub Actions will then automatically build all supported platforms.
WPForge releases use the following format:
MAJOR.MINOR.PATCH
For example:
1.0.0
1.0.1
1.1.0
2.0.0
The Git tag automatically receives the v prefix:
v1.0.0
v1.0.1
v1.1.0
v2.0.0
Bug fix:
1.0.0 → 1.0.1
New backward-compatible feature:
1.0.0 → 1.1.0
Breaking change:
1.0.0 → 2.0.0
Do not manually create the GitHub Release when using the release scripts.
The release process is automated.
You only need to create and push the version tag.
GitHub Actions will create the Release automatically.
If you do not want to use the provided scripts, you can create a release manually.
First commit your changes:
git add .
git commit -m "Release v1.0.0"Create the tag:
git tag v1.0.0Push the branch:
git push origin mainPush the tag:
git push origin v1.0.0After the tag is pushed, GitHub Actions automatically starts the release workflow.
After pushing the tag, open the GitHub repository and go to:
Actions
You should see:
Build and Release WPForge
Wait until all jobs finish successfully.
The workflow should produce:
Windows x64
Linux x64
macOS ARM64
macOS Intel x64
SHA256SUMS.txt
The final files will be available under:
GitHub
→ Releases
→ WPForge v1.0.0
A typical WPForge release contains:
WPForge-v1.0.0-Windows-x64.exe
WPForge-v1.0.0-Linux-x64
WPForge-v1.0.0-macOS-arm64
WPForge-v1.0.0-macOS-x64
SHA256SUMS.txt
Download:
WPForge-v1.0.0-Windows-x64.exe
No Python installation is required.
Download:
WPForge-v1.0.0-Linux-x64
Then:
chmod +x WPForge-v1.0.0-Linux-x64Run:
./WPForge-v1.0.0-Linux-x64For Apple Silicon Macs such as M1, M2, M3 and M4:
WPForge-v1.0.0-macOS-arm64
Run:
chmod +x WPForge-v1.0.0-macOS-arm64
./WPForge-v1.0.0-macOS-arm64For Intel-based Macs:
WPForge-v1.0.0-macOS-x64
Run:
chmod +x WPForge-v1.0.0-macOS-x64
./WPForge-v1.0.0-macOS-x64Every release includes:
SHA256SUMS.txt
This file contains SHA-256 hashes for the release binaries.
You can use it to verify that a downloaded file has not been corrupted or modified.
PowerShell:
Get-FileHash .\WPForge-v1.0.0-Windows-x64.exe -Algorithm SHA256sha256sum WPForge-v1.0.0-Linux-x64shasum -a 256 WPForge-v1.0.0-macOS-arm64Compare the generated hash with the corresponding value in:
SHA256SUMS.txt
If GitHub Actions fails:
- Open the repository on GitHub.
- Go to Actions.
- Open the failed workflow.
- Select the failed job.
- Check the error message.
Do not immediately create another tag with the same version.
For example, if:
v1.0.0
failed, fix the problem first.
Then use a new patch version:
v1.0.1
unless the original tag can safely be deleted and recreated.
For normal development, the recommended workflow is:
1. Make changes
↓
2. Test locally
↓
3. Commit changes
↓
4. Run release.bat / release.sh
↓
5. Tag vX.Y.Z is pushed
↓
6. GitHub Actions builds all platforms
↓
7. GitHub Release is created
↓
8. Users download the binaries
This keeps the release process simple and consistent across Windows, Linux and macOS.
Download the new Windows release and replace the old executable.
Download the latest binary and replace the existing installation:
sudo mv wpforge-linux-x64 /usr/local/bin/wpforgeDownload the latest macOS binary and replace the previous version.
If running from source:
git pullThen update dependencies:
pip install -r requirements.txt --upgradeClone the repository:
git clone https://github.com/alirezasayadi/WPForge.gitEnter the project:
cd WPForgeCreate a virtual environment.
python -m venv .venv
.venv\Scripts\activatepython3 -m venv .venv
source .venv/bin/activateInstall dependencies:
pip install -r requirements.txtRun:
python main.pyShow help:
python main.py --helpCreate a plugin:
python main.py newWPForge can be packaged as a standalone executable using PyInstaller.
The generated executable does not require Python to be installed on the target machine.
Build instructions may vary depending on the target operating system.
GitHub Actions automatically builds release packages for supported platforms.
WPForge uses GitHub Actions to automate:
- Testing
- Building
- Packaging
- Release creation
The project is designed to produce platform-specific builds for:
- Windows
- Linux
- macOS
Release artifacts are attached automatically to GitHub Releases.
WPForge/
├── main.py
├── requirements.txt
├── README.md
├── LICENSE
├── templates/
│ └── wordpress-plugin/
│ └── plugin-name/
└── .github/
└── workflows/
└── release.yml
The templates/wordpress-plugin/plugin-name directory contains the WordPress Plugin Boilerplate template used by WPForge.
WPForge is inspired by and based on the work of:
- Tmeister's WPPB CLI
- WordPress Plugin Boilerplate
WPForge provides its own CLI implementation and tooling around the WordPress Plugin Boilerplate structure.
WPForge is licensed under the GNU General Public License v2.0 or later (GPL-2.0-or-later).
See:
LICENSE
for the complete license text.
Contributions are welcome.
If you find a bug or have an idea:
- Open an issue.
- Describe the problem or feature.
- Provide reproduction steps when applicable.
- Submit a pull request if you have a fix.
When reporting a bug, please include:
- Operating system
- WPForge version
- Python version (if running from source)
- Command used
- Full error message
- Steps to reproduce the problem
Example:
OS: Windows 11
WPForge: v1.0.0
Python: 3.12
Command:
wpforge new
Error:
...
If WPForge is useful to you:
⭐ Star the repository on GitHub.
You can also report bugs, suggest features, and contribute code.
Made with ❤️ by Alireza Sayadi