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

Installing embedded plugins in Avada #5

Closed dlecan closed 4 years ago

dlecan commented 4 years ago

Thank you for this plugin, installation of Avada theme works great on my Bedrock WordPress website.

But ... it is very hard to install additional plugins. For example, I get an error when I try install a plugin:

[Composer\Downloader\TransportException]                                                                                     
  The "https://api.envato.com/v3/market/buyer/download?item_id=1362246" file could not be downloaded (HTTP/1.1 404 Not Found)

The id of copied/pasted from the README file.

Is it an issue with the id of the plugin, a missing role of my access token? How/where to get reliable plugins item-id and/or package names such as layerslider-plugin?

Thank you!

szepeviktor commented 4 years ago

Hello Damien! :)

szepeviktor commented 4 years ago

kép

szepeviktor commented 4 years ago

package names such as layerslider-plugin

You choose package names! It is read from config.json

dlecan commented 4 years ago

Thank you!

What I understand:

Do you know where to find the item-id of "Fusion Core" and "Fusion Builder" plugins?

szepeviktor commented 4 years ago
package "names" can be chosen just for humans

actually Composer does need a name for each package

szepeviktor commented 4 years ago

Do you know where to find the item-id of "Fusion Core" and "Fusion Builder" plugins?

I've started a project for downloading WP plugins from the manufacturer of Avada. See class-avada-remote-installer.php in Avada.

Could be called composer-themefusion:

  1. ThemeFusion API/get_plugins https://updates.theme-fusion.com/?avada_action=get_plugins&avada_version=5.9.0 : "theme-fusion/" + if("external_url" === '') "name"
  2. ThemeFusion API/request_download https://updates.theme-fusion.com/?avada_action=request_download&item_name=Fusion%20Builder&ver=&token=$FUSION-TOKEN : gets a nonce
  3. ThemeFusion API/get_download https://updates.theme-fusion.com/?avada_action=get_download&item_name=Fusion%20Builder&ver=5.9.0&nonce=$NONCE&t=$TIMESTAMP gives the ZIP URL

$FUSION-TOKEN comes from a WP option named fusion_registration

these come with Avada for free

theme-fusion/fusion-core theme-fusion/fusion-builder theme-fusion/fusion-white-label-branding theme-fusion/convertplug theme-fusion/advanced-custom-fields-pro theme-fusion/LayerSlider theme-fusion/revslider

Would you like to contribute?

dlecan commented 4 years ago

Would you like to contribute?

Yes

dlecan commented 4 years ago

Do you know where to find the item-id of "Fusion Core" and "Fusion Builder" plugins?

I've started a project for downloading WP plugins from the manufacturer of Avada.

So it's not possible?

szepeviktor commented 4 years ago

So it's not possible?

Yes it is. I've made the above sketch only, no more progress. Up to now :)

dlecan commented 4 years ago

Ok, i've understand, I can find plugin item-ids from the Theme fusion API with the request you have provided above

szepeviktor commented 4 years ago

I suspect those IDs have nothing to do with Envato.

dlecan commented 4 years ago

ah ok, so we need another composer plugin, such as composer-theme-fusion to do something equivalent as composer-envato?

szepeviktor commented 4 years ago

yes, but this time only the ThemeFusion token is necessary in config.json

szepeviktor commented 4 years ago
$ wget -qO- 'https://updates.theme-fusion.com/?avada_action=get_plugins&avada_version=5.9.0' \
  | jq -r 'to_entries[].value.slug'
fusion-core
fusion-builder
fusion-white-label-branding
convertplug
advanced-custom-fields-pro
LayerSlider
revslider
pwa
woocommerce
the-events-calendar
wordpress-seo
leadin
contact-form-7
bbpress

so package names will look like themefusion/layerslider

szepeviktor commented 4 years ago

@dlecan Would you give it a try? Its structure would be the same as this one.

dlecan commented 4 years ago

Yes, I will try

dlecan commented 4 years ago

A new plugin or en enhancement of your one?

szepeviktor commented 4 years ago

Of course a new one :) dlecan/composer-theme-fusion

szepeviktor commented 4 years ago
"require": {
  "szepeviktor/composer-envato": "^0.1.2"
}
szepeviktor commented 4 years ago

btw I've contacted ThemeFusion to support this development

szepeviktor commented 4 years ago

@dlecan Have you started a draft or something?

szepeviktor commented 4 years ago

I've written an MVP. Publishing.... https://github.com/szepeviktor/composer-theme-fusion

kép

dlecan commented 4 years ago

Have you started a draft or something?

Not yet :-)

I will try your new plugin

You are more comfortable than me