Skip to content

Instantly share code, notes, and snippets.

@getsource
Created July 13, 2013 00:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save getsource/5988793 to your computer and use it in GitHub Desktop.
Save getsource/5988793 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Bad Plugin
Plugin URI: http://github.com/wp-cli/wp-cli
Description: Creates a difficult to search-replace option
Author: Mike Schroder
Version: 0.1
Author URI: http://www.getsource.net/
*/
add_action( 'init', 'gs_add_bogus_option' );
function gs_add_bogus_option() {
update_option( 'gs_bad_option', serialize( GS_WP_Private_Singleton::get_instance() ) );
}
class GS_WP_Private_Singleton {
protected static $instance;
public $stuff = "I am a string";
public $things = "I have the things";
private function __construct() {
return 1;
}
public static function get_instance() {
if ( !self::$instance ) {
self::$instance = new GS_WP_Private_Singleton();
}
return self::$instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment