Support » Plugin: WP PHP Console » Fatal error on activation v1.5.4

  • Since upgrading to v1.5.4 I’m getting this fatal error that crashes the whole website:

    Fatal error: Uncaught Error: Call to a member function addPsr4() on bool in <…>/wp-content/plugins/wp-php-console/wp-php-console.php:125

    The referenced code:

    `/**
    * Initializes the plugin.
    *
    * @internal
    *
    * @since 1.5.4
    */
    private function init_plugin() {

    // autoload plugin and vendor files
    $loader = require_once( plugin_dir_path( __FILE__ ) . ‘vendor/autoload.php’ );

    // register plugin namespace with autoloader
    $loader->addPsr4( ‘WP_PHP_Console\\’, __DIR__ . ‘/includes’ );

    require_once plugin_dir_path( __FILE__ ) . ‘includes/Functions.php’;

    wp_php_console();
    }`

Viewing 2 replies - 1 through 2 (of 2 total)
  • I have found that the file ‘…vendor/autoload.php’ was already required in another plugin so require_once above was returning bool(true) instead of an object

    Plugin Author Fulvio Notarstefano

    (@nekojira)

    hey @oyatek thanks for reporting this and sorry for the late reply

    indeed that’s something that could happen, but in this case vendor/autoload.php should be exclusive to WP PHP Console and the classes generated by composer are unique

    out of curiosity which was the plugin that required that file?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.