Security enhancements, updated for WordPress 3.9