[WordPress] 外掛分享: Debug Tool

首頁外掛目錄 › Debug Tool
WordPress 外掛 Debug Tool 的封面圖片
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
10+
安裝啟用
尚無評分
2809 天前
最後更新
問題解決
WordPress 4.0+ v2.2 上架:2017-02-22

內容簡介

這是一個幫助開發人員和管理員更輕鬆地取得訊息的工具。

如果 WP_DEBUG 為 true,則在前端,調試欄會對所有人都可用。如果你是管理員,則可以在任何頁面上打開調試欄。將滑鼠指標懸停在右下角並點擊即可。

功能特點:

實現時間計數器
查詢數計數器
查詢列表(可排序)
記憶體計數器
段檢查器
Cron 任務資訊
WP_Cache 計數器
phpinfo() 視窗
參考菜單
Image Puller 提供了從生產環境中拉取丟失圖像到開發站點的功能

實現時間計數器

它從套件已載入動作到調試欄計時。
它不考慮在載入插件之前或之中實現的進程。

查詢數計數器

它計算通過 $wpdb 對象查詢的所有內容。

查詢列表

它顯示通過 $wpdb 對象查詢的所有內容。

必須將 SAVEQUERIES 常量定義為 true。

記憶體計數器

返回當前分配給 PHP 腳本的記憶體(以位元組為單位)的數量。

段檢查器

您還可以檢查代碼的任何段落。

do_action('check_segment', 'segment_1');

// 做一些事情

do_action('check_segment', 'segment_1');

以下代碼在調試欄中返回新項目,如下所示:

segment_1: 14.14/3/1

那裡的數字是時間、查詢和此代碼實現的次數。

參考菜單

這個菜單的默認項目是 Errors。它顯示通知和警告,包括當 WP_DEBUG 為 false 的情況。

還可以輕鬆地將您的項目添加到此菜單中,並在其中打印任何 var_dump 或其他東西。

add_filter('wp_debug_refs', 'my_debug_tool_ref');

function my_debug_tool_ref ($refs) {

global $post;

$refs['my_ref_id'] = array(
'title' => 'My ref',
'content' => '<b>My ref</b>' . var_export($post, true),
);
return $refs;
}

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Debug Tool」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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. 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
WP_Cache counter
phpinfo() window
References menu
Image Puller that provide pull missed images from production to develop site

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.
Queries list
It show all what is queried via $wpdb object.
The SAVEQUERIES constant must be defined as true.
Memory counter
Returns the amount of memory, in bytes, that’s currently being allocated to your PHP script.
Segment checker
Also you can check any segment of your code.
do_action('check_segment', 'segment_1');

//do somethisng

do_action('check_segment', 'segment_1');

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

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.
And also you can easy add your item to this menu and print there any var_dump or anything else.
add_filter('wp_debug_refs', 'my_debug_tool_ref');

function my_debug_tool_ref ($refs) {

global $post;

$refs['my_ref_id'] = array(
'title' => 'My ref',
'content' => 'My ref' . var_export($post, true),
);
return $refs;
}

延伸相關外掛

文章
Filter
Apply Filters
Mastodon