szepeviktor / composer-envato

Composer plugin for Envato 💚 Install WordPress themes and plugins from ThemeForest‎‎ and CodeCanyon
https://packagist.org/packages/szepeviktor/composer-envato
MIT License
33 stars 4 forks source link

Incorrect folder structure after expanding zip #18

Closed jandagroup closed 9 months ago

jandagroup commented 1 year ago

Hi,

Thanks for creating this Composer plugin!

I'm using composer with Roots Bedrock (wordpress) framework. I'm running into an issue how composer/this plugin expands a zip file from Envato. Any idea on how to rectify an issue when a plugin/package zip is getting expanded in an incorrect structure/format (wordpress doesn't recognize it as a plugin based on folder structure)?

For instance, the plugin is downloaded like so:

wp/plugins/plugin_package_name/plugin_name/CONTENTS

Vs. What Wordpress expects it to be:

wp/plugins/plugin_name/CONTENTS

Please advise.

Thanks!

szepeviktor commented 1 year ago

Hello @jandagroup 👋🏻 Thank you for opening this issue.

All this Composer plugin does is changing the URL of the ZIP file that is downloaded by Composer. https://github.com/szepeviktor/composer-envato/blob/1434bed56e02631de38e9e34c65ca0e1a1510b68/src/EnvatoPackage.php#L90-L94

composer/installers sets the target directory. Please see your Composer configuration. https://github.com/szepeviktor/composer-managed-wordpress/blob/c2e05a2a42a39b544d6b9b01d77ec54bd7d69253/composer.json#L65-L73

szepeviktor commented 1 year ago

Two more pointers.

  1. You have not set "type": "wordpress-plugin" in your configuration
  2. You don't have composer/installers installed - not possible: https://github.com/szepeviktor/composer-envato/blob/1434bed56e02631de38e9e34c65ca0e1a1510b68/composer.json#L17