junaidbhura / composer-wp-pro-plugins

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

Failed to execute (9) unzip -qq -o 'web/app/plugins/wp-all-import-pro// ... #27

Closed jesstucker closed 1 year ago

jesstucker commented 3 years ago

Hey all,

Trying to use the all import/export pro plugin part of this.

Seems that I am getting a similar error as the issues referenced below (and commented in issue 18): https://github.com/junaidbhura/composer-wp-pro-plugins/issues/18 https://github.com/junaidbhura/composer-wp-pro-plugins/issues/14 https://github.com/junaidbhura/composer-wp-pro-plugins/issues/1

Screenshots of my error: Screen Shot 2021-02-24 at 12 40 46 PM

Text version:

[RuntimeException]                                                                                     
  Failed to execute (9) unzip -qq -o 'web/app/plugins/wp-all-import-pro//7d7969993593a13942741e4a52c3e8  
  29' -d '/Users/jesstucker/Code/redacted/site/vendor/composer/b8cc9703'                  

  [web/app/plugins/wp-all-import-pro//7d7969993593a13942741e4a52c3e829]                                  
    End-of-central-directory signature not found.  Either this file is not                               
    a zipfile, or it constitutes one disk of a multi-part archive.  In the                               
    latter case the central directory and zipfile comment will be found on                               
    the last disk(s) of this archive.                                                                    
  unzip:  cannot find zipfile directory in one of web/app/plugins/wp-all-import-pro//7d7969993593a13942  
  741e4a52c3e829 or                                                                                      
          web/app/plugins/wp-all-import-pro//7d7969993593a13942741e4a52c3e829.zip, and cannot find web/  
  app/plugins/wp-all-import-pro//7d7969993593a13942741e4a52c3e829.ZIP, period.   

I noticed that some previous fixes had occurred on Installer.php but I must be honest in admitting I am terribly new to composer / wp / etc... and not really sure where / what to inspect to catch the error.

@junaidbhura asked me to post my versions in the prior post; here they are again:

composer.json:

...
{
      "type": "package",
      "package": {
        "name": "junaidbhura/wp-all-import-pro",
        "version": "4.6.5",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.wpallimport.com"
        },
        "require": {
          "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "junaidbhura/wp-all-export-pro",
        "version": "1.6.4",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.wpallimport.com"
        },
        "require": {
          "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    }
...
 "require": {
    ...
    "junaidbhura/wp-all-import-pro": "*",
    "junaidbhura/wp-all-export-pro": "*"
  },

Perhaps I will also add that I am using Bedrock / Roots / Trellis / Sage 10 Also my assumption is that I am using the 1.2.0 version of this plugin (composer-wp-pro-plugins)

Love what you're doing, managing these paid plugins is a headache!

Sincerely, Jess

jesstucker commented 3 years ago

Also, just tried mimicking the api call to the WP All Import Api using postman, I'm getting presumably desired results from postman – at least a download_link property. But not in the WpAiPro.php plugin – it returns a similar json object, without a download_link value.

Screen Shot 2021-02-24 at 1 17 32 PM

Whereas the plugin returns: Screen Shot 2021-02-24 at 1 19 55 PM

junaidbhura commented 3 years ago

Hey @jesstucker thanks for creating this issue, and I'm glad you find this plugin useful! :)

A few things to test:

  1. Are you sure you have the correct values in the .env file?
  2. Try deleting the vendor directory, the WP All Import / Export plugins from the wp-content/plugins directory and composer.lock file and running composer install again
  3. In Postman - Can you click the download_link to see if you actually get a ZIP file?

I've faced issues with WP All Import / Export before - its really fussy

jesstucker commented 3 years ago

Hey @junaidbhura,

  1. I believe the values are correct in the .env file. Here is a var_dump of the params seemingly sent to the wpallimport api:
    {
    ["edd_action"]=>
    string(11) "get_version"
    ["license"]=>
    string(32) "(redacted: but matches license)"
    ["item_name"]=>
    string(13) "WP All Import"
    ["url"]=>
    string(161) "https://www.wpallimport.com/index.php?eddfile=<redacted>&ttl=<redacted>&file=<redacted>&token=<redacted>"
    ["version"]=>
    string(5) "4.6.5"
    }

When I send these same values in postman, I do seem to get a download_link value.

  1. Just tried deleting vendor, site/web/app/plugins (note this is a little different in wp sage), and composer.lock. Ran composer install and still getting that error.

  2. Yes, the postman response download_link downloads a zip file containing the expected contents.

I discovered that if I modify the site/vendor/junaidbhura/composer-wp-pro-plugins/plugins/WpAiPro.php file to omit the version param, it seems to download properly:

        $response = json_decode( $http->post( 'https://www.wpallimport.com', array(
            'edd_action' => 'get_version',
            'license'    => $license,
            'item_name'  => $name,
            'url'        => $url,
            'version'    => $this->version, # <---- removing this seems to successfully download/unzip
        ) ), true );

Also, this is a little crazy making, but I just reprovisioned a local environment, and it seems to work, which I cannot make any sense of!

junaidbhura commented 3 years ago

Hey @jesstucker hmm that is really weird. If reprovisioning a local environment works, then there must be some obscure configuration in your existing environment that must be preventing it from working.

I can confirm that the exact same versions of All Import and Export work for me - both locally on a Mac and in an Ubuntu CI environment

Can you run composer clear-cache before running composer install? What version of Composer do you use?

jesstucker commented 3 years ago

Hey @junaidbhura,

Just ran composer clear-cache and composer install, same behavior. I'm using Composer version 1.10.10. Started using v.2 but was having problems.

I can't for the life of me understand why removing the versions param would allow the plugin to download?

I suppose if it comes down to it, maybe I can fork your repo and modify, I do sincerely appreciate your work!!!

Thanks, Jess

junaidbhura commented 3 years ago

@jesstucker Do you use https://github.com/hirak/prestissimo ? This plugin is incompatible with it

jesstucker commented 3 years ago

@junaidbhura,

Just checked the dependencies, and don't see any use of prestissimo. I did try updating to composer v2 and was having the same zip download error.

Just as a test I tried overwriting this line with a hardcoded url download link (available on wp-all-import site: https://www.wpallimport.com/checkout/purchase-confirmation/?payment_key=REDACTED) that follows this link formatting:

https://www.wpallimport.com/index.php?
eddfile={redacted}&
ttl={redacted}&
file={redacted}&token={redacted}

And was able to successfully download and install the packages.

So then I tried a hybrid approach of your repo and ffraenz/private-composer-installer, this seemed to work. See composer.json example:

#composer.json
...
{
      "type": "package",
      "package": {
        "name": "junaidbhura/wp-all-import-pro",
        "version": "4.6.5",
        "type": "wordpress-muplugin",
        "dist": {
          "type": "zip",
          "url": "https://www.wpallimport.com/index.php?eddfile={redacted}&ttl={redacted}&file={redacted}&token={redacted}"
        },
        "require": {
          "composer/installers": "^1.4",
          "ffraenz/private-composer-installer": "^5.0"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "junaidbhura/wp-all-export-pro",
        "version": "1.6.4",
        "type": "wordpress-muplugin",
        "dist": {
          "type": "zip",
          "url": "https://www.wpallimport.com/index.php?eddfile={redacted}&ttl={redacted}&file={redacted}&token={redacted}"
        },
        "require": {
          "composer/installers": "^1.4",
          "ffraenz/private-composer-installer": "^5.0"
        }
      }
    }
  ],
...
"require": {
    "junaidbhura/wp-all-import-pro": "*",
    "junaidbhura/wp-all-export-pro": "*"
},
...

Still not really sure of anything 😅

Thanks!

sixclones commented 3 years ago

I've been facing a similar issue too.

At first I thought the problem was caused by the fact that zip was named tmp-somehash.ZIP with uppercase and as I'm using Ubuntu, the OS is case sensitive.

But then I tried to replicate the problem to give you more information about it but I was able to run composer install without any troubles.

Between my first and second try, I modified the permissions of my directories by running some sudo chmod 775 path/to/directory -R inside the project.

So, I don't know what you can do with those information, hope it'll help.

Twansparant commented 3 years ago

So I'm trying to achieve the same with Composer 2 and Sage 9, but how can I get this registered_url_for_wpae_pro? I purchased WP All Export Pro and need to add it to my composer, just like I did with my GravityForms plugins.

I tried with this url as the WP_ALL_EXPORT_PRO_URL:

https://www.wpallimport.com/index.php?eddfile=<somestring>&ttl=<somenumber>&file=<number>&token=<somerandomstring>

But it's not working, getting this error:

Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 1 removal
  - Downloading junaidbhura/wp-all-export-pro (1.6.5)
  - Downloading junaidbhura/wpae-user-add-on (1.0.4)
  - Removing junaidbhura/wpai-user-add-on (1.0.4)
Deleting web/app/plugins/wpai-user-add-on/ - deleted
  - Installing junaidbhura/wp-all-export-pro (1.6.5): Extracting archive
  - Installing junaidbhura/wpae-user-add-on (1.0.4): Extracting archive
 0/2 [>---------------------------]   0%    Install of junaidbhura/wp-all-export-pro failed
    Install of junaidbhura/wpae-user-add-on failed
 2/2 [============================] 100%

  [RuntimeException]                                                                                                    
  Failed to extract junaidbhura/wp-all-export-pro: (9) unzip -qq -o '/path/to/project/site/vendor/composer/tmp-9951e9fc7fed9695e45bb6396442b314' -d '/path/to/project/site/vendor/composer/af2697f1'                                

  [/path/to/project/site/vendor/composer/tmp-9951e9fc7fe  
  d9695e45bb6396442b314]                                                                                                
    End-of-central-directory signature not found.  Either this file is not                                              
    a zipfile, or it constitutes one disk of a multi-part archive.  In the                                              
    latter case the central directory and zipfile comment will be found on                                              
    the last disk(s) of this archive.                                                                                   
  unzip:  cannot find zipfile directory in one of /path/to/project/site/vendor/composer/tmp-9951e9fc7fed9695e45bb6396442b314 or                                               
          /path/to/project/site/vendor/composer/tmp-9951  
  e9fc7fed9695e45bb6396442b314.zip, and cannot find /path/to/project/site/vendor/composer/tmp-9951e9fc7fed9695e45bb6396442b314.ZIP, period.

Any idea where to get this magical url? Thanks!

jesstucker commented 3 years ago

So I'm trying to achieve the same with Composer 2 and Sage 9, but how can I get this registered_url_for_wpae_pro? I purchased WP All Export Pro and need to add it to my composer, just like I did with my GravityForms plugins.

I tried with this url as the WP_ALL_EXPORT_PRO_URL:

https://www.wpallimport.com/index.php?eddfile=<somestring>&ttl=<somenumber>&file=<number>&token=<somerandomstring>

But it's not working, getting this error:

Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 1 removal
  - Downloading junaidbhura/wp-all-export-pro (1.6.5)
  - Downloading junaidbhura/wpae-user-add-on (1.0.4)
  - Removing junaidbhura/wpai-user-add-on (1.0.4)
Deleting web/app/plugins/wpai-user-add-on/ - deleted
  - Installing junaidbhura/wp-all-export-pro (1.6.5): Extracting archive
  - Installing junaidbhura/wpae-user-add-on (1.0.4): Extracting archive
 0/2 [>---------------------------]   0%    Install of junaidbhura/wp-all-export-pro failed
    Install of junaidbhura/wpae-user-add-on failed
 2/2 [============================] 100%

  [RuntimeException]                                                                                                    
  Failed to extract junaidbhura/wp-all-export-pro: (9) unzip -qq -o '/path/to/project/site/vendor/composer/tmp-9951e9fc7fed9695e45bb6396442b314' -d '/path/to/project/site/vendor/composer/af2697f1'                                

  [/path/to/project/site/vendor/composer/tmp-9951e9fc7fe  
  d9695e45bb6396442b314]                                                                                                
    End-of-central-directory signature not found.  Either this file is not                                              
    a zipfile, or it constitutes one disk of a multi-part archive.  In the                                              
    latter case the central directory and zipfile comment will be found on                                              
    the last disk(s) of this archive.                                                                                   
  unzip:  cannot find zipfile directory in one of /path/to/project/site/vendor/composer/tmp-9951e9fc7fed9695e45bb6396442b314 or                                               
          /path/to/project/site/vendor/composer/tmp-9951  
  e9fc7fed9695e45bb6396442b314.zip, and cannot find /path/to/project/site/vendor/composer/tmp-9951e9fc7fed9695e45bb6396442b314.ZIP, period.

Any idea where to get this magical url? Thanks!

Hey what's up @Twansparant,

I got this URL by logging into my All Import Pro account (customer portal), and finding the "special" url available for download: Screen Shot 2021-06-17 at 2 31 10 PM

Twansparant commented 3 years ago

Hi @jesstucker, thanks for your reply! I did try that url already by setting it as the WP_ALL_EXPORT_PRO_URL env variable, but that resulted in the error above.

junaidbhura commented 3 years ago

Hello everyone, are you sure you're not using Prestissimo? https://github.com/hirak/prestissimo . Its a global package, so it won't show up in your composer.json file

Just in case, you can try removing it by running: composer global remove hirak/prestissimo

Twansparant commented 3 years ago

Yes, in my case 100% sure since I had the same problems with gravityforms packages.

WP_ALL_EXPORT_PRO_KEY='{redacted}'
WP_ALL_EXPORT_PRO_URL='https://www.wpallimport.com/checkout/purchase-confirmation/?payment_key={redacted}'

In my composer.json repositories:

{
      "type": "package",
      "package": {
        "name": "junaidbhura/gravityforms",
        "version": "2.5.5",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.gravityforms.com"
        },
        "require": {
          "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "junaidbhura/gravityformsmailchimp",
        "version": "4.9",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.gravityforms.com"
        },
        "require": {
          "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "junaidbhura/wp-all-export-pro",
        "version": "1.6.5",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.wpallimport.com"
        },
        "require": {
          "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "junaidbhura/wpae-user-add-on-pro",
        "version": "1.0.4",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.wpallimport.com"
        },
        "require": {
          "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    }

And in my require:

  "require": {
    "php": ">=7.1",
    "composer/installers": "^1.9",
    "vlucas/phpdotenv": "^4.1",
    "oscarotero/env": "^2.1",
    "junaidbhura/wp-all-export-pro": "*",
    "junaidbhura/wpae-user-add-on-pro": "*",
    "junaidbhura/gravityforms": "*",
    "junaidbhura/gravityformsmailchimp": "*"
  }

When I run rm -rf vendor && rm -rf composer.lock && composer clear-cache && composer install, I get this error:

 Installing dependencies from lock file (including require-dev)
Package operations: 30 installs, 0 updates, 0 removals
  - Downloading symfony/polyfill-ctype (v1.23.0)
  - Downloading phpoption/phpoption (1.7.5)
  - Downloading vlucas/phpdotenv (v4.2.0)
  - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
  - Installing phpoption/phpoption (1.7.5): Extracting archive
  - Installing vlucas/phpdotenv (v4.2.0): Extracting archive
  - Downloading ffraenz/private-composer-installer (v5.0.1)
  - Installing ffraenz/private-composer-installer (v5.0.1): Extracting archive
  - Downloading junaidbhura/composer-wp-pro-plugins (1.2.0)
  - Installing junaidbhura/composer-wp-pro-plugins (1.2.0): Extracting archive
  - Downloading composer/installers (v1.11.0)
  - Downloading junaidbhura/gravityforms (2.5.5)
  - Downloading junaidbhura/gravityformsmailchimp (4.9)
  - Downloading junaidbhura/wp-all-export-pro (1.6.5)
  - Downloading junaidbhura/wpae-user-add-on-pro (1.0.4)
  - Downloading oscarotero/env (v2.1.0)
  - Installing composer/installers (v1.11.0): Extracting archive
  - Installing junaidbhura/gravityforms (2.5.5): Extracting archive
  - Installing junaidbhura/gravityformsmailchimp (4.9): Extracting archive
  - Installing junaidbhura/wp-all-export-pro (1.6.5): Extracting archive
  - Installing junaidbhura/wpae-user-add-on-pro (1.0.4): Extracting archive
  - Installing oscarotero/env (v2.1.0): Extracting archive
    Install of junaidbhura/wp-all-export-pro failed
    Install of junaidbhura/wpae-user-add-on-pro failed
 11/11 [============================] 100%

  [RuntimeException]                                                                                                      
  Failed to extract junaidbhura/wp-all-export-pro: (9) unzip -qq -o '/path/to/my/project/vendor/composer/tmp-984efec9b23b461d3b06190ff14bcd00' -d '/path/to/my/project/vendor/composer/d15eea56'                                      

  [/path/to/my/project/vendor/composer/tmp-984efec9b23b4  
  61d3b06190ff14bcd00]                                                                                                    
    End-of-central-directory signature not found.  Either this file is not                                                
    a zipfile, or it constitutes one disk of a multi-part archive.  In the                                                
    latter case the central directory and zipfile comment will be found on                                                
    the last disk(s) of this archive.                                                                                     
  unzip:  cannot find zipfile directory in one of /path/to/my/project/vendor/composer/tmp-984efec9b23b461d3b06190ff14bcd00 or                                                   
          /path/to/my/project/vendor/composer/tmp-984efe  
  c9b23b461d3b06190ff14bcd00.zip, and cannot find /path/to/my/project/vendor/composer/tmp-984efec9b23b461d3b06190ff14bcd00.ZIP, period.                                         

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-scripts] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>]...

If I try and install the junaidbhura/wpai-acf-add-on addon, it does install correctly? Thanks, Toine

junaidbhura commented 3 years ago

hey @Twansparant the WP_ALL_EXPORT_PRO_URL is supposed to just be your site's URL. Ex: https://www.yoursite.com

Twansparant commented 3 years ago

Hi @junaidbhura, thanks for your reply! I just tried, but got the same error:

[RuntimeException]                                                                                                                          
  Failed to extract junaidbhura/wp-all-export-pro: (9) unzip -qq -o '/path/to/my/project/vendor/composer/tmp-7e6750d4615d750484de93b33b7aa67c' -d '/path/to/my/project/vendor/composer/40f1397d'

Also I didn't have to register my domain anywhere when purchasing my license, so what is this url used for in the first place?

junaidbhura commented 3 years ago

That URL is used to identify your site to WP All Export. It simulates when you update the plugin through the WP Admin. I don't think you have to register the URL anywhere.

Stupid question but, do you have a valid license key? Also can you try the license key without quotes in the .env file?

Twansparant commented 3 years ago

Ok check. Yes I have got a valid WP All Export Pro Unlimited License key. I tried without the quotes, same error. Are there different types of licenses? I only have the WP All Export license, not a WP All Import license? That shouldn't matter right?

junaidbhura commented 3 years ago

Hmm this is weird. I've come across some weirdness with WP All Import / Export based on version numbers. Can you try a different version number like 1.6.4. It should still give you the latest. That's the last thing I can think of.

I use this on a lot of websites, and it has been tested on Mac, Linux and Windows, and works fine!

Twansparant commented 3 years ago

Just tried it with setting the version as 1.6.4 but same thing... Weird, it works with my gravityforms plugins on several running projects, so I know your plugin works :)

Twansparant commented 3 years ago

I just purchased the whole suite incl. import pro add-ons, but the same error happens:

Failed to extract junaidbhura/wp-all-import-pro: (9) '/usr/bin/unzip' -qq '/path/to/my/project/mysite.com/site/vendor/composer/tmp-cc86a236ce6b42763ace23cf8d1f1a17' -d '/path/to/my/project/mysite.com/site/vendor/composer/ea9087ce'

Still not able to reproduce this? Thanks!

junaidbhura commented 3 years ago

Hey @Twansparant a fix for WP All Import / Export add-ons was recently released. Are you using the latest version of this plugin? It looks like the issue may be different - but can you try to see if updating the plugin helps?

Twansparant commented 3 years ago

I already am using all the latest versions of the plugin and the add-ons.

vaandefanel commented 3 years ago

I'm here to confirm the issue, I have the same behaviour than @jesstucker . When i remove 'version' or set another version like 4.4.4 i have the downlaod_link with the package v4.6.9.

I think the problem is WPAI side. :)

junaidbhura commented 3 years ago

Hey @Twansparant I mean the latest version of THIS plugin? https://github.com/junaidbhura/composer-wp-pro-plugins/releases/tag/1.2.1

@vaandefanel What OS are you on? Are you also using the latest version of this plugin?

Twansparant commented 3 years ago

Hey @Twansparant I mean the latest version of THIS plugin? https://github.com/junaidbhura/composer-wp-pro-plugins/releases/tag/1.2.1

Ah sorry, yes also using latest version 1.2.1 of your plugin!

vaandefanel commented 3 years ago

@junaidbhura I'm using version 1.2.1 on WSL Ubuntu on Windows. I confirmed the error with api call with Insomnia (postman alternative) on Windows. The WPAI licence is a Bundle Elite.

jensdraserschieb commented 3 years ago

Getting the same error message as the OP here @junaidbhura, using composer-wp-pro-plugins 1.2.1 on Mac, also with the Bundle Elite WPAI license.

I made sure to try all of the above solutions. Only adding the full link in the url instead of https://www.wpallimport.com like shown in https://github.com/junaidbhura/composer-wp-pro-plugins/issues/27#issuecomment-788084552 works fine, even without requiring ffraenz/private-composer-installer, like so:

{
  "type": "package",
  "package": {
    "name": "junaidbhura/wp-all-import-pro",
    "version": "4.6.9",
    "type": "wordpress-plugin",
    "dist": {
      "type": "zip",
      "url": "https://www.wpallimport.com"
    },
    "require": {
      "junaidbhura/composer-wp-pro-plugins": "*"
    }
  }
}

The plugin folders seem to appear in the the plugins directory, but will disappear once the installer fails.

Thanks for the great work!

junaidbhura commented 3 years ago

Hey @Twansparant I just re-read one of your earlier comments. WP All Import and Export use different keys. Are you sure you're using the right key for both of them? Edit: If you're using both All Import and Export, you need to add both keys:

WP_ALL_IMPORT_PRO_KEY="<wp_all_import_license_key>"
WP_ALL_IMPORT_PRO_URL="<registered_url_for_wpai_pro>"
WP_ALL_EXPORT_PRO_KEY="<wp_all_export_license_key>"
WP_ALL_EXPORT_PRO_URL="<registered_url_for_wpae_pro>"

@vaandefanel @jdraserschieb can you point me to the Bundle Elite license? I don't see it on their website?

berlinersueden commented 3 years ago

Sorry for the confusion @junaidbhura, I remembered the name wrong, the license is called “Import + Export Pro Package”.

My config file looks like this:

ACF_PRO_KEY="<acf_pro_license_key>"
POLYLANG_PRO_KEY="<polylang_pro_license_key>"
POLYLANG_PRO_URL="localhost/"
WP_ALL_IMPORT_PRO_KEY="<wp_all_import_pro_license_key>"
WP_ALL_IMPORT_PRO_URL="localhost/"
WP_ALL_EXPORT_PRO_KEY="<wp_all_export_pro_license_key>"
WP_ALL_EXPORT_PRO_URL="localhost/"

ACF and Polylang work just fine with the localhost/ URL, but maybe this is different for WP All Import and Export?

Twansparant commented 3 years ago

Are you sure you're using the right key for both of them?

Yes I'm sure of that, I do have 2 separate license keys for both indeed. Thanks

junaidbhura commented 2 years ago

Hi @Twansparant is this still an issue with the latest Composer?

Twansparant commented 2 years ago

Jup, I updated my local composer to version 2.3.5 and am still getting this error when running composer update:

Loading composer repositories with package information
Updating dependencies                                 
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Downloading junaidbhura/wp-all-export-pro (1.7.5)
  - Downloading junaidbhura/wp-all-import-pro (4.7.2)
  - Installing junaidbhura/wp-all-export-pro (1.7.5): Extracting archive
  - Installing junaidbhura/wp-all-import-pro (4.7.2): Extracting archive
    Failed to extract junaidbhura/wp-all-export-pro: (9) '/usr/bin/unzip' -qq '/path/to/my/project/site/vendor/composer/tmp-8faf5dafcf7502ada78bbf920af3d78a' -d '/path/to/my/project/site/vendor/composer/1a60b100'

[/path/to/my/project/site/vendor/composer/tmp-8faf5dafcf7502ada78bbf920af3d78a]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /path/to/my/project/site/vendor/composer/tmp-8faf5dafcf7502ada78bbf920af3d78a or
        /path/to/my/project/site/vendor/composer/tmp-8faf5dafcf7502ada78bbf920af3d78a.zip, and cannot find /path/to/my/project/site/vendor/composer/tmp-8faf5dafcf7502ada78bbf920af3d78a.ZIP, period.

    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
    Install of junaidbhura/wp-all-export-pro failed
    Failed to extract junaidbhura/wp-all-import-pro: (9) '/usr/bin/unzip' -qq '/path/to/my/project/site/vendor/composer/tmp-3f27b8f0f24a0760162c76120cab3d77' -d '/path/to/my/project/site/vendor/composer/9ed93e8c'

[/path/to/my/project/site/vendor/composer/tmp-3f27b8f0f24a0760162c76120cab3d77]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /path/to/my/project/site/vendor/composer/tmp-3f27b8f0f24a0760162c76120cab3d77 or
        /path/to/my/project/site/vendor/composer/tmp-3f27b8f0f24a0760162c76120cab3d77.zip, and cannot find /path/to/my/project/site/vendor/composer/tmp-3f27b8f0f24a0760162c76120cab3d77.ZIP, period.

    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
    Install of junaidbhura/wp-all-import-pro failed
    0 [--->------------------------]
In ZipDownloader.php line 209:

  '/path/to/my/project/site/vendor/composer/tmp-8faf5dafcf7502ada78bbf920af3d78a' is not a zip archive.  

update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>...]

I still don't know why I'm the only one with this problem? I added the trailingslash like suggested but it doesn't make a difference?

    {
      "type": "package",
      "package": {
        "name": "junaidbhura/wp-all-export-pro",
        "version": "1.7.5",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://www.wpallimport.com/"
        },
        "require": {
          "junaidbhura/composer-wp-pro-plugins": "*"
        }
      }
    },

