記事INDEX
Introducing Optrion — See Who Reads Your wp_options, Then Clean Up Safely
Every WordPress plugin and theme you’ve ever installed has probably left rows in your wp_options table. Deactivating or deleting the plugin doesn’t
remove them — they just sit there, and many ride along with autoload = yes, quietly inflating every single page load. WordPress gives you no
built-in way to tell which rows are still being used, which plugin or theme created them, or whether any given row is safe to delete.
Optrion is a free, GPL-licensed WordPress plugin that fixes exactly that problem.
Observe, judge, quarantine, delete
Optrion is built around a four-stage workflow designed so you never have to guess:
- Observe — Optrion dynamically registers an
option_{$name}filter for every row inwp_options. Every timeget_option()fires, it walks
the live PHP backtrace, identifies the calling plugin or theme, and records alast_read_attimestamp. No guesswork, no prefix-only heuristics — the
real caller on the stack. - Judge — The admin dashboard surfaces the raw signals as individual sortable columns: accessor (with an inactive badge when the owning
plugin/theme is gone), autoload flag, size, and last-read timestamp. You make the call; Optrion doesn’t hide it behind an opaque score. - Quarantine — Not sure yet? Optrion renames the row (
wpseo_titles→_optrion_q__wpseo_titles) and installs apre_option_{name}filter
that transparently returns the stored value. Your site keeps working exactly as before. Any access during the window is logged; if the option is
being used, the UI flags it “in use — restore” and auto-expiry is paused. - Delete — Only after the quarantine window passes with no access does the permanent Delete button unlock.
Performance, carefully
Tracking only activates for 10 minutes after an admin visits the dashboard — not on front-end traffic, not always-on. Reads are buffered in memory
and flushed as a single upsert at shutdown. The admin UI displays a persistent reminder to deactivate Optrion once your cleanup round is finished;
the plugin is a tool, not a dependency.
Try it in your browser, right now
Optrion ships with a WordPress Playground blueprint. Click here and a full WordPress
instance boots in your browser with Optrion pre-installed and a demo plugin already active so you have rows to inspect. No server, no commitment.
Source, issues, releases: github.com/mt8/optrion.
Optrion のご紹介 — wp_options を「誰が使っているか」で見える化し、安全に掃除する
WordPress のサイトを長く運用していると、いつの間にか wp_options
テーブルが肥大化していきます。プラグインやテーマは設定値をこのテーブルに書き込みますが、停止・削除してもレコードは残り続け、しかもその多くはautoload = yes としてすべてのページ読み込みに同乗します。標準の WordPress
には、「どの行がまだ使われているのか」「どのプラグインやテーマが作ったのか」「消して安全か」を判断する手段がありません。
Optrion は、まさにこの問題を解決するための GPL ライセンスの WordPress プラグインです。
観察 → 判断 → 隔離 → 削除
Optrion は、推測に頼らずにクリーンアップできるよう、4段階のワークフローを軸に設計されています。
- 観察(Observe) —
wp_optionsのすべての行に対してoption_{$name}フィルターを動的に登録します。get_option()が呼ばれるたびに PHPのバックトレースを辿り、使用元のプラグインやテーマを特定し、last_read_atを記録します。プレフィックスによる推測ではなく、スタック上の実際の呼び出し元を捉えます。 - 判断(Judge) — 管理画面は、アクセサ(使っている主体。無効化されていればバッジを表示)、autoload、サイズ、最終アクセス時刻を、独立したソート可能な列としてそのまま表示します。不透明な「スコア」に丸め込まず、判断はあなたが行います。
- 隔離(Quarantine) — まだ削除する決心がつかない? Optrion は対象行を
_optrion_q__プレフィックス付きにリネームし、元の名前に対するpre_option_{name}フィルターで保管された値を透過的に返します。隔離した瞬間にサイトが壊れることはありません。
観察期間中にアクセスがあれば記録し、UI に「使用中 — 復元してください」のバッジを出して自動失効を停止します。 - 削除(Delete) — 隔離期間中に一度もアクセスされなかった場合にのみ、恒久削除ボタンが有効になります。
パフォーマンスへの配慮
トラッキングは、管理者がダッシュボードを開いた時点から 10分間だけ自動的に有効になります。
フロントエンドでは動作せず、常時稼働もしません。
読み取りはメモリにバッファリングされ、shutdown 時に 1 回の upsertでまとめて書き込まれます。
管理画面には「掃除が終わったら Optrion を停止してください」と常時表示されており、常駐するタイプのプラグインではありません。
ブラウザで試せます
Optrion には WordPress Playground 用のブループリントが同梱されています。
こちらをクリックすると、Optrion と確認用プラグインがインストール済みのWordPress がブラウザ内で起動します。
サーバー不要、インストール不要で、すぐに挙動を確認できます。
ソースコード・Issue・リリース: github.com/mt8/optrion










