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

fix: failed to execute unzip for all import/export #39

Closed david-bzh closed 1 year ago

david-bzh commented 1 year ago

Checklist:

Description

I changed api call in POST for GET the api return seems more stable.

How has this been tested?

I have tested installation for :

junaidbhura commented 1 year ago

Hi @david-bzh thanks for the PR! Could you elaborate what your PR does, and how it improves stability?

If you look at wp-all-import-pro/classes/updater.php - you'll see wp_remote_post being used which essentially sends a POST not a GET. So the plugin itself uses a POST.

david-bzh commented 1 year ago

Hi @junaidbhura thank you for your feedback, which allowed me to deepen on my problematic,

it seems that there were two problems for the failed to execute unzip.

Problème 1 : Api return of wp all export by request POST

request POST ( after )

Screenshot-1

This problem seems to be solved without really knowing how.

the posibile actions are :

For my part I did not do anything else for this problem, request GET does not do any verification on the key

request GET

Screenshot-2

request POST

Screenshot-3

Problem 2 : defaut $arg_separator for fn http_build_query()

On a client server $arg_separator by default is & and not &

Screenshot-4

Solution 1 : change code

Solution 2 : for the developer gist.github:

php -n -c /usr/local/lib/composer.php.ini /usr/local/bin/composer.phar

Tell me if you want to do something else, sorry for the response time

junaidbhura commented 1 year ago

Thanks @david-bzh I think the & fix would be a good one to make here instead? https://github.com/junaidbhura/composer-wp-pro-plugins/blob/master/Http.php#L31 so that all the plugins can benefit from it?

david-bzh commented 1 year ago

Hi @junaidbhura , yes it is the best solution, I changed my commit with the new patches. Thanks !

junaidbhura commented 1 year ago

Thanks @david-bzh ! Let me test this out before merging!

junaidbhura commented 1 year ago

Looks good and merged thanks @david-bzh !