I’ve happily run this website for many years now – starting off as a personal blog before transforming into a semi-professional technology, then returning back to its roots again. However, things have changed and I’ve made the difficult decision to close this site1.

First of all, I’ve grown up and realised that people don’t necessarily want to read the personal thoughts (mainly rants) of a random person. Running it as a professional site never worked either as I never made sufficient money from it. I have a full time job and a family to support – I can’t jeopardise either on a whim.

At the same time as abandoning this site I will also be leaving my WordPress plugins (and WordPress generally). I loved developing these but they are all-consuming – just working on them over a lunch break was never enough and I found myself working on them when I shouldn’t be – again that all-important day job is the important thing here.

What I won’t miss are the attitudes of some people with regard to my plugin development. Only in the last week I had one person, requiring support for one of my free plugins, post twice on the WordPress forum, multiple times on this site’s forum (now closed!) and even email me within a matter of minutes insisting on immediate help. The latter is more annoying as the contact page (now closed!) states that it shouldn’t be used for support queries – even the automated email she got informing her of this didn’t put her off and she simply responded to this. People have been rude and impatient. I reply to everything and help as much as I can but that never is enough. Hell, I even fixed and published a new release of a plugin whilst on holiday a while ago (never again!).

I’d hoped that working in web development – particularly PHP and MySQL – and specialising in WordPress may have got me a new job. Certainly I’d hoped so as I love working with them. But a lack of commercial experienced was always my undoing.

So, no new job on the horizon and a lack of time to dedicate has been the spur of this decision.

I can now reclaim my lunchtime at work and enjoy the summer with some lovely walks. I wish everyone the best.

  1. for which I mean “abandon” – the site will remain up and available []

k-bigpic

ConsoleDeals.co.uk has learnt that Microsoft intends to charge Xbox One owners 90% of the original RRP for second hand game purchases. The leak first emerged from a senior employee at one of the UK’s largest video game retailers.

The source revealed that game retailers will be forced to sell second hand games at just a 10% discount on the original RRP. This news will come as a shock to consumers who are currently used to finding discounts of as much as 50% for trade-in games.

With the new Xbox One being announced this week, Microsoft have stated that each game will use a code that locks it to the owner’s account – giving the tech giant complete control over the second hand games market. Such control has been widely speculated but no specifics have been released until now.

Owner of ConsoleDeals.co.uk Phil Jones, who initially leaked the news on their blog said “the second hand games market has been struggling to survive for the past decade; this leak, which we believe to be true, is the final nail in the coffin.” he went on to say “We were all expecting the worst and we got the worst – I’m shocked that Microsoft is taking this decision”

Prior to the leak, Microsoft were quick to counter-act initial speculation at the Xbox One launch event, stating that they had a trade-in plan in place, and would reveal more about it at 2013’s E3 convention. This news comes as further disappointment following the new console’s luke-warm reception earlier in the week.

Editor’s Comment

The release of Xbox One I too found underwhelming. Yes, I’m a PS3 owner but I’m always very open minded to the possibility of “jumping ship”. If the Xbox One was exceptionally better than anything else then I’d definitely consider it over the PS4. Sadly, the PS4 is more powerful and Sony are concentrating more on the gaming aspect. For me I think this is the key to success – as casual gamers move over to tablets and both TVs, PVRs and Blu-Ray players offer movie and video streaming, its the “hard code” gamer that’s likely to keep the console alive.

Sadly news such as this isn’t going to help Microsoft (assuming it turns out to be true) but we’ve yet to find out what Sony are going to do either. In some respects it makes sense – until recently the most I’d ever spent on a PS3 game was £17 because I mainly bought from the used market. Sony would have received nothing from me a result. This will be their way of clawing back some of that “lost” revenue. Of course, tablet and other recent gaming markets don’t have a second hand market at all but, then again, their game prices are often only a few pounds rather than £40+.

Although tongue-in-cheek the following video, to me, demonstrated what was wrong with the new Xbox one…


Download YouTube Video | Convert YouTube to MP3

Transients are a great tool for the WordPress developer. They allow you to easily save temporary data with their own expiry time – simply pass the transients data into the easy-to-use API and it will sort everything out for you. Caching made simple.

Unfortunately, using transients is not without its downsides and recent experiences have shown a couple of issues that any developer should be aware of.

But first I need to explain how transients work.

Transients were not introduced until version 2.8 of WordPress and make use of the WordPress options table (usually named wp_options) to store their data. There aren’t enough fields in this table for the transients to be stored as one record so, instead, it’s split over 2.

Each transient is given, by the developer, a unique name. This is prefixed by either _transient_ or _transient_timeout_ and used as the option_name field. The option_value field is the transient value and the expiry time respectively. You can also store and access network wide transients and these have _site further prefixed to the beginning of the transient name.

So, let’s say you create a transient named ‘test’. Two records will be added to your options table. The first record will be named _transient_test and will have a value of whatever you wished to store in the transient. The second record will be named _transient_timeout_test and the value will be the timestamp of when it expires.

The exception to this rule is if you create a transient that is not set to timeout. In this case only the first record will be created.

If you were creating a network-wide transient then the names would be  _site_transient_test and _site_transient_timeout_test.

How to use Transients

There are 3 simple commands – set_transient, get_transient and delete_transient. The latter two have just one parameter – the transient name.

set_transient, in comparison, has 3 parameters – the transient name, the contents to store and the timeout (in seconds). Set the timeout to 0 for it to never expire.

set_transient and delete_transient both return true or false, depending on their success. get_transient returns the transient content or false if it wasn’t found.

Network-wide transients are handled by the commands set_site_transient, get_site_transient and delete_site_transient. All parameters and return values are as the non-network equivalent.

Problem #1: Transient Name Lengths

The option_name field in the options table has a record length of 64 characters. So, taking into account the prefixes added to the transient name, a transient name can only be a maximum of 45 characters (or 40 characters for network transients). The problem here is that WordPress doesn’t check. It doesn’t fail either – it creates the transients but simply truncates the name. And because each of the transient record pairs has a different length prefix then they each end up with a different name – this means the transient can’t be retrieved.

The Solution

  • WordPress are aware of this and a Trac ticket is open to prevent this from happening. I have updated the ticket myself to ensure they’re aware of the 40 limit for network transients (suggesting that the limit should be a uniform 40 to avoid confusion).
  • The Codex already makes mention of the 45 character limit for set_transient but didn’t mention the 40 limit for set_site_transient. I have now updated the appropriate page to reflect this.

Problem #2: Housekeeping

When you attempt to get a transient and it’s expired WordPress will automatically remove that transient from the table. However, if that transient is never accessed again then it will not be removed.

Why would this happen? Let’s say a plugin uses transients to cache some data. The transient name may be a unique name which represents the options requested – that way, if the user changes the options the, now incorrect, cached data is not used. However, the old transient will never be re-accessed.

To give you an idea of the scale of this I’ve heard one user has over 250,000 transients in his database which have expired.

The Solution

Conclusion

Transients are a powerful and useful tool for the WordPress developer. However, be aware of their limitations and tread carefully!

I’m one of those who are guilty of writing plugins that generate transient names longer than the limit and of generating transients that won’t be accessed once they’ve expired. Now I know all of the above the way I use the transient system has changed.

Top
%d bloggers like this: