junaidbhura / composer-wp-pro-plugins

Composer installer for Pro WordPress plugins.
https://packagist.org/packages/junaidbhura/composer-wp-pro-plugins
MIT License
91 stars 28 forks source link

BUG: Zips are coming back empty. I think! #14

Closed alicam closed 4 years ago

alicam commented 4 years ago

Hi Junaid.

Great little app you have here, but I can't get it to work with Composer 1.9.1 or 1.9.0. (I've not tried rolling back to a previous version.)

image

It always fails, and I have tried it on ACF, Gravity Forms, All Import Pro, etc. All experience the same issue.

Now I checked that it wasn't an issue with Dotenv not being read properly, but that's not the issue. The file download URLs are being correctly created, including the licence key/s.

(I've also tested the EDD download links created for All Import Pro, and they're getting correctly created too.)

So I'm not sure what to think right now. It seems to be Composer quitting too soon on the downloads. Is there a timeout issue??

Can you please try with the latest Composer and see what it does for you?

Thanks!

alicam commented 4 years ago

I looked in ~/.composer/cache/files/junaidbhura/ and I can see zip files in there for all the plugins, but they're all the wrong filesize and broken (they won't unzip).

So a bit more detail for you there, but still unusable to me :(

A

alicam commented 4 years ago

And in case it's relevant I've cleared the cache, deleted the vendor directory, and as much as possible tried to do it from a "clean install", and to no avail.

A

alicam commented 4 years ago

Hope you can get to this before you get too busy at 10Up!! Congrats, by the way.

A

junaidbhura commented 4 years ago

Hey @alicam Thanks :)

I think this could possibly be related to: https://github.com/junaidbhura/composer-wp-pro-plugins/issues/1

Can you try running composer clear-cache before composer install ?

alicam commented 4 years ago

Yeah I have. Repeatedly. No go.

Other plugins/dependencies are added just fine, but none that use your app.

Maddening!

junaidbhura commented 4 years ago

Hmm @alicam do you use Prestissimo with Composer?

alicam commented 4 years ago

No I don't. Latest OSX but nothing weird.

junaidbhura commented 4 years ago

Hmm that's really weird @alicam just tested this on the latest OSX Catalina and Composer 1.9.1 and everything works great!

Can you share your composer.json file, and confirm that you have the .env file added correctly in the same directory as the composer.json file?

alicam commented 4 years ago

This is my composer.json:

