BSD-2-Clause and BSD-3-Clause licenses are incorrectly flagged as not GPL-compatible
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 22/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- PHP
- Estrellas
- 365
- Forks
- 135
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 20
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de WordPress/plugin-check
-
False positive trademarked_term warning for "wc" inside the word "Flowchart"Posiblemente ocupada @anandrajaram21 la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
WordPress/plugin-check#1556 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Add opt-in .distignore exclusions for local and CI scansPosiblemente ocupada @jakaria-istauk la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
WordPress/plugin-check#1559 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
WordPress/plugin-check#1557 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
WordPress/plugin-check#1555 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
PHPErrorReportingSniff flags debug constants used as values in const declarationsPosiblemente ocupada @elphizu la tomó hace 7 días. Abierto
Dificultad 3/5 Medio día Aptitud para principiantes 35/100
WordPress/plugin-check#1553 ·
Los mantenedores suelen responder en 1 día
Todos los issues de WordPress/plugin-check
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
ExpressionEngine/ExpressionEngine#5493 ·
Los mantenedores suelen responder en 5 días
-
"Attempt to read property 'username' on null" error after a user is deletedPosiblemente ocupada @dicksonlaw583 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
omeka/plugin-SimplePages#49 ·
-
Bug Status: Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
quantum-php/project#222 ·
-
support
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día