Also still not sure what to fill in for the WP_ALL_EXPORT_PRO_URL & WP_ALL_IMPORT_PRO_URL env variables, because I don't have any reference to a registered_url_for_wpae_pro? I never had to fill in a url for the licenses and I also don't see any references to registered url's in the WP All Import Customer Portal?

I tried with my local test domain, localhost and leaving it empty, but all with same result.

Any ideas?

stefthoen commented 2 years ago

Just want to add that I'm having the same issue as @Twansparant. As far as I know I've configured everything correctly.

junaidbhura commented 2 years ago

Hey @Twansparant @jesstucker can you check if the new version 1.4.1 fixes this issue for you? https://github.com/junaidbhura/composer-wp-pro-plugins/releases/tag/1.4.1

Twansparant commented 2 years ago

Hi @junaidbhura, I have updated to version 1.4.1 but unfortunately I'm still getting the same error:

Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Downloading junaidbhura/wp-all-export-pro (1.8.0)
  - Downloading junaidbhura/wp-all-import-pro (4.7.6)
  - Installing junaidbhura/wp-all-export-pro (1.8.0): Extracting archive
  - Installing junaidbhura/wp-all-import-pro (4.7.6): Extracting archive
 0/2 [>---------------------------]   0%    Failed to extract junaidbhura/wp-all-export-pro: (9) '/usr/bin/unzip' -qq '/path/to/my/project/site/vendor/composer/tmp-77f32b53af2b876a93a2621702118f6f' -d '/path/to/my/project/site/vendor/composer/11745059'

