wp-plugin-lifecycle

wp-plugin-lifecycle is a skill for Claude Code, Codex from Lonsdale201/wp-agent-skills. It costs 184 tokens per session (3,392 once invoked), scanned A, original, MIT.

A guide to the three events around a WordPress plugin's lifetime: activation, deactivation, and uninstall. It explains what setup or cleanup belongs in each event.

In plain words
What is it for?
Use it when adding or reviewing activation setup, deactivation cleanup, scheduled jobs, database initialization, permissions, or uninstall logic.
Why use it?
It prevents missed setup, recurring scheduled tasks after deactivation, and unwanted deletion or leftover data after uninstall. It also distinguishes uninstalling from updating a plugin.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding or reviewing activation setup, deactivation cleanup, scheduled jobs, database initialization, permissions, or uninstall logic.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lonsdale201/wp-agent-skills/wp-plugin-lifecycle
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Lonsdale201/wp-agent-skills --skill wp-plugin-lifecycle
Clone the repo
git clone --depth 1 https://github.com/Lonsdale201/wp-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for wp-plugin-lifecycle

README.md
[![agentmods](https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/wp-plugin-lifecycle/github.svg)](https://agentmods.dev/skills/lonsdale201/wp-agent-skills/wp-plugin-lifecycle)
Your own site
<a href="https://agentmods.dev/skills/lonsdale201/wp-agent-skills/wp-plugin-lifecycle"><img src="https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/wp-plugin-lifecycle/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for wp-plugin-lifecycle

Your own site · 80×15
<a href="https://agentmods.dev/skills/lonsdale201/wp-agent-skills/wp-plugin-lifecycle"><img src="https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/wp-plugin-lifecycle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 184 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,392 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00184 $0.03392
Opus 5 $0.00092 $0.01696
Sonnet 5 $0.00037 $0.00678
Haiku 4.5 $0.00018 $0.00339

Measured yesterday against content hash cbe3b444f753, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

wp-plugin-lifecycle scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin-scaffold/wp-plugin-lifecycle/SKILL.md · 255 lines

How it starts

The opening of the file, as written. The whole thing — 255 lines — stays where its author put it; the contents beside it link to each section on GitHub.

WordPress plugin: lifecycle (activate / deactivate / uninstall)

The three events that frame a plugin's existence on a site. Each has a different scope, different runtime context, and different non-negotiable rules. Get the contract wrong and you ship plugins that:

  • Activate "successfully" but leave the site in a broken state.
  • Leave behind cron events that fire forever after deactivation.
  • Leave 50 orphan options + 100k orphan meta rows after uninstall.

This skill assumes the plugin already has a clean bootstrap (see wp-plugin-bootstrap). It covers ONLY what happens at the three lifecycle boundaries.

Update-time migrations after plugin files are replaced are out of scope here; note that activation does not fire on an ordinary plugin update.

When to use this skill

Trigger when ANY of the following is true:

  • Scaffolding a new plugin and writing the activation / deactivation / uninstall logic.
  • Reviewing a PR that touches register_activation_hook, register_deactivation_hook, or uninstall.php.
  • Debugging "ghost cron events still firing after my plugin is deactivated", or "I deleted the plugin but options are still in wp_options".
  • Adding a "Preserve data on uninstall" toggle / a clean removal toggle for site owners.
  • Adapting an existing plugin to be multisite-aware (per-site activation, network-wide uninstall).

The diff or file most likely contains: register_activation_hook, register_deactivation_hook, register_uninstall_hook (anti-pattern, see below), uninstall.php, WP_UNINSTALL_PLUGIN, dbDelta, wp_unschedule_hook, wp_clear_scheduled_hook, delete_option, delete_site_option, or switch_to_blog.

The three events at a glance

Event Hook / file When it fires Runtime context
Activate register_activation_hook( __FILE__, $cb )activate_<basename> User clicks "Activate" in /wp-admin/plugins.php. Also re-fires on reactivation. NOT on plugin update. Full WP loaded, user logged in, plugin's main file already loaded. Classes via autoloader available.
Deactivate register_deactivation_hook( __FILE__, $cb )deactivate_<basename> User clicks "Deactivate". Full WP loaded, plugin loaded.
Uninstall uninstall.php at plugin root User clicks "Delete" on a deactivated plugin. Full WP loaded, BUT plugin's main file NOT loaded — uninstall.php runs in isolation with only the WP API available. WP_UNINSTALL_PLUGIN constant is defined (wp-admin/includes/plugin.php:1324).

Read the full file on GitHub · 255 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · -1 lines · -2 tokens per session cbe3b444f753
  2. 9d ago First seen · 256 lines · 186 tokens per session scan A bad09f4cc8e2

Subscribe to this mod's changes

wp-plugin-lifecycle is a skill published in the GitHub repository Lonsdale201/wp-agent-skills (22 stars, last pushed 2d ago), licensed MIT. It adds 184 tokens to every session and 3,392 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

syndic

Gère un parc de copropriétés en France avec vue portfolio consolidée. Couvre administration, comptabilité (décret 2005, plan comptable copro, 5 annexes), assemblées générales (convocation, PV, notification), appels de fonds, travaux, fournisseurs, recouvrement d'impayés et transition de syndic. Maîtrise les majorités…

romainsimon/paperasse · 194 tokens

template-instantiation

Creates .NET projects from templates with validated parameters, smart defaults, Central Package Management adaptation, and latest NuGet version resolution. USE FOR: creating new dotnet projects, scaffolding solutions with multiple projects, installing or uninstalling template packages, creating projects that respect…

managedcode/dotnet-skills · 168 tokens

note-improvement

Capture an out-of-scope improvement opportunity so it doesn't get lost. Use when the user asks to "note improvement", "save improvement", "track this for later", "remember this improvement", "note this idea", "log improvement", "backlog this", or "park this idea". Also invoke proactively when noticing something…

tobihagemann/turbo · 107 tokens

turborepo-monorepo

Provides comprehensive Turborepo monorepo management guidance for TypeScript/JavaScript projects. Use when creating Turborepo workspaces, configuring turbo.json tasks, setting up Next.js/NestJS apps, managing test pipelines (Vitest/Jest), configuring CI/CD, implementing remote caching, or optimizing build performance…

giuseppe-trisciuoglio/developer-kit · 76 tokens

handover-admin

Generate comprehensive admin documentation for AEM Edge Delivery Services project handover. Use when handing over admin responsibilities, onboarding a new site administrator, or documenting admin procedures — e.g., "admin guide", "admin documentation", "admin handover".

adobe/skills · 52 tokens

project-context-setup

Scaffolds per-repository agent context so coding agents share the same issue tracker rules, triage label vocabulary, domain glossary, ADR layout, and handoff conventions. Triggers on: "set up project context", "configure agent docs", "create CONTEXT.md", "setup agent workflow", "agent issue tracker setup", "triage…

Mathews-Tom/armory · 109 tokens