內容簡介
WordPress 和 bbPress 的外掛開發者使用兩個函數來擴展 WordPress/bbPress 的功能。它們分別為 add_action() 和 add_filter()。它們用於設置由某些事件觸發的鉤子(hook)。
經驗表明,鉤子的執行佔了頁面生成時間的重要部分。當查詢不多但頁面生成時間較長時,這個外掛程序就可以幫忙了。
與需要明確指定要進行分析的事件的 WP Tuner 不同,SJ Hook Profiler 可自動檢測所有使用的鉤子,並設置處理程序以測量它們的執行時間。
默認情況下,該外掛程序僅對管理員(WordPress)或關鍵管理員(bbPress)啟用。可以通過為 enable_hook_profiler 過濾器設置處理程序來更改此行為。如果鉤子分析器應該被啟用,則處理程序應返回 true,否則返回 false。
外掛標籤
開發者團隊
原文外掛簡介
WordPress and bbPress plugin developers use two functions to extend WordPress/bbPress functionalty. These are add_action() and add_filter(). They are used to set up a hook which is triggered by some event.
The experience shows that hook execution takes signifacnt part of the page generation time. When there are few queries but the page generation is high, this plugin comes to the rescue.
Unlike WP Tuner, which needs to specify the events to profile explicitly, SJ Hook Profiler automatically detects all used hooks and sets up the handlers to measure their execution time.
By default the plugin is active only for the Administrator (WordPress) or Key Master (bbPress). This behavior can be changed by setting up a handler for enable_hook_profiler filter. The handler should return true if the hook profiler should be activated, or false otherwise.