[/path/to/my/project/site/vendor/composer/tmp-77f32b53af2b876a93a2621702118f6f]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /path/to/my/project/site/vendor/composer/tmp-77f32b53af2b876a93a2621702118f6f or
        /path/to/my/project/site/vendor/composer/tmp-77f32b53af2b876a93a2621702118f6f.zip, and cannot find /path/to/my/project/site/vendor/composer/tmp-77f32b53af2b876a93a2621702118f6f.ZIP, period.

    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
    Install of junaidbhura/wp-all-export-pro failed
    Failed to extract junaidbhura/wp-all-import-pro: (9) '/usr/bin/unzip' -qq '/path/to/my/project/site/vendor/composer/tmp-e6f727256f19f306475879df533fe197' -d '/path/to/my/project/site/vendor/composer/db24defe'

[/path/to/my/project/site/vendor/composer/tmp-e6f727256f19f306475879df533fe197]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /path/to/my/project/site/vendor/composer/tmp-e6f727256f19f306475879df533fe197 or
        /path/to/my/project/site/vendor/composer/tmp-e6f727256f19f306475879df533fe197.zip, and cannot find /path/to/my/project/site/vendor/composer/tmp-e6f727256f19f306475879df533fe197.ZIP, period.

    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
    Install of junaidbhura/wp-all-import-pro failed
 2/2 [============================] 100%
