Testing WordPress Plugins

Testing your code is essential – especially if you are going to publish it somewhere like the WordPress Plugin Directory. It takes no time at all for someone to find it and politely (or not so politely) point out it’s flaws.

So how do you go about testing a plugin within a WordPress installation? Easy, install WordPress locally, copy it into the plugins folder and of you go.

Hang on, what if you want to test it in another version of WordPress? Install that version and copy the plugin into that one too. How do you now merge changes between the two versions of the plugin?

Use WinMerge, or even better, subversion or GIT .. oh but my version control files are neatly organised somewhere else…

You get the picture.

The solution is to use symbolic links. A single working copy of the plugin is used and symbolic links to it are created from the plugin directory of each WordPress install you want to test it in. The only limitation is that the files need to be on the same computer.

I use a local Debian web server for development, so the first step is get into the terminal and go to the directory where I want to create the symbolic link:

cd /var/www/wp/4.5.3/wp-content/plugins

Then use the ln command to create the link to the location of the plugin files:

ln -s /var/www/wordpress-svn/dmg-text-widget/tags/1.0/ dmg-text-widget

The final part of the above command is the name of the link, which is the plugin folder name ‘dmg-text-widget’ in this case.

Then do the same in any other versions of WordPress that you need to test in, e.g:




You can also create symbolic links on a Windows host – see this article on How to Geek for more info – but I haven’t tested it on Windows.


Version 1.0 of DMG Text Widget released

Finally got around to publishing Widgets that I’ve been using for a while on the WordPress plugin repository.

DMG Text Widget is a simple widget that replaces the standard text widget with one that includes options to apply a CSS class, add paragraphs, apply shortcodes and hide the title.

More information on the DMG Text Widget page.

FontAwsome Bulleted Lists

As I’ve mentioned before, I like to the use Font Awesome icon set because it’s so awesome.

This CSS snippet allows you to use Font Awesome icons as bullets in lists by applying a class to the list wrapper, e.g. <ul class="list-fa-check">

The class is simply list- plus the CSS class name of the Font Awesome icon.

See the Pen Font Awsome icons as bullets by Dan (@dgifford) on CodePen.0

Most of the icons which I think you’d want to use as bullets are there, including the check mark, chevron, caret, plus etc.