Repository navigation
Add support for 0BSD and SPDX BSD-2/3-Clause licenses - #1571
Merged
Merged
Conversation
Normalize Zero-Clause BSD variants to 0BSD and accept it as GPL compatible. Also match BSD-2-Clause and BSD-3-Clause after normalization strips dashes, which previously caused false plugin_header_invalid_license errors. Fixes #1570 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
marceltannich
approved these changes
Dec 4, 2026
marceltannich
left a comment
Member
There was a problem hiding this comment.
Tested manually on a local site: 0BSD, BSD-3-Clause, BSD-2-Clause and Zero-Clause BSD all errored before and pass now; BSD-4-Clause is still rejected.
ernilambar
approved these changes
Dec 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Closes #1570
Adds support for the Zero-Clause BSD (
0BSD) license and fixes matching of the SPDX identifiersBSD-2-ClauseandBSD-3-Clausein the plugin header license check.Why?
Plugins licensed under
0BSD(a permissive, public-domain-equivalent, GPL-compatible license) get a falseplugin_header_invalid_licenseerror.While testing, I also found that
BSD-3-ClauseandBSD-2-Clausefail end to end:get_normalized_license()strips dashes (BSD-3-ClausebecomesBSD3Clause), andis_license_gpl_compatible()only matched the dashed form, so the plugin header check rejected them too.How?
get_normalized_license(): normalize Zero-Clause BSD variants (Zero-Clause BSD,BSD Zero Clause License,BSD-0-Clause,0-clause BSD) to0BSD.is_license_gpl_compatible(): accept0BSD, and replace theBSD-3-Clause|BSD 3 Clausepatterns withBSD[\s\-]*[23][\s\-]*Clause, so the dashed, spaced and normalized forms of BSD-2-Clause and BSD-3-Clause all match.BSD-4-Clauseis still rejected (it is not GPL compatible).License_Utils_Tests, including a negative case forBSD4Clause.Testing Instructions
License: 0BSDin the main file header.wp plugin check <slug> --checks=plugin_header_fields).plugin_header_invalid_licenseerror. After: no license error.License: BSD-3-Clause,License: BSD-2-ClauseandLicense: Zero-Clause BSD; none should error.License: BSD-4-Clauseshould still return the error.npm run test-php -- --filter License_Utils_Tests.AI Usage Disclosure
If AI tools were used, please describe how they were used:
Used Claude Code to find the cause, write the fix and tests, and draft this description. I reviewed the changes.