WPCode
93Easily add code snippets in WordPress. Insert header & footer scripts, add PHP code snippets with conditio...
An implementation of PHP Console as a WordPress plugin. Use Chrome Dev Tools to debug your WordPress installation!
WP PHP Console is a WordPress plugin designed for developers to handle PHP errors and exceptions, execute PHP code remotely, and dump variables. It integrates with the Google Chrome extension PHP Console, allowing you to test WordPress-specific functions or classes directly from your browser's terminal. This tool is particularly useful for debugging and inspecting results without needing to leave the browser or write temporary PHP code in files.
To use the plugin, you must enter a password to access the PHP Console features. Once authenticated, you can run PHP code, view outputs, and catch errors in the Chrome Dev Tools JavaScript console, making it easier to debug themes and plugins directly from the browser.
Best for: This plugin suits developers looking for a debugging tool for WordPress.
What it does well
Where it falls short
WP PHP Console offers a practical solution for debugging and testing PHP code in WordPress. However, its last update was in 2020, which may raise concerns about ongoing support.
Fulvio Notarstefano's own description of WP PHP Console, lightly tidied.
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.
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.
Other plugins for developer tooling.
Easily add code snippets in WordPress. Insert header & footer scripts, add PHP code snippets with conditio...
Easily add tracking code snippets, conversion pixels, or other scripts required by third party services for an...
Duplicate post, post order, image resize, email via SMTP, admin menu editor, custom css / code, disable gutenb...
Create custom "Shortcodes" easily for HTML, JavaScript, CSS code snippets and use the shortcodes wit...
Add PHP code to your pages and posts easily using shortcodes.
An easy, clean, and simple way to enhance your site with code snippets.