Tag Archives: wordpress

Feeling RESTful

A month ago I took a (relatively) short train ride into the beautiful Derbyshire countryside to spend a week coding in the middle of nowhere.

I was attending A Week of REST – a training event put on by the excellent folks at WordPress agency, Human Made.

Part of a group of about 20, we descended on Darwin Lake near Matlock, a beautiful set of holiday cottages set around a lake and right next door to the Peak District National Park – one of Britain’s best destinations.

Being remote there was no mobile signal and the wifi was pretty terrible! But that didn’t matter – the course had been set up in such a way that an internet connection was more of a luxury and the disconnect allowed us to concentrate on learning and interacting with each other.

So what did I learn?

I learnt how to build a standalone React app in ES6 syntax, using NPM and Webpack for a local development environment. I learnt how to authenticate with the REST API from Javascript, send different types of request and interact with the responses within React.

Building a React app was very different to developing for WordPress. We used NPM and Webpack to create a local development environment (sitting at localhost:3000) and we were writing entirely in JS/JSX and there was even an index.html file! Crazy times.

The API endpoints were just a WordPress plugin, and creating them was much like interacting with other WordPress APIs. I’d equate it to registering new post types, so very simple for a WordPress developer to get on with.

Having done the React class at last year’s Automattic Grand Meetup everything I learnt came flooding back, so that wasn’t a big challenge. Using ES6 was weird at first but I quickly came to enjoy it – and I really don’t enjoy JS dev usually 😉 The biggest challenge was probably understanding authentication with the API. While we only used one authentication method and had a helpful library to make it easy, there are some complicated concepts to get your head around and there were a lot of questions on that topic from the group.

The teachers – Joe Hoyle, Ryan McCue and Zac Gordon – were great. We went at a good pace, no-one got left behind and we were given lots of opportunities to ask questions. I’d recommend looking out for future Human Made events, including A Day of REST and you should certainly check out Zac’s Javascript for WordPress course.

Not only were they great teachers, I had a great time hanging out with them, the other Human Made crew and the other attendees. I’m lucky that because of my awesmazing job I already knew some of the HM folks (and met some I work with but hadn’t yet met in person!) which made socialising easier, but I also got along really well with my fellow students, and really enjoyed our various games and late night shenanigans 🙂

Finally, it wouldn’t be right to spend such a long time without an internet connection and not have something to show for it. So I present to you my very first solo-built standalone React app: howmuchhuel.com.

I’ve recently started using Huel* regularly and needed a quick way to measure the mixture on my phone, so I built this neat little app. The calculations are a bit scrappy, but it works. Contributions welcome.

*get £5 off with this link,  because I love you.

WordCamp Europe 2014: Sofia, Bulgaria

All images in this post provided under the CC-BY-SA license.

4 years and 2 months later… TheyWorkForYou plugin gets an update

Shocking it’s been so long really, but I’ve finally revived my TheyWorkForYou WordPress plugin.

When I first released it, all the plugin did was supply a TheyWorkForYou widget. Nothing’s changed! That’s for good reason though… At the time, the latest version of WordPress was 2.8.6 and we’re now on 3.8.1 so a lot has changed!

Crucially, the way plugin developers add widgets has changed so that needed to be updated.

Also of huge importance was that the original plugin hard-coded my own TheyWorkForYou API key and was a key reason why the plugin never made it to the WordPress.org plugin repository. There is now a simple settings page for you to enter your own API key, and the widget isn’t even available to you until you do that.

I have a bunch of other enhancements I want to add, all of which are listed on the GitHub issues page for the plugin. If there’s something you’d like to see in the plugin, please add it there too.

Given the amount of functions provided by the TheyWorkForYou API there are probably loads more things the plugin could do – please think of them and ask me to add them. Or, even better, fork and pull on GitHub and to add them yourself.

Finally, to use the plugin you can;

  1. Go to Plugins > Add New in your WordPress dashboard, search for TheyWorkForYou and install
  2. Download from the WordPress.org plugin repository and install manually

One important note: if you are using the original plugin, you’ll need to remove that first.

Enjoy!

WordPress fork is happening – and it looks amazing!

Obviously I’m a huge WordPress fan, but I’m not a blind believer. I can see it’s limitations, I’m well aware of it’s growing pains. That’s why, when John O’Nolan first presented his concept for Ghost I was excited.

While WordPress evolves into a CMS from a blogging platform (and it still has a long way to go!) it necessarily looses the simplicity it had as a pure blogging platform. John’s brainchild was to provide something that returned to those first principles.

Now the project is actually coming to life. John and his team have a great introduction and they’re seeking backers through Kickstarter. I’ve pledged.

One big thing that draws me in are the principles that John talks about in the introductory video. One of my constant bugbears around other open source project, WordPress included, is the ownership – structures that often do not reflect the spirit of open source, and we see the impact time and time again.

John is committed to making sure that Ghost is open source and non-profit and that that follows through to the entire eco-system that will surround Ghost.

I can’t wait!

Update: just two hours after this post was published (and a while after I actually wrote it!) I’ve had an e-mail from John O’Nolan along with all the other backers. Ghost is over 120% funded. Phenomenal! It’s got incredible backing – WooThemes, Envato, Seth Godin and many more influential tech folk. This could really be something…

Vulnerability in WP Super Cache and W3 Total Cache – update now!

Hot on the heels of the big WordPress botnet attack comes news of a serious vulnerability in the two most popular caching plugins, WP Super Cache and W3 Total Cache.

By allowing anyone to inject malicious code into your WordPress site through the standard comments form, this security vulnerability is particularly nasty in it’s simplicity and ease of exploitation.

I’m glad that the security and maintenance measures I take as part of my WordPress maintenance package mean that both the botnet attack and this vulnerability weren’t a concern, but others might not be so lucky.

Make sure you secure your site now, and keep it up to date.

Options galore for Author Bio Shortcode plugin

My Author Bio Shortcode WordPress plugin has received a substantial update today, adding a bunch of new options.

Thanks to some helpful and constructive criticism from Richard Tubb about my blog I’ve been making a few updates including wanting to put a bio below each post, which reminded me I already had a handle little tool for that! Not satisfied that it only printed out the bio, I wanted to add my avatar and also some wrapper HTML to make styling the whole thing a little easier.

Version 2.0 of Author Bio Shortcode now does that. If you want to use it, or upgrade, I’d suggesting checking out the usage instructions at the WordPress.org plugin repository to see the fine detail. You can also see it in action at the bottom of this post!

Enjoy!

Update! Based on Nara’s comments I’ve just added some name parameters too, so that you can add the author’s name as well as bio.