{
  "name": "hingeltd/wordpress-starter",
  "type": "project",
  "license": "MIT",
  "description": "WordPress boilerplate with Bedrock, Lumberjack, Laravel mix on Docker",
  "homepage": "https://github.com/hingeltd/wordpress-starter/",
  "authors": [
    {
      "name": "Hinge",
      "email": "hello@hinge.agency",
      "homepage": "https://hinge.agency/"
    }
  ],
  "keywords": [
    "bedrock", "composer", "boilerplate", "docker", "wordpress", "wp", "wp-config"
  ],
  "support": {
    "issues": "https://github.com/hingeltd/wordpress-starter/issues"
  },
  "config": {
    "preferred-install": "dist"
  },
  "repositories": [
    {
      "type": "composer",
      "url": "https://wpackagist.org"
    },
    {
      "type":"vcs",
      "url":"https://github.com/junaidbhura/composer-wp-pro-plugins"
    },
    {
      "type": "package",
      "package": {
        "name": "advanced-custom-fields/advanced-custom-fields-pro",
        "version": "5.8.7",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://connect.advancedcustomfields.com/index.php?a=download&p=pro&k={%ACF_PRO_KEY}&t={%version}"
        },
        "require": {
          "composer/installers": "^1.4",
          "ffraenz/private-composer-installer": "^3.0"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "junaidbhura/advanced-custom-fields-pro",
        "version": "5.8.7",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.advancedcustomfields.com"
        },
        "require": {
            "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "junaidbhura/gravityforms",
        "version": "2.4.15.13",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.gravityforms.com"
        },
        "require": {
          "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "junaidbhura/wp-all-import-pro",
        "version": "4.5.8",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.wpallimport.com"
        },
        "require": {
          "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "junaidbhura/wpai-acf-add-on",
        "version": "3.2.4",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.wpallimport.com"
        },
        "require": {
          "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "junaidbhura/wpai-user-add-on",
        "version": "1.1.2",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.wpallimport.com"
        },
        "require": {
          "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "codepress/admin-columns-pro",
        "version": "4.7.3",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.admincolumns.com/?wc-api=software-licence-api&request=plugindownload&licence_key={%AC_PRO_KEY}&plugin_name=admin-columns-pro"
        },
        "require" : {
          "composer/installers": "^1.4",
          "ffraenz/private-composer-installer": "^3.0"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "codepress/ac-addon-acf",
        "version": "2.5.5",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url":"https://www.admincolumns.com/?wc-api=software-licence-api&request=plugindownload&licence_key={%AC_PRO_KEY}&plugin_name=ac-addon-acf"
        },
        "require" : {
          "composer/installers": "^1.4",
          "ffraenz/private-composer-installer": "^3.0"
        }
      }
    }
  ],
  "require": {
    "php": ">=7.1",
    "composer/installers": "^1.4",
    "vlucas/phpdotenv": "^3.0",
    "oscarotero/env": "^1.1.0",
    "roots/wordpress": "^5.1.1",
    "roots/wp-config": "^1.0.0",
    "roots/wp-password-bcrypt": "^1.0.0",
    "rareloop/lumberjack-core": "^4.2",
    "rareloop/lumberjack-primer": "^1.0",
    "wpackagist-plugin/classic-editor": "^1.5",
    "wpackagist-plugin/debug": "^1.8",
    "wpackagist-plugin/debug-bar": "^1.0",
    "wpackagist-plugin/debug-bar-timber": "^0.3.0",
    "codepress/admin-columns-pro": "*",
    "codepress/ac-addon-acf": "*",
    "advanced-custom-fields/advanced-custom-fields-pro": "^5.8"
  },
  "require-dev": {
    "squizlabs/php_codesniffer": "^3.0.2",
    "roave/security-advisories": "dev-master"
  },
  "extra": {
    "installer-paths": {
      "web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
      "web/app/plugins/{$name}/": ["type:wordpress-plugin"],
      "web/app/themes/{$name}/": ["type:wordpress-theme"]
    },
    "wordpress-install-dir": "web/wp"
  },
  "scripts": {
    "post-root-package-install": [
      "php -r \"copy('.env.example', '.env');\""
    ],
    "test": [
      "phpcs"
    ]
  }
}

If I then try composer require junaidbhura/wp-all-import-pro it fails.

And yes, the .env file is there, and in the right place... hence why it does download some of the file, but not all - weirdly.

A

alicam commented 4 years ago

Note also, in the above, that I have TAKEN OUT the other repo for ACF Pro, but have here put it back, because I needed ACF Pro, and this other approach to ACF Pro works. In or out, it doesn't work.

junaidbhura commented 4 years ago

@alicam Can you try removing this?

"post-root-package-install": [
  "php -r \"copy('.env.example', '.env');\""
],

It's possible that your .env file might be overwritten.

Also, just to confirm, your require should look like:

"require": {
...
    "junaidbhura/advanced-custom-fields-pro": "*"
    "junaidbhura/gravityforms": "*"
...
  },

Try using * for the version.

alicam commented 4 years ago

Yeah, no. The .env file is ok. That's only on install.

And yes, I had it like this (and it didn't work):

"junaidbhura/wp-all-import-pro": "*"

A

junaidbhura commented 4 years ago

Hey @alicam I've tested this with the latest Composer on Mac, Windows and also Linux on CI systems and it seems to be all okay. This leads me to believe that it might be something specific on your machine that might be causing it to behave this way.

I'm closing this issue because of this reason, but we can continue to have a discussion here to try to figure out what the issue might be!

Did you have any luck with it?