An advanced WordPress plugin generator that uses OpenAI's Agents SDK to create production-ready plugins through an intelligent multi-agent workflow.
- Features
- What's New in v0.0.16
- Quick Start
- Model Support
- Installation
- Usage
- Examples
- Configuration
- Contributing
- License
- Multi-Agent Architecture: Specialized AI agents for different aspects of plugin development
- Complete Plugin Generation: Creates all necessary files, including PHP, CSS, JS, and documentation
- WordPress Standards Compliant: Follows WordPress coding standards and best practices
- Interactive Development: Built-in testing and refinement capabilities
- Production Ready: Generates plugins that can be immediately deployed
- Flexible AI Models: Support for OpenAI, Anthropic Claude, Google Gemini, local Ollama models, and more
- Any LiteLLM Model: Use OpenAI, Anthropic, Google, Groq, Cohere, and 20+ other providers
- Local Ollama Support: Run completely free models locally (deepseek-r1, llama3.2, etc.)
- Flexible Model Selection: No hardcoded restrictions - use any model with simple format
- Smart Provider Detection: Automatically detects and configures model providers
- New Flags:
--model,--list-models,--temperature,--disable-tracing - Better Discovery:
--list-modelsshows all supported providers and examples - Environment Config: Set default models and API keys in
.envfile
- Quick Start Guide: Step-by-step setup for each AI provider
- Provider Comparison: Performance, cost, and capability tables
- Troubleshooting: Common issues and solutions for each provider
# Update your installation
pip install "openai-agents[litellm]==0.0.16"
# Your existing usage still works
python main.py -p "Create a plugin"
# New: Try different models
python main.py --model claude-3-5-haiku-20241022 -p "Create a plugin"
python main.py --model ollama/deepseek-r1:14b -p "Create a plugin" # Free!The WordPress Plugin Generator supports any AI model via LiteLLM, including OpenAI, Anthropic, Google, local Ollama models, and many more providers.
By default, the generator uses OpenAI's gpt-4o model, which provides the best balance of capabilities and performance.
| Provider | Example Models | API Key Required | Notes |
|---|---|---|---|
| OpenAI | gpt-4o, gpt-4o-mini, o1-preview | ✅ OPENAI_API_KEY | Best overall performance |
| Ollama | ollama/llama3.2:latest, ollama/deepseek-r1:14b | ❌ None | Free, runs locally |
| Anthropic | claude-3-5-sonnet, claude-3-5-haiku | ✅ ANTHROPIC_API_KEY | Excellent for complex tasks |
| litellm/gemini/gemini-1.5-flash | ✅ GOOGLE_API_KEY | Strong multimodal capabilities | |
| Groq | litellm/groq/llama-3.1-70b-versatile | ✅ GROQ_API_KEY | Ultra-fast inference |
# List all available models and providers
python main.py --list-models
# OpenAI (default) - best reliability
python main.py --model gpt-4o -p "Create a plugin"
# Ollama (free) - privacy-focused local models
python main.py --model ollama/deepseek-r1:14b -p "Create a plugin"
# Claude (premium) - excellent for complex logic
python main.py --model claude-3-5-haiku-20241022 --disable-tracing -p "Create a plugin"
# Custom temperature for different creativity levels
python main.py --model gpt-4o --temperature 0.3 -p "Create a precise plugin"📖 Full Setup Guide: For detailed installation and configuration instructions for each provider, see the Quick Start Guide.
To use non-OpenAI models, install the optional LiteLLM dependency:
pip install "openai-agents[litellm]==0.0.16"For detailed setup instructions for all AI providers (OpenAI, Ollama, Claude, etc.), see our 📖 Quick Start Guide.
# Default OpenAI usage (requires OPENAI_API_KEY)
python main.py -p "Create a contact form plugin with name, email, and message fields"
# Try alternative models - see QUICKSTART.md for full setup
python main.py --model ollama/deepseek-r1:14b -p "Create a plugin" # Free local model
python main.py --model claude-3-5-haiku-20241022 -p "Create a plugin" # High-quality Claude
python main.py --model gpt-4o-mini -p "Create a plugin" # Fast OpenAI model
# Discover all available models
python main.py --list-models🔗 For complete setup instructions: See 📖 Quick Start Guide
🎯 For real-world examples: See 📖 Examples & Use Cases
python main.py# Generate a plugin with direct prompt
python main.py -p "Create a contact form plugin with email notifications"
# Generate with verbose output
python main.py -p "SEO optimization plugin" -v
# Use a different model
python main.py -p "Custom post type plugin" --model claude-3-5-sonnet
# Use any LiteLLM model with custom settings
python main.py -p "Plugin description" --model litellm/groq/llama-3.1-70b-versatile --temperature 0.3
# Check environment setup
python main.py --check
# List all available models and shortcuts
python main.py --list-models
# Custom retry attempts
python main.py -p "Custom post type plugin" --max-retries 5The generator supports several advanced testing methods to ensure your plugin works correctly:
# Test with WordPress Playground (requires Selenium)
python main.py -p "Your plugin description" --playground
# Run WordPress Plugin Check (requires Docker)
python main.py -p "Your plugin description" --wp-check
# Generate and run PHPUnit tests (requires Docker)
python main.py -p "Your plugin description" --phpunit
# Run all available tests
python main.py -p "Your plugin description" --all-tests-p, --prompt: Plugin description (skip interactive prompt)-v, --verbose: Enable verbose output with detailed logging--check: Check environment setup and exit--max-retries: Maximum retry attempts on failure (default: 3)
--playground: Test plugin with WordPress Playground in a headless browser--wp-check: Run the official WordPress Plugin Check tool--phpunit: Generate PHPUnit test bootstrap and run tests--all-tests: Run all available advanced tests
- PHP Syntax Check: Validates PHP syntax using
php -l - Static Code Analysis: Analyzes code for potential issues without execution
Tests your plugin in a real WordPress environment using a headless browser.
Requirements:
- Selenium:
pip install selenium webdriver-manager - Chrome or Chromium browser
What it does:
- Creates a ZIP of your plugin
- Uploads and activates it in WordPress Playground
- Verifies successful activation
- Reports any activation errors
Runs the official WordPress Plugin Check tool to ensure compliance with WordPress guidelines.
Requirements:
- Docker and Docker Compose
- Running:
docker-compose up -d
What it checks:
- WordPress coding standards
- Security best practices
- Performance optimizations
- Accessibility requirements
Generates and runs unit tests for your plugin.
Requirements:
- Docker and Docker Compose
- Running:
docker-compose up -d
What it does:
- Generates PHPUnit bootstrap and configuration
- Creates sample test files
- Runs the test suite
- Reports test results
- Planning Phase: Analyzes requirements and prepares the workflow
- Specification Collection: Gathers detailed plugin requirements
- Code Generation: Creates complete plugin codebase
- File Writing: Saves all files with proper structure
- Compliance Checking: Verifies WordPress standards
- Testing: Validates syntax and simulates activation
- Reporting: Provides comprehensive generation report
write_file: Enhanced file writing with error handlingread_file: Safe file reading with encoding supportlist_files: Directory listing with pattern matchingensure_directory: Safe directory creationdelete_file: File deletion with existence checking
docker_compose_up: Docker environment managementactivate_plugin: Plugin activation with timeout supportlist_plugins: Enhanced plugin listing with JSON outputcheck_plugin_syntax: PHP syntax validation
test_with_playground: Test plugins using WordPress Playground in a headless browserrun_plugin_check: Run WordPress Plugin Check tool via WP-CLIrun_phpunit_tests: Execute PHPUnit tests for pluginsgenerate_phpunit_bootstrap: Generate PHPUnit test configuration
python main.py -p "Create a simple contact form plugin with spam protection"# With all tests enabled
python main.py -p "Create a plugin for managing team members with custom post type, taxonomies, and Gutenberg blocks" --all-tests# Only WordPress Playground and Plugin Check
python main.py -p "Create a WooCommerce extension that adds custom product fields" --playground --wp-checkThe generator now provides detailed progress updates during plugin creation:
- Planning Phase: Shows requirements analysis
- Specification Details: Displays plugin name, slug, and features
- File Generation: Reports number of files created
- Writing Progress: Shows each file as it's written
- Compliance Summary: Reports errors, warnings, and suggestions
- Testing Status: Shows which tests are running and their results
Run the environment check:
python main.py --check-
API Key Not Found
export OPENAI_API_KEY="your-key"
-
Docker Not Available
- Install Docker Desktop or Docker Engine
- Testing will be simulated without Docker
-
PHP Syntax Checking Failed
- Install PHP CLI:
brew install php(macOS) orapt install php-cli(Ubuntu)
- Install PHP CLI:
For detailed debugging information:
python main.py -p "your plugin description" -vpluginator/
├── main.py # Enhanced CLI entry point
├── plugin_agents.py # Multi-agent definitions
├── tools.py # Enhanced tool implementations
├── requirements.txt # Python dependencies
├── docker-compose.yml # WordPress test environment with WP-CLI & PHPUnit
└── plugins/ # Generated plugins directory
The docker-compose.yml now includes:
- WP-CLI: Pre-installed WordPress command-line interface
- PHPUnit: Unit testing framework for WordPress plugins
- Composer: PHP dependency management
- PHPMyAdmin: Optional database management interface (port 8080)
- Debug Mode: WordPress debug logging enabled
Test your plugin in a browser-based WordPress environment:
# The generator can automatically test with WordPress Playground
# This uses Selenium to verify plugin activationRun the official WordPress Plugin Check tool:
# Start Docker environment
docker-compose up -d
# Plugin will be automatically checked during generation
# Or manually run: docker-compose exec wordpress wp plugin check <plugin-slug>Generate and run unit tests:
# Generator can create PHPUnit bootstrap files
# Tests run automatically in Docker environment- Create a new function in
tools.py:
@function_tool
def your_custom_tool(param: str) -> str:
"""Tool description for the agent.
Args:
param: Parameter description
"""
# Implementation
return result- Add the tool to the appropriate agent in
plugin_agents.py
Agents can be customized by modifying their:
- Instructions
- Model settings (temperature, model version)
- Output types (Pydantic models)
- Available tools
MIT License - See LICENSE file for details
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Built with OpenAI Agents SDK
- WordPress coding standards and best practices
- Community feedback and contributions
- Python 3.9+
- An API key for your chosen AI provider (see Quick Start Guide)
# Clone the repository
git clone https://github.com/yourusername/pluginator.git
cd pluginator
# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install with LiteLLM support for all models
pip install "openai-agents[litellm]==0.0.16"
# Install other dependencies
pip install -r requirements.txt
# Set up environment (copy and edit)
cp env.example .env
# Edit .env with your API keys and model preferencesIf you only plan to use OpenAI models:
pip install openai-agents==0.0.16
pip install -r requirements.txt
export OPENAI_API_KEY="your-api-key-here"- Docker & Docker Compose: For testing plugins in real WordPress environments
- PHP CLI: For syntax validation of generated code
- Ollama: For free local AI models (see Quick Start Guide)
# Check that everything is working
python main.py --list-models
# Test with a simple plugin
python main.py -p "Create a simple hello world widget plugin"