In ZipDownloader.php line 207:

  '/path/to/my/project/site/vendor/composer/tmp-77f32b53af2b876a93a2621702118f6f' is not a zip arch  
  ive.                                                                                                                                           

update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>...]

Somehow my WP All Import add-ons are installed correctly? Not sure if this was always the case or only since the 1.4.1 update?

Thanks!

junaidbhura commented 2 years ago

@Twansparant Can you try composer clear-cache and then try again?

Twansparant commented 2 years ago

Just cleared the cache and did a clean install: composer clear-cache && rm -rf vendor && rm composer.lock && composer install with same result unfortunately...

junaidbhura commented 2 years ago

That's unfortunate! If someone can help me replicate this issue, I'll be able to help resolve and close this.

cschalenborgh commented 2 years ago

I'm experiencing the same issue. I'm running composer 2.3.5


    Failed to extract junaidbhura/wp-all-import-pro: (9) '/usr/bin/unzip' -qq '/Users/PROJECT/vendor/composer/tmp-fd1a082c3a46d7a3925f838b9e9176b2' -d '/Users/PROJECT/vendor/composer/5f75bc1b'

[/Users/PROJECT/vendor/composer/tmp-fd1a082c3a46d7a3925f838b9e9176b2]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /Users/PROJECT/vendor/composer/tmp-fd1a082c3a46d7a3925f838b9e9176b2 or
        /Users/PROJECT/vendor/composer/tmp-fd1a082c3a46d7a3925f838b9e9176b2.zip, and cannot find /Users/PROJECT/vendor/composer/tmp-fd1a082c3a46d7a3925f838b9e9176b2.ZIP, period.

    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
    Install of junaidbhura/wp-all-import-pro failed
 19/19 [============================] 100%
