Diving into Wordpress
Yes, I know the title is a little cheesy, but it does introduce some of the recent projects we have been working on.
One of the things that is often requested is a means for businesses to update their own content and this generally requires some kind of content management system. For previous larger projects like underwater.com.au, the requirements have been specific enough to require a custom system to be developed. For smaller projects, however, a custom solution is often overkill. In this article I’m going to run through some of the thoughts that went into developing a couple of sites using Wordpress.
Yongala Dive
Yongala Dive is a small dive resort based in the Great Barrier Reef Marine Park which primarily runs trips to the famous S.S. Yongala Wreck.
Their previous static site was difficult to update and maintain and was also in need of search engine optimisation. We started by looking at their statistics to get an indication of how the site was being used and from that came up with the following overview:
- First users looked for information about the S.S. Yongala wreck.
- Then they wanted to know about the people providing the service.
- Then about the service they provide.
- Then they looked at images in the gallery.
- At this point they seemed ready to contact them.
These were some of the findings that were used in the development of the site and influenced decisions, such as, what order pages appeared in the site navigation.
I initially started looking at using a pared down version of our own content management system but decided that in this case it would have been the wrong choice. Instead, the advantages of using a solution like Wordpress include:
- You can spend more time solving business problems than on the inevitable tweaking of your in-house engine.
- It is free, used all over the place, many hosts actually have it as a package.
- It is well documented.
- Finding someone in the future to develop for it will be many times easier than finding someone to develop for an in-house custom solution.
- You will be able to take advantage of the many available plugins like gallery, calendar, weather, etc. Plus, of course, you can also build plugins.
Bear in mind that many of the above benefits apply not only to your involvement in the project, but also in the case of you no longer working on the site. If, for example, your client employs an in-house developer it will be to your benefit to have allowed for that.
Wordpress Plugins Used
- Lazy-K Gallery (although it is a little too simple and we’ll move to myGallery soon)
Australian Divemaster Academy
The Australian Divemaster Academy is an initiative of Byron Bay Dive Centre, taking students from beginner to Divemaster in 10 weeks of training.
The main requirement for this site, aside from introducing the course, was to provide a means for the non-technical staff to update news and the program calendar. The relative simplicity of Wordpress’ “Write Post” process was really the key reason to use it.
We also added the WP-iCal plugin to publish the calendar posts to an .ics format so that calendar applications like iCal, Sunbird and the upcoming Outlook 2007, can subscribe and be kept up to date with program availability.
Wordpress Plugins Used
- WP-iCal plugin (iCal for Wordpress also looks interesting)
Conclusion
Wordpress is not a panacea and I have to admit that moving from developing object-oriented, MVC-architected, design-pattern-influenced, ok-I-sound-like-a-wanker, code to Wordpress and many of its plugins feels like a step back in time. Articles recommending what not to do when developing modern PHP applications could find examples in Wordpress and its plugins.
Just to mention a few: Functions are often huge and on occasion perform everything from querying the database to outputting the HTML. The API seems geared mainly towards retrieving HTML output when often you’d like to set or retrieve more basic data like an array or an integer. Many plugins would benefit greatly from updating the indexing of the database columns but make no such recommendation.
One example is a plugin that had database queries nested in two levels of loops. Having first retrieved some data, it used it to loop through another query and in turn, used that to loop through a further query. In a small test it had already run over 100 queries and would have increased in line with the number of posts. A reworking of the code reduced the total queries down to 2. (Note: I did do what you’re supposed to do with open-source code you see needing some work; fix it and send its developer the reworked solution. I’ve intentionally not named the plugin as a mark of gratitude to anyone who gives their time to helping others out.)
However, before I go on and on, getting all precious and code nazi, I have to admit that it is fun to hack away at Wordpress. If your client makes a request the first thing you can do is Google for a plugin. Often there are a selection that almost meet the mark which can then be used as a prototype to show the client. If not immediately appropriate, most can be adapted to the needs of the business.
In short while you still need to be vigilant there is a real sense of liberation in being able to focus on finding solutions to your clients needs rather than getting overly (and the danger being unnecessarily) precious about the code itself.
