WPTT / theme-sniffer

Theme Sniffer plugin using sniffs.
MIT License
269 stars 3 forks source link

Readme.txt License Warning #178

Open BinaryMoon opened 5 years ago

BinaryMoon commented 5 years ago

Hi - when I use the theme sniffer I am seeing a license warning:

jarvis/readme.txt
WARNING No matching license critera could be determined from: GNU General Public License v2 or later!
WARNING Unable to determine License URI with an invalid License supplied in readme.txt!

As far as I know the license information is valid. You can see the actual readme.txt I am testing here: https://github.com/BinaryMoon/jarvis/blob/master/readme.txt

dingo-d commented 5 years ago

We're using: https://github.com/timelsass/wp-license-compatibility to check for the license compatibility. The theme sniffer will look at the License and License URI from the readme.txt and try to compare them with an item in this list.

So for GPL2 or later you'd put:

License: GPL-2.0+
License URI: https://www.gnu.org/licenses/license-list.html#GPLv2

It's because the package is using an SPDX license identifier to identify licenses, to have everything standardised.

Try changing the readme with what I provided and see if the same thing happens.

BinaryMoon commented 5 years ago

Thanks - that's helpful. Unfortunately it doesn't fix it. I now get the following error:

0   WARNING The license identification provided, $s, indicates a deprecated license! Please use a valid SPDX Identifier!
0   WARNING Unable to determine License URI with an invalid License supplied in readme.txt!

Is it possible to add a link to the allowed values in the error message to make it easier for people to understand/ fix?

djallet commented 5 years ago

According to the list provided, GPL-2.0+ IS deprecated. You should use GPL-2.0-or-later instead.

BinaryMoon commented 5 years ago

Thank you!

timelsass commented 4 years ago

We're using: https://github.com/timelsass/wp-license-compatibility to check for the license compatibility. The theme sniffer will look at the License and License URI from the readme.txt and try to compare them with an item in this list.

So for GPL2 or later you'd put:

License: GPL-2.0+
License URI: https://www.gnu.org/licenses/license-list.html#GPLv2

It's because the package is using an SPDX license identifier to identify licenses, to have everything standardised.

Try changing the readme with what I provided and see if the same thing happens.

I had started working on doing a scan to try to get some more information as to some common strings that themes might already be using. Didn't get very far on that and have been caught up in some other work lately. Hopefully I'll be able to work on the license compatibility definitions a bit more since I know there's a few "commonly used by themes" strings that do "identify" the license despite not being SPDX.

Thanks - that's helpful. Unfortunately it doesn't fix it. I now get the following error:

0 WARNING The license identification provided, $s, indicates a deprecated license! Please use a valid SPDX Identifier!
0 WARNING Unable to determine License URI with an invalid License supplied in readme.txt!

eek yeah - overlooked $s though, didn't get the placeholder for a printf/sprintf in there correctly, so it's still a good catch!

Is it possible to add a link to the allowed values in the error message to make it easier for people to understand/ fix?

Yeah, the deprecated check, doesn't have data associated with any sort of recommended identifier. I'd have to do some research on that, but I initially was wanting this also. Anytime we can tell someone what they should put that will make it easier for future iterations to even auto correct something like this if the they click a "fix" button or something of that nature.

dingo-d commented 4 years ago

Glad to have you back @timelsass 🙂

Kudratullah commented 3 years ago

If anyone still having this issue please take a look on the licenses.json and update your readme files accordingly.

You can use any of the licenses in your theme where isDeprecatedLicenseId is false & isGpl2Compatible or isGpl3Compatible is true