Home/ Journal Bens Projects Binary Moon Archives About Ben Gillbanks Subscribe to Binary Moon updates

Subscribe to Binary Moon website updates, it's free and easy to stay in touch

Search Binary Moon

Search Binary Moon

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?

2 Responses to “Building WPVote Part 5 : Programming” Leave a reply ›

  • why must be build theme as theme ben?, i`m sure this stuff will be more popular as pluggins

    • Hey William - The main reason is that there's a lot more to the theme than just the voting and other things that could . A lot of the functionality would require making changes to the theme files to integrate all the options so it makes sense (to me) to release it as a theme.

      Secondly, I have had a lot of people ask me for a theme, and so far nobody has requested a plugin. The people I have spoken to want to have something they can just upload and use, rather than have to set up themselves.

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

About me

About BenMy name is Ben Gillbanks. I'm a lover of Video Games, WordPress, Web Development and everything in between.

I have been working with the internet for over 10 years, and working with computers even longer. I am a hardcore Nintendo fanboy and have owned most of their consoles at one stage or another.

Read more about me on my about page


Random Link-outs

My Twitter Updates follow me

The Binary Network links to all my websites
bengillbanks.co.uk - Ben Gillbanks

Ben Gillbanks

All my websites under 1 roof, the easiest way to find out what I do

Pro Theme Design - premium WordPress themes

Pro Theme Design

Premium WordPress themes by web design pros (erm... that includes me)

Binary Joy - gaming news and reviews

Binary Joy

Gaming news and reviews

Binary Sun - play free online games

Binary Sun

Play and download free and paid games (many made by me)

Gaming Angel - download and play games online

Gaming Angel

Stacks of shareware games, free to try and cheap to buy