BSD-2-Clause and BSD-3-Clause licenses are incorrectly flagged as not GPL-compatible
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
Start in includes/Traits/License_Utils.php, comparing get_normalized_license() (which strips hyphens) with the patterns in is_license_gpl_compatible(), which expect the hyphenated form. Check how Plugin_Header_Fields_Check and Plugin_Readme_Check call them, and extend the existing License_Utils_Tests to cover normalized BSD-2-Clause and BSD-3-Clause input. Done when both licenses pass after normalization. Pull request #1538 is already open against this issue, so review it before starting.
索引モデルが issue の本文から書いたものです。
説明
Plugin Check reports BSD-2-Clause and BSD-3-Clause licenses as not GPL-compatible, even though both are GPL-compatible.
Both licenses should pass the check, just like MIT, Apache-2.0, MPL-2.0, and GPL-2.0-or-later.
The issue is in includes/Traits/License_Utils.php, where license normalization and validation do not use the same format.
get_normalized_license()removes hyphens. For example,BSD-3-ClausebecomesBSD3Clause.is_license_gpl_compatible()acceptsBSD-3-ClauseandBSD 3 Clause, but does not recognizeBSD3Clause.- The validation patterns also do not include
BSD-2-Clause.
Both Plugin_Header_Fields_Check and Plugin_Readme_Check normalize the license before they check compatibility. This causes both checks to report the same error.
The existing License_Utils_Tests test uses BSD-3-Clause directly without normalization. Because of this, the test passes but does not catch the issue.
Step-by-step reproduction instructions
- Create a plugin and add
License: BSD-3-Clauseto the plugin header. - Add
License: BSD-3-Clausetoreadme.txt. - Run:
wp plugin check <plugin-slug> - Check the license validation result.
Expected result: Plugin Check accepts both BSD-2-Clause and BSD-3-Clause as GPL-compatible licenses.
Actual result: The compatibility check returns false for both licenses after normalization.
Code snippet
$normalized = $this->get_normalized_license( 'BSD-3-Clause' );
// Returns: BSD3Clause
$this->is_license_gpl_compatible( $normalized );
// Returns: false (expected true)
Environment info
- Plugin Check version: 2.2.0
- Branch: trunk
- 主要言語
- PHP
- スター
- 365
- フォーク
- 135
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WordPress/plugin-check のほかの issue
-
False positive trademarked_term warning for "wc" inside the word "Flowchart"対応中かも @anandrajaram21 が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
WordPress/plugin-check#1556 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add opt-in .distignore exclusions for local and CI scans対応中かも @jakaria-istauk が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
WordPress/plugin-check#1559 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
WordPress/plugin-check#1557 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
WordPress/plugin-check#1555 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
PHPErrorReportingSniff flags debug constants used as values in const declarations対応中かも @elphizu が 7 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 35/100
WordPress/plugin-check#1553 ·
メンテナーはふだん 1 日以内に返信
WordPress/plugin-check の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ExpressionEngine/ExpressionEngine#5493 ·
メンテナーはふだん 5 日以内に返信
-
"Attempt to read property 'username' on null" error after a user is deleted対応中かも @dicksonlaw583 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
omeka/plugin-SimplePages#49 ·
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
quantum-php/project#222 ·
-
support
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信