[WordPress] 外掛分享: WP Console – WordPress PHP Console powered by PsySH

WordPress 外掛 WP Console – WordPress PHP Console powered by PsySH 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「WP Console – WordPress PHP Console powered by PsySH」是 2019-06-20 上架。
  • 目前有 20000 個安裝啟用數。
  • 上一次更新是 2025-01-13,距離現在已有 110 天。
  • 外掛最低要求 WordPress 5.3.12 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
  • 有 19 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

ediamin |

外掛標籤

dump | repl | shell | browser | autocomplete |

內容簡介

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 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.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WP Console – WordPress PHP Console powered by PsySH」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


2.4.0 | 2.4.1 | 2.5.0 | 2.5.1 | trunk |

延伸相關外掛(你可能也想知道)

  • Laravel DD for WordPress 》在你的 WordPress 專案中使用 Laravel 的 dd()(die dump)功能。這個功能非常適合用來除錯自訂的查詢!Laravel 的 dd() 函數建立在 Symfony VarDumper 組件 ...。
  • VarDumper 》這是一個外掛,可以在開發或除錯時包含 var-dump 套件,使用 dump 函式。它與 PHP 5.5.9+ 版本配合使用。, 安裝插件後,如果您有足夠的 PHP 版本,即可開始使...。
  • WP-Dump 》此外掛可讓您將資料庫和檔案導出至一個最終的 Zip 檔案。, 主要功能:, , 使用簡單,只需按下一個按鈕, 將您的安裝導出為備份或用於不同用途(例如本機 XAMP...。
  • System information 》新增一個系統信息頁面,其中包含有關您的 WordPress 配置的所有詳細信息,包括伺服器詳細信息、PHP 配置、WordPress 配置、當前主題詳細信息、外掛詳細信息和...。
  • CC-Backup 》WordPress CC-Backup 外掛程式允許您隨時備份網站資料庫,並在一個按鈕的點擊下輕鬆還原備份。, 重要資訊, 請從 wp-content/cc-backup 目錄複製 db.php 檔案...。

文章
Filter
Apply Filters
Mastodon