Skip to main content

WordPress Plugin Development Boilerplate

Scaffold a WordPress plugin with OOP architecture — admin pages, REST API endpoints, custom database tables, and WordPress coding standards.

Vul de plaatshouders in

Edit the values, then copy your finished prompt.

Jouw Prompt
prompt.txt

                                

What this prompt does

This prompt scaffolds a WordPress plugin named [plugin_name] that [plugin_purpose], built with a proper object-oriented architecture. It produces PSR-4 autoloading, a main plugin class with activation and deactivation hooks, an admin page with [admin_sections] via the Settings API, REST endpoints from [api_endpoints], a custom database table [db_table] with a migration/upgrade system, a [shortcode_name] shortcode, a [block_name] Gutenberg block, AJAX handlers, WP-CLI commands for [cli_commands], and full i18n with a .pot file.

The structure works because it treats a plugin like real software, not a single procedural file. PSR-4 autoloading and a class-based core keep it testable and standards-compliant as it grows. The [db_table] definition drives the migration system so schema changes upgrade cleanly, and [api_endpoints] plus [cli_commands] give the plugin both a programmatic and a command-line surface. It also includes PHPUnit setup, GitHub Actions CI, and a readme.txt for WordPress.org.

When to use it

  • You're starting a plugin and want OOP structure with PSR-4 autoloading from line one
  • You need a Settings API admin page with [admin_sections] instead of hand-rolled forms
  • You're exposing functionality through REST endpoints from [api_endpoints]
  • You need a custom [db_table] with a migration and upgrade system
  • You want WP-CLI commands for [cli_commands] like exports and cleanup
  • You're aiming for WordPress.org submission and need a readme.txt, tests, and CI

Example output

Expect a plugin skeleton: a PSR-4 directory layout, a main class with activation/deactivation hooks, a Settings API admin page, registered REST routes, a custom table with a versioned upgrade routine, a registered shortcode and Gutenberg block, AJAX handlers, WP-CLI command stubs, a .pot translation template, a PHPUnit test setup, a GitHub Actions workflow, and a WordPress.org readme.txt.

Pro tips

  • Make [plugin_purpose] concrete — a sharp purpose produces a focused class structure instead of a grab-bag of features
  • Define [db_table] columns explicitly so the migration system generates the right schema and upgrade path
  • Keep [api_endpoints] RESTful and predictable; the generated permission callbacks are a baseline you must review for security
  • Use [cli_commands] for the operational tasks you'll actually run, like exports and purges, not speculative ones
  • Verify the i18n wrapping is complete before shipping — generated .pot files sometimes miss strings in newer code paths
  • Run the included PHPUnit and CI setup early so the plugin stays maintainable as you extend it

Frequently Asked Questions

Why use OOP and PSR-4 instead of a single plugin file?
A class-based architecture with PSR-4 autoloading keeps the plugin testable and standards-compliant as it grows. Single procedural files become unmaintainable quickly, while the structured approach this prompt scaffolds supports the PHPUnit tests and CI it also generates.
Does it handle database schema changes over time?
Yes, it creates the `[db_table]` with a migration and upgrade system, so schema changes apply cleanly on plugin updates. Define your columns explicitly in the variable so the generated migration produces the right table and version-aware upgrade path.
Is the plugin ready for WordPress.org submission?
It scaffolds the pieces you need, including a `readme.txt`, PHPUnit setup, and GitHub Actions CI, and follows WordPress coding standards. You'll still need to review security, complete the readme details, and test thoroughly before actually submitting to the directory.
Are the REST endpoint permissions secure out of the box?
The generated permission callbacks are a baseline, not a guarantee. Review each endpoint's authentication and capability checks against your `[api_endpoints]` carefully, since security mistakes in REST permissions are a common and serious source of plugin vulnerabilities.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

Meer in WordPress & CMS Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support