WordPress REST API: Forcing authentication for all requests

I’m working on a project that will be using WordPress’s REST API to feed JSON data to a mobile app. We only want authenticated users to be able to query the REST API.

Out of the box, the REST API exposes all public content by GET request without any authentication requirements.

We’re using Enrique Chavez‘s JWT Authentication for WP REST API to allow us to authenticate users and get an authentication token. We have made a modification to the JWT auth plugin to expose the “validate_token” method by adding the following code to line 143 of the class-jwt-auth.php file.



like so


This gives us access to the validate_token method elsewhere in WordPress.

We then hook into the REST API’s “rest_pre_dispatch” hook to require the presence of a valid token before exposing any API data with this custom filter in our theme’s functions.php file.




Last week the family all ventured to Rhoscolyn on the beautiful Isle of Anglesey for a big wedding do. I used this as an excuse to get a new toy to film the week’s fun.

I’ve stitched some of the more scenic clips together in this video. It’s all very cliched. Queue “floating” music…


Tridion Developer Summit 2015

In September I was fortunate enough to attend the 2015 Tridion Developer Summit in Amsterdam. It was great to get out of the office and spend some real time with the other Content Bloomers to meet so many new people who are working with Tridion. We also got to see lots of the cool stuff that is coming in Web 8 and some really interesting things that people are doing with Tridion right now. There is so much to remember and this post is just a glimpse of some of the highlights.

Amsterdam airport has Tesla Model S taxis!

Amsterdam airport has Tesla Model S taxis!

I flew over to Amsterdam a day early to attend Alex Klock and Tanner Brine’s Alchemy workshop. Lots of interesting questions, quips and suggestions made by so many people with plenty of experience and real-world insight.

Tanner, Nick and Jon on the Ferry to the Eye

Day one of TDS and a little worse for wear. Tanner, Nick and Jon on the Ferry to the Eye.

Day one of the summit opened with a cool little video by Robert Curlette followed by a keynote presentation of SDL Web 8 by Nuno Linhares.


There’s some great new stuff coming in Web 8 that will make life so much easier for Tridion (SDL Web) implementors and users. My particular favourites are the ability to move items around the blueprint model and the site creation wizard. Oh, and free development licenses too!

Nuno presenting the SDL Web 8 site builder wizard. It worked after some teething problems as is the way with demos.

Bart Koopman presented lots of new stuff for DXA 1.1 and the roadmap for the future of the project.

Bart Koopman presented lots of new stuff for DXA 1.1 and the roadmap for the future of the project.

On the evening of the first day we were all carted off to Pllek for food and entertainment, a live band playing some funky funk as well as a 2015 rendition of this. I have to say it’s an odd experience being shepherded into a shipping contained on an industrial estate. It’s fair to say we all had a good night and held out to the last, I think we may have been amongst the last to leave.

The entrance to Pllek

The entrance to Pllek

An early start on the second day and Tanner, Alex and I left the rest of the CBers sleeping on the houseboat we rented for the week as it departed the mooring.

The accommodation floating away from its moorings

The accommodation floating off with a sleeping team CB.

Day two started with a presentation of Alchemy and the great “build a GUI extension in 5 minutes” party piece by Tanner and Alex. Then the live launch of DD4T 2.0 by Quirijn Slings.

Tanner and Alex presenting Alchemy

Tanner and Alex presenting Alchemy


Quirijn Slings

Quirijn Slings launches DD4T 2.0

And Finally Will Price, with a broken voice, and Jan Horsman showed how they built a SmartTarget web service for JavaScript rendering of personalised SmartTarget content on a cached website. I can see this being picked up a lot in the future.


Will Price demoing SmartTarget on cached content

Will Price demoing SmartTarget on cached content

There is so much more that I’ve missed or skipped over and it was a great couple of days. The future is definitely bright for SDL Web and events like this really help to keep momentum in the community which has created and shared so much amazing work and knowledge.

Thanks to Robert Curlette for all the hard work he put in to organising the summit. It can’t be easy but it’s so valuable. Thanks to all the presenters and attendees for being there and sharing the cool stuff they’ve been doing and thanks to Content Bloom HQ for letting me bunk off work to hang around the Eye and eat cake in Amsterdam for three days 🙂


The mini quad is back in action!

I was having some strange problems with my ZMR 250 mini quad at the start of the summer. One motor kept out during flight, there was also some strange pitching behaviour during aggressive manoeuvres. A lack of time to do anything over the summer meant that it was mothballed.

