Skip to content

Instantly share code, notes, and snippets.

@szbl
Created December 9, 2012 18:01
Show Gist options
  • Save szbl/4246300 to your computer and use it in GitHub Desktop.
Save szbl/4246300 to your computer and use it in GitHub Desktop.
Plugin for WP Maintainter client on 1and1 hosting with PHP5.4 strict standards notices
<?php
/*
Plugin Name: WP Maintainer 1and1 Server Fix
Author: theandystratton
Author URI: http://wpmaintainer.com
Description: Attempts to clean up some server environment issues with PHP to stop Strict Standards warnings from displaying in production.
*/
add_action( 'admin_init', 'wpm_admin_init' );
add_action( 'init', 'wpm_supress_public_errors' );
function wpm_admin_init()
{
// Change to ~E_STRICT. Using php.ini in directories was NOT working.
// Setting is defaulting on this server to E_ALL & ~E_NOTICE & E_STRICT
error_reporting( E_ALL & ~E_STRICT & ~E_NOTICE );
}
function wpm_supress_public_errors()
{
ini_set( 'display_errors', 'Off' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment