# Taken from

Output Compression, Browser Caching, Asset Minification and Image Optimization

The following apache and nginx configurations will handle compression and browser caching. A few different WordPress plugins can be used for asset minification.

mod-pagespeed may be available for configuration as an apache or nginx module. If available, there's no need to use the individual apache or nginx configurations. Mod-pagespeed will handle compression and browser caching, making the apache and nginx configurations unnecessary. The WordPress plugins are still needed for asset minification as they ensure assets are loaded in the proper order once minified.

Image optimization should be done using the EWWW Image Optimizer plugin.

Apache Config

Output Compression


Hardening WordPress

Securing WordPress using a combination of configuration changes and plugins.

.htaccess and wp-config.php tasks

1. Add keys to wp-config.php

2. Hide .htaccess and wp-config.php

View function-alt.php
function my_login_redirect( $redirect_to, $request, $user ) {
$redirect_to = home_url() . '/members/';
return $redirect_to;
add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );
View sticky-alert-options.js
$(document).ready(function() {
barColor: '#222', // alert background color
barFontColor: '#FFF', // text font color
barFontSize: '1.1rem', // text font size
barText: 'I like bass and car audio :)', // the text to display, linked with barTextLink
barTextLink: '', // url for anchor
cookieRememberDays: '2', // in days
displayDelay: '3000' // in milliseconds, 3 second default
View insert-posts.php
// Load WordPress
require_once 'path/to/www/wp-load.php';
require_once ABSPATH . '/wp-admin/includes/taxonomy.php';
// Set the timezone so times are calculated correctly
// Create post
View rss-via-shortcode.php
Plugin Name: RSS Via Shortcode for Page & Post
Version: 1.2.b
Plugin URI:
Description: Makes it easy to display an RSS feed on a page
Author: Susanta K Beura
Author URI:
License: GPL v2
Usages: [rssonpage rss="Feed URL" feeds="Number of Items" excerpt="true/false" target="_blank|_self"]
View pug-bomb.php
Plugin Name: Pug Bomb API Endpoint
Description: Adds an API endpoint at /api/pugs/$n_pugs
Version: 0.1
Author: Brian Fegter
Author URL:
class Pugs_API_Endpoint{

Running WordPress on

The official wordpress and mysql image combined for a project. You can extend the json with more variables from the official images.

Start it

sloppy start wordpress.json  -var=USERNAME:username,,DBUSER:db-user-for-wordpress,DBPASS:db-password-for-wordpress,DBROOT:db-root-password
where USERNAME has to be your username
View config.json
"api_url": "",
"api_token": "TfmCMdxDhU5myguKNlW5",
"monitors": [
"name": "nodegear frontend",
"url": "",
"metric_id": 1,
"threshold": 80,
"component_id": null,