← Back to blog
WordPress Plugin

Custom WordPress Plugin Design

Custom WordPress Plugin Design

We have a new project launching in about 6 weeks so we can not show you anything just yet as we are still in the middle of the data entry stage for the client once this is done the layout of the site may even change depending on how the data is formatted across the site, we have the basics down but until we have all of the data inputted the final layout design of the site has not been finalised.

We had a little challenge with this one and it came in the form of keeping a specific dataset current as it is public interest information, we started by manually entering the data in the form of Scores on The Doors ratings, you have all seen the green logo on food premises advertising their scores on the doors award. Our problem was that this data needed to be current so the manual process we initially set out was not going to do the job required.

The Food Standards Agency FSA have an API which can be tapped into to retrieve the Scores on The Doors data we needed and in our research we found a simple WordPress plugin which done the basic job of retrieving the recursive data we needed but it was not accurate, it retrieved the data based on the pub name alone which caused the wrong data to be displayed.

So we got about modifying the plugin to our needs, our first attempt was to retrieve the data based on the business’s establishment ID which did not work properly as from what we can tell the different authorities submit data to the FSA database and some establishment ID seem to be replicated so we had another bash and ended up doubling down on the data request to make sure we got the correct information, the first point on query was the establishment name and the second was the establishment’s full address. Some addresses can have two registered food businesses so we needed two points of query.

Overall all the plugins worked and we tested it on 100 different establishments in Swindon with no errors, that was until we read through the full API documentation and these live requests we were doing may get rate limited with the number of expected visitors this website will be getting so back to the drawing board we went.

Version No.3 of the plugin is a more intricate monster which stores all of the data retrieved from page requests into a database so when a page loads the information is retrieved from our database instead of using the API, so that’s all great but this is not live data, so we settled on a schedule of every 7 days at 5 am a script what we call a Cron Job will update any entry in the database with the latest information using the API.

That last step sounds easy but was the hardest part to implement and took twice as long as the previous two versions combined in programming time but it was all worth it in the end as we now have a plugin which any website using WordPress can take advantage of.

As a proof of concept we have installed this plugin on two live websites which you can go view right now as both of these websites already display their Scores on The Doors data, just scroll down to the footer of either of these websites www.TheSuninn.info or www.ThePlough.info

Using the shortcodes we found that the first option works probably 80% of the time, and the second 85% of the time as some of the pub names also include their area which is not always in the title of a blog post for our user case and the third option produces a 100% accurate result.

If you are looking for a custom WordPress Plugin then why not contact us and we can talk about your needs?

More articles