humanmade / S3-Uploads

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

Non-composer install, inc/ files not `include`d. #528

Open beporter opened 3 years ago

beporter commented 3 years ago

I'm attempting to upgrade from v2.0.0.

Following the instructions in the README for a manual (non-composer) install, I've downloaded the 3.0.1 release and extracted into my wp-content/plugins/ folder:

$ ls wp-content/plugins/S3-Uploads-3.0.1/
CHANGELOG.md  composer.json  psalm      README.md       verify.txt
codecov.yml   inc            psalm.xml  s3-uploads.php

Then I ran the wp command to activate the plugin:

$ wp plugin activate S3-Uploads-3.0.1
Error: Callable "S3_Uploads\\WP_CLI_Command" does not exist, and cannot be registered as `wp s3-uploads`.

It appears that none of the files in the inc/ folder are ever directly require'd or include'd in a non-composer setup so they're out of scope. Here's the chain as I understand it:

It's not clear to me how PHP is supposed to know about any of the files in the inc/ folder when they aren't being explicitly include'd or require'd anywhere in this package. 😣

beporter commented 3 years ago

In the 2.0.0 release, this happened right at the top of s3-uploads.php:

if ( defined( 'WP_CLI' ) && WP_CLI ) {
    require_once dirname( __FILE__ ) . '/inc/class-s3-uploads-wp-cli-command.php';
}

For 3.0.0 that's not the case anymore and I am unable to find the equivalent command.

joehoyle commented 3 years ago

It looks like the release script is broken again, so there's no "manual install zip" on the GitHub release page (see https://github.com/humanmade/S3-Uploads/runs/2828157924?check_suite_focus=true)

beporter commented 3 years ago

This might be the fix then?

  with:
    php-version: "7.4"
+   coverage: pcov

https://github.com/marketplace/actions/setup-php-action#pcov

mycarrysun commented 2 years ago

Has this been fixed yet? Looks like there's a vendor/autoload.php in the manual-install.zip file, but its not getting included?

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.