plugin-structure
Installation
SKILL.md
WordPress Plugin Structure
When to use
- The user wants to organize plugin code with namespaces or autoloading and avoid function, class, or constant name clashes with other plugins.
- The user needs to run setup or teardown code on plugin activation, deactivation, or uninstall (create tables, flush rewrites, remove options).
- The user is starting a new WordPress plugin and needs the main plugin file, header, and directory layout.
When NOT to use
- Do not scaffold a full distributable plugin for a one-off single-site tweak; a code snippet or a small mu-plugin is enough.
- Do not build a plugin for theme-specific presentation such as templates, styles, or layout; put that in the theme or a child theme.