Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No suitable autoloader found #143

Open
wimkroegman opened this issue Feb 1, 2023 · 10 comments
Open

No suitable autoloader found #143

wimkroegman opened this issue Feb 1, 2023 · 10 comments

Comments

@wimkroegman
Copy link

Hi, I keep on getting a 'No suitable autoloader found' message with the 0.2.0 version. I've used the .zip file in the tagged version and tried to build via composer. Both give the same error.

Also clearing browser cache and installing new WP installs doesn't help.

When I use 0.1.0-beta, all works fine. Any suggestions?

@stefthoen
Copy link

I ran into the same issue. Tried forking the repo and updating the Composer installer to 2.0. Didn't work.

In the end I ran composer install in the plugin folder and added the plugin to my website's repo. I'm not happy with the 9063 files being added, but don't see how else I can use this plugin.

@stefthoen
Copy link

stefthoen commented Feb 7, 2023

@wimkroegman I finally did get it working without including all the dependencies. I ran composer dumpautoload in the plugins folder and it created the autoload classes it needed.

@ferdydurque
Copy link

Hi, I'm sorry.

I tried to use composer as you mention, or downloading the zip from releases ... and set the plugins in the mu-plugins but nothing works. Is there a way to download the plugin without any use of composer?

@wimkroegman
Copy link
Author

Thx @stefthoen. Will have a look at your solution.

@jordanrabidou
Copy link

having the same issues as the above

@stefthoen
Copy link

Here's a link to the fork that includes the the autoload files. I'm not planning to maintain it and keep it in sync with this repo. @ferdydurque @thebananaland

@peteratomic
Copy link

Don't get it. The instructions don't say anything about composer (whatever that is) being a requirement. Can someone from the developer team confirm this? Is using composer REQUIRED or not?

I have tried a regular plugin install AND placing the release (downloaded from the release page as instructed!) in the mu-plugins folder. Neither works.

"No suitable autoloader found. Multisite Global Media cannot be loaded correctly." never goes away.

@stefthoen
Copy link

@peteratomic this plugin hasn't been updated in a while and the main developer is unresponsive, so I don't think you'll get an answer anytime soon.

Composer is a PHP dependency manager. It's like npm for PHP. You can use Composer to pull in packages from packagist.org, but you can also use it to create an autoloader. This is a file that tells your PHP project where it can find the classes that your code needs.

If you need to use a class in another file you use to do require, or require_once. With namespacing, and file import using use, that's no longer necessary.

The developer of this plugin requires a autoload file, but forgot to include one in this codebase. You need to generate it yourself.

@alevals
Copy link

alevals commented Mar 6, 2024

thanks @stefthoen !

@ethaizone
Copy link

Hi. I found this same issue too so here is steps that I did and it helped me. I just share in case if someone don't familiar with composer.

  1. Install this plugin with composer command. BTW I install from dev-master as I use PHP 8.2.
  2. create wp-content/mu-plugins/load.php then put content like this.
<?php
require_once ABSPATH.'vendor/autoload.php';
require_once WPMU_PLUGIN_DIR.'/multisite-global-media/multisite-global-media.php';

If you do this way then it won't throw error. I tested and it works for PHP. (I found other issue on JS on latest Wordpress but it's another topic.)

BTW I think someone might aware as exists of Composer\Installers as it's required library for install plugin via composer but you won't need to worry. Composer won't load class if no one call it. so no need to worry. If someone want to prove it then you can put var_dump and die in vendor/composer/installers/src/Composer/Installers/Installer.php to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants