| 1 |
# WP Console - WordPress PHP Console powered by PsySH |
| 2 |
|
| 3 |
### Description |
| 4 |
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). |
| 5 |
|
| 6 |
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. |
| 7 |
|
| 8 |
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. |
| 9 |
|
| 10 |
[](https://wordpress.org/plugins/wp-console/Download the plugin from wordpress.org](https://wordpress.org/plugins/wp-console/](https://wordpress.org/plugins/wp-console/) |
| 11 |
|
| 12 |
### Features |
| 13 |
- Powerful code editor powered by Ace Editor. |
| 14 |
- Real-time autocompletion for PHP core and WordPress functions, complete with placeholders. |
| 15 |
- Introducing `_dump` as a more versatile alternative to `var_dump`, leveraging the capabilities of Symfony VarDumper. |
| 16 |
- Instant access to debug.log contents, with the added convenience of clearing them directly from your browser. |
| 17 |
- Enhanced shell experience courtesy of psySH, facilitating advanced interaction through `wp shell`. |
| 18 |
- Customizable code snippet functionality, compatible with VS Code supported code snippets. Explore examples like these [](https://github.com/claudiosanches/vscode-woocommerce/blob/master/snippets/functions.jsonWooCommerce snippets](https://github.com/claudiosanches/vscode-woocommerce/blob/master/snippets/functions.json](https://github.com/claudiosanches/vscode-woocommerce/blob/master/snippets/functions.json). |
| 19 |
|
| 20 |
Please note that certain PsySH commands, such as `ls`, `doc`, `show`, and magic variables like `$_`, `$__class`, are not currently supported in the browser console. |
| 21 |
|
| 22 |
👉 WP Console uses Gutenberg packages and components to ensure a seamless and user-friendly UI/UX. |
| 23 |
|
| 24 |
### Getting Started |
| 25 |
To begin using the plugin, follow these steps: |
| 26 |
|
| 27 |
1. Activate the plugin within your WordPress setup. |
| 28 |
2. Look for a quick link labeled "Console" in the WP Admin Bar on the right-hand side (see the second screenshot below). |
| 29 |
3. Click on the "Console" link to access the WP Console panel. |
| 30 |
|
| 31 |
### Security Concern |
| 32 |
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. |
| 33 |
|