Adding AJAX to your WordPress Plugins

This weekend I’m giving a talk at WordCamp Victoria about using AJAX in WordPress. The talk uses a couple of code snippets to demonstrate creating a simple plugin that passes some data from the client to the server and then updates the web page using data sent back from the server. Here’s the code for the final, most functional, plugin:

 

Continue reading Adding AJAX to your WordPress Plugins

Ubuntu 12.10 Upgrade… OK Something Did Break

A week after I upgraded my laptop to Ubuntu 12.10 and I’ve found something that’s actually broken.

In 12.10, the node.js package has been moved from /usr/bin/node to /usr/bin/nodejs as it clashed with another package name (called, unsurprisingly, node).

This is actually documented in the release notes (but only for Ubuntu Server… not for Ubuntu Desktop): https://wiki.ubuntu.com/QuantalQuetzal/ReleaseNotes/UbuntuServer#Other

I had node.js installed in order to run lessc, the LESS compiler. And, because of various complications due to my installation, 12.10 broke this.

Continue reading Ubuntu 12.10 Upgrade… OK Something Did Break

WordCamp Victoria 2013

January 12th 2013 is the date for next year’s WordCamp Victoria.

I’m a big fan of WordPress and I’ve benefited greatly from local events such as the Vancouver WordPress group and Vancouver WordCamp. I’m also a big fan of Victoria and, not having had a pint in The Swan (or The Bent Mast for that matter) for far too long, I thought I really should attend. I also thought it was about time I gave something back to the community and submitted a talk proposal. So here it is:

Continue reading WordCamp Victoria 2013

Ubuntu upgrade – 12.10

Just upgraded my laptop to Ubuntu 12.10 (aka Quantal Quetzal – although this is the first & last time you’ll hear me refer to it as such) and… well I guess I should be getting used to how painless this process (generally) is. Took exactly an hour from start to finish and left me with a fully working 12.10 system with all the post-release upgrades added.

Continue reading Ubuntu upgrade – 12.10

WordCamp Vancouver 2012 – What Did I Learn?

Another great event & I learnt lots of great stuff.

Probably the most interesting talk of the day, for me, was Zack Tollman’s talk about cache invalidation schemes. Yeah… hard-core, that’s me 🙂

The talk was, obviously enough, very technical and right up my alley. I already knew there was a caching mechanism built into WordPress, even though I’ve never used it, and the talk was well-paced so it wasn’t hard to follow – so most of it wasn’t revolutionary. Except for one throw-away comment that Zack made…

Continue reading WordCamp Vancouver 2012 – What Did I Learn?

Adding an Admin User to Your WordPress Database

Ever locked yourself out of your WordPress installation? No, of course not – you always keep a secure copy of your passwords. But I had a situation last week where I needed to perform admin actions on a copy of a client’s site and only had non-administrative access.

I’d recommend strongly against hacking yourself an admin account on a client’s actual site – if you need admin access and they haven’t given it to you then ask them for admin access and explain why it’s necessary. Hacking your clients doesn’t always go down well. But if they’ve already given you a full site backup then you’re not going to break anything and it’s pretty clear they trust you, so go ahead and hack your local copy.

Of course you might also need to do this in the unlikely event that you DO forget your administrative password or you’re hacked and your administrative user is deleted.

There’s several how-to guides on the net that lay out the three minimum steps:

  1. add yourself a user ID in the wp_users table
  2. add a wp_capabilities entry for that user in the wp_usermeta table
  3. add a wp_user_level entry for that user in the wp_usermeta table

but one thing I noticed they all failed to emphasize & initially tripped me up when I did this myself, was the table names…

Continue reading Adding an Admin User to Your WordPress Database

Using The WordPress Settings API

So I’ve been writing WordPress plugins & widgets for people recently and having to produce administration pages in the dashboard. Using the WP Settings API makes this SO amazingly easy… you barely have to write any code or HTML at all.

Basically it comes down to just this…
Continue reading Using The WordPress Settings API

Glitch and the LED Sneakers: Epilogue

What now?

Well, it was a one-off… a little bit of fun for the Glitch Launch Party and an excuse for me to explore the Arduino platform. However I just noticed today that the in-game shoes have a couple more tricks up their sleeves (do shoes have sleeves?). When you’re away from the keyboard in the game and your Glitch falls asleep, the shoes pulse gently in time with your breathing. Also when you laugh or frown, the lights have their own emotions that mirror your character’s. This got me thinking about ways to extend the project.

Continue reading Glitch and the LED Sneakers: Epilogue

Glitch and the LED Sneakers – In Action!

So it’s all put together… but what do they look like? Show us!

OK, OK… your patience is finally rewarded, here’s a video of what they look like in action:

Continue reading Glitch and the LED Sneakers – In Action!

Glitch and the LED Sneakers – Putting It All Together

At this point I’ve got a jumble of wires, crocodile clips and circuit boards spread across half my desk. Nothing too shoe-related going on yet and definitely not portable.

To bring this to life, I needed two basic set of things:

  • something in which to mount the Lilypad, power board and batteries. My original idea was something along the lines of a money belt with the Lilypad in the small of my back and a wire to the button somewhere easily accessible
  • something to hold the LEDs and attach to the shoes. I wasn’t going to modify the shoes in any way so my original idea was some sort of a fabric overshoe sewn together and held in place with stretchy straps and velcro.

Continue reading Glitch and the LED Sneakers – Putting It All Together