Boltgun's Toolbox

Latest news

AO Speak 0.2

Online players on RimorHey there,

I nailed down a few features of the AO Speak widget for wordpress.

You can now choose which fields you should display on the widget, as country or ingame status may not be interesting for everyone. Everything will be displayed by default.

The idle time field is also supported. The teamspeak server used to send it in seconds and it needed to be converted to an human readable language. Seconds doesn't mean muchs after a few thousands.

This will be the version 0.2 of the plugin, a decent step toward release.

Memory usage in PHP 5.4

Last month PHP 5.4 was released, it has been a while since we had a major release to this language. The changelog look small but get to the point : removal of old bad configs (safe mode's gone, wee!), better performance and more modern ways to code.

The performance part quickly caught my eye at work. There is two problems a website can have : memory usage and speed. And as far as I know, wordpress suffer from both. A vanilla install can be quite slow on a shared host.

What's the point ?

Memory usage is a major factor about how many people can visit your site at the same time. If you add something popular on your forum and you get linked on twitter, blog, etc. More visitors will suddenly show up and your site might slow down or even go off line. Using less memory simply push back this limitation.

A few tests

I quickly measured the memory usage of several sites and here are the result :

  • The Kindred forum, using SMF 1 : 3.5 Mb in PHP 5.3 => 1.6 Mb in PHP 5.4
  • This site, using GetSimple : 844 Kb in PHP 5.2 => 537 Kb in PHP 5.4
  • A clean wordpress install : 16 Mb in PHP 5.3 => 9 Mb in PHP 5.4

So PHP 5.4 uses 30 to 50% less memory, without any modification to the code. There is definitely something better inside.

Using php 5.4

Few hosts allows you to choose your version of PHP and if your site is compatible it's really worth the upgrade.
But your site must be compatible. Usually you should not be using old broken apps, so it should be ready for the upgrade. You better seek what other users said about upgrading to find out if your forum/gallery/whatever will break or not.

Unfortunately many hosts doesn't take good care and still run an obsolete 5.2, possibly with safe mode, magic quotes and all kind of crap web developers hate. This version still runs over 70% of PHP sites, but I am keeping an eye for any evolution.

If you wish to play safe, you can also wait for PHP 5.4.1. Modules and apps will have received the attention they deserve by then. 

New and effective vs old and secure

There is always a dilemma when making webpages. Do I use the fancy new techniques or do I fallback with old and tried tools ?

I am trying to have old browsers (read Internet Explorer 8) display pages correctly, at least in a fully functional way, while allowing fancy stuff for the newer browsers. There is no future in using old tools but we all have this time when we don't have a choice and use whatever is available, be it a tired library terminal.

So far so good, there is no problem so far in using HTML5 markup even in IE7 (as long as JavaScript is enabled). Oddly enough, the troublesome part is inserting special characters, like the UTF8 arrow displaying as a blank square under Windows. If I can get to the bottom of this, I will be able to complete the theme and move on.

General green

I updated the site's theme with news manager support and better HTML markup, it should be production worthy once I'm finished with the details.

I'm studying the addition of a control pannel to let you modify the footer or titles. Once done, you'll find it in the GetSimple repositories.

Roster step 1, done

As the roster page of Mercury Dragon broke again. I didn't plan to refactor the page this soon but after a few tweaks that's one less thing to worry about.

I made the 2 most important changes: Drop the need for PEAR, and have it query the AO website once. PEAR is a php library that can handle a few functions but kept braking because of MD's host using safe mode. As for asking twice for the listing, that's a waste of time.

By the way, safe mode is bad. Despites the name, it doesn't make your site safer, but will break a lot of things. Best is to not have it, otherwise you should check your host's documentation for a way to disable it. I'm glad we have these problems. If a plugins works there, it will work on most setups.

AO Speak plugin

The first version of the AO Speak plugin has been online on the Mercury Dragons website for a couple of months and worked well so far. The main features being there, I will take to chance to add optimisations, like a simple file cache, to reduce the number of requests.

At the same time I had a loot at the roster page, with this "I'll get you!" look. The code behind this page is pretty good and I can't be thankful enough to the ones who made it, but the page currently requests the People of Rubi Ka website for the members of his organization, and this slow downs the page badly.

Perhaps I'll merge all this work into a big AO for Wordpres plugin, depends of the ammount of copy/paste I end up doing.

Anyway, it seems that Funcom's dev team will have news for us soon. I hope it will be worth the wait.

Download only from official sites

I remember an article from January everyone should read : Why You Should Never Search For Free WordPress Themes in Google or Anywhere Else.

It's a good lesson in security, sites offering 'free wordpress themes' are actually trying to make money out of the hidden backlinks they can insert into your site. But it doesn't ends there, I have also ran into plugins installing backdoors into the admin, email your password and so on.

So to stay on the safe side, download themes and plugins only from the official sites, no matter what you use :

Should you find something you really like, you should at least search for the author's site. From there you should find a trustworthy place to get your content, this will save you a lot of trouble.

Mercury Dragons

I’m currently working with Windguaerd on on the Mercury Dragon website. Now that the theme have been ported to Wordpress, we are looking toward integrating AOspeak’s webservice in a plugin form once the plugin have matured enough I’ll release it for the community.