I had a couple of spare hours this week whilst avoiding the last episode of Downton Abbey to take a look at the problems. It appeared that one motor had a short. Testing the resistance between the motor leads and the stator found the short. A quick motor swap and solder job and it’s back in flying condition again so I’ll be getting some FPV in again when the winds calm down.

Back in action! #zmr250

A video posted by Mark Williams (@willburt) on

A new blunt nose versa wing

After losing my last versa wing into the River Wharfe when flying under a bridge (Don’t ask) I’ve decided to get another built. The plan is to build without a motor for some slope soaring fun (which I’ve never tried before) and then to add a motor and some FPV gear as time allows.

The parts have all arrived so I’m ready to get started.

Here is a video of me bashing the last versa wing around my home field in Wetherby in early 2015. At the start of the video you can see the bridge that caused the loss of video reception and the aircraft. That was a sad day.

FlightTest Blunt Nose Versa

I’ve built a blunt nose versa using the flitetest PDF plans. British foam board is almost twice the weight of the stuff available in the US so my set up has more power to compensate and probably doesn’t glide as well, fast landings are in order too.

The aircraft flies really nicely and even in a forced stall won’t drop a wing!

Naze32 configuration via Bluetooth Android and Cleanflight

250 Mini quad with Naze32 bluetooth transceiver attached

I recently added a bluetooth transceiver to my 250 mini quad. Travis Grindal’s video shows how simple it is to get working. It makes configuration at the field much quicker and easier.

A couple of things to note. The bluetooth module that I bought is different to the standard and the connection PIN is “3232” which took a while to work out. Secondly, it is possible to connect to the Naze32 board via the cleanflight configurator on a computer. Just make sure that correct port and baud rate are selected as shown in the image below.

Cleanflight configurator bluetooth settings

Here is Travis’ video walking through the bluetooth set up.


Georeferencing ImageJ output files with GDAL

I’ve been using ImageJ (aka FIJI) to create an NDVI floating point image from some aerial imagery of a heathland in Nidderdale. In order to import the NDVI output image into a GIS package or image processing software like eCognition the NDVI TIFF needs to be georeferenced.

The original aerial imagery from which the NDVI image was created has already been georeferenced so we can grab the coordinates of it’s corners and copy them over to the new NDVI GeoTIFF. The steps below go through this process.

  1. First install gdal. If you are using homebrew on a mac, the install process is as simple as
    brew install gdal
  2. Get the CRS and coordinate information from the already georeferenced GeoTIFF with the gdalinfo command
    gdalinfo sourceimage

    GDAL info
    The values we want from here are the GEOGCS (WGS84) image size (7428, 7932) upper left and lower right coordinates.

  3. Now we can take those values and create a GeoTIFF from the NDVI TIFF image with the following command
    gdal_translate -of GTiff -a_srs WGS84 -a_ullr -1.6811175 54.0748652 -1.6754438 54.0713020 GeoTiff\ ndvi-input-image.tif ndvi-georeferenced-geotiff.tif

    You will see a status bar as below as the image is tagged by GDAL.

    gdal_translate GEoTiff Tag

  4. Now we can import the NDVI GeoTIFF image into whatever GIS or image processing software we want. Below you can see the georeferenced NDVI GeoTIFF perfectly overlaid on the NGB aerial image that the georeferencing information was taken from. The GIS software in use here is QGIS.
    GeoTIFF NDVI image in QGIS
  5. Now we can go ahead and use the NDVI image to aid in vegetation classification and we can export classified objects as georeferenced *.shp files and use them in our GIS software

    Heathland classification eCognition shape file export

    eCognition shape files exported to QGIS. Credit to Letters from Sal for the how-to.

Banggood.com LEDs for orientation

Banggood.com strip LEDs for drones and multirotors

Banggood.com strip LEDs for drones and multirotors

I’ve been looking at various options for adding orientation lighting to my hexacopter. It’s a toss up between price, visibility and power draw. I finally settled on these banggood.com strip LEDs and I’m impressed. They’re nice and bright and will help me to keep orientation when flying the hexacopter at a distance. I just wish delivery was a little quicker. It took about 3 weeks for these to turn up.

They are pretty cheap too at £1.62 per strip with free shipping. You can pick them up here http://www.banggood.com/LED-Decoration-Board-Strip-3S-For-QAV250-Quadcopter-p-951108.html

Subscribe to my YouTube channel for more.