You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,20 +7,18 @@
7
7
8
8
An implementation of [PHP Console](https://github.com/barbushin/php-console"PHP Console") as a [WordPress](http://www.wordpress.org) plugin. Use Chrome Dev Tools to debug your WordPress installation!
9
9
10
-
<sup>Note: this is the development repository. If you download a zip from the master branch here you'll also need to build the plugin using `npm install` and then `grunt build` since it uses composer to manage dependencies. Or you can simply download the packaged plugin in the latest publicly released version from [wordpress.org]((https://wordpress.org/plugins/wp-php-console/)) and you'll be ready to go.</sup>
11
-
12
10
## Description
13
11
14
12
> 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](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef) and [PHP Console server library](https://github.com/barbushin/php-console).
15
13
16
-
This implementation of PHP Console makes easy to debug a WordPress installation from Chrome browser JavaScript console and test any WordPress specific function or class (including those introduced by your active theme and plugins!) from a terminal. You can run any PHP or WordPress specific function and inspect results, catch errors and warnings with call stack trace straight which will be displayed in the Chrome JavaScript console. You can do PHP debugging alongside your JavaScript debugging in one place, without having PHP to print errors and warnings in your HTML page.
14
+
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 terminaland 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.
17
15
18
16
[](https://wordpress.org/plugins/wp-php-console/)
19
17
20
18
21
19
## Installation
22
20
23
-
Note: you will need PHP 5.4.0 minimum version on your machine or server to run this plugin.
21
+
Note: you will at least PHP 5.4.0 or above installed on your machine or server to run this plugin.
24
22
25
23
1. First, install [Google Chrome extension PHP Console](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef) from the [Chrome WebStore](https://chrome.google.com/webstore/search/php%20console?_category=extensions).
26
24
Make sure the PHP Console Chrome extension is enabled through [chrome://extensions/](chrome://extensions/"chrome://extensions/").
Copy file name to clipboardExpand all lines: readme.txt
+12-8Lines changed: 12 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ Use Chrome Dev Tools to debug your WordPress installation!
15
15
16
16
> 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](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef) and [PHP Console server library](https://github.com/barbushin/php-console).
17
17
18
-
This implementation of PHP Console offers yet another tool to make it more easy 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 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 as if it were Javascript. It's very handy to keep everything in one place.
18
+
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.
19
19
20
-
Note: PHP 5.4.0 minimum version is required to use this plugin.
20
+
Note: PHP version 5.4.0 or above is required to use this plugin.
21
21
22
22
For support and pull requests, please refer to [WP PHP Console GitHub repo](https://github.com/unfulvio/wp-php-console) and read the instructions there - thank you.
23
23
@@ -68,7 +68,7 @@ The result includes the output, the return value and the net server execution ti
68
68
69
69
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.
70
70
71
-
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.
71
+
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.
72
72
73
73
== Frequently Asked Questions ==
74
74
@@ -84,6 +84,10 @@ No it doesn't, unless PHP Console browser extension is ported, for example, as a
84
84
85
85
You *can* but it is probably not a good idea. You should do your debugging and testing on a development/testing environment on a staging server or local machine. Likewise, you normally wouldn't want to turn on PHP error reporting or set WP_DEBUG to true in a live site as you wouldn't want to display error information to public. Furthermore, PHP Console allows execution of any remote PHP code through terminal - for this you can set a strong password and restrict the IP address range to access the terminal, but still it's not advisable. Besides putting your site at risk, you will also add more load to your server.
86
86
87
+
= Will there be items logged in my debug.log files when a PHP error occurs? =
88
+
89
+
Generally no, WP PHP Console will intercept those. However, it's always a good idea to keep an eye on the logs too. Furthermore, WP PHP Console is unable to catch many server errors that result in a 500 error code on the browser. For those you may have traces left in the debug.log file.
90
+
87
91
= Why are PHP arrays shown as objects? =
88
92
89
93
The JavaScript console prints PHP variables as JavaScript variables. Associative PHP arrays such as `['key1' => 'var2', 'key2' => 'var2', ... ]` are shown as objects; automatically indexed arrays like `[ 'var1', 'var2', ... ]` are shown as arrays.
@@ -96,9 +100,9 @@ You could move your debug code or either do something like
96
100
97
101
`
98
102
// delay use of PC class until WP PHP Console plugin is included
99
-
add_action('plugins_loaded', function () use ($my_var) {
103
+
add_action('plugins_loaded', function () use ($my_var) {
100
104
// send $my_var with tag 'my_tag' to the JavaScript console through PHP Console Server Library and PHP Console Chrome Plugin
0 commit comments