public
Last active

Social Debugger WordPress Plugin

  • Download Gist
social_debugger.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
<?php
 
/*
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: http://crowdfavorite.com/
*/
 
/** README
*
* Once activated, simply go to any page in the admin and append the query string argument social_debug=true
*
* Example:
*
* http://yourdomain.com/wp-admin/index.php?social_debug=true
*/
 
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
<pre>
# Social Debug
 
Current Time: $current_time
 
## Software Versions
 
MySQL: $mysql_version
WordPress: $wp_version
PHP: $php_version
Social: $social_version
WebServer: {$_SERVER['SERVER_SOFTWARE']}
 
## Social options
 
social_locked: $social_locked
social_unlocked: $social_unlocked
social_last_lock_time: $social_last_lock_time
social_semaphore: $social_semaphore
 
</pre>
OUT;
die($message);
}
}
 
if (is_admin()) {
add_action( 'wp_loaded', 'social_print_debug', 1);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.