wp-plugin-bootstrap

Review WordPress plugin bootstrap files for activation safety and autoload correctness.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents WordPress plugins from failing activation or producing runtime errors by ensuring the root bootstrap file is structured correctly for modern WP requirements (6.5+ plugin dependencies and 6.7+ translation timing).

Core Features & Use Cases

  • Bootstrap header correctness: Guides the required and recommended plugin header fields so WordPress can recognize, activate, and manage the plugin properly.
  • Safe initialization wiring: Establishes ABSPATH guards, constants, Composer/PSR-4 autoload with a manual fallback, and correct use of register_activation_hook plus plugins_loaded instantiation.
  • Modern activation i18n safety: Prevents translation calls from firing before after_setup_theme on WP 6.7+ to avoid _doing_it_wrong issues.
  • Practical review checklist: Helps diagnose common activation problems like “Plugin could not be activated”, missing class/autoload failures, and incorrect hook placement or top-level business logic.

Quick Start

Ask the AI to review your plugin root main PHP file for activation safety, autoload correctness, plugin header requirements, and WP 6.5+/6.7+ translation timing, then propose concrete fixes.

Frequently Asked Questions about wp-plugin-bootstrap

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

FAQPage Schema
Why does my WordPress plugin fail to activate on WP 6.7+ with a translation timing error?

WordPress plugin activation fails on WP 6.7+ when translation functions fire before the `after_setup_theme` hook. You must restructure the root file to delay translation calls until after this hook fires to avoid `_doing_it_wrong` notices.

How do I set up the main entry file for a WordPress plugin to safely load dependencies?

To safely load dependencies in a WordPress plugin entry file, use Composer-first PSR-4 autoloading with a `spl_autoload_register` fallback. Wrap the file in an ABSPATH guard and instantiate classes on the `plugins_loaded` hook.

What is the correct way to register activation hooks and check plugin dependencies in WordPress 6.5+?

Registering activation hooks in WordPress 6.5+ requires `register_activation_hook` for one-shot requirement checks. You must declare dependencies in the plugin header and ensure the bootstrap file validates required plugins before executing business logic.

Can I put top-level business logic directly inside my WordPress plugin's root bootstrap file?

No, you should not put top-level business logic in a WordPress plugin root bootstrap file. The entry file must only wire constants, autoloaders, activation hooks, and defer class instantiation to the `plugins_loaded` hook.

How do I fix missing class or autoload failures when scaffolding a new WordPress plugin?

Fix missing class or autoload failures in a WordPress plugin by verifying Composer autoload configuration and adding a `spl_autoload_register` fallback. Ensure class instantiation happens inside the `plugins_loaded` hook after dependencies load.