Title: wp pear debug
Author: silasco
Published: <strong>2008 年 7 月 25 日</strong>
Last modified: 2015 年 12 月 5 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/wp-pear-debug.svg)

# wp pear debug

 作者：[silasco](https://profiles.wordpress.org/silasco/)

[下载](https://downloads.wordpress.org/plugin/wp-pear-debug.1.5.zip)

 * [详情](https://cn.wordpress.org/plugins/wp-pear-debug/#description)
 * [评价](https://cn.wordpress.org/plugins/wp-pear-debug/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/wp-pear-debug/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/wp-pear-debug/#developers)

 [支持](https://wordpress.org/support/plugin/wp-pear-debug/)

## 描述

This plugin incorporates the pear php_debug library into wordpress.

I started creating a new website around wordpress and noticed that there was no 
way to quickly access debug information so I integrated this class
 into wordpress
for quick easy debugging when developing or experiencing problems on your wordpress
website.

Please feel free to ping me on twitter if you have a question.

 * Features

This plugin unlike most operates from within a class.
 There are several options
which can be set in the admin section

 1.  Debug Status: Overall
      this option allows you to enable and disable debugging 
     entirely
 2.  Display Debugging for: Guests
      This option allows you to enable debugging when
     no user is logged in
 3.  The rest are a list of roles found in the sytem, eg. editor, contributor, administrator
     
     For each you have the following options: Admin & Front End, Admin Only, Front 
     End Only, Disable
 4.  The plugin shows queries that were run by wordpress
      Please note that some queries
     run before the plugin is initialized. to ensure most if not all queries get recorded
     see step 4 in installation section. v1.4.1 shows not only the query but the time
     taken by the query and the function which called the query.
 5.  You can easly add debug information to the debugger by making use of several functions
 6.      ```
         <?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();
     
     
          ?>
         ```
     
 7.  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.
 8.  Note that the debug bar floats at the top right and will not disrupt your layout.
 9.  To ensure layout stability the plugin is hard coded to use only the HTML Div Renderer
 10. displaying server and response varables.
 11.  * 请求
      * 反馈
      * Setings
      * Globals
      * Php
      * 文件
      * Database queries
      * 执行时间
      * Errors and messages
      * Link to w3c validator
 12. 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″]
 13. 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.

### Interesting Points

This plugin requires no 3rd party dependencies such as jQuery.

## 屏幕截图

 * [[
 * [[

## 安装

Automatic Install:

 1. Use the wordpress online installer
 2. 通过WordPress的“插件”菜单激活插件
 3. Set the appropriate option under settings->Debugger admin menu
 4. Please note that the above options must be saved at least once before the debugger
    can appear
 5. The following step is optional but recommended. Add the following code to wp-config.
    php `define('SAVEQUERIES',true);`

Manual Upload:

文件列表

 * lang (language files)
 * lib (containing debugger and helper libraries)
 * wp-pear-debug.php (Main plugin file)

 1. UPload folder `wp-pear-debug` to the `/wp-content/plugins/` directory
 2. 通过WordPress的“插件”菜单激活插件
 3. Set the appropriate option under settings->Debugger admin menu
 4. Please note that the above options must be saved at least once before the debugger
    can appear
 5. The following step is optional but recommended. Add the following code to wp-config.
    php `define('SAVEQUERIES',true);`

## 常见问题

  Who is this for

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.

  Can I see the library in action?

You can see the pear demo [here:](http://www.php-debug.com/www/PHP_Debug_HTML_Div_test.php)
Pear Demo.

## 评价

此插件暂无评价。

## 贡献者及开发者

「wp pear debug」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ silasco ](https://profiles.wordpress.org/silasco/)

[帮助将「wp pear debug」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-pear-debug)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wp-pear-debug/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/wp-pear-debug/)，或通过[RSS](https://plugins.trac.wordpress.org/log/wp-pear-debug/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wp-pear-debug/)。

## 额外信息

 *  版本 **1.5**
 *  最后更新：**11 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 2.8 或更高版本 **
 *  已测试的最高版本为 **4.3.34**
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-pear-debug/)
 * 标签
 * [debug](https://cn.wordpress.org/plugins/tags/debug/)[debugging](https://cn.wordpress.org/plugins/tags/debugging/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-pear-debug/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/wp-pear-debug/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-pear-debug/reviews/)

## 贡献者

 *   [ silasco ](https://profiles.wordpress.org/silasco/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wp-pear-debug/)