[wordpress插件] Debug Tool调试工具

wordpress 插件 文章 2020-04-14 08:01 819 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This is tool that help developers and administrators easier getting information.

此工具可帮助开发人员和管理员更轻松地获取信息。

The debug bar is available on front side for everyone if WP_DEBUG is true.

如果WP_DEBUG为true,则调试栏可用于所有人。

If you are admin you can open bar on any page.

如果您是管理员,则可以在任何页面上打开栏。

Hover the mouse cursor to bottom right corner and click on

将鼠标悬停在右下角,然后单击

Features:

功能:

    • Implementation time counter
    • 实施时间计数器

    • Queries counter
    • 查询柜台

    • Queries list (sortable)
    • 查询列表(可排序)

    • Memory counter
    • 内存计数器

    • Segment checker
    • 段检查器

    • Cron jobs information
    • Cron职位信息

    • WP_Cache counter
    • WP_Cache计数器

    • phpinfo() window
    • phpinfo()窗口

    • References menu
    • 参考菜单

    • Image Puller that provide pull missed images from production to develop site
    • Image Puller,可提供从生产到开发站点的缺失图像

    Implementation time counter

    实施时间计数器

    It count the time from plugin loaded action to debug bar.

    它计算从插件加载操作到调试栏的时间。

    It does not consider processes that implement before and during the plugins are loading.

    它不考虑插件加载之前和期间实现的过程。

    Queries counter

    查询柜台

    It count all what is queried via $wpdb object.

    它计算通过$ wpdb对象查询的所有内容。

    Queries list

    查询列表

    It show all what is queried via $wpdb object.

    它显示了通过$ wpdb对象查询的所有内容。

    The SAVEQUERIES constant must be defined as true.

    SAVEQUERIES 常量必须定义为 true

    Memory counter

    内存计数器

    Returns the amount of memory, in bytes, that’s currently being allocated to your PHP script.

    以字节为单位返回当前分配给您的PHP脚本的内存量。

    Segment checker

    段检查器

    Also you can check any segment of your code.

    您还可以检查代码的任何段。

    do_action('check_segment', 'segment_1');

      do_action('check_segment','segment_1');

    //do somethisng

    //做某事

    do_action('check_segment', 'segment_1');

    do_action('check_segment','segment_1');

    The code below returns in debug bar new item like this:

    下面的代码在调试栏中返回如下新项:

    segment_1: 14.14/3/1

    segment_1:14.14 / 3/1

    The digits there ara time, queries and how many times this code was implemented.

    时间,查询次数以及该代码的实施次数。

    References menu

    参考菜单

    The default one item of this menu is Errors.

    此菜单的默认一项是“错误”。

    It shows notices and warnings including case when WP_DEBUG is false.

    它显示通知和警告,包括 WP_DEBUG 为false时的情况。

    And also you can easy add your item to this menu and print there any var_dump or anything else.

    您还可以轻松地将项目添加到此菜单,然后在其中打印任何var_dump或其他任何内容。

    add_filter('wp_debug_refs', 'my_debug_tool_ref');

      add_filter('wp_debug_refs','my_debug_tool_ref');

    function my_debug_tool_ref ($refs) {    

    函数my_debug_tool_ref($ refs){    

    global $post;    

    全球$ post;    

    $refs['my_ref_id'] = array(        

    $ refs ['my_ref_id'] = array(        

    'title' => 'My ref',        

    'title'=>'我的推荐人',        

    'content' => 'My ref' .

    'content'=>'我的推荐人'。

    var_export($post, true),    

    var_export($ post,true),    

    );    

    );    

    return $refs;

    返回$ refs;

    }

    }

安装步骤

Debug Tool is easy to install and configure.

调试工具易于安装和配置。

    1. Upload the easyazon directory to the /wp-content/plugins/ directory
    2. easyazon 目录上传到 / wp-content / plugins / 目录

    3. Activate the plugin through the ‘Plugins’ menu in WordPress
    4. 通过WordPress中的“插件”菜单激活插件

    5. Set WP_DEBUG constant if you want to see the bar at front side when you are logged out.
    6. 如果要在注销时看到正面的栏,请设置WP_DEBUG常量。

下载地址
https://downloads.wordpress.org/plugin/debug-tool.2.2.zip
-EOF-

AI助手支持GPT4.0