Title: WP PHP Console
Author: Fulvio Notarstefano
Published: <strong>Ṣẹrẹ 18, 2015</strong>
Last modified: Bélú 9, 2020

---

Ṣàwárí àwọn plugin

![](https://ps.w.org/wp-php-console/assets/banner-772x250.png?rev=1070278)

Plugin yìí **kò tíì ṣe àyẹ̀wò pẹ̀lú àwọn ìtújáde mẹ́ta pàtàkì tó kẹ́yìn ti WordPress**.
Ó lè jẹ́ pé a kò tọ́jú tàbí ṣe àtìlẹ́yìn fún un mọ́, ó sì lè ní àwọn ọ̀ràn ìbámu
nígbà tí a bá lò ó pẹ̀lú àwọn ẹ̀yà WordPress tuntun.

![](https://ps.w.org/wp-php-console/assets/icon-256x256.png?rev=1070278)

# WP PHP Console

 Láti ọwọ́ [Fulvio Notarstefano](https://profiles.wordpress.org/nekojira/)

[Ṣe ìgbàsílẹ̀](https://downloads.wordpress.org/plugin/wp-php-console.1.6.0.zip)

 * [Àwọn àlàyé](https://yor.wordpress.org/plugins/wp-php-console/#description)
 * [Àwọn àgbéyẹ̀wò](https://yor.wordpress.org/plugins/wp-php-console/#reviews)
 *  [Ìgbéwọlẹ̀](https://yor.wordpress.org/plugins/wp-php-console/#installation)
 * [Ìdàgbàsókè](https://yor.wordpress.org/plugins/wp-php-console/#developers)

 [Ìrànlọ́wọ́](https://wordpress.org/support/plugin/wp-php-console/)

## Àpèjúwe

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

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](https://github.com/unfulvio/wp-php-console)
and read the instructions there Ìtumọ̀ Yorùbá: – thank you.

### Usage

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Ìtumọ̀ Yorùbá:’
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.

## Ìgbéwọlẹ̀

 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).
    
    Make sure the PHP Console Chrome extension is enabled through chrome://extensions/.**
    Important Note** If the Google Chrome extension is not available on the Chrome 
    Web Store, you can manually install it [from source](https://github.com/barbushin/php-console-extension).
 2. Then, add this plugin to your WordPress installation either by:

 * Installing it as any other WordPress plugin from your WordPress admin Plugins
   page (`Add New`)
 * Uploading it in `wp-php-console` directory into your `wp-content/plugins/` directory
   or corresponding plugins directory in your installation

 1. Activate the plugin through the `Plugins` admin page in WordPress
 2. In the `Settings` menu go to `WP PHP Console`:

 * Enter a password for the Eval Terminal (this setting is needed or the terminal
   feature simply wonÌtumọ̀ Yorùbá: ’t work).
 * You can also set other options.

#### Options

**Allow only on SSL**
 Forces PHP Console to connect on a SSL connection only (of
course then if you donÌtumọ̀ Yorùbá: ’t actually have SSL (https), PHP Console simply
wonÌtumọ̀ Yorùbá: ’t work).

**Allowed IP Masks**
 You can secure your server by specifying IP addresses to restrict
the accessibility from the Eval Terminal (a single address eg. `192.168.0.4` or 
an address mask eg. `192.168.*.*` or multiple IPs, comma separated `192.168.1.22,192.168.1.24,192.168.3.*`).
In case of having issues connecting with the Remote PHP Eval Terminal, try leaving
this blank.

**Register PC Class**
 Tick this option to register `PC` in the global PHP namespace.
This allows to write `PC::debug($var, $tag)` or `PC::magic_tag($var)` instructions
in PHP to inspect `$var` in the JavaScript console.

**Show Call Stack**
 Tick this option to see the call stack when PHP Console server
writes to the JavaScript console.

**Short Path Names**
 Tick this checkbox to shorten PHP Console error sources and
traces paths in the JavaScript console. E.g. paths like `/server/path/to/document/
root/WP/wp-admin/admin.php:38` will be displayed as `/WP/wp-admin/admin.php:38`

## FAQ

### Is this an official plugin from PHP Console author?

No, but it makes use of SergeyÌtumọ̀ Yorùbá: ’s PHP Console library as it is.

### Does it work with Firefox, IE, Opera or other browsers?

No it doesnÌtumọ̀ Yorùbá: ’t, unless PHP Console browser extension is ported, for
example, as a Firefox add-on.

### Can I use PHP Console in a live production environment?

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Ìtumọ̀ Yorùbá: ’t want to turn on PHP error reporting or set 
WP_DEBUG to true in a live site as you wouldnÌtumọ̀ Yorùbá: ’t want to display error
information to public. Furthermore, PHP Console allows execution of any remote PHP
code through terminal Ìtumọ̀ Yorùbá: – for this you can set a strong password and
restrict the IP address range to access the terminal, but still itÌtumọ̀ Yorùbá:’
s not advisable. Besides putting your site at risk, you will also add more load 
to your server.

### Will there be items logged in my debug.log files when a PHP error occurs?

Generally no, WP PHP Console will intercept those. However, itÌtumọ̀ Yorùbá: ’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.

### Why are PHP arrays shown as objects?

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.

### Fatal error: Class ‘PC’ not found in ‘my code’

PC::debug( $my_var, $my_tag ) can only be called after the WordPress core included
the WP PHP Console plugin.

You could move your debug code or either do something like

    ```
      // delay use of PC class until WP PHP Console plugin is included
      add_action( 'plugins_loaded', function () use ( $my_var ) {
        // send $my_var with tag 'my_tag' to the JavaScript console through PHP Console Server Library and PHP Console Chrome Plugin
        PC::my_tag( $my_var );
      });
    ```

or

    ```
      // PHP Console autoload
      require_once dirname( __FILE__ ) . '/wp-php-console/vendor/autoload.php';

      // make PC class available in global PHP scope
      if ( ! class_exists( 'PC', false ) ) PhpConsole\Helper::register();

      // send $my_var with tag 'my_tag' to the JavaScript console through PHP Console Server Library and PHP Console Chrome Plugin
      PC::my_tag( $my_var );
    ```

## Àwọn àgbéyẹ̀wò

![](https://secure.gravatar.com/avatar/ea1815cf699d3e404f65ad6c0f8ad8682bdf7d2935acd79d3b962d9b3c49c661?
s=60&d=retro&r=g)

### 󠀁[Wonderful idea, but too unreliable](https://wordpress.org/support/topic/wonderful-idea-but-too-unreliable/)󠁿

 [ChemaZ](https://profiles.wordpress.org/chemaz/) Agẹmọ 4, 2019 1 ìdáhùn

Sometimes it works nicely, sometimes it takes 10 secs. to produce output, sometimes
thereÌtumọ̀ Yorùbá: ’s no output at all. It disables logging so no idea whatÌtumọ̀
Yorùbá: ’s going on. 2+2 always works tho. The Chrome extension is also spotty, 
sometimes opening the menu instead of the console (“inspect window” makes it work;
sometimes). It also lacks a keyboard shortcut. As an alternative for quick fixes,
good ol’ Debug Bar + Debug Bar Console work reliably as a poor manÌtumọ̀ Yorùbá:’
s REPL, as does Debug Toolkit to show a trace on the page. XDebug + PHPStorm for
real work.

![](https://secure.gravatar.com/avatar/3b88bf7ba8368f14e607264a97f3d2a3af955dcc497ade51ffbd4dcfe5c09554?
s=60&d=retro&r=g)

### 󠀁[ItÌtumọ̀ Yorùbá: ’s great!](https://wordpress.org/support/topic/its-great-208/)󠁿

 [erdemarslan](https://profiles.wordpress.org/erdemarslan/) Òkúdù 4, 2019 1 ìdáhùn

Thank you so much.

![](https://secure.gravatar.com/avatar/6340888b3f61ec0bfa4f2d80f1d37c1a8597bca7c71b8b926323b6e2d5ff64e9?
s=60&d=retro&r=g)

### 󠀁[Great work](https://wordpress.org/support/topic/great-work-716/)󠁿

 [taisho](https://profiles.wordpress.org/taisho/) Èbìbí 5, 2019 1 ìdáhùn

As soon as I realized that Chrome extension is off in incognito mode by default 
and enabled it, I could enter password and got it to work immediately.

![](https://secure.gravatar.com/avatar/20adf0fe59e92e5d502d17de65ca6b86607fdead8b50c213d3a9e763d6aa58c2?
s=60&d=retro&r=g)

### 󠀁[Wow super effective](https://wordpress.org/support/topic/wow-super-effective/)󠁿

 [Eric Valois](https://profiles.wordpress.org/bulledev/) Ọwẹ́wẹ̀ 19, 2018 1 ìdáhùn

Very easy to set up and it has saved my life.

![](https://secure.gravatar.com/avatar/e9797bf3cb673a6de44bcae751c3464f34e20132df108dd1a6506cc9d5740bc8?
s=60&d=retro&r=g)

### 󠀁[Thank you very much!](https://wordpress.org/support/topic/thank-you-very-much-56/)󠁿

 [rpf5573](https://profiles.wordpress.org/rpf5573/) Èrèlé 23, 2018 1 ìdáhùn

This plugin is very useful to debug php variable! And show me stack ! Really Thank
you !

![](https://secure.gravatar.com/avatar/28969534fc01002e4bb1eb9d0f1b5ec0cb426d996cf6b3f531fcca41ddcb7cc1?
s=60&d=retro&r=g)

### 󠀁[Amazing Tool!](https://wordpress.org/support/topic/amazing-tool-44/)󠁿

 [Amritansh Trivedi](https://profiles.wordpress.org/amritanshatwisetr/) Ṣẹrẹ 27,
2018 1 ìdáhùn

Hardly you find a tool in wordpress.org plugin repo that is technologically a masterpiece.
I am thrilled with the power it provides to the devs who really face issues in debugging
just like me. By using this tool I no longer need to go here and there to see the
debug info. It makes my life super easy. P.S. I am also looking forward to contributing
to this plugin in any possible way.

 [ Ka gbogbo àwọn àgbéyẹ̀wò 19 ](https://wordpress.org/support/plugin/wp-php-console/reviews/)

## Àwọn Olùkópa & Olùgbéejáde

“WP PHP Console” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa
sí plugin yìí.

Àwọn Olùkópa

 *   [ Fulvio Notarstefano ](https://profiles.wordpress.org/nekojira/)

A ti túmọ̀ “WP PHP Console” sí àwọn èdè agbègbè 2. Ọpẹ́lọpẹ́ fún [àwọn atúmọ̀ èdè](https://translate.wordpress.org/projects/wp-plugins/wp-php-console/contributors)
fún àwọn ìkópa wọn.

[Túmọ̀ “WP PHP Console” sí èdè rẹ.](https://translate.wordpress.org/projects/wp-plugins/wp-php-console)

### Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

[Ṣàwárí koodu](https://plugins.trac.wordpress.org/browser/wp-php-console/), ṣàyẹ̀wò
[ibi ìpamọ́ SVN](https://plugins.svn.wordpress.org/wp-php-console/), tàbí ṣe àgbékalẹ̀
sí [àkọsílẹ̀ ìdàgbàsókè](https://plugins.trac.wordpress.org/log/wp-php-console/)
nípasẹ̀ [RSS](https://plugins.trac.wordpress.org/log/wp-php-console/?limit=100&mode=stop_on_copy&format=rss).

## Àkọsílẹ̀ àwọn àyípadà

#### 1.6.0

 * Misc: Add note about Chrome extension unavailability in web store
 * Misc: Add plugin admin action links
 * Misc: Improved settings handler
 * Misc: Updates PHP Console core library to v3.1.8

#### 1.5.5

 * Misc: Add plugin admin action links
 * Misc: Improved settings handler

#### 1.5.4

 * Fix: Temporarily suppress PHP warnings while connecting with PhpConsole to avoid
   headers already sent warnings, then restore all errors reporting
 * Misc: Improved PHP and WordPress compatibility loader

#### 1.5.3

 * Fix: Try to get rid of PHP errors related to “Unable to set PHP Console server
   cookie” and “Cannot modify header information Ìtumọ̀ Yorùbá: – headers already
   sent”
 * Misc: Require PHP 5.6

#### 1.5.2

 * Misc: Updates PHP Console core library to v3.1.7

#### 1.5.1

 * Misc: Bump WordPress compatibility to mark support for the latest versions

#### 1.5.0

 * Fix: Fixes “PHP Warning: session_start(): Cannot send session cache limiter Ìtumọ̀
   Yorùbá: – headers already sent” notice in logs
 * Misc: Internal changes, new Settings class, deprecated methods and properties
   in main Plugin class
 * Misc: Updated PHP Console Library to 3.1.6
 * Misc: Tested up to WordPress 4.5.2

#### 1.4.0

 * Enhancement: Support for WordPress language packs
 * Misc: Improved error and exception handling and usage of Composer in plugin development
 * Misc: Updated PHP Console Library to 3.1.5
 * Misc: Tested up to WordPress 4.4.1

#### 1.3.9

 * Misc: Use WP Requirements as Composer dependency.

#### 1.3.8

 * Misc: Internal changes (alternate PHP version check, automated SVN deploys)

#### 1.3.7

 * Fix: Fixes a bug `Cannot send session cache limiter - headers already sent`
 * Misc: Updated PHP Console Library to 3.1.4

#### 1.3.5

 * Misc: Made PHP 5.4.0 the minimum required version to activate the plugin
 * Misc: Updated PHP Console library to 3.1.3

#### 1.3.3

 * Misc: Supports WordPress 4.2

#### 1.3.2

 * Fix: Fixes “Fatal error: Using $this when not in object context” upon activation
   in some installations.

#### 1.3.1

 * Enhancement: earlier PC initialisation Ìtumọ̀ Yorùbá: – props @Polfo
 * Misc: Updated readme files

#### 1.3.0

 * Fix: IP mask
 * Enhancement: added configuration options Ìtumọ̀ Yorùbá: – props @Polfo
    - Register PC class
    - Show Call Stack
    - Short Path Names

#### 1.2.3

 * Fix: Fixes “Wrong PHP Console eval request signature” error when executing WordPress
   code from terminal, props @Polfo @barbushin

#### 1.2.2

 * Fix: Bugfixes
 * Misc: Submission to WordPress.org plugins repository.

#### 1.2.1

 * Fix: Fixed allowed IPs bug.

#### 1.2.0

 * Misc: Updated dependencies and got rid of git submodules.

#### 1.1.0

 * Fix: PHP Console server is now instantiated later, allowing to catch all your
   theme functions too.
 * Misc: Included PHP Console server library as git submodule rather than a composer
   dependency.

#### 1.0.0

 * First public release.

## Àkójọpọ̀ Meta

 *  Ẹ̀yà **1.6.0**
 *  Ìgbàgbọ́hùn tó kẹ́yìn **ọdún 6 sẹ́yìn**
 *  Àwọn ìgbéwọlẹ̀ tó ṣiṣẹ́ **500+**
 *  Ẹ̀yà WordPress ** 3.6.0 tàbí ju bẹ́ẹ̀ lọ **
 *  Dánwò dé **5.5.18**
 *  Ẹ̀yà PHP ** 5.6 tàbí ju bẹ́ẹ̀ lọ **
 *  Àwọn èdè
 * [English (US)](https://wordpress.org/plugins/wp-php-console/), [German](https://de.wordpress.org/plugins/wp-php-console/),
   àti [Italian](https://it.wordpress.org/plugins/wp-php-console/).
 *  [Túmọ̀ sí èdè rẹ](https://translate.wordpress.org/projects/wp-plugins/wp-php-console)
 * Àwọn àmì
 * [bug](https://yor.wordpress.org/plugins/tags/bug/)[debug](https://yor.wordpress.org/plugins/tags/debug/)
   [debugging](https://yor.wordpress.org/plugins/tags/debugging/)[dev](https://yor.wordpress.org/plugins/tags/dev/)
   [development](https://yor.wordpress.org/plugins/tags/development/)
 *  [Ìwòye Tó Péye](https://yor.wordpress.org/plugins/wp-php-console/advanced/)

## Àwọn ìbò

 4.7 lára àwọn ìràwọ̀ 5.

 *  [  16 5-star reviews     ](https://wordpress.org/support/plugin/wp-php-console/reviews/?filter=5)
 *  [  1 4-star review     ](https://wordpress.org/support/plugin/wp-php-console/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/wp-php-console/reviews/?filter=3)
 *  [  1 2-star review     ](https://wordpress.org/support/plugin/wp-php-console/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/wp-php-console/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-php-console/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/wp-php-console/reviews/)

## Àwọn Olùkópa

 *   [ Fulvio Notarstefano ](https://profiles.wordpress.org/nekojira/)

## Ìrànlọ́wọ́

Nǹkan wà tí o fẹ́ sọ? Ṣé o nílò ìrànlọ́wọ́?

 [Wo àpéjọ ìrànlọ́wọ́](https://wordpress.org/support/plugin/wp-php-console/)

## Ṣe ìtọrẹ

Ṣé o fẹ́ ṣe àtìlẹ́yìn fún ìlọsíwájú plugin yìí?

 [ Ṣe ìtọrẹ sí plugin yìí ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XSFHY4Y9AEH58&source=url)