[WordPress] 外掛分享: Log HTTP Requests

首頁外掛目錄 › Log HTTP Requests
2,000+
安裝啟用
★★★★★
5/5 分(15 則評價)
128 天前
最後更新
問題解決
WordPress 5.0+ v1.5.0 上架:2017-07-18

內容簡介

記錄並查看所有 WP HTTP 請求

核心、外掛或佈景主題更新檢查運行需要多長時間?我的網站發送了哪些數據?所有這些 AJAX 請求怎麼辦?這些問題的答案只需點擊一下即可獲得。

此外掛記錄所有 WP_HTTP 請求,並將它們顯示在表格清單中,以便於查看。它還存儲每個 HTTP 請求的執行時間。

可用的掛鉤

自定義在刪除舊日誌項目之前的時間長度(以天為單位):

add_filter( 'lhr_expiration_days', function( $days ) {
return 7; // 預設值 = 1
});

不要記錄來自特定主機名的項目:

add_filter( 'lhr_log_data', function( $data ) {
if ( false !== strpos( $data['url'], 'wordpress.org' ) ) {
return false;
}
return $data;
});

在上述示例中,$ data 數組鍵對應於 lhr_log 數據庫表中的列。

重要連結

Github →

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.5.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Log HTTP Requests」→ 直接安裝(推薦)

原文外掛簡介

Log and view all WP HTTP requests
How long do [core / plugin / theme] update checks take to run? What data about my site is being sent out? What about all those ajax requests? The answers to these questions are just a few clicks away.
This plugin logs all WP_HTTP requests and displays them in a table listing for easy viewing. It also stores the runtime of each HTTP request.
Available Hooks
Customize the length (in days) before older log items are removed:

add_filter( 'lhr_expiration_days', function( $days ) {
return 7; // default = 1
});

Don’t log items from a specific hostname:

add_filter( 'lhr_log_data', function( $data ) {
if ( false !== strpos( $data['url'], 'wordpress.org' ) ) {
return false;
}
return $data;
});

In the above example, the $data array keys correspond to columns within the lhr_log database table.
Important Links

Github →

延伸相關外掛

文章
Filter
Apply Filters
Mastodon