WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.

Home Page:https://wordpress.org/plugins/plugin-check/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error `no_license` not triggered with missing readme file

ernilambar opened this issue · comments

When there is no readme file, "no_license" is not triggered even when there is no "License" header in plugin main file.

This is happening because license check is under Plugin_Readme_Check. May be we should separate license check for plugin header and readme file.

Check Plugin_Header_Fields_Check should be better place for License plugin header check.

Also same error code no_license is used for missing license in readme and plugin header which is confusing.

But, it getting the error for readme. I think that would be enough. After the user makes the readme, it will take the license problem. I think there is no problem with that. But do you think then is important to warn the license issue as well in one step then?

Although not accepted by the directory, PCP still supports single file plugin. So we should not assume that readme will be always be there.

@davidperezgar

For validating license in readme, we are using regex like this:

'/^([a-z0-9\-\+\.]+)(\sor\s([a-z0-9\-\+\.]+))*$/i'

But for license validation in plugin header, we are using like this:

'/GPL|GNU|MIT|FreeBSD|New BSD|BSD-3-Clause|BSD 3 Clause|OpenLDAP|Expat|Apache/im'

Any particular reason why these two are checked in different way?

No, there is no reason for that. And you can update with MPL 2.0 support #719 .

Fixed in #775