Build user appreciation links into your plugin

The other day I posted about showing plugin developers appreciation and how it’s actually really easy to do. The problem, as was pointed out to me, is that writing reviews, donations, etc. are all only accessible from the plugin page on the repo and there’s no quick way to get there from the WordPress dashboard. All is not lost, however! It is possible to add custom links to the plugin list table alongside the default links that point to the author’s website and the plugin details page.

Setting up my WordPress development environment

Plenty of posts have been written about setting up a local development environment for WordPress, but when I moved to a new Macbook (running OS X Yosemite) I couldn’t find a post that contained all the instructions I needed. After some searching I got everything up and running and thought it would be worthwhile to share my process and tools here for posterity.

WordPress: Add plugin settings link to Plugins page

When building a plugin that has its own settings page, it’s often handy to create a link to the settings page straight from the Plugins list – this saves users the time it takes to find where exactly your plugin appears in the admin menu. Here is a simple code snippet that creates the settings link for you – all you need to do is tell it where to go.

WordPress POST data and the 404 errors: The mystery of the restricted query variables

I recently had a problem with a form submitted in WordPress returning a 404 error everytime even though it was submitting to an entirely valid URL. The form submission was managed via AJAX using jQuery.post(), so at first I assumed it was a Javascript problem – after a bit of testing, however, I discovered it was happening even if I submitted the form via PHP. In the end it turned out that the problem had nothing to do with Javascript, PHP or the server configuration, but was actually due to a restriction built into WordPress that isn’t immediately apparent.

Loop through each character in a string in PHP

The other day I was working on a project that required me to extract a numeric ID from the current page’s URL. The problem was that the ID could either be at the end of the URL string or in the middle, depending if there were any parameters added on or not. Here is how I worked around the problem by looping through each character of the string.