> Free generator of a modern WordPress plugin starter as a zip: namespaces and PSR-4, settings page, block.json block, REST endpoint and uninstall cleanup.

Source: https://nitramix.com/tools/wordpress-plugin-boilerplate-generator

Free tool

# WordPress Plugin Boilerplate Generator A modern starter in one zip.

Name your plugin, pick the parts you need and download a clean, working starter: namespaces and autoloading, a settings page, a block, a REST route and proper uninstall cleanup. It follows the WordPress Coding Standards and what the WordPress.org review checks.

## Generate your plugin

1.Name and details

Folder and slug: gallery-boost

2.Where will it live?

Plugins on WordPress.org skip load\_plugin\_textdomain (translations load on their own).

3.What should it include?

4.Code names

Filled in from the name. Change them only if they clash with another plugin.

Your plugin

gallery-boost.zip · 13 files

.distignore

```
/.git
/.github
/node_modules
/vendor
.distignore
.gitignore
composer.json
composer.lock
phpcs.xml.dist
package.json
package-lock.json
```

Built in your browser. Upload the zip in Plugins > Add New > Upload Plugin, or unzip it into wp-content/plugins. Run `composer install` first if you picked composer.json.

## How it works

1.  1

    ### Name it

    The name sets the folder, slug, text domain, namespace and prefix.

2.  2

    ### Pick the parts

    Only what you need: settings, block, REST, a post type.

3.  3

    ### Look through it

    Browse every file before you download.

4.  4

    ### Install the zip

    Upload it in Plugins > Add New, or unzip into wp-content/plugins, and activate.

## What you get

Every file is small and commented, so you can read the whole plugin in a few minutes and know where your code goes.

### Namespaces and PSR-4

Classes live in src/ under your own namespace, loaded by a tiny autoloader. No class name collisions with other plugins.

### Settings page done right

Settings API with register\_setting, a sanitize callback, escaped output and a capability check. The nonce comes from settings\_fields().

### Gutenberg block without a build

block.json (API version 3), an index.asset.php with the script dependencies and plain JavaScript you can later move to @wordpress/scripts.

### REST endpoint with a permission check

A route under /wp-json/your-slug/v1 with a real permission\_callback and validated, sanitized arguments.

### Clean activation and uninstall

Default options on activation, scheduled events cleared on deactivation, and every option removed on uninstall, across a multisite network.

### Coding standards config

phpcs.xml.dist with the WordPress ruleset, your text domain and your prefixes, plus .distignore to keep dev files out of releases.

## Before you submit to WordPress.org

The boilerplate gets the structure right. These are the steps that usually decide how fast the review goes.

### Run Plugin Check

Install the official Plugin Check plugin on a test site and fix every error it reports.

### Escape late, sanitize early

Escape every value at the moment you print it, sanitize every value the moment you receive it.

### No remote code or tracking

Do not load scripts from other servers or send data home without asking the user first.

### A real readme.txt

A clear name, short description, tags and FAQ. The readme generator checks it for you.

Plugin development

### Want it built and published for you?

We build WordPress plugins, get them through the WordPress.org review and keep them updated. Our own plugins there have 4,000+ active installs.

[Talk about your plugin](https://nitramix.com/services/wordpress-plugin-development)

Free calculator

### What would your plugin cost to build?

Pick the type, size and features and get a price range, a timeline and the yearly support cost in about a minute.

[Estimate my plugin](https://nitramix.com/tools/wordpress-plugin-development-cost-calculator)

## FAQ

### What is a WordPress plugin boilerplate?

A ready-made starting structure for a new plugin: the main file with its header, an autoloader, a place for admin code, uninstall cleanup and a readme.txt. It saves the first hour of every project and makes sure the basics (security checks, prefixes, translations) are right from the start.

### How is this different from the old WordPress Plugin Boilerplate?

The classic boilerplate dates from 2015 and uses class-\*.php files with a loader class and a separate admin and public folder for everything. This generator uses PHP namespaces with PSR-4 autoloading, block.json for blocks, the Settings API, and only includes the parts you pick, so you do not start by deleting files.

### Will the generated plugin pass the WordPress.org review?

The structure follows what reviewers and the Plugin Check tool look for: a direct access guard in every PHP file, escaped output, sanitized input, nonce handling through the Settings API, capability checks, a permission callback on REST routes, prefixed names and an uninstall.php that removes your data. The review is of your whole plugin though, so the code you add has to follow the same rules.

### Do I need Composer or a build step?

No. The plugin ships with its own small PSR-4 autoloader and the Gutenberg block is plain JavaScript using the wp.\* globals, so it runs as soon as you unzip it. If you tick composer.json, the main file prefers vendor/autoload.php when it exists and you get the coding standards as a dev dependency.

### Why is there no load\_plugin\_textdomain() call?

Since WordPress 4.6, plugins hosted on WordPress.org get their translations loaded automatically from translate.wordpress.org, and Plugin Check now discourages the call. If you choose "Somewhere else" as the hosting, the generator adds it so your bundled /languages files load.

### What does uninstall.php remove?

The options the plugin created and its scheduled events, on every site of a multisite network. It runs only when a user deletes the plugin from the Plugins screen, not on deactivation, so settings survive a quick deactivate and reactivate.

## More free tools

### WordPress Readme Generator & Validator

Write or check your plugin readme.txt with a live preview and an SEO score based on how WordPress.org search ranks plugins.

Open tool

[WordPress Readme Generator & Validator](https://nitramix.com/tools/wordpress-readme-generator)

### WordPress Plugin Search Rank Checker

See where your plugin ranks in WordPress.org search for any keyword, and why the top 10 rank above you.

Open tool

[WordPress Plugin Search Rank Checker](https://nitramix.com/tools/wordpress-plugin-search-rank-checker)

### WordPress Plugin Stats & Comparison

Downloads chart, active installs, ratings and support for any WordPress.org plugin, with a side by side comparison.

Open tool

[WordPress Plugin Stats & Comparison](https://nitramix.com/tools/wordpress-plugin-stats)

### WordPress Plugin Name Checker

Check a plugin name against the WordPress.org rules and see whether its slug is still free.

Open tool

[WordPress Plugin Name Checker](https://nitramix.com/tools/wordpress-plugin-name-checker)

### WordPress Plugin Header Generator

Generate the main plugin file header with every field checked against the WordPress.org rules.

Open tool

[WordPress Plugin Header Generator](https://nitramix.com/tools/wordpress-plugin-header-generator)

### WordPress Plugin Banner & Icon Generator

Turn one image (or your plugin name) into the four banner and icon files WordPress.org needs, named right.

Open tool

[WordPress Plugin Banner & Icon Generator](https://nitramix.com/tools/wordpress-plugin-banner-icon-generator)

[All free tools](https://nitramix.com/tools)
