Year: 2016
-
The Correct Way to Build Plugins – The Bitter Truth
What is the correct way to build a WordPress plugin, the official, recommended way that was always intended? The idealised standard? The Problem Plugins are not discrete modules in the WordPress world. Their isolation exists only on the filesystem, but once that code is loaded into memory it shares the same space as Core itself.…
-
Return Data not HTML
Functions and methods should return data structures, not rendered HTML. Returning HTML encourages early escaping, HTML parsing, and mixed data processing and output. These are all security and performance issues. What Could Go Wrong? Assembling and handling strings of HTML complicates things as you’re no longer dealing directly with the data, but a particular form…
-
Vagrant Provision Timeouts
Have you ever encountered this error? Timed out while waiting for the machine to boot. This means that Vagrant was unable to communicate with the guest machine within the configured ("config.vm.boot_timeout" value) time period. If you look above, you should be able to see the error(s) that Vagrant had when attempting to connect to the…
-
WordCamp Food
Lunch can be stressful for any WordCamp organiser, but there’s a major issue that’s trivially easy to fix that’s gone unnoticed. What’s for lunch? Different people have allergies and dietary requirements, but lunch can be a stressful and anxious situation for all attendees. For example, lunch at the first WordCamp Europe was a mound of unlabelled…
-
Embedding PHP in Content
Would you like to embed and run some PHP code in a blog post? Need to include a PHP file in a sidebar widget? Recently discovered this curious plugin? Don’t, you’re about to make an awful mistake. Lets walk through why it’s bad, and what you should be doing instead. Why Might Somebody Embed PHP? Perhaps you…