barbushin / php-console

Handle PHP errors, dump variables, execute PHP code remotely in Google Chrome
https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef
MIT License
1.34k stars 283 forks source link

Third party integration: standalone php-console build doesn't work on Wordpress #164

Open userlond opened 4 years ago

userlond commented 4 years ago

I try to setup standalone php-console on Wordpress. Site is on localhost.

I've made all necessary preparations and extension works in standalone (not Wordpres) index.php, minimal working code is:

<?php
require __DIR__ . '/classes/vendor/autoload.php';
\PhpConsole\Helper::register();
PC::debug(23);

Then I try to integrate it into my theme, in my functions.php:

<?php
add_action('init', function() {
    require __DIR__ . '/classes/vendor/autoload.php';
    \PhpConsole\Helper::register();
    PC::debug(23);
});

Seems like extension starts and even outputs some data into HTTP-headers, related to php-console. But I can't get Chrome notifications with debug data.

I tried recipes from https://github.com/barbushin/php-console/issues/88, but with no luck.

I know about special WP-phpconsole plugin, but question is related to standalone php-console build.

unfulvio commented 3 years ago

try this plugin https://wordpress.org/plugins/wp-php-console/