Adding a WordPress admin page

Adding a WordPress admin page in itself is pretty straightforward, and well documented.  You do it using the add_menu_page function, something like this… add_menu_page(‘My Page’, ‘My Page’, ‘manage_options’, ‘my-page’, ‘show_my_page’, ”, 1); This function takes the following parameters: Page title (required) – the text to be displayed in the title tags of the page when the…

Updating WordPress post metadata

I was fighting with a WordPress issue earlier today, and the solution turned out to be pretty simple, and a clear case of me not reading the WordPress developer resources properly. The situation arose because I was updating a number of post metadata fields and trying to count the number of edits, like this… $count…

PHP vs BOM

I’ve just fixed a little head-scratcher, and as a little reward to myself, I’m going to write about it.  Well, I’m sat on train, so methods of celebration are a little limited. Anyway, what’s that title about? PHP is a popular general-purpose scripting language that is especially suited to web development.  And a BOM (or Byte…

Time To First Byte – part 2

I often do performance optimisation on WordPress sites for clients, and have recently completed such a project.  One really critical metric I explored is Time To First Byte (TTFB).  But it can be hard to really drill down into it. In my last post I spoke specifically about how to use the Server-Timing response header…