PHPackages                             alleyinteractive/create-wordpress-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alleyinteractive/create-wordpress-plugin

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

alleyinteractive/create-wordpress-plugin
========================================

A skeleton WordPress plugin

v1.8.1(6mo ago)36472↓33.3%1[5 issues](https://github.com/alleyinteractive/create-wordpress-plugin/issues)[10 PRs](https://github.com/alleyinteractive/create-wordpress-plugin/pulls)GPL-2.0-or-laterPHPPHP ^8.2CI passing

Since Dec 2Pushed 2mo ago24 watchersCompare

[ Source](https://github.com/alleyinteractive/create-wordpress-plugin)[ Packagist](https://packagist.org/packages/alleyinteractive/create-wordpress-plugin)[ Docs](https://github.com/alleyinteractive/create-wordpress-plugin)[ RSS](/packages/alleyinteractive-create-wordpress-plugin/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (47)Used By (0)

Create WordPress Plugin
=======================

[](#create-wordpress-plugin)

This is a skeleton WordPress plugin that can scaffold a WordPress plugin. This template includes a base plugin file, autoloaded PHP files, unit tests powered by [Mantle](https://mantle.alley.com/), front-end assets compiled via Webpack, and Continuous Integration [via GitHub Actions](.github/workflows). Actions are configured to test the plugin and also [build it for releases](https://github.com/alleyinteractive/action-release). The workflows will also create a `*-built` branch, too.

The plugin supports front-end assets which can be enqueued inside `src/assets.php` or from within an entry points `index.php` file. For plugins that don't require front-end assets, the configuration script below will prompt you to delete the front-end files if you don't wish to use them.

Getting Started
---------------

[](#getting-started)

Follow these steps to get started:

1. Press the "Use template" button at the top of this repo to create a new repo with the contents of this skeleton.
2. Run `make` (or `php ./configure.php`) to run a script that will replace all placeholders throughout all the files.
3. Have fun creating your plugin! 🎊

Create WordPress Plugin
=======================

[](#create-wordpress-plugin-1)

Contributors: author\_username

Tags: vendor\_name, create-wordpress-plugin

Stable tag: 0.0.0

Requires at least: 6.3

Tested up to: 6.7

Requires PHP: 8.2

License: GPL v2 or later

[![Testing Suite](https://github.com/alleyinteractive/create-wordpress-plugin/actions/workflows/all-pr-tests.yml/badge.svg?branch=develop)](https://github.com/alleyinteractive/create-wordpress-plugin/actions/workflows/all-pr-tests.yml)

A skeleton WordPress plugin.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require alleyinteractive/create-wordpress-plugin
```

Usage
-----

[](#usage)

Activate the plugin in WordPress and use it like so:

```
$plugin = Create_WordPress_Plugin\Skeleton\Example_Plugin();
$plugin->perform_magic();
```

Development
-----------

[](#development)

To setup a WordPress installation and run the plugin in a local environment, you can use `wp-env` via the `composer dev` command:

```
npm install
composer dev
```

The command will start a local WordPress environment with the plugin activated while also running the front-end assets build process. You can also run `npm run start` to start the front-end assets build process separately. The front-end assets will be compiled into the `build` directory and will be enqueued automatically by the plugin.

Registering Meta
----------------

[](#registering-meta)

The plugin supports registering post and term meta via JSON files located in the `config` directory. Out of the box, the plugin will look for `config/post-meta.json` for post meta and `config/term-meta.json` for term meta.

```
{
  "$schema": "https://raw.githubusercontent.com/alleyinteractive/mantle-framework/HEAD/src/mantle/support/schema/meta.json",
  "example_meta_key": {
    "post_types": "article",
    "type": "string"
  },
  "another_meta_key": {
    "post_types": [ "article", "page" ],
    "type": "number",
    "single": false,
    "default": 0
  }
}
```

For more information on how to register meta via JSON files, [see the documentation](https://mantle.alley.com/docs/features/support/helpers#register_meta_from_file).

The `entries` directory and entry points
----------------------------------------

[](#the-entries-directory-and-entry-points)

All directories created in the `entries` directory can serve as entry points and will be compiled with [@wordpress/scripts](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/README.md#scripts) into the `build` directory with an accompanied `index.asset.php` asset map.

### Scaffolding an entry point

[](#scaffolding-an-entry-point)

To generate a new entry point, run the following command:

```
npm run create-entry
```

To generate a new slotfill, run the following command:

```
npm run create-slotfill
```

The command will prompt the user through several options for creating an entry or slotfill. The entries are scaffolded with the `@alleyinteractive/create-entry` script. Run the help command to see all the options:

```
npx @alleyinteractive/create-entry --help
```

[Visit the package README](https://www.npmjs.com/package/@alleyinteractive/create-entry) for more information.

### Enqueuing Entry Points

[](#enqueuing-entry-points)

You can also include an `index.php` file in the entry point directory for enqueueing or registering a script. This file will then be moved to the build directory and will be auto-loaded with the `load_scripts()` function in the `functions.php` file. Alternatively, if a script is to be enqueued elsewhere there are helper functions in the `src/assets.php` file for getting the assets.

### Scaffold a dynamic block with `create-block`

[](#scaffold-a-dynamic-block-with-create-block)

Use the `create-block` command to create custom blocks with [@alleyinteractive/create-block](https://github.com/alleyinteractive/alley-scripts/tree/main/packages/create-block) script and follow the prompts to generate all the block assets in the `blocks/` directory. Block registration, script creation, etc will be scaffolded from the `create-block` script. Run `npm run build` to compile and build the custom block. Blocks are enqueued using the `load_scripts()` function in `src/assets.php`.

### Updating WordPress Dependencies

[](#updating-wordpress-dependencies)

Update the [WordPress dependency packages](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/#packages-update) used in the project to their latest version.

To update `@wordpress` dependencies to their latest version use the packages-update command:

```
npx wp-scripts packages-update
```

This script provides the following custom options:

- `--dist-tag` – allows specifying a custom dist-tag when updating npm packages. Defaults to `latest`. This is especially useful when using [`@wordpress/dependency-extraction-webpack-plugin`](https://www.npmjs.com/package/@wordpress/dependency-extraction-webpack-plugin). It lets installing the npm dependencies at versions used by the given WordPress major version for local testing, etc. Example:

```
npx wp-scripts packages-update --dist-tag=wp-WPVERSION`
```

Where `WPVERSION` is the version of WordPress you are targeting. The version must include both the major and minor version (e.g., `6.7`). For example:

```
npx wp-scripts packages-update --dist-tag=wp-6.7`
```

Testing
-------

[](#testing)

Run `npm run test` to run Jest tests against JavaScript files. Run `npm run test:watch` to keep the test runner open and watching for changes.

Run `npm run lint` to run ESLint against all JavaScript files. Linting will also happen when running development or production builds.

Run `composer test` to run tests against PHPUnit and the PHP code in the plugin. Unit testing code is written in PSR-4 format and can be found in the `tests`directory.

Releasing the Plugin
--------------------

[](#releasing-the-plugin)

The plugin uses [action-release](https://github.com/alleyinteractive/action-release) via a [built release workflow](./.github/workflows/built-release.yml) to compile and tag releases. Whenever a new version is detected in the root plugin's headers in the `plugin.php` file or in the `composer.json` file, the workflow will automatically build the plugin and tag it with a new version. The built tag will contain all the required front-end assets the plugin may require. This works well for publishing to WordPress.org or for submodule-ing.

When you are ready to release a new version of the plugin, you can run `npm run release`/`composer release` to start the process of setting up a new release. If you want to do this manually you can follow these steps:

1. Change the `Version` in the `plugin.php` file to a new higher-level version.

    ```
    - * Version: 0.0.0
    + * Version: 0.0.1
    ```

    **✨ `npm run release` will do this for you automatically.**
2. Commit your changes and push to the repository.
3. Check the actions tab in the repository to see the progress of the release. The action will automatically create a new tag and release for the plugin. You are done!

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

This project is actively maintained by [Alley Interactive](https://github.com/alleyinteractive). Like what you see? [Come work with us](https://alley.com/careers/).

- [author\_name](https://github.com/author_username)
- [All Contributors](../../contributors)

License
-------

[](#license)

The GNU General Public License (GPL) license. Please see [License File](LICENSE) for more information.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance76

Regular maintenance activity

Popularity26

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Recently: every ~57 days

Total

16

Last Release

202d ago

PHP version history (3 changes)v1.0.0PHP ^8.0

v1.2.0PHP ^8.1

v1.5.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/338d27065b1074f2d66d049d742f22996dd137eef6f91bc8f75350ceee1e8ef2?d=identicon)[srtfisher](/maintainers/srtfisher)

---

Top Contributors

[![srtfisher](https://avatars.githubusercontent.com/u/346399?v=4)](https://github.com/srtfisher "srtfisher (320 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (261 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (243 commits)")[![stevenslack](https://avatars.githubusercontent.com/u/1856961?v=4)](https://github.com/stevenslack "stevenslack (130 commits)")[![kevinfodness](https://avatars.githubusercontent.com/u/2650828?v=4)](https://github.com/kevinfodness "kevinfodness (25 commits)")[![mogmarsh](https://avatars.githubusercontent.com/u/11542164?v=4)](https://github.com/mogmarsh "mogmarsh (16 commits)")[![emilyatmobtown](https://avatars.githubusercontent.com/u/24902269?v=4)](https://github.com/emilyatmobtown "emilyatmobtown (14 commits)")[![renatonascalves](https://avatars.githubusercontent.com/u/19148962?v=4)](https://github.com/renatonascalves "renatonascalves (11 commits)")[![anubisthejackle](https://avatars.githubusercontent.com/u/1724534?v=4)](https://github.com/anubisthejackle "anubisthejackle (7 commits)")[![dlh01](https://avatars.githubusercontent.com/u/697432?v=4)](https://github.com/dlh01 "dlh01 (6 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (3 commits)")[![mboynes](https://avatars.githubusercontent.com/u/465154?v=4)](https://github.com/mboynes "mboynes (3 commits)")[![juliobranha](https://avatars.githubusercontent.com/u/6450969?v=4)](https://github.com/juliobranha "juliobranha (2 commits)")[![goodguyry](https://avatars.githubusercontent.com/u/2059404?v=4)](https://github.com/goodguyry "goodguyry (2 commits)")[![ellm](https://avatars.githubusercontent.com/u/370019?v=4)](https://github.com/ellm "ellm (2 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (1 commits)")

---

Tags

wordpresswordpress-pluginwordpress-plugin-templatealleyinteractivecreate-wordpress-plugin

###  Code Quality

Static AnalysisRector

### Embed Badge

![Health badge](/badges/alleyinteractive-create-wordpress-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/alleyinteractive-create-wordpress-plugin/health.svg)](https://phpackages.com/packages/alleyinteractive-create-wordpress-plugin)
```

###  Alternatives

[alleyinteractive/wp-block-converter

Convert HTML into Gutenberg Blocks with PHP

62321.0k1](/packages/alleyinteractive-wp-block-converter)[alleyinteractive/wp-curate

Plugin to curate homepages and other landing pages

10154.3k](/packages/alleyinteractive-wp-curate)[alleyinteractive/wp-alleyvate

Defaults for WordPress sites by Alley.

3434.2k](/packages/alleyinteractive-wp-alleyvate)[alleyinteractive/feed-consumer

Ingest external feeds and other data sources into WordPress

114.8k](/packages/alleyinteractive-feed-consumer)[alleyinteractive/wp-bulk-task

A library to assist with running performant bulk tasks against WordPress objects.

21326.8k4](/packages/alleyinteractive-wp-bulk-task)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
