Panegyric: showing off what we’ve done on Github

4 Jan 2018

LShift  Tools  Web 

Originally posted at https://tech.labs.oliverwyman.com/blog/2018/01/04/panegyric-showing-off-what-weve-done-on-github/

Last month, I said we’d be talking more about open source work that we’re doing. This month, I’ve been building Panegyric, a WordPress plugin (which is what this site is written in). This plugin (which isn’t live on the site yet, but will be soon) lists all the Github pull requests we’ve recently done. However I figured it would be fairly self-serving to show stuff we’ve done for internal projects or for colleague’s projects, so it skips all of those. It only shows 3rd party project pull requests, and only the merged ones of those (because of the reasonable assumption that merged PRs are wanted by said projects). Some of these PRs we’ll be blogging about, but many are simply the day-to-day things we try and give back to the wider world.

Along the way, I had the “fun” of writing in PHP again. If you’re going to write a WordPress plugin, it’s basically the only sensible option. However, I’m once again reminded of it’s many, many problems (crappy namespaces, tendency to just keep going rather rather than stop when there’s an error, etc, etc) and reminded it’s not a good place to work. However, there was a few things I could do to encapsulate things a bit. Namely: Docker. Now, WordPress and Docker is a common thing. Heck, it’s the canonical “Hello World” for Docker Compose, and there are many other guides on “how to set it up in Docker”.  However, I found a complete lack of “and here’s how you do plugin development under Docker while keeping the source files outside of the container” guides. The docker-compose.yml in the repo is the first time I’ve seen that actually done, primarily due to the “volumes” setting for WordPress so the plugins folder is external. This works mainly because the first time a WordPress Docker container boots, it installs into the specified path and copies the rest of the plugin folder files into the external folder (which we then promptly ignore). WordPress always auto-reloads your plugin changes (because PHP), so you can now do external development easily. There’s also an auto-reformatter running against your code which I generally find absolutely vital these days.

This can all be installed in your WordPress instance by following the WordPress automatic plugin installation instructions, searching for “panegyric”, as it’s now been submitted to the upstream plugin repo

Previously: Business Idea: Animal Sanctuary video feeds Next: Sked: merged calendars as a service