UPDATE: PLEASE READ THIS POST
So to get things started I have created a new plugin template which to start with doesn’t include much except the base files and information needed for WordPress to identify it as a plug in.
In the “wp-content/plugins” folder I create a new folder called “pux-woocommerce-gift-cards”. The naming convention I am going to follow is “[uniqueID]-[system]-[pluginname]”.
- [uniqueID] is something specific to me (hopefully) and will be used to prefix all of my files, folders, functions and variables. This ensures a greater chance that it will not clash with other plugins.
- [system] will simply be a reference to the plugin I am extended. I will expect this to be optional as we could in theory create a plugin for wordpress itself, but as this plugin will extend the WooCommerce plugin it may be useful to make some identifying link.
- [pluginname] is simply a name for my plugin. In this case it will be “giftcards”.
The first file to include in this folder will be one named “pux-woocommerce-giftcards.php”. Within this file we will need to include the following at the top of the file.
<?php /* Plugin Name: WooCommerce Gift Cards Plugin URI: http://www.pu43x.co.uk/ Description: Extends WooCommerce to allow customer to purchase gift cards that can be used to purchase product in part or full payment. Version: 0.0.1 Author: Gareth Davies Author URI: http://www.pu43x.co.uk License: GPL2 */ ?>
Once this file is saved it will become visible in the Plugins page in the WordPress admin screens and be available for activation.