예제 #1
0
<?php

// Get a reference to the SysInfo instance
$sysinfo = SysInfo::get_instance();
// Now get information from the environment
$theme = wp_get_theme();
$browser = $sysinfo->get_browser();
$plugins = $sysinfo->get_all_plugins();
$active_plugins = $sysinfo->get_active_plugins();
$memory_limit = ini_get('memory_limit');
$memory_usage = $sysinfo->get_memory_usage();
$all_options = $sysinfo->get_all_options();
$all_options_serialized = serialize($all_options);
$all_options_bytes = round(mb_strlen($all_options_serialized, '8bit') / 1024, 2);
$all_options_transients = $sysinfo->get_transients_in_options($all_options);
?>

<div id="sysinfo">
	<div class="wrap">
		<div class="icon32">
			<img src="<?php 
echo SYSINFO_PLUGIN_URL;
?>
/images/sysinfo.png" />
		</div><!-- /.icon32 -->
		
		<h2 class="title"><?php 
_e(' SysInfo', 'sysinfo');
?>
</h2><!-- /.title -->
		
예제 #2
0
     * @return	array	$options	All of the options that exist in the WordPress installation
     */
    function get_all_options()
    {
        // Not to be confused with the core deprecated get_alloptions
        return wp_load_alloptions();
    }
    // end get_all_options
    /**
     * Gathers a list of all of the transients set in the plugin.
     * 
     * @param	array	$options		The array of options managed by the installation of WordPress
     * @return	array	$transients		The array of transients currently stored by WordPress
     */
    function get_transients_in_options($options)
    {
        $transients = array();
        foreach ($options as $name => $value) {
            if (stristr($name, 'transient')) {
                $transients[$name] = $value;
            }
            // end if
        }
        // end foreach
        return $transients;
    }
}
// end class
// Let's get this party started
SysInfo::get_instance();