composer-envato
composer-envato copied to clipboard
Composer plugin for Envato 💚 Install WordPress themes and plugins from ThemeForest and CodeCanyon
Composer plugin for Envato
A Composer plugin to load WordPress themes and plugins from Envato.
:bulb: Always the latest version is installed, as Envato does not make other versions available. Package version locking can only be achieved by local persistent cache, not across hosts or users.
Installation
This Composer plugin must be installed globally as it adds a virtual package repository.
composer global require --update-no-dev szepeviktor/composer-envato
Configuration
Add all your products to your config.json
(in $COMPOSER_HOME
) as packages.
You find the item-id
at the end of product URL-s.
e.g. https://themeforest.net/item/avada-responsive-multipurpose-theme/2833226
{
"config": {
"envato": {
"token": "YOUR ENVATO PERSONAL TOKEN FROM https://build.envato.com/create-token",
"packages": {
"envato/avada-theme": {
"item-id": 2833226,
"type": "wordpress-theme"
},
"envato/layerslider-plugin": {
"item-id": 1362246,
"type": "wordpress-plugin"
}
}
}
}
}
:bulb: Please use the vendor name envato
for consistency.
Usage
Once the plugin is installed and configured, you can simply install any of the listed products as Composer packages.
:bulb: Envato API has dynamic rate limiting
Behind the scenes
- This package is a Composer plugin
- In the
activate
method it creates anArrayRepository
with package data fromconfig.json
- Package version is queried from Envato API
- When installing a package its URL is also queried from Envato API
- Pretty package version is e.g.
v1.2
- Normalized package version is e.g.
1.2.0.0