Debug This is a standalone plugin built, maintained & operated by the friendly folks over at MachoThemes 调试 strong>是一个独立的插件,由友好的人员在 MachoThemes上构建,维护和操作
p>
For admins, developers, and support staff, Debug This provides a ton of information about your WordPress installation, all from the front-end admin bar.
对于管理员,开发人员和支持人员,调试此 strong>可从前端管理栏中提供大量有关WordPress安装的信息。 p>- The current WP_Query object
- 当前WP_Query对象 em> li>
- Blog info and options
- 博客信息和选项 li>
- Embed providers
- 嵌入式提供商 li>
- Files in rendered HTML (CSS, images, JavaScript)
- 呈现的HTML文件(CSS,图像,JavaScript) li>
- Filters and actions
- 过滤器和操作 li>
- Images sizes
- 图片大小 li>
- Globals and constants
- 全局变量和常量 li>
- Menus
- 菜单 li>
- Object cache stats
- 对象缓存统计信息 li>
- Plugins, must-use plugins, and dropins
- 插件,必须使用的插件和dropins li>
- Rewrite rules
- 重写规则 li>
- Queries
- 查询 li>
- PHP and server information
- PHP和服务器信息 li>
- Post attachments
- 帖子附件 li>
- Post types
- 帖子类型 li>
- Scripts and styles enqueued
- 排队的脚本和样式 li>
- Shortcodes
- 简码 li>
- Sidebars and widgets
- 侧边栏和小部件 li>
- Taxonomies and terms
- 分类法和术语 li>
- Themes
- 主题 li>
- Users
- 用户 li>
- WP cron schedules and jobs
- WP cron的时间表和工作 li>
- WP debug log
- WP调试日志 li>
ul>
Debug This helps you save time and effort when trying to figure out what’s going on.
调试 strong>可帮助您节省时间和精力,以弄清正在发生的事情。Instead of hardcoding debug snippets or writing complex unit
不用硬编码调试代码片段或编写复杂的单元
tests for small functionality, you can simply bring to the surface what you need right from the admin bar.
测试小功能,您可以直接从管理栏中显示所需的内容。 p>
For example, when viewing a single post, you can see:
例如,查看单个帖子时,您可以看到: p>
- a list of post attachments,
- 帖子附件列表, li>
- which menus and sidebars are being displayed,
- 正在显示哪些菜单和侧边栏, li>
- the post type, post fields, and meta data,
- 帖子类型,帖子字段和元数据 li>
- the current query variables and query string,
- 当前查询变量和查询字符串, li>
- the rewrite rules applied,
- 应用的重写规则, li>
- the author,
- 作者 li>
- the terms,
- 条款 li>
- and much more.
- 还有更多 li>
ul>
Now compatible with Kint!
现在与Kint兼容! h4>
Don’t get lost in deep arrays and objects.
不要迷失在深层阵列和对象中。
Organize and isolate your debugging output by installing this great plugin:
通过安装此出色的插件来组织和隔离调试输出:
Kint Debugger
调试器 p>
Recommended Plugins
推荐插件 h4>
add_debug_extension( add_debug_extension( $mode,
$模式,
$menu_label,
$ menu_label,
$description,
$ description,
$callback,
$ callback,
$group = 'General'
$ group ='常规'
);
);
code> pre>
Example
示例 strong> p>add_debug_extension( add_debug_extension( 'actions',
“动作”,
__('Actions', 'debug-this'),
__('Actions','debug-this'),
__('$wp_actions contains all active registered actions', 'debug-this'),
__('$ wp_actions包含所有活动的已注册动作','debug-this'),
'foo_callback',
'foo_callback',
'Filters And Actions'
“过滤条件和操作”
);
);
function foo_callback($buffer, $template){
函数foo_callback($ buffer,$ template){
global $wp_actions;
全局$ wp_actions;
$debug = print_r($wp_actions, true);
$ debug = print_r($ wp_actions,true);
return $debug;
返回$ debug;
}
}
code> pre>
You can add links to the header of a debug mode page.
您可以将链接添加到调试模式页面的标题。
Place this code within your debug callback function.
将此代码放在调试回调函数中。 p>
add_debug_header_link('http://urltolink', 'Link Label'); add_debug_header_link('http:// urltolink','链接标签');
code> pre>
Extensions can be removed as well using remove_debug_extension($mode);
扩展名也可以使用 remove_debug_extension($ mode); code> p>删除No PRE Tags
没有PRE标签 strong> p>If you don’t want your debug output to be enclosed in PRE tags, simply set the following in your extension:
如果您不希望调试输出包含在PRE标签中,只需在扩展名中设置以下内容即可: p>
Debug_This::$no_pre = true; Debug_This :: $ no_pre = true;
code> pre>
Saved Queries and Execution Time
保存的查询和执行时间 strong> p>Retrieve saved queries and execution time by using the following static properties:
使用以下静态属性检索保存的查询和执行时间: p>
Debug_This::$execution_time
-
Debug_This :: $ execution_time code> li>Debug_This::$queries
– SAVEQUERIES must defined as true-
Debug_This :: $ queries code> –必须将SAVEQUERIES定义为true li>
ul>
URL Helpers
URL帮助器 strong> p>