Support » Plugin: Plausible Analytics » Class “Plausible\Analytics\WP\Plugin” not found

  • shukantpal

    (@shukantpal)


    PHP Fatal error:  Uncaught Error: Class "Plausible\Analytics\WP\Plugin" not found in /app/web/wp-content/plugins/plausible-analytics/plausible-analytics.php:44
    2021-03-21T15:56:35.219439+00:00 app[web.1]: Stack trace:
    2021-03-21T15:56:35.221238+00:00 app[web.1]: #0 /app/web/wp-admin/includes/plugin.php(2299): include()
    2021-03-21T15:56:35.221513+00:00 app[web.1]: #1 /app/web/wp-admin/plugins.php(191): plugin_sandbox_scrape()
    2021-03-21T15:56:35.221577+00:00 app[web.1]: #2 {main}
    2021-03-21T15:56:35.221907+00:00 app[web.1]: thrown in /app/web/wp-content/plugins/plausible-analytics/plausible-analytics.php on line 44
    

    I’m getting this error when trying to activate the Plausible plugin. I’m not familiar with PHP yet so I the most I can figure out is that the Plugin.php file isn’t being required. My tiny brain fix was as to manually require all the files in the src directory:

    require_once __DIR__ . '/src/Plugin.php';
    require_once __DIR__ . '/src/Includes/Helpers.php';
    require_once __DIR__ . '/src/Includes/Filters.php';
    require_once __DIR__ . '/src/Includes/Actions.php';
    require_once __DIR__ . '/src/Admin/Actions.php';
    require_once __DIR__ . '/src/Admin/Filters.php';
    require_once __DIR__ . '/src/Admin/Settings.php';
    

    Please let me know how to properly fix this. I think the problem is related to the vendor/autoload.php shipped with this plugin.

    • This topic was modified 6 months ago by shukantpal.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mehul Gohil

    (@mehul0810)

    Hi @shukantpal

    Based on the error you mentioned, it seems that the vendor directory doesn’t exists in the Plausible Analytics plugin folder. I have tried installing the plugin from WordPress.org in a new WP instance and is working fine.

    So, can you let me know from where you have downloaded the plugin ZIP and then what steps you have followed which ended up in these fatal errors. This will help me debug the issue.

    Thanks,
    Mehul

    Thread Starter shukantpal

    (@shukantpal)

    Thanks @mehul0810

    I do have a vendor directory with the plugin:

    vendor/autoload.php: https://ibb.co/f4wtPpV
    vendor/composer: https://ibb.co/cNGczCX

    I installed the plugin manually – downloaded it & extracted contents into web/wp-content/plugins

    Could this be related to me placing WordPress in web/ and not the repository root?

    • This reply was modified 6 months ago by shukantpal.
    Plugin Author Mehul Gohil

    (@mehul0810)

    Hi @shukantpal

    Based on the screenshots you shared, I assume that the wp-includes and wp-admin folder are under site and wp-content folder is under site/web, Can you clarity?

    If you can share the screenshot for listing under site and web which might help me understand what is the cause.

    Thanks,
    Mehul

    Thread Starter shukantpal

    (@shukantpal)

    @mehul0810 No, the whole WordPress installation is under web/.

    https://ibb.co/mqP411j

    Thread Starter shukantpal

    (@shukantpal)

    I can give temporary access to the repo if needed.

    Plugin Author Mehul Gohil

    (@mehul0810)

    @shukantpal Let me try and replicate the similar directory structure on my local system and get back to you in couple of days. If any fix is necessary, I will do that and release a new version.

    If I have any further questions, then I will reach out to you here.

    Thanks,
    Mehul

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Class “Plausible\Analytics\WP\Plugin” not found’ is closed to new replies.