Wordpress Install version 5

Hi - I’ve tried installing the auth0 plugin version 5.2.0 using Composer. When trying to activate the plugin, I receive a fatal error, 'Error: Class “Auth0\WordPress\Plugin” not found in [REDACTED]/wp-content/plugins/wordpress/wpAuth0.php. Is this a known issue or did I install it incorrectly?

Hi @markramos83 :wave:

There’s no such known issue — could you step me through your install process?

The error indicates that your Composer installation isn’t able to autoload the namespace, which sounds like a configuration issue with the host/site setup.

1 Like

Thanks evansims; I’m brand new to using Composer for installing plugins so I figured it was user error. I initialized Composer, and after adding the composer/installers package, I ran this command:

composer require symfony/http-client nyholm/psr7 auth0/wordpress:^5.0

My composer.json file now contains:

    "require": {
        "composer/installers": "~1.0",
        "symfony/http-client": "^7.0",
        "nyholm/psr7": "^1.8",
        "auth0/wordpress": "^5.0"

And the plugin is now visible in my WP dashboard. But when I click to Activate it, I get that fatal error.

1 Like

No worries @markramos83, we’ll get ya up and running!

Some essentials, just to cover our bases:

  1. What type of WordPress install do you have? Standard (or Multisite?), or are you using a variant like Bedrock?
  2. What version of PHP, Composer, and WordPress are you running?

In regards to your install steps:

  1. Where did you run the composer require command? Depending on your install type, this might need to be adjusted.
  2. Can you check inside your /wp-content/plugins/wordpress folder and let me know if there is a ‘vendor’ subfolder in there?
1 Like
  1. Standard, not using any variant or Bedrock.
  2. PHP 8.2, Composer 2.7.6, WordPress 6.5.3
  3. I ran this from the wp-content/plugins folder
  4. There is not a vendor subfolder here. Upon install, a vendor folder was added to /wp-content/plugins/

As an aside, I found this thread which seems to be very similar to my issue: Composer installation not working - fatal error upon attempting activation · Issue #893 · auth0/wordpress · GitHub

Interesting, OK — re: 4, is there a composer.json file in there? If so, can you try cding into that folder and running composer install from there? That should create a vendor subfolder with the necessary dependencies and, critically, the autoloader that’s missing that is likely the root of the issue for you. Let me know how that goes

Success! I had to also remove the ‘vendor’ line from /wp-content/plugins/wordpress/.gitignore so that I could push these changes to my host. But now that all dependencies and autoloader have been added, I’m able to activate and get on with configuration. Please let me know if there’s anything else I may be missing, otherwise thanks very much for your help!

Fantastic! So glad that sorted things for you. It sounds like you did everything just as you should’ve, so I’ll dig in and see if I can figure out what might have gone wrong there — at a minimum, I want to make sure our documentation covers all the edge cases possible so we can save others from similar situations, and if there’s a bug somewhere, definitely want to fix that. I appreciate you stepping through it with me!

Please do let us know if you hit any other snags, and we’ll be happy to help.