WordPress is based on the script language PHP, which is why its plugins are essentially nothing more than PHP scripts. A simple extension can consist of a single PHP file with just a few lines of code, provided that this script adheres to its corresponding license. WordPress is subject the GNU General Public License (GPL), so make sure to select a license that complies with these rules, such as GPLv2. In order to unify plugin codes, coding standards have been created to serve as programming guidelines, which comes in handy for those who wish to publish their plugins. To develop your own WordPress plugin, proceed as follows:
1. First, a PHP file needs to be created. Any word processing program can be used for this step (but when working with lines of code, it’s best to use a special program, like Notepad++). When saving the file, just select ‘All files’ and add the ending ‘.php’. For example, my.plugin.php. Copy and paste this file into the WordPress plugin directory—generally the file path, /wp-content/plugins/ is used here. For better structuring, especially with scripts that are composed of more than one file, it’s recommended to create a directory for your plugin: /wp-content/plugins/my-plugin.
2. In the file, you can add the following general information to your plugin: