Tag Archives: What is this I don’t even

Note To Self: Keep Transient Names Short

In case anybody has this problem: I was trying to set a transient for a certain plugin and using an API key in the transient. This seemed like a great idea, since the transient would automatically be invalidated if the user ever updated their API key. Super simple.

But the transient wouldn’t set. No matter what, I’d hit my breakpoints inside the ‘if not set’ code block.

Well, as it turns out, if you set an expiration time, WordPress will also set a secondary transient option: _transient_timeout_{$transient_key}. That’s a lot of extra characters padding the left side of that option name! 19, in fact.

So with only 64 characters allowed in the option_name column of wp_options to begin with, you need to limit your transient names to 45 characters or fewer. In my case, the api key I was working with was 36 characters, which left me just 9 characters with which to uniquely prefix my transient.

I had 17.

Oops.

The Last Days of Distro…

… maybe?

I’ve been getting significantly frustrated with Ubuntu since upgrading to 11.10. It seems to be getting too bloated for my needs. What’s more frightening is that it’s starting to do too much without my input and (sometimes) against my wishes.

The things I’m talking about are very minor and I’ll get into them below, but the direction is what’s worrying.

Continue reading