Implement missing textdomain argument sniff

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

メンテナーはふだん 1 日以内に返信

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

  • #1042 @ernilambar による — マージされずにクローズ

評価

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

調査の方向性

WordPress.WP.I18n.MissingArgDomain sniff と既存のテストから始め、次に重大度レベルの設定方法を確認します。この変更で重大度を 7 に引き上げるだけでよいのか、それとも文字列を WordPress core-string map と照合する必要もあるのかを判断します。意図したケースが正しい重大度で報告され、提案されている false positive が発生しなければ完了です。

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

説明

[Team] Plugins

The WordPress.WP.I18n.MissingArgDomain sniff currently flags when a translation function is missing the text domain argument. However, its current severity level means it might not receive appropriate attention from plugin developers.

Background
  • When the domain argument is missing in WordPress translation functions, the function will default to using core translations
  • This behavior works technically but is discouraged in plugin or theme
  • In 99.9% of cases, this occurs because plugin authors are unaware they need to specify their text domain, not because they intentionally want to use core translations
Proposal

Increase the severity level of this sniff from its current level to 7 (as a blocker in PCP).

Suggested improvement provided from Plugins Team meeting

Compare plugin strings with a map of WordPress core strings to reduce false positives when checking for missing text domains.

For example:

echo esc_html__( 'Submit' ): // WARNING: This string exists in WP core.
echo esc_html__( 'Example plugin specific string' ): // ERROR: This string is not in core.
主要言語
PHP
スター
365
フォーク
135
平均マージ
1日 8時間
マージ済み PR(30日)
20

環境構築

はじめの一歩

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

WordPress/plugin-check のほかの issue

WordPress/plugin-check の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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