I’m always looking for ways to improve my workflow and productivity; most recently I’ve started using Markdown for as many projects as I can, so using Markdown in WordPress is no exception!
If you haven’t seen or used Markdown before; it’s a super-lightweight markup language that allows you to add formatting elements as you go by using special syntax. For example, if you want to make a section of text display in italic, simply put an asterisk at the start of the word or sentence. When the output is then parsed, your *Italics* then becomes Italics).
Why is this useful?
Like an XML file, it’s open, super portable and easily readable across many applications, operating systems and web platforms (think Reddit, GitHub, Stack Exchange, Confluence, etc).
It saves time when editing simple documents as you don’t have to go back and highlight/modify formatting, just add the syntax as you go, often with the use of one or two characters at the start of a line. Simple examples might be a bulleted list, where you add an asterisk *, or an H1 heading where you add a single hash symbol #.
It’s fantastic for writing documentation where you might want to insert a quick code snippet or command just like this!
Due to the very simple notation, it’s far quicker than writing HTML and can be substituted for HTML on many publishing platforms.
If Git is already part of your workflow, it makes for easy collaboration with others (ideal for Devs!) and you can use GitHub for both version control and easy access from anywhere to your in-progress content.
Learning and practising with Markdown opens up future opportunities to move to various publishing platforms such as Jekyll, Hugo, etc. I might even think about giving the site a facelift sometime soon!
New skill to master, init?
You’ve sold me! How do I start?
I don’t know why WordPress didn’t enable it in the default code, but it does come as part of Jetpack (which I assume 90% of sensible WordPress Users are using!). If you want to adopt it to your blogging workflow your site too, simply install Jetpack, then enable it under Settings → Writing.
After writing a couple of draft posts with it so far, I have to say I’m pretty happy with it. The next step is to find a decent plugin for linking to GitHub, enabling me to write/edit posts in my favourite text editor (VSCode, Sublime Text, Atom depending on my mood), then push them up via Git!
Just a quick update on a handful of changes I have made / am making to the site, the first of which is hopefully pretty obvious from the post title! I have been meaning to add a CloudFlare CDN to my WordPress site for a very long time, but like all things which involve a bit of complexity and time to implement, I’ve been putting it off!
My blog was recently suffering quite a few issues caused by the performance of my site host (possible news on that upcoming in the next few weeks). I wanted to both mitigate their performance problems, and generally reduce page times to my site as part of my recent efforts to improve SEO for the site. As many of you may know, Google rank sites higher if they have page load times under about 2000 ms (or 2 seconds to us human folk!)
There are many ways to improve site performance in WordPress, but the one with then biggest impact is to introduce a CDN.
So what is a CDN?
This reduces both outbound bandwidth and server resources used on your web server (otherwise known as an Origin Server), leaving it to get on with serving up dynamic content only. (Yes, technically they can also serve dynamic content, but let’s keep it simple for now!)
Why CloudFlare, and who are the alternatives?
For WordPress blogs, there are a number of well-known alternatives you could choose from (assuming you have little to no budget).
Built into the Jetpack, this will cache much of your content to the WordPress cloud servers. This seems to improve performance a bit, but it’s not perfect. The great thing is that it’s insanely easy to enable, with just one check box. Zero hassle implementation!
If you are using AWS, this is a great option, and it’s pretty cheap at about 8-12p per GB of content delivered. You also get 2 million requests and 50GB per month free for the first 12 months on the AWS Free Tier.
If you want the ultimate WAF, I highly recommend this. Their pricing is a bit out of my league for this feature on a personal blog though, so at the free or low cost tiers, CloudFlare worked better for my budget! Ironically if you then move to an enterprise support tier (e.g. for a company site), they are very keenly priced vs some of their competitors.
Superb free and “pro” tier features. Even at free tier you get free SSL, DDoS mitigation and CDN included!
I obviously went for the latter as it gives me options later on, to upgrade to a cloud-based WAF (Web Application Firewall), for a very reasonable price of only $20 per month. This is particularly useful if you are not so good at regularly updating WordPress or plugins as it will protect many of the most common SQL injection or XSS attack types.
What issues did I have implementing CloudFlare?
So far the switch has been pretty easy and smooth, there were just a few considerations, one of which I have resolved, the others I am still working on.
Firstly, CloudFlare is a pure DNS and CDN provider, they do not provide email hosting or forwarding services as standard. By moving my DNS from my existing provider (ZoneEdit) I lost the email forwarding functionality (I’m lazy and just use a catch-all for the domain). Fortunately I found an article by Chris Anthropic on using MailGun as a free alternative.
Second, I am keen to utilise CloudFlare’s free SSL encryption. I have been messing around trying to get either Flex or Full mode working, but have run into a few problems, which I will probably document once resolved! As far as I can tell this is more down to WordPress than CloudFlare!
In the mean time, if you go to the HTTPS version of my site you will likely get a few cert errors. These mainly seem to be caused by some objects within pages being HTTP and some HTTPS. This is something I hope to have resolved soon!
Lastly, the massively improved page load times have (as per the theory of constraints) uncovered the next bottlenecks in my system, which mainly seem to revolve around certain plugins I’m using for WordPress. If you want to check your own blog, simply open Chrome developer tools, navigate to the Network Tab, then refresh one of your pages for a very useful picture of the load times on your pages and every object within them:
So what is the result of all this effort? I seem to have reduced my average page load time down from 5-10 seconds, into the 2.5-3 second range for most pages, and much of that is background loading (i.e. most content appears almost instantly)! I will be working on those plugins to try to get everything under the 2000ms time frame over the next few weeks…
If you aren’t already using a CDN for your WordPress blog (other blog providers are available!), I highly recommend you check out CloudFlare!
The changes went live tonight (27/02/2016) around midnight, and all previous blog paths are now 301 redirected to the equivalent address on the new site. Hopefully I won’t lose too much Google juice with the new address!
So, if you have any difficulties whatsoever accessing paths or content, please let me know via Twitter, and I would be very grateful!
Wow! Little did I think that when I posted my first couple of silly posts in May 2010, that 6 years later I would actually be doing this thing on a regular basis and that it would have given me so many amazing learning and networking opportunities!
I originally built the blog both to remind myself of stuff by blogging about it and to test out running Ubuntu in my homelab; more fool me however, I chose Joomla as my CMS platform…
I’m sure it’s a great product, but frankly as a novice blogger it was really not a friendly platform, which discouraged me from actually using it, and for the first two years I managed a sum total of three posts! Woohoo!
I then made what was in hindsight, a very sensible decision to switch to WordPress. Since then I haven’t looked back… averaging a couple of posts every month for the past 4 years.
The funny thing I have found about blogging over this time is that I do this mostly for the enjoyment of writing and sharing information etc, yet I find myself in a permanent state of mental flagellation over not producing enough content or publishing often enough.
Like everyone I have my excuses, not least my two small children and crazily busy job, but I do what I can! I am always in awe at the amount of content some bloggers manage to generate, whilst still staying sane and having a personal life!
I don’t believe I’m the only one who feels like this… Perhaps we should start a support group and give the condition a name? How about “Bloggers Contrition”?
Anyway enough jabbering…
As to the title above, if you are a regular visitor to the site you may already have noticed some small changes going on with the domain name and titles. I am not rebranding, but I felt that switching from .org to .it and dropping the www was a nice way to give the site a bit of a refresher going into 2016.
The process itself will probably take me a couple of weeks to complete as I want to make sure I have all of the right 301 redirects in place before the final switch, but I am not anticipating this being a huge issue. If for any reason you happen to spot any of the content becoming unavailable, please let me know via a wee tweet!
Anyhoo, I’ll just wrap up by saying thank you all very much for allowing me to continue ranting on this little corner of the internet and for all the positive comments and feedback over the years. I shall endeavour to keep it up – if I can think of anything to write about!