humanmade / S3-Uploads

The WordPress Plugin to Store Uploads on Amazon S3
1.94k stars 389 forks source link

Installed 3.0.4 manual-install.zip: wp-cli crashed: Callable "S3_Uploads\\WP_CLI_Command" does not exist, and cannot be registered as `wp s3-uploads`. #585

Closed garubi closed 1 year ago

garubi commented 2 years ago

I installed the v 3.0.4 manual-install.zip to upgrade from an old 2.0.0 release. The plugin activate and runs ok but the wp-cli crashes with the following error: Callable "S3_Uploads\WP_CLI_Command" does not exist, and cannot be registered as wp s3-uploads.

We are unable to run any wp-cli command, even the 'wp' itself. We always gat Callable "S3_Uploads\WP_CLI_Command" does not exist, and cannot be registered as wp s3-uploads.

Looking into other similar issues still open (see #573 , #528 , #530) and to PR #519 I solved editing /inc/namespace.php moved the line require_once dirname( __DIR__ ) . '/vendor/autoload.php'; just below the require_once dirname( __DIR__ ) . '/vendor/autoload.php'; since is autoload.php that includes the wp-cli commands, we need to inlude it anyway, even if the S3 class is already loaded by others plugin.

But I'm not sure that this is teh right way to resolve. Please take a look at PR #519 and if it's ok accept it and merge

Thank you

gabriserra commented 2 years ago

Same here. PR #519 fixes my issue. I cannot see any problem with it, so let's ask again maintainers to accept that PR

nosilver4u commented 2 years ago

Confirmed on a fresh install of both 3.0.4 and 3.0.3 using manual install, PR #519 worked for me also.

MattWilliamsDev commented 1 year ago

Tagging @kovshenin for visibility on this duplicate issue as well as he seems to be the only one looking at issues recently.

rmccue commented 1 year ago

Thanks for the issue! We're going to remove this installation method to avoid problems like this, see #644.