前言介紹
- 這款 WordPress 外掛「WP PHP Console」是 2015-01-17 上架。
- 目前有 800 個安裝啟用數。
- 上一次更新是 2020-11-09,距離現在已有 1637 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.6.0 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
- 有 19 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
nekojira |
外掛標籤
bug | dev | debug | debugging | development |
內容簡介
PHP Console 讓你可以透過 Google Chrome 擴充元件 PHP Console 和 PHP Console 伺服器程式庫 處理 PHP 錯誤和例外、輸出變數、遠端執行 PHP 程式等等多種任務。
這個 PHP Console 的實作是一個方便的工具,使你可以直接從終端機中測試任何 WordPress 用的函數或類別(包括你啟用的主題或外掛所引進的),並從 Chrome JavaScript 控制台中檢查結果、捕獲錯誤和警告,連同呼叫堆疊追蹤。換言之,除了除錯外,你還可以直接從終端機執行 PHP 或 WordPress 特定的 PHP 代碼,並將 PHP 變數與你正常的 JavaScript 調試和測試的 Chrome Dev Tools JavaScript 控制台一起列印。保持一切在一個地方,不需要離開瀏覽器檢查日誌或在 PHP 檔案上編寫臨時的 PHP 測試代碼並刷新你的瀏覽器頁面。
注意:使用此外掛需要 PHP 版本 5.6.0 或以上。
如需支援和拉取請求,請參閱 WP PHP Console GitHub 存儲庫,閱讀該處的說明 - 謝謝。
使用方法
在輸入 WP PHP Plugin 密碼後,你的瀏覽器地址欄應顯示一個黃色的「鑰匙」圖示,如果單擊它,將提示你輸入之前設置的密碼。
「鑰匙」圖示將變成一個「終端機」圖示,單擊它可打開 PHP Console eval & options 表單。
在輸入正確的密碼後,你可以在 PHP Console eval & options 表單中使用 Eval Terminal,運行任何 PHP 代碼,包括 WordPress 的函數:在黑色的 Eval 終端機屏幕中輸入一行或多行 PHP 代碼,按下 Ctrl+Enter,並在 Chrome Dev Tools JavaScript 控制台中查看結果。
結果包括輸出、返回值和網絡伺服器執行時間。
在伺服器上的 PHP 代碼中,你可以調用 PHP Console debug 陳述式,例如PC::debug($var, $tag)將會在 JavaScript 控制台中列印出 PHP 變數,並可以透過從瀏覽器地址欄中打開 PHP Console eval & options 表單篩選選定的標記。
在 JavaScript 控制台中,你會看到任何 "PC::debug()" 訊息、PHP 錯誤、警告、注意事項及選擇性堆疊追蹤,這些將有助於調試你的外掛或主題。
原文外掛簡介
PHP Console allows you to handle PHP errors & exceptions, dump variables, execute PHP code remotely and many other things using Google Chrome extension PHP Console and PHP Console server library.
This implementation of PHP Console is a handy tool to make it easier to test on the fly any WordPress specific function or class (including those introduced by your active theme and plugins!) from a terminal and inspect results, catch errors and warnings with complete call stack trace straight from the Chrome JavaScript console. In other words, besides debugging, you can execute PHP or WordPress-specific PHP code straight from the terminal and print PHP variables in Chrome Dev Tools JavaScript console along with your normal JavaScript debugging and testing. Keep everything in one place, without leaving the browser to check for your logs or writing temporary PHP test code on a PHP file and refresh your browser page.
Note: PHP version 5.6.0 or above is required to use this plugin.
For support and pull requests, please refer to WP PHP Console GitHub repo and read the instructions there – thank you.
Usage
After you entered WP PHP Plugin password, your browser address bar should show a yellow “key” icon, which, if clicked, will prompt for the password you have set earlier.
The “key” icon will change into a “terminal” icon, click on it to open the PHP Console eval & options form.
After entering the correct password, you can use the Eval Terminal in the PHP Console eval & options form and run any PHP code from it, including WordPress’s own functions: enter one or more lines of PHP code in the black Eval terminal screen, press Ctrl+Enter and see the result in Chrome Dev Tools JavaScript console.
The result includes the output, the return value and the net server execution time.
In your PHP code on the Server, you can call PHP Console debug statements like PC::debug( $var, $tag ) to display PHP variables in the JavaScript console and optionally filter selected tags through the PHP Console eval & options form opened from the address bar in your browser.
In the JavaScript console you will see printed any `PC::debug()“ information, PHP errors, warnings, notices with optional stack trace, which will be useful to debug your plugin or theme.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WP PHP Console」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.2.2 | 1.2.3 | 1.3.0 | 1.3.1 | 1.3.2 | 1.3.3 | 1.3.5 | 1.3.7 | 1.3.8 | 1.3.9 | 1.4.0 | 1.5.0 | 1.5.1 | 1.5.2 | 1.5.3 | 1.5.4 | 1.6.0 | trunk |
延伸相關外掛(你可能也想知道)
Query Monitor – The developer tools panel for WordPress 》ministrator user). This cookie can be set by defining QM_AUTH_KEY in your wp-config.php file., To learn more about how to use Query Monitor, please...。
Yoast Test Helper 》此外掛能幫您測試 Yoast SEO、Yoast SEO 外掛和整合功能,並且方便地重置不同功能。同時,讓您可以設定資料庫版本,方便測試資料庫升級過程是否順利。, 功能,...。
What The File 》What The File 是一個 WordPress 外掛,在您的工具列中增加了一個選項,顯示目前正在檢視的頁面所使用的文件和模板部分。, 您可以通過單擊文件名直接使用佈景...。
P3 (Plugin Performance Profiler) 》這個外掛程式可以創建您 WordPress 網站的外掛程式效能概況,並且藉由測量這些外掛對網站載入時間的影響。通常WordPress網站由於過多或配置不佳的外掛程式而...。
Prevent Browser Caching 》您是一位前端開發人員嗎?想要清除所有使用者的瀏覽器快取嗎?只需啟用此外掛程式並展現您的作品!, Prevent Browser Caching 外掛程式可讓您自動或手動一鍵...。
Stop Emails 》這個 WordPress 外掛可以停止發送電子郵件。它可以停止由 WordPress 核心、外掛和佈景主題所產生的所有出站信件,使用 wp_mail() 函數發送的信件也會停止發送...。
WP Secure Maintenance 》想要將您的網站鎖定進行維護或開發嗎?那麼這就是正確的外掛程式。使用 WP Secure Maintenance,您可以使用密碼鎖定整個網站。, 功能:, , 設置密碼,以保護...。
Ultrapress 》lugins you need are not compatible with each other, which is why Ultrapress was developed. It is a suite of tools designed for WordPress developers...。
Monkeyman Rewrite Analyzer 》這是一個了解你的重寫規則(“美麗連結”)的工具。如果你正在添加或修改規則,並想要了解它們的運作方式(或者為什麼它們不起作用),這個工具是必不可少的。,...。
What Template 》在管理列中加入目前頁面的範本名稱。, 由於這個外掛揭露了關於啟用佈景主題的潛在敏感訊息,因此建議僅在開發環境下啟用,並不應在生產網站上啟用。。
Display Environment Type 》WordPress 5.5 引入了一種區分環境類型(開發、備試、正式)的方式。此外掛會在管理列顯示您網站的環境類型。, 更多有關此新功能的資訊。
Developer 》一個能幫助 WordPress 開發者進行開發的外掛。, 這個外掛將幫助您優化您的開發環境,確保您已安裝所有必要的工具和外掛。, 如果您想查看代碼並做出貢獻,加入...。
Cron View 》此外掛在管理面板中添加了一個頁面,您可以在其中查看所有排隊的 Cron 事件,了解它們的到期時間、所在的排程(或是否為一次性事件)以及它們將調用的鈎子。...。
WP Example Content 》這個外掛可以輕鬆地協助你設計和開發新的及現有佈景主題,加入或移除範例文章內容。享受它的便利!, 在啟用外掛後,只需進入管理面板導覽 (通常為最後一項),...。
Debug-Bar-Extender 》這個外掛為偵錯列(debug-bar)增加了更多功能,主要針對開發者喜歡除錯(debug)程式碼的人,或測量執行時間以找出程式碼中的錯誤。, 它還允許通過在源代碼中添...。