Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.

Project structure · More

WordPress plugin project structure

Opens with credits

A modern WordPress plugin that adds product reviews: blocks scaffolded with @wordpress/create-block and built by @wordpress/scripts, PHP classes autoloaded by Composer, a REST API, a React settings page, and tests running inside wp-env. For students who can write a little PHP and JavaScript and want to build a plugin the way WordPress core contributors and serious plugin teams lay it out.

Curated by Tauseef FayyazIntermediate124 files and foldersWordPress 7.1 (tested up to; requires 6.8), PHP 8.1 or newer, @wordpress/create-block 4.99Checked October 2026
Explore the filesPick any file to see what it is, why it exists and when you add it.

How it grows

Each stage opens the explorer there

  1. 1Day 1What the scaffold and your first hour give you19 files and folders
  2. 2GrowingWhat a real app with features and tests adds+63 files and folders
  3. ProductionWhat running it for real users adds+21 files and foldersOpens with credits
  4. ExpertWhat a team needs to keep it healthy for years+21 files and foldersOpens with credits

How it is organised

  • One main plugin file with the header, a few constants and a call to boot the plugin. Everything else is a class in `includes/` loaded by Composer.
  • Blocks are defined by block.json and live one folder each under `src/`; @wordpress/scripts builds them into `build/` and the plugin registers them all from the generated manifest.
  • Prefer dynamic blocks (render.php) for data that changes, and the Interactivity API for front end behaviour, so visitors do not download React.
  • Every input is sanitised, every output is escaped, every write checks a capability and a nonce. Assume every request is hostile.
  • Prefix everything global: function names, option names, post types, hooks, REST namespace and text domain, so your plugin never clashes with another.
  • Use WordPress APIs (WP_Query, options, meta, REST, cron, transients) before writing your own SQL or HTTP handling.
  • Develop and test in wp-env, against the oldest and newest WordPress and PHP versions your header promises.
  • What ships is the built plugin, not the repository: .distignore and package.json "files" decide what goes into the zip.

At the top of the project

Open one in the explorer for the full story

Learn more on Sefism

Roadmaps, cheat sheets and projects that go with WordPress plugin.

See 7 more
Checked against 20 official sources, October 2026. If something has changed, the docs win.Show sources

Picked from the other libraries by shared topics.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

  • 1:1 Mentorship
  • Fresh Graduate Mentorship
  • Career Guidance

Brand deals, promos and partnerships: tauseeffayyaz@gmail.com