Today hasn’t been what I’d call an over-all winning day, and I’m too fried to come up with an original, coherent post… but that doesn’t mean I can’t write! So today will effectively be a brain dump of things I’ve worked on, realized or discovered today. Consider this fair warning that while you will likely learn something from this post, some of it is likely to be nonsensical at best.
In the Beginning…
Kicking off with the basics; in other words, how did I manage to end up in this state of borderline insanity… particularly the day after writing a post on occupational burnout. The short story is that I started this morning (ok, it was last night, but who’s counting) with a semi-brilliant idea for a plugin. Well, technically it wasn’t originally my idea. It was a suggestion brought up by another member of the Easy Digital Downloads team. Or was it a suggestion brought to another member of the team who then proceeded to hand it off to me? Even I’m starting to lose score…
Reaffirmed: WordPress is Awesome
It’s no secret that I love WordPress. It’s a great platform with a stable community, is insanely flexible, and can generally be adapted to pretty much any given scenario. Trust me I’ve done it. So has he, but Pickle Project by Jason Schuller wins for overall coolness:
The point is… WordPress is awesome, period. Almost every time write a WordPress plugin or solution, I learn something new. Of course, at the same time…
Reaffirmed: WordPress Drives Me Nuts
As much as I love WordPress, it definitely has its moments where things don’t make sense. For example, why is it that you can remove post type bulk actions, but you can’t add new ones to the default array? Or why is the media modal so convoluted? I mean you can make it do almost anything (except maybe work sanely on the frontend), but it’s downright painful to do even the simplest tweaks. Still, the headaches don’t outweigh the huge wins, so I’ll keep on using it. Don’t like it, deal!
Reaffirmed: Michelle is an Awesome Artist
For those who haven’t been introduced to the absolute awesomeness that is Michelle Schulp, among other things she is a kick-ass artist. In fact, she just released her third piece in a set of impressionist re-imaginings of classic science fiction. This far, she’s managed to put together her own unique twist on Doctor Who, Firefly, and Star Wars and there are rumors of an upcoming Star Trek piece as well. Whether you’re an impressionist fan or a science fiction fan, this set is (no pun intended) out of this world.
New Knowledge: Hacking Jetpack
Again, the title is misleading. I’m sure everyone’s familiar with the insanely popular Jetpack plugin which somehow manages to accomplish being both epic and ridiculous at the same time. What you might not know is that Jetpack has a few hidden tricks up its sleeve, particularly for us developers!
Did you know Jetpack has a dev mode? I didn’t! I’d never installed it on a local instance until today, but when I did, I discovered that on localhost, it is automatically kicked into dev mode. I don’t agree with everything that this “dev mode” entails, but I do love the idea! It’s something that I’ve been trying to work into some of my more complicated plugins over the last few months and, at times, can be incredibly helpful. Of course, you don’t have to be on a local machine to active dev mode. It can be activated in any environment by adding a simple hook to your plugin or the
functions.php file for your theme:
add_filter( ‘jetpack_development_mode’, ‘__return_true’ );
So when you’re actually in dev mode, you’ll learn quickly that certain modules are forcibly disabled. Of course, there’s a pretty good reason for most of them, but that doesn’t mean that you can’t trick them into activating anyway. Thanks to my friend George Stephanis, I know now how Jetpack determines things like whether or not modules can be loaded in developer (aka offline) mode. Turns out it’s super simple. Modules are loaded from
modules/<module_name>.php, and each module file has a header, not unlike the header of a WordPress plugin. It looks something like this:
* Module Name: WP.me Shortlinks
* Module Description: Enable WP.me-powered shortlinks for all posts and pages.
* Sort Order: 8
* First Introduced: 1.1
* Requires Connection: Yes
* Auto Activate: Yes
* Module Tags: Social
While most of this isn’t relevant to our purposes, there is a line in there that’s quite intriguing. If you change the
Requires Connection line to “No”, suddenly the plugin works in dev mode! Sort of. In reality, of course, a WP.me shortlink is completely incapable of linking to a local site, but that doesn’t mean we can’t go through the motions! Super effective if you’re trying to integrate WP.me into another plugin.
To be Continued?
So that’s about it for the insanity that’s made up my day. I’m now on hour 26 of working on the same stupid plugin and (so far) no end in sight. I’m sure I’ll eventually figure it out. Maybe tomorrow will introduce new chaos and learning experiences. Maybe I’ll have a structured post. Maybe I’ll release a new product. Who knows. What I do know is that if I don’t get some sleep tonight, I won’t be functioning at a high enough level to do anything tomorrow, so I’ll probably be vanishing for the night in an hour or two. See you tomorrow!