Backups are simple

… or they should be, anyway.

I think that one of the more popular excuses around for not having backups it’s “I haven’t gotten to it”; usually because you don’t have the time to try that fantastic tutorial you found for encrypted-incremental-automatic-deduplicated-control-versioned-backups on Amazon S3.

The thing it’s… it’s ok if you don’t have time for it, because it means you’re doing your job… which very likely isn’t Chief Backups Officer. What it’s not ok it’s that you keep postponing your backups!

That’s why I think that when you’re first configuring your server you should immediately configure some sort of backup that:

  1. It’s very quick to setup, so you actually do it
  2. It’s easy to restore from, so it’s actually useful

And since I’m assuming you’re not an idiot, I know you’ll do your best to keep them safe; which doesn’t mean creating some new fancy encryption scheme but using existing tools to do the job (for instance, ssh and rsync are both encrypted, so they’re good enough for transmitting the data to another server).

I’m sure there are plenty cool alternatives to keep your data safe, but the truth it’s that if they don’t comply with these two basic requirements you should wonder if there’s a better, simpler way.

Adding a new panel to the WordPress Debug Bar plugin

You can extend the WordPress Debug Bar plugin adding new custom panels to fit your needs; for instance, showing responses from external APIs or webservices, or for other custom features.

// the 'debug_bar_panels' filter it's used by the plugin;
// hook into it to add your custom panel
add_filter( 'debug_bar_panels', 'my_custom_panel_init' );

/**
 * Initialize my custom debug panel
 * @param array $panels Debug bar panels objects
 * @return array Debug bar panels with your custom panels
 */
function my_custom_panel_init( $panels ) {
    // you'll be extending the Debug_Bar_Panel class provided
    // by the plugin
    class Debug_Bar_Custom_Panel extends Debug_Bar_Panel{
        public function init(){
            // you should set at least the title of your custom
            // panel. it'll be used as the tab title
            $this->title( 'Custom Panel' );
        }
        public function render(){
            // build and echo your relevant output
        }
    }
    // add your custom panel
    $panels[] = new Debug_Bar_Custom_Panel();
    return $panels;
}

That’s an extremely simple example. You can check a more complex and complete one by viewing the source of one of the Debug Bar extender plugins, such as the Debug-Bar-Shortcodes GitHub repo.