Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Social Debugger WordPress Plugin
Plugin Name: Social Debugger
Description: Plugin to print debugging information by appending ?social_debug=true to the url within the admin
Version: 0.1
Author: Crowd Favorite
Author URI:
* Once activated, simply go to any page in the admin and append the query string argument social_debug=true
* Example:
function social_print_debug() {
if ($_GET['social_debug'] == 'true') {
$current_time = current_time('mysql', 1);
$mysql_version = mysql_get_server_info();
$php_version = phpversion();
$wp_version = get_bloginfo('version');
$social_version = Social::$version;
$social_locked = get_option('social_locked', "Doesn't Exist");
$social_unlocked = get_option('social_unlocked', "Doesn't Exist");
$social_last_lock_time = get_option('social_last_lock_time', "Doesn't Exist");
$social_semaphore = get_option('social_semaphore', "Doesn't Exist");
$server = print_r($_SERVER, true);
$message = <<<OUT
# Social Debug
Current Time: $current_time
## Software Versions
MySQL: $mysql_version
WordPress: $wp_version
PHP: $php_version
Social: $social_version
## Social options
social_locked: $social_locked
social_unlocked: $social_unlocked
social_last_lock_time: $social_last_lock_time
social_semaphore: $social_semaphore
if (is_admin()) {
add_action( 'wp_loaded', 'social_print_debug', 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment