My blog

Something goes here but I don't know what I want to write. So I'll just leave it at this.

Dan Cameron

I build stuff with WordPress

I'm currently building Sprout Apps to help small businesses and freelancers running WordPress.

Took a few days to straighten things out but I’m n…

January 2, 2014

Took a few days to straighten things out but I’m no longer running this blog on a dedicated server and finally recovered a backup that could be used to export the DB. I’ve learned a lot of lessons, the big ones: one, don’t count on software RAID setups; two, always review your backups periodically, something could have gone wrong since you set them up.

Git Submodules with Detached HEAD

November 8, 2013

This week we at Sprout Venture migrated our largest project to git. Without going into detail about our process we ran into a problem with our superproject’s submodules initialized with detached HEADs; regardless if they’re added with the branch set.

The .gitmodules file would properly show the branch, e.g.

[submodule "wordpress"]
	path = wordpress
	url = git://github.com/WordPress/WordPress.git
	branch = 3.7-branch

But when a branch would be checked out the branch for each submodule wouldn’t be set (or worse at times reset to detached). Not a big deal if the branch has a few submodules but ours has 100s.

I found out about $git submodule foreach and created a little command/script that would recursively loop through all of the projects submodules and checkout the branch according to the branch set in the submodules config file (see above).

git submodule foreach -q --recursive 'branch="$(git config -f <path>.gitmodules submodule.$name.branch)"; git checkout $branch'

Just change to the absolute path of where the .gitmodules file can be found.

Screen Shot 2013-09-12 at 3.56.55 PM

WordPress Clearing All Transients on Upgrade

September 12, 2013

Nacin just tweeted about a little changeset in WordPress trunk that will delete all transients after an upgrade.

Obviously someone is going to make this “controversial”, there always is with a huge project like this; I’m also not looking forward to the wp-hackers thread on the topic either. Personally, I think it’s a good idea because it’s starts a new conversation about how to properly use transients and what a developer can expect from them. It could lead to some performance improvements on sites that had/have plugins/themes that improperly utilize transients, as suggested by Nacin already.

The problem, which I should preface is untested but conceptually reasonable to bring up, is upgrade/update lag.

I believe a lot of developers, myself included are hooking on init to check for a transient and if not available call an external API (and store it temporarily again). In a current project I’m doing this (technically hooking on admin_init to check on transient data) at least twice, one for an API callback and another to get a json package for an add-on marketplace. That said, immediately after an upgrade these external APIs are going to be hit because transient data isn’t available. This would ultimately delay the load of the next page, which for any user would be either: the welcome page (that the user is redirected to after an auto-upgrade) or the dashboard (redirected to after the DB update page when first visiting the admin after core was updated manually (SVN/Git)).

Consider I do a poor job maintaining these external resources and they’re slow to respond or worse timeout, that would mean a user who just upgraded would be staring at a white screen for the duration that it takes for these external APIs to respond. In the perception this WP user/admin, the burden for this delay wouldn’t be on the plugin authors or external resources it would be on WordPress. Most likely causing people to think ‘is it going to take this long every-time I upgrade?’.

There are a lot of other rabbit holes issues that could be brought up but this is the one I’m concerned about because it affects the perception of how easy an upgrade is.

Do I still think it’s worth clearing out transients after an upgrade? Absolutely. The approach should be different, possibly a background process after the welcome page (or dashboard).

[Update] Anyone know if after an upgrade/update (with these changes) update_plugins and update_themes are fired, since their transients are deleted? This would cause our project (as an example) to need two more immediate external fetches by filtering pre_set_site_transient_update_plugins and pre_set_site_transient_update_themes, excluding the calls to the extend API which I’d expect to always be fast.

white tip shark

White Tip Shark

June 15, 2013

The video didn’t end showing how awesome this was but this is the best I have. What’s missing is how close we (snorkel guide with me on the outer part of the reef) got by swimming down, I had given him my camera but I didn’t get a chance to tell him it was already on, so he ended up turning it off just after this was taken.

DCIM100GOPRO

Dole, North Shore and Turtle Beach

June 14, 2013

Took a trip to the Dole plantation and toured the grounds on a train and had a ton of fun breaking up into teams to complete the huge maze, apparently the worlds largest maze.

After we went to a Haleiwa (North Shore) beach, Laniakea Beach also known as turtle beach.

DCIM100GOPRO

Watching the turtles eat their dinner off the rocks was fun.

DCIM100GOPRO

Avery found this turtle swimming with us within minutes of us jumping in.

kickin it

Sawyer just kicked it with mom while Avery and I snorkeled.

DCIM100GOPRO

Rest and Relaxation

June 14, 2013

Our second day on Honolulu was uneventful and filled with a lot of relaxing, swimming, more relaxing at the beach, relaxing, slides, lazy river and a bit of drinking in between. The kids went to Auntie’s Beach House for some activities while we relaxed and planed our next few days.

For dinner we ended up leaving Aulani (for the first time since arriving) but only walked across the way to eat at MonkeyPod.

DCIM100GOPRO

jumper

From Hilo to Honolulu

June 14, 2013

We ventured out first thing in the morning for the long drive back to Hilo. Our plan was to hit up a Ken’s House of Pancakes before our flight but it ended up being a bust; I dropped Sara off with the kids to get a seat and place our orders while I went to fill up the rental car with gas, when I returned (15-20 minutes later) not one person helped them, at that point we were running late. Sara tried to get a waitresses attention as she walked by and she totally ignored her because I saw here shake her head after passing, it was insane.

Breakfast was a bit frustrating but arriving and renting a car at Budget in Honolulu was the absolute worst. After getting pushed out of the Budget shuttle from the airport we’re told “only the driver should go stand in line in the office”, well only the drivers could fit in the tiny office anyway so we waited — seemingly hours. I ended up having to argue with the people their about car seat safety and how they shouldn’t have thrown out the backs to their kids booster seats we ended up at Walmart to buy a booster with a high back just for the trip. Ends up that buying a car seat here is cheaper than renting a POS at the rental company.

Those two experiences set us back a bit for the day but arriving at “our home” at Aulani, settling in, getting drinks by the pool and watching the kids swim made up for it.

jumper

Screen Shot 2013-06-11 at 10.08.16 PM

Hilo, Helicopter Volcano Tour and Falls

June 12, 2013

Our third full day revolved around a helicopter volcano tour that we would take in the afternoon in Hilo.

ocean view to hilo

The drive wasn’t too bad, the kids were surprisingly civil with each other.

We walked downtown for a while, shopping in it’s little shops and settling for a mexican restaurant that had some very unique Hawaiian flavors (surprisingly). After we went to a park/garden close to downtown and the airport.

Screen Shot 2013-06-11 at 10.08.16 PM

Finally around 3pm we boarded our first helicopter tour (a first as a family or individually). We ended up using Safari and the tour was incredible. I have a ton of video that I plan to trim down to a short clip, photos will go up on flickr later.

Screen Shot 2013-06-11 at 10.12.18 PM
That afternoon we checked out Rainbow Falls (east of Hilo) and Pe’ePe’e Falls (just north of Rainbow Falls). this was an experience too since we climbed under the railings and trekked down to the frigid “Boiling Pots” for a swim. Avery and I jumped in and were headed for the falls up stream but it started to pour rain and we had to head back because of it, it was running late too. I have some cool video of this too but I’ll need time to create something watchable.

Screen Shot 2013-06-09 at 7.30.01 PM

Snorkel Trip to Captain Cook

June 9, 2013

This was our day to snorkel and without much a plan we headed to Kona Boys in south Kona to rent stuff and ask about places.

After a fair bit of going back and forth we decided to do the “45 minute” hike to Kealakekua Bay, regardless of wether she said it probably wasn’t a good idea since we had kids.

Well, the 45 minutes turned into about an hour and a half down and an hour up. It was a really tough hike, probably one of the worst I’ve done, carrying Sawyer on my shoulders didn’t help that fact.


View Captain Cook Hike in a larger map

The hike was worth it for Avery and me since we snorkeled but I can’t say the same for Sara and Sawyer, although they had a little beach in front of some cool tide pools to relax on.

Newer Posts
Older Posts