WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
195 stars 39 forks source link

Check: GPL Compatible license declared #436

Closed davidperezgar closed 6 days ago

davidperezgar commented 3 months ago

The plugins must be GPL compatible, so we have to warn to developers to fix this issue.

It has to be declared in readme and plugin. And we have to check if they are the same in both files.

This is the text that we are using to warn users.

## No GPL-compatible license declared

It is necessary to declare the license of this plugin. You can do this using the fields available both in the plugin readme and in the plugin headers.

Remember that all code, data, and images — anything stored in the plugin directory hosted on WordPress.org — must comply with the GPL or a GPL-Compatible license. Included third-party libraries, code, images, or otherwise, must be also compatible

For a specific list of compatible licenses, [please read the GPL-Compatible license list on gnu.org](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses).

The license declared on this plugin is either no present or it's not GPL compatible:

ERROR: License declaration not found on tiqq-shop.php
Please check the header requirements in order to correctly declare the license of the plugin: https://developer.wordpress.org/plugins/plugin-basics/header-requirements/
It is necessary to configure the "License: " field in the plugin header with a valid, GPL-compliant license name.
swissspidy commented 3 months ago

The current license check is a bit limited:

Should be trivial to add an allowlist of compatible licenses and then check for those in both files (and ensure both files use the same one, of course)

davidperezgar commented 2 months ago

Assign me this issue, I'll start to do it.

davidperezgar commented 2 months ago

Hey, What would be the best approach for this issue? What I'm thinking is creating a new file check Checks/Plugin_License_Check.php and that file could process Readme License check and Plugin Header Check and compare both of them.

davidperezgar commented 2 months ago

Done in the #454