Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add check for register_uninstall_hook

オープン
#716 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
php
領域
tooling

調査の方向性

まず、関数呼び出しを検出するための既存の PHP_CodeSniffer の sniffs とテストを見つけ、次にこの issue の register_uninstall_hook の例をエントリーポイントとして使用します。register_uninstall_hook の呼び出しがエラーとして報告され、issue 内で誤検知のケースが特定されていなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

Standard: VIP-Go Type: Enhancement

What problem would the enhancement address for VIP?

Because the contents of /wp-content/plugins and /wp-content/themes are setup as read-only directories on the VIP Go platform, admin users cannot uninstall plugins from within the wp-admin. This results in the function register_uninstall_hook never being able to run.

A VIP customer can deactivate a plugin through the admin, but uninstallation can only be done by removing the plugin from the GitHub repo and deploying the changes. If a customer needs to run any clean-up steps associated with a plugin or theme's use of register_uninstall_hook, their development team has to reverse engineer the code to execute any functionality that needs to run.

This is not entirely unique to VIP, but only impacts WordPress environments where the /wp-content/plugins and /wp-content/themes are read-only, so it may not be a good fit for the WordPress Coding Standards.

Describe the solution you'd like

A sniff that will flag places where the register_uninstall_hook function is used. Preferably as an error because it is functionality that will not work.

What code should be reported as a violation?

register_uninstall_hook( __FILE__, 'your_prefix_uninstall' );

What code should not be reported as a violation?

I'm unaware of cases where this might be detected as a false positive.

Additional context

None applicable

主要言語
PHP
スター
261
フォーク
44
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Automattic/VIP-Coding-Standards のほかの issue

Automattic/VIP-Coding-Standards の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。