Recovering Scratch Files In phpStorm

I love phpStorm. It’s the best IDE for WordPress development, period end of story.

One of its many cool features is the scratch files. I used to have a bad habit of typing up a quick test, or example code in whatever file was last open, promising myself to clean up after myself later. Or, to take advantage of phpStorm’s ability to jump to a function, class, hook callback, etc’s source, by command clicking on it, I’d just type in the function (or whatever) and jump through.

Scratch files are the right place for this sort of thing, as while they actually can be executed, they are not executed as part of WordPress. Until recently, I was under the mistaken impression that once you closed a scratch file it was lost for ever. This made Josh a very sad boy many times.

Turns out I was wrong and you can easily get back to any closed scratch file in a project. All you have to do is click on the dropdown at the top of the file viewer pane, and change form project files, the default to scratches. All your old friends are there! Day == saved.



Is this me blogging at my self? Yes, yes it is 🙂


For the 900th time, I’m trying to get into the daily blogging habit. But, I don’t want to write about WordPress, everyday, and when I do, I don’t want to just talk about WordPress business or tutorials. I want to share more of my story. But, that puts me in an emotionally vulnerable space. It’s scary and the fear holds me back.

How much of it is because, as hard as I push back, I’m still subject to the “be a man” gender-conditioning of our culture, I don’t know. It would be a shame if I put all this work into this awesome platform for people to make their voices heard, without telling the stories that I desperately want to tell. I hope, that by naming this fear, I’ll empower myself, or others — men, women and those in between and beyond a like — to conquer this fear.

Photo by:  Shlomit Wolf (CC0)
Photo by: Shlomit Wolf (CC0)

Was The #WooMattic Deal About The People?

There has been a lot of speculation and analysis about the WooMattic deal — why it happened, what it means for the future of and the ecosystem as a whole. A lot of people have assumed Automattic bought WooThemes, so they could use WooCommerce to power a eCommerce offering.

That seems like a funny reason to spend what is rumored to be $30 million. If they just wanted to use WooCommerce, they could have just installed the plugin. If that’s why, then no one can ever complain about spending a few hundred or thousand on WooCommerce add-ons.

I think the real value here, besides a new revenue stream, is the people. Automattic is growing rapidly and finding employees who can thrive in a distributed company has to be a constant challenge for them. They just got fifty-some new employees, all of which are used to working remotely.

And yes, a lot of those people are experienced in building a WordPress eCommerce platform. WooCommerce-powered or built from scratch, a hosted eCommerce platform would be a very smart thing for Automattic to branch out into.

In addition,  the leadership of WooCommerce is used to managing and planning a retail product-based business. Automattic is, for the most part, in the software as a service (SAAS) business. While Automattic does sell products, like Akismet and VaultPress to the self-hosted WordPress market, those are still SAAS products.

If Automattic is looking to make a major change, and start selling more products to self-hosted WordPress users, which would make sense, then they just acquired some new talent that is super successful at doing so.

I’m not denying that this acquisition is probably a sign that there are more eCommerce offerings coming from Automattic. But, I really think the move is less about WooCommerce, and more about product-based eCommerce in general.



A Letter To JavaScript

Dear JavaScript,

I’m sorry I ever said mean things about you. It’s about me, not you. You are beautiful and don’t let anyone ever tell you otherwise.

The fact of the matter is I tried to treat you like you were PHP but you’re not. I wanted all languages to be like my first, but you are both unique entities and are both special parts of my life.

Your pal,

Fun With array_column()

  • array_column() is only available in PHP 5.5 or later. 😛
  • Figured this out for the example code demonstrating some cool new features in Caldera Forms 1.2
  • This is a little extra-complex due to my need to find the array key, as the function returns the (numeric) index.
  • I need a syntax highlighter, I know.
$a = array(
	'x' => array(
		'a' => 7,
		'b' => 8,
	'y' => array(
		'a' => 2,
		'b' => 9,
	'z' => array(
		'a' => 55,
		'b' => 'hats'

//demonstrate how array_column works
var_dump( array_column( $a, 'b' ) ); //returns an array of all 'b' keys in array $a

//get the index (numeric) of array in $a with value of 1 for index 'b'
$index = array_search( 9, array_column( $a, 'b' ) ); // returns one, the (numeric) index of the array we want

//get numberic indexes of array
$indexes = array_keys( $a ); 

//get key for the index we want
$key = $indexes[ $index ]; //returns 'y'

var_dump( $key );

Pretentiousness In The Age of The Algorithim

When I was younger I didn’t want to listen to System of a Down because they were too mainstream. Eventually I got my head out of my butt, and gave them another chance. I’m still not into Toxicity, but the rest is pretty awesome.

Now I don’t want to listen to them because then Google Play will recommend I listen to Disturbed.

The New Work/ Work Balance

I love a lot of things about what I do, but most of all that it’s stupid fun. I’m mid-transition from freelancer to business owner, which has been a fun new adventure. But the side-effect is I don’t get to write as much code, something I love to do.

The  secondary side-effect of this is that I love writing instructional blog posts about WordPress development. As I’ve made clear before, I primarily do so to give myself an excuse to learn something interesting or cement the knowledge of a fun new skill I learned.

So, I haven’t been blogging a lot either recently. That sucks because I love writing  about writing coding almost as much as I love writing code. Also, my blogging has always been about marketing myself.

This is the new challenge, and I’m starting to face it with this tiny little post. And  the code I wrote to add a micro-blog within my blog 🙂 More on that soon…