This week we’ll be talking about the license your plugin will be under. Although this is a rather dull topic, I believe that it is important for plugin authors to be aware of this information. Let’s begin with a bit of background information.
WordPress is open-source software licensed under the GNU General Public License version 2 or later (GPL). What this means is that all code within WordPress falls under the GPL’s terms. Basically, you are free to distribute, edit and distribute modified versions of WordPress as long as the license stays the same.
Of course, the GPL is much more complicated than that. Although there is much debate on this, technically when you write a plugin for WordPress, the plugin must be released under the GPL or a GPL-compatiable license. Let’s take a look at this GPL FAQ answer:
It depends on how the program invokes its plug-ins. If the program uses fork and exec to invoke plug-ins, then the plug-ins are separate programs, so the license for the main program makes no requirements for them.
If the program dynamically links plug-ins, and they make function calls to each other and share data structures, we believe they form a single program, which must be treated as an extension of both the main program and the plug-ins. This means the plug-ins must be released under the GPL or a GPL-compatible free software license, and that the terms of the GPL must be followed when those plug-ins are distributed.
If the program dynamically links plug-ins, but the communication between them is limited to invoking the â€˜mainâ€™ function of the plug-in with some options and waiting for it to return, that is a borderline case.
Since WordPress’ Plugin API does, in fact, dynamically link plugins (they do make function calls to each other), WordPress and plugins form a single program. Which, according to the GPL, the plugin must be release under a GPL (or compatiable) license.
This may bother some people who may want to sell their program. The GNU General Public License does allow you to sell GPLed code, but it also allows people to freely distribute it once they’ve got their hands on it. Which can negatively affect your revenue, if someone is distributing your plugin for free, while you’re trying to sell it.
In conclusion, if you plan on developing plugins for WordPress, I would recommend reading through the GNU General Public License.
A full list of other licenses compatible with the GPL is available here.