Tag Archives: Plugin

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.


TinyMCE Advanced as a Network Activated Plugin

If you’ve ever needed the TinyMCE Advanced plugin┬áby Andrew Ozz, you know that the configuration process can be somewhat tedious.

If you’ve ever had to install it as a network activated plugin on a multisite installation (especially one with more than just a few sites), you probably thought about ditching the plugin altogether.

At work, I’m in the process of building a multisite installation that will consist of more than a dozen sites and they need this plugin. Being the lazy coder I am, I came up with this quick script to force TinyMCE Advanced to use site-wide options rather than options on a per-site basis.

Continue reading