In ZipDownloader.php line 209:

  '/Users/PROJECT/vendor/composer/tmp-fd1a082c3a46d7a3925f838b9e9176b2' is not a zip archive.
arnespremberg commented 1 year ago

Having the same issue in a Bedrock/Sage setup. @junaidbhura I'm happy to give you access to the private repo that should enable you to recreate the issue

junaidbhura commented 1 year ago

Thanks @arnespremberg - definitely don't want access to your private repo - but could you give me a detailed description of the environment you are running on, which environments you've tested this on, and can you add your composer.json file here?

jessedyck commented 1 year ago

@junaidbhura I've run into this same problem and have narrowed it down a bit more.

I tested the API call via Postman and it was working fine, as did the PHP it generated with cURL. So I slowly rebuilt the same request in the plugin and discovered the difference is that Postman is defaulting to sending the params of the request as query string params in the URL rather than in the request body. A POST without the query string params in the URL will fail. Or, a simple GET request works fine, too.

# GET request works
curl --location --GET "https://www.wpallimport.com" -d edd_action=get_version \
-d license=<INSERT> -d item_name=WP+All+Import -d version=4.7.8 \
-d url= | jq "{download_link}"

# POST request fails
curl --location --request POST "https://www.wpallimport.com" -d edd_action=get_version \
-d license=<INSERT> -d item_name=WP+All+Import -d version=4.7.8 \
-d url= | jq "{download_link}"

This is on macOS 12.6.1, but I also ran it in my app container - Lando's Pantheon app container (php:8.0-fpm-bullseye, Debian based).

EDD's docs do say the requests can be GET or POST, so perhaps this could be fixed by adding a new get method on to the Http class and switch over the EDD plugins?

https://easydigitaldownloads.com/docs/software-licensing-api/

I'm happy to submit a PR for that!

junaidbhura commented 1 year ago

Hey @jessedyck thanks for looking into this! Sure, a PR would be great if you could!

junaidbhura commented 1 year ago

Looks like WP All Import has started using Cloudflare recently which causes downloads from the command line to fail :(

junaidbhura commented 1 year ago

@Twansparant is this still an issue for you?

Twansparant commented 1 year ago

Wow, I think it's working now! At least in my local vagrant box. I'll report back when I deployed!

EDIT: Deploys are also working now! Brilliant!

junaidbhura commented 1 year ago

Excellent thanks @Twansparant ! Closing this issue at long last :)