wp-plugin-bootstrap

Scaffold and validate WordPress plugin bootstrap files with header metadata and ABSPATH guards.

21|1|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/Lonsdale201/wp-agent-skills --skill wp-plugin-bootstrap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wp-plugin-bootstrap
Source: https://github.com/Lonsdale201/wp-agent-skills/tree/main/plugin-scaffold/wp-plugin-bootstrap
Command: npx skills add https://github.com/Lonsdale201/wp-agent-skills --skill wp-plugin-bootstrap

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides the creation and review of a WordPress plugin bootstrap entry-point, ensuring the main file includes a valid header, ABSPATH guard, proper autoload, activation hooks, and safe initialization patterns.

Core Features & Use Cases

  • Validates the presence of a plugin bootstrap file at the root with correct header fields (Plugin Name, Version, Requires PHP, Requires at least, Requires Plugins) and top-level safeguards.
  • Enforces a clean bootstrap lifecycle: guard clauses, constant definitions, composer/autoload fallback, and a plugins_loaded-first initialization in a small, testable footprint.
  • Use cases include scaffolding a new plugin or auditing PRs to confirm the bootstrap file adheres to WordPress best practices and modern PHP standards.

Quick Start

Create or review the plugin bootstrap at the root and verify the header, ABSPATH guard, autoload, and activation hook wiring follow WordPress best practices.

Frequently Asked Questions about wp-plugin-bootstrap

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a WordPress plugin bootstrap file with the correct header and security guard?

Scaffolding a WordPress plugin bootstrap file requires a valid header with Plugin Name, Version, and PHP requirements, plus an ABSPATH guard to prevent direct access and proper autoload setup for initialization.

What is a plugins_loaded initialization pattern and when do I need it for a WordPress plugin?

The plugins_loaded initialization pattern defers plugin setup until all plugins are loaded, preventing premature execution. You need it when your plugin depends on other plugins or must hook into WordPress core safely.

How do I validate a plugin entry-point for ABSPATH guard, autoload, and activation hook wiring?

Validating a plugin entry-point involves checking for a root-level bootstrap file with correct header fields, an ABSPATH guard clause, composer autoload fallback, and properly wired activation hooks to ensure security and compatibility.

Does this WordPress plugin scaffolding approach work with WordPress 6.5+ and modern PHP standards?

Yes, the scaffolding approach targets WordPress 6.5+ and later by enforcing modern PHP standards, including namespace autoload setup, clean constant definitions, and plugins_loaded-first initialization for a testable bootstrap footprint.

What's the best way to audit a PR for WordPress plugin bootstrap best practices?

The best way to audit a PR is to verify the main plugin file contains a valid header, ABSPATH guard, composer autoload fallback, and activation hook wiring, ensuring the bootstrap lifecycle follows WordPress best practices.

Why does my WordPress plugin bootstrap need a guard clause and constant definitions?

A guard clause prevents direct file access for security, while constant definitions establish plugin configuration before initialization. Together they ensure the bootstrap lifecycle is secure, identifiable, and compatible with WordPress standards.