I recommend creating a fork of this project, and globally replacing (AspieSoft, aspieSoft, aspiesoft) with your github name (keep caps consistent).
You can run a search and replace for variables such as X_AUTHOR_NAME_X
, X_PLUGIN_NAME_X
, X_AUTHOR_SLUG_X
, etc.
The First wp-plugin/ directory is where the entire wordpress plugin lives. You can use the outside of this directory for other things unrelated to wordpress.
The Second wp-plugin/ directory is the actual plugin that gets submitted to wordpress.
Note: The Below Description Has Not Been Updated Yet. You Can Now Use A Linux Bash Script To Generate The Plugin. The Windows Version Has Not Been Created Yet. To start using the bash script, just open a terminal in the folder and run ./run.sh I Recommend running the Delete Plugin Option to remove the template plugin, then go through the steps to build your own. The directory structure in 2.0 is still consistant to the info below.
Your wordpress plugin code lives inside the wp-plugin/trunk/ directory. The cdn/ directory is in case you wanted to add a CDN that doesn't require wordpress, and does something similar. The wp-plugin/ directory is what gets uploaded to svn.
Some of the plugin files do not need to be touched.
index.php can be ignored. It's just the
silence is golden
comment, and also contains a redirect script to/404
to help hide the plugins existence from hackers.
readme.txt is your wordpress readme, and you can change it however you want.
I recommend changing the donation link to your own, unless you want people paying me for your plugin :)
plugin-name.php (default:
aspiesoft-plugin-template.php
) if the main file that runs, and should be named after the plugin.You do not need to touch this file, just rename it to the proper plugin name.
functions.php contains some basic functions that may be useful.
This file should remain consistent for multiple plugins, and for any changes, you should also globally change the version number at the end for that plugin.
This file gets loaded once, and is shared between all your plugins. This can help with performance, because only one plugin will load this file if the class isn't already loaded, and every other plugin will use that class thats already been loaded, rather than reloading it's duplicate.
templates/ is just a directory containing admin.php which is the settings template.
You do not need to touch this directory. admin.php does some complex stuff, and pulls from another php file I will mention later.
assets/ is a directory you do not need to touch.
It contains assets that this plugin template uses.
main.php is the main plugin file, and runs on every non admin page.
You can do anything here, as long as you keep the class name consistent.
The init function is the first function to run, is used to pass the plugin data and set up everything.
The start function, is where you start running your plugin scripts
If your plugin doesn't use this file, you can safely delete it.
admin.php is the admin plugin file, and runs on every admin page.
You can do anything here, as long as you keep the class name consistent.
This file has the same init and start functions as main.php
If your plugin doesn't use this file, you can safely delete it.
settings.php is where you modify the plugins admin settings.
This page is used by a more advanced system, that allows your plugin settings to be saved with ajax requests, and automatically adds multi site support.
I recommend keeping the current options as they are, apart from the "altShortcode" example option.
The
jsdelivr
option is read by the plugin templates core system, and is used to automatically pull assets from jsdelivr.net to load them from github if the user chooses to do so for performance.The global settings are shared by multiple plugins, and you can add options there as well.
If your plugin doesn't need a settings page, you can safely delete this file, and the settings page will automatically be removed
src/assets directory is dynamic, and any
.js
or.css
files will automatically be loaded.These files will also have automatic support for the
jsdelivr
option users are given.assets/0settings.php can be used to load any inline scripts or styles.
This is useful if you need to pass any options to the client side.
You can uncomment the function, and it will automatically be detected.
Plugin Description
<script src="https://cdn.jsdelivr.net/gh/AspieSoft/[email protected]/cdn/plugin-template.js"></script>
- Upload plugin to the /wp-content/plugins
- Activate the plugin through the "Plugins" menu in WordPress
- Enjoy
[plugin-template
attr="value example or description"
]
<param attr="value example or description"></param>
Answer 1.
Answer 2.