Hardening drebbits.com

Apache to Nginx An Attempt HTTP2 Since I am in upgrading :allthethings: mood, I decided to also use the latest technology in the http world. I stumbled into this guide by deliciousbrain plus other guides for hosting WordPress yourself. White screen of Death To enable http2, I needed to upgrade nginx. After upgrading from 1.6.x to 1.10.x, I was greeted with a white […]

Purge Varnish Cache on Save

In case, someone out there trying to figure out how to purge varnish (3.x) cache in your WordPress site when updating a post/page — I’ve dealt with it this week and it’s pretty easy to accomplish it. Now that we’re talking about purging the cache, I presumed you have varnish configured and all your setup works. To start off, if there’s no […]

Sanitize Multidimensional Input Field

Since input can accept multidimensional reference such as name=”foo[bar]” or name=”foo[bar][inside], you should sanitize/escape values multidimensional array recursively from the POST action. With WordPress’s sanitize_text_field, here’s a gist: function sanitize_array( &$array ) { foreach ($array as &$value) { if( !is_array($value) ) // sanitize if value is not an array $value = sanitize_text_field( $value ); else // go inside this […]

Activating Photon of Jetpack

Maximizing the full capacity of Jetpack, I decided to enable Photon to boost serving of images in my blog from WordPress.com end. It’s worth noting that WordPress.com rank very well in terms of DNS performance. Along the way of discovering how to effectively use this module to match with the design specification of my blog, I have discovered […]