Do Wordpress Plugins Have to be GPL?

No! You do not need to publish your Wordpress Plugins under the GPL license.

410 views
d

By. Jacob

Edited: 2021-01-04 19:12

Wordpress is a very popular platform, so naturally developers would also like to make some of their software work with Wordpress to reach a broader audience.

For me personally, I love open source, so I got no problem with having to release my code as open source. I just do not like the GPL license, which I think is a bit too restrictive as to what developers are allowed to do with my code.

I do not mind someone taking my code, improving it, and selling it as their own software. If I use the GPL license, people will have to also release their modified version as open source under the GPL; for this reason, the GPL license is not a good fit for my work.

The good news is that we do not have to use the GPL license; we can use a compatible license, such as Apache 2.0 or MIT.

Quote:

- Your plugin must be compatible with the GNU General Public License v2, or any later version. We strongly recommend using the same license as WordPress — “GPLv2 or later.”

Keeping your Plugins Private

It is also important to note that you do not have to publish your plugins in the official Wordpress Plugin Browser; you can also keep them private and install them manually on your clients websites.

I have created several plugins that must be installed manually. The disadvantage of this approach is that it will be more difficult to update plugins — at least unless you create your own update system.

Plugins can often be installed simply by moving the plugin-directory to the wp-content/plugins/ directory; you should then be able to enable them from the Wordpress controlpanel.

This option is also best if you do not wish to release the source code completely. Of course, since we are working with web technologies, the client will usually have access to our source code — or parts of it — but that is not really a big concern to me.

What license should you use?

I can not tell you what license you should use for your project. But, I will tell you what goes into my own considerations.

One of the things that I do not like about the GPL is that you must release the source code if you modified the software. I can think of a couple of reasons why someone might not want to do this, here is a few:

  1. It might be too much work.
  2. They might want to keep the source code secret to protect their own inventions.

One thing I dislike about the Apache 2.0 license is the requirement to add modification notices to files that we modify. This is just an unnecessary burden to developers, and it just takes up space in the source. I do not really see how this should be beneficial considering we now got places like Github — but the GPL also has the same requirement.

This only really matters if you redistribute the code. The Apache License not require the release of source code, and you can even sell modified copies of the software as your own.

You can always change the license at a later time, if all of your team members agree on the change.

Links

  1. Developer Information - Wordpress.org
  2. Apache 2.0 License - apache.org
  3. MIT License - opensource.org

Tell us what you think:

  1. How to insert code right after body opening tag, and creating a wrapper around the code in a page using PHP output buffering and the Wordpress shutdown hook.
  2. How to properly remove the title from a Wordpress post, and how to do it for specific post types.
  3. There is no function to select a post by slug name (post name), but we can create our own function to do it; find out how in this tutorial.
  4. How to properly customize Wordpress based website, where to add your own code, and how to override existing functionality.
  5. How to manually move a Wordpress website to another domain name, and copy the database and the files from the old site.

More in: WordPress Tutorials