
內容簡介
您是否曾經想要在 WordPress 不中斷頁面顯示的情況下,從 WordPress 發送偵錯資訊給您?
您是否希望在不需要登入其他用戶帳戶或要求他們自行查看偵錯輸出(呃)或絕望地試圖重新創建他們的問題時,也能從其他使用者的會話中獲得偵錯輸出?
登入他們的帳號
要求他們自行查看偵錯輸出(呃)
或絕望地試圖重新創建他們的問題
此外掛可讓您通過 UDP 將偵錯信息發送給Jabber Bot,然後將偵錯資訊路由到您的 IM 客戶端。
注意:此外掛通過 UDP 發送消息。接收端不一定需要是 Jabber bot …… 它可以是您想要的任何東西
(例如,電子郵件機器人、日誌記錄器)。我在本地開發環境中實現了一個 Jabber Bot}}
用法
要發送偵錯輸出,只需調用:
do_action('debug_robot', $message [, $target ]);
$Message: 要發送給您的 Jabber bot 的消息。
$Target:(可選)您的 Jabber bot 將傳送消息到的電子郵件地址。
要接收偵錯資訊,您需要:
已安裝並配置Jabber Bot。
Jabber Bot 必須正在運行。
您必須試圖用其他 Jabber 帳號(例如,您的 Google 帳號)作友好聯係,以使用您的機械人的 Jabber 帳號。
您必須以某種方式登錄 Google Talk,以便您的 Jabber bot 可以為您發送即時消息。
注意:如果 Jabber Bot 未運行,不用擔心,您的 WordPress 實例不受影響,因為 UDP 不等待回應......直到您的機器人運行前,您才收不到被發送的消息:)
致謝
此代碼很大程度上由@abackstrom編寫,我在我們在@PlymouthState工作時添加了一些功能,然後將其移植到WordPress插件中。
外掛標籤
開發者團隊
原文外掛簡介
Have you ever wanted to get debug output sent to you from WordPress without interrupting the flow of the page?
Do you ever wish you could get debug output from other users’ sessions so you don’t have to:
Log in as them
Asking them to look at debug output themselves (bleh)
Or try in vain to re-create their issue
This plugin allows you to send debug messages via UDP to a Jabber Bot that can then route
the debug information to your IM client.
Note: This plugin sends the messages via UDP. The receiving end doesn’t necessarily need to be a Jabber bot…it could be anything you want
(e.g. email bot, logger, whatever). My implementation is a Jabber Bot on my local dev environment 🙂
Usage
To send debug messages, simply call:
do_action( 'debug_robot', $message [, $target ]);
$message: Message to send to your jabber bot.
$target: (optional) Email address that your jabber bot will route the message to.
To receive debug messages, you will need to have:
Your Jabber Bot installed and configured.
The Jabber Bot must be running.
You must have friended your robot’s jabber account with another jabber account (e.g. your Google account).
You must be signed into Google Talk in some way shape or form so that your jabber bot can IM you.
Note: If your Jabber Bot isn’t running, no worries. UDP doesn’t wait for a response so it won’t impact your WordPress instance…you just won’t get the messages that
are sent until your bot is running 🙂
Credits
This code was largely written by @abackstrom with some additions by me while we worked at @PlymouthState. I then ported it into a WordPress plugin.
