Skip to the guide
All guides

Plugin development

Build, debug or review the parts of a WordPress plugin that run it: activation, hooks, upgrades, stored data, scheduled jobs and the release package.

app WordPress DevKit 2.0.3checked reading 4 minutes

On this page

When to use it

Use this skill when a plugin fails to activate, upgrade or uninstall cleanly. It also fits hooks that fire in the wrong order or cannot be removed, multisite setup problems, and questions about the plugin directory and packaging.

It does not cover REST routes, admin screens or WP-CLI commands. The skill looks after the plugin skeleton that those features hang on.

What it hands off

When a question belongs to another skill, the review stops and points you there:

  • REST routes, schemas and permissions go to wp-devkit-rest-api-development.
  • Settings pages, list tables and admin assets go to wp-devkit-admin-ui-development.
  • WP-CLI commands, search-replace and runbooks go to wp-devkit-wpcli-and-ops.
  • Exploitable-input analysis beyond the lifecycle questions goes to wp-devkit-security-review.

Run a review in Claude

With the plugin loaded, start a read-only review of one bounded target:

Text
/wp-devkit:plugin-review <target-path>

The shorter /wp-devkit:plugin asks for a quick scan instead.

Run a review in Codex, ChatGPT or Antigravity

Name the installed skill and keep the request small. Replace the target with your own files or journey.

Text
$wp-devkit-plugin-development
Review the target without editing files.
Read the project instructions and the skill's engineering contract first.
Separate confirmed findings from candidates and state the evidence and checks you could not run.

The engineering contract is the set of rules every DevKit skill follows. It covers how findings are rated and what counts as evidence.

How a review works

The agent works through these steps in order:

  1. It finds the real entry file and how the plugin loads, then follows the bootstrap, dependency loading and hook registration to the first point where behavior differs from what you expect.
  2. It places each concern in one lifecycle stage: activation, versioned upgrade, runtime, deactivation or uninstall. Updates never run activation again, and must-use plugins and drop-ins have no activation hooks.
  3. For each hook, it checks the timing, the priority, the number of accepted arguments and, for filters, the return value on every branch. It also checks that a removal uses the same callback that was registered.
  4. For stored data and jobs, it checks who owns the schema or option, autoload and size, whether a repeated run is safe, multisite scope and what happens at uninstall.
  5. For packaging, it compares the headers, text domain, shipped files and dependencies with what really runs. It does not build, install or activate anything.
  6. It rates each concern under the engineering contract. A search match stays a candidate until the agent has traced a reachable path. If the target version, loading mode or runtime is unknown, the result is insufficient evidence.

Reference files

The agent starts with the workbook and loads the others only when the task needs them:

  • plugin-development-workbook.md is read first. It helps sort symptoms, shows worked decisions, lists harmless code that looks like a bug, and gives verification steps.
  • lifecycle-and-upgrades.md covers plugin headers, activation, deactivation and uninstall, versioned upgrades, dbDelta, dependencies and multisite setup.
  • hooks-and-callbacks.md covers hook order, priorities, removal, recursion, custom hooks, detecting the request context and early-translation notices.
  • storage-jobs-and-multisite.md covers options and autoload, transients and the object cache, custom tables, $wpdb->prepare, WP-Cron, Action Scheduler, privacy hooks and the cost of switch_to_blog.
  • packaging-and-compatibility.md covers directory rules, Plugin Check, the readme, Composer and prefixing, PHP-version gates and release ZIP checks.

What you get back

A review opens with the result and the scope it covered. Each confirmed finding gives the file and line, who triggers it, the reachable path, the impact, the confidence, the severity, a minimal fix and a regression check. Candidates and missing evidence come in a separate list.

An implementation lists the boundaries it changed, the design decision, each command with its exit status, the checks it could not run, a rollback note and the risk that remains.

Note

Reviews are read-only. A clean review covers the inspected scope and is not a certification. Ask for implementation as a separate, bounded task with a regression check.

Where to go next

Use review to fix for a bounded implementation and Doctor and reports for environment and evidence tooling.