Wordpress 3.8.1 SAE port

https://gist.github.com/soulteary/7985940