Choosing license

Docs

Composer
composer.json schema: “license” field,
also PHPStorm supports autocompletion for this field.

Github
guide about licensing
https://choosealicense.com/

Non-WordPress projects

Most of projects:

  • place LICENSE file in a repo root
  • mention the license in license field of composer.json (laravel doesn’t, only mentions in README.md)

Sample repos: symfony, var-dumper, doctrine, laravel.

WordPress

Most of plugins and WP Core itself use GPL v2 +

  • license.txt (wp-core)
  • LICENSE
  • license text is placed in the header of a entry PHP-file of a plugin

Sample repos: Query Monitor, Yoast SEO, WP Core