Building WPVote Part 5 : Programming

I’m nearly finished with the design of my new WordPress voting site, WPVote, so now need to look more closely at the programming.

I enjoy dissecting WordPress themes, and since I also like code simplicity and minimalism (and am working with a child theme) I decided to strip out as much of the original WPVote theme as possible.

First I had to go through the theme files and work out which were normal theme files (archives etc) and which had special stuff going on (the voting functionality). I could then drop any files that duplicated functionality in Elemental.

Next I joined what was left into functions in the child themes functions.php. I was left with half a dozen files making things a lot easier to manage.

JavaScript isn’t one of my strong points but I like to learn new skills so swapped all the dynamic/ ajax functionality over to jQuery (before it was custom coded). This included the Ajax code – which is something I have I have even less experience with.

The original theme used WordPress custom page templates for the login and registration screens but I wanted to use the fewest number of files possible to make things as easy to set up as I could.

The reasoning behind this is that if I end up turning this theme into a premium theme then anything I can remove from the setup process is one thing extra that I don’t have to support.

What I did instead was use lightboxes with ajax pop-up windows for both the login/ registration screens and the article submission screen.

For the lightbox (and tabs, and tooltips etc) I went for the jQuery Tools library, which I also use extensively here on Binary Moon. It’s a really complete jQuery add-on and covers all the things I need for the average website. I’d recommend it.

The article submission page on the old WPVote site used the TDO mini forms plugin. It’s a cool system but, again, this would mean something else for people to set up, and supporting someone elses code is not something I want to do.

Luckily I was once working on a theme and plugin that were not released – it was a plugin version of the post submission element of the Prologue theme (now known as P2). So, I spent about an hour modifying that to fit the new WPVote theme. The big advantage of doing things myself is that I know how things work and am not relying on other developers.

Because so many elements of WPVote are publicly accessible security is a big aspect of the development and I am now looking at ways to harden up the data entry and make sure bots can’t be set to hack/ spam the site.

WordPress has a lot of security related functionality built-in, there’s a page on validating data input on the WordPress Codex which I have found really handy. I also intend to use Nonces to prevent unauthorised article submissions, along with CAPTCHA (which Elemental supports natively), and I am considering support for Akismet to stop spam entries in their tracks.

Additional functionality I will be adding are some new WordPress Widgets, to make the site customisation easier, and some new Dashboard Widgets for logged in users.

Next I will be looking at making the transition to a live site. Is there anything else I should consider adding/ developing that I might not have thought of?

How was it for you? Let me know on BlueSky or Mastodon

(Please) Link to this page

Thanks for reading. I'd really appreciate it if you'd link to this page if you mention it in your newsletter or on your blog.

Related Posts

29 Jan 2010

Building WPVote Part 7: Almost Done

Building WPVote has been a really interesting process for me. I have learnt stacks of new things, and through developing WPVote have added a stack of improvements to my WordPress Elemental.From start to finish I have: Building WPVote Part 1:...
01 Apr 2015

The State of WordPress Themes #wcldn

I recently spoke on a panel at WordCamp London 2015e. Lance – who used to be the Theme Team lead at WordPress.com – asked me if I wanted to speak on a panel with him at WordCamp London 2015. I’ve...
27 May 2013

WordPress: 10 Years Young, What Does The Future Hold?

WordPress is now 10 years old. I started using wordpress 9 years ago – which means I joined the WordPress community early on. The reason I chose WordPress is simply because of the fabled 5 minute install process – I...
13 May 2010

6 Tips to Build Better WordPress Themes

If you want to make WordPress themes, for clients, to release for free or to sell, then there are a lot of factors you need to take into consideration. Below are some hints and tips that should help ease your...
30 Dec 2009

Building WPVote Part 3 : Research

After receiving the WPVote domain and theme from Jean I moved on to stage 3. Researching ‘competitors‘ websites.I must admit I tend not to do too much research when building a website, but this time I did decide to do...
07 Jan 2010

Building WPVote Part 4 : Design

Once I had finished researching similar voting sites I was ready to start designing and building the WPVote theme.To decide basic page structure I went with Balsamiq mockups and knocked out some quick reference designs. I had a firm idea...