Skip to content

ohryan/plugin-plugin-plugin

Repository files navigation

Plugin! Plugin! Plugin!

A WordPress plugin that uses the WP 7.0 AI Client to generate, install, and iterate on WordPress plugins through a chat interface. From your WordPress admin. Using AI. Yes, really.


Requirements

  • WordPress 7.0+
  • PHP 8.1+
  • An AI provider plugin configured under Settings → Connectors (official options: Anthropic, Google, OpenAI)
  • Node.js + Docker (for local development via wp-env)

How It Works

  1. Go to Tools → Plugin! Plugin! Plugin!
  2. Describe what you want in plain English
  3. The AI generates a complete, single-file WordPress plugin
  4. Review the code — the panel is editable, in case you have notes
  5. Click Install & Activate
  6. Ask for changes. The AI remembers the conversation. Click Update Plugin.
  7. Go to Tools → Saved Plugins to revisit past conversations.

Local Development

npm install
npm run env:start

WordPress will be available at http://localhost:8888. Admin credentials are admin / password.

npm run env:stop   # stop the environment
npm run env:clean  # wipe the database and start fresh

Project Structure

wp-plugin-builder.php                  # Plugin entry point & bootstrap
system-prompt.md                       # AI system prompt — edit freely
includes/
  class-admin-page.php                 # Tools > Plugin! Plugin! Plugin! UI
  class-conversations-page.php         # Tools > Saved Plugins UI
  class-rest-controller.php            # REST API endpoints
  class-chat-service.php               # Core chat/generation logic
  class-code-generator.php             # AI prompt building & response parsing
  class-conversation-store.php         # Conversation persistence (custom post type)
  class-plugin-installer.php           # WP_Filesystem install & activate
  class-job-queue.php                  # Async job queue (transients)
assets/
  builder.js                           # Chat UI
  builder.css                          # Styles

REST API

Method Endpoint Description
POST /wp-plugin-builder/v1/chat Send a message, get a response
GET /wp-plugin-builder/v1/conversations List saved conversations
GET /wp-plugin-builder/v1/conversations/{id} Get a single conversation
DELETE /wp-plugin-builder/v1/conversations/{id} Delete a conversation
POST /wp-plugin-builder/v1/install Install & activate a generated plugin

All endpoints require manage_options capability. Install requires install_plugins and activate_plugins.


Customising the AI

Edit system-prompt.md in the plugin root. The file is loaded at runtime, so changes take effect immediately without reactivating the plugin. The default personality is dry and slightly resigned. You can change this if you want. That's fine.


Security Notes

Generated plugins are written to wp-content/plugins/ via WP_Filesystem and require an explicit install action — nothing runs automatically. The code review step exists for a reason. The AI instructs itself to follow WordPress security best practices (nonces, capability checks, sanitization, escaping), but you should still read what you're installing.

This tool is restricted to administrators. It should not be accessible to untrusted users. You knew that already.


License

GPL-2.0-or-later

About

Describe a plugin. Get a plugin. Try not to think too hard about what that means.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors