开发者 | Garvin Casimir |
---|---|
更新时间 | 2015年12月5日 13:55 |
PHP版本: | 2.8 及以上 |
WordPress版本: | 4.3.1 |
<?php
//For advanced use.
//Direct access to instance of debugger
$oDebug = wp_pear_debug::get();
$oDebug->add($variable); //add variable to debug
$oDebug->dump($object,$varname); //var_dump an array or object. $varname optional
$oDebug->queryRel($info); //add query related info
$oDebug->error($info); //add user error
//more options available in the pear::php_debug documentation
//With v1.2 you have access to several wrapper functions
//Enough for most people
wp_pear_debug::add();
wp_pear_debug::dump();
wp_pear_debug::error();
//if you run this query with wpdb
//It will probably appear anyways.
wp_pear_debug::query();
?>
1. Debug information appears in a neat panel controlled by javascript. The options expand and collapse. The debug panel also has
a close button to completely remove the debug panel.
1. Note that the debug bar floats at the top right and will not disrupt your layout.
1. To ensure layout stability the plugin is hard coded to use only the HTML Div Renderer
1. displaying server and response varables.
* 请求
* 反馈
* Setings
* Globals
* Php
* 文件
* Database queries
* 执行时间
* Errors and messages
* Link to w3c validator
1. With v1.2 you can add debug information via shortcode from within your post. [wp_pear_debug]foo bar[/wp_pear_debug]
or you may use:
[wp_pear-debug foo="bar" foo1="bar2"]
1. Internationalization support has been added with version 1.4.6. A rough spanish translation has been provided in the hope that someone can take it and create a better translation.
define('SAVEQUERIES',true);
wp-pear-debug
to the /wp-content/plugins/
directory
define('SAVEQUERIES',true);
I imagine this plugin will be most valuable to wordpress developers It will also be good for people who are seeing errors on their site. This plugin also measures script execution time so It is also good for people who want to measure the performance of their entire site or a specific part of their script.
You can see the pear demo here: Pear Demo.