
內容簡介
WP Console 是一個外掛,讓你在瀏覽器中使用著名的 PsySH 工具,PsySH 是 PHP 的運行時開發者控制台、交互式調試器和 REPL 環境。
在程式碼編輯器中編寫程式碼,按下 Cmd-Enter(mac) 或 Ctrl-Enter(win/linux) 即可在瀏覽器中獲得輸出。
你也可以使用內建對 psysh 的支援的 wp-cli 中使用 psysh,只需啟用 WP Console 即可使用。
功能
功能強大的程式碼編輯器,採用 Ace Editor 技術。
支援 PHP 核心和 WordPress 函數的即時自動完成。
_dump 為 var_dump 的替代方案,使用 Symfony VarDumper 技術。
從瀏覽器中獲取 debug.log 的內容,並清除它們。
對於 wp shell 使用 psySH 的先進 Shell 技術。
自訂程式碼片段。支持 VS Code 支援的程式碼片段,例如你可以使用 這個 WooCommerce 片段。
請注意,目前 PsySH 的命令 (如 ls、doc、show 等) 和 Magic 變數 (如 $_、$__class 等) 不能在瀏覽器中使用本插件提供的控制台功能。
👉 WP Console 的 UI/UX 採用 Gutenberg 套件和組件。請在此處查看 GitHub 存儲庫 ediamin/wp-console。
安全問題
WP Console 明確檢查「manage_options」權限才顯示 UI 並進行其他操作。但是,本外掛不應在生產伺服器上使用。
外掛標籤
開發者團隊
② 後台搜尋「WP Console – WordPress PHP Console powered by PsySH」→ 直接安裝(推薦)
原文外掛簡介
WP Console brings the renowned PsySH directly to your browser. PsySH serves as a runtime developer console, an interactive debugger, and a PHP REPL (Read-Eval-Print Loop).
To utilize WP Console, simply write your code within the code editor, then press Cmd-Enter (mac) or Ctrl-Enter (win/linux) to instantly view the output in your browser.
Moreover, you have the option to employ PsySH alongside wp-cli by executing the command wp shell. Notably, wp-cli comes with inherent compatibility for psysh. All that is required is the activation of WP Console to leverage this feature.
Features
Powerful code editor powered by Ace Editor.
Real-time autocompletion for PHP core and WordPress functions, complete with placeholders.
Introducing _dump as a more versatile alternative to var_dump, leveraging the capabilities of Symfony VarDumper.
Instant access to debug.log contents, with the added convenience of clearing them directly from your browser.
Enhanced shell experience courtesy of psySH, facilitating advanced interaction through wp shell.
Customizable code snippet functionality, compatible with VS Code supported code snippets. Explore examples like these WooCommerce snippets.
Please note that certain PsySH commands, such as ls, doc, show, and magic variables like $_, $__class, are not currently supported in the browser console.
👉 WP Console uses Gutenberg packages and components to ensure a seamless and user-friendly UI/UX.
Getting Started
To begin using the plugin, follow these steps:
Activate the plugin within your WordPress setup.
Look for a quick link labeled “Console” in the WP Admin Bar on the right-hand side (see the second screenshot below).
Click on the “Console” link to access the WP Console panel.
Security Concern
WP Console explicitly verifies the presence of the manage_options permission to render the user interface and execute various functions. However, it’s important to note that this plugin is not intended for use on a production server.
Other Plugin
Working with the block or the block editor? Checkout CSS Class Manager – An advanced autocomplete additional css class control for your blocks.
