title: Install premium Wordpress theme with Composer
body: <p>I've bought a "premium" theme on <a href="http://themeforest.net/" rel="noreferrer">Themeforest</a>: <a href="http://themeforest.net/item/avada-responsive-multipurpose-theme/2833226" rel="noreferrer">Avada</a>. I'd like to install this theme with <a href="https://getcomposer.org/" rel="noreferrer">Composer</a> because it's a dependency (I'm using <a href="https://github.com/roots/bedrock" rel="noreferrer">Bedrock</a> as base). So I came across <a href="https://deliciousbrains.com/using-composer-manage-wordpress-themes-plugins/" rel="noreferrer">this article</a> where they suggest to make a custom package with the download link (example with some of there own Wordpress plugins WP Migrate DB Pro):</p>
  
  <pre><code>"require": {
      "deliciousbrains/wp-migrate-db-pro": "*"
  },
  "repositories": [
      {
          "type": "package",
          "package": {
              "name": "deliciousbrains/wp-migrate-db-pro",
              "type": "wordpress-plugin",
              "version": "1.5",
              "dist": {
                  "type": "zip",
                  "url": "https://deliciousbrains.com/dl/wp-migrate-db-pro-latest.zip?licence_key=&lt;LICENSE_KEY&gt;&amp;site_url=composer-test.dev"
              },
              "require": {
                  "composer/installers": "v1.0.7"
              }
          }
      }
  ]
  </code></pre>
  
  <p>Very nice, but then I've to maintain the version numbers by myself (I can't download an old version) and I don't like license keys in urls that much. But alright, I've tried but I need to be logged in on Themeforest else the download link (something like <code>http://themeforest.net/user/username/download_purchase/some-random-id?accessor=wordpress_theme</code>) won't work. I can try to trace the download link but Envato <a href="https://help.market.envato.com/hc/en-us/articles/202500504" rel="noreferrer">recommends against download manager</a>, so I don't think this is allowed or the way to go. I've contacted Envato in the past because they recommend using Composer on there tutorial site <a href="http://tutsplus.com/" rel="noreferrer">Tutsplus</a> but they don't support this on there marketplace sites. Never got a reply.</p>
  
  <p>Another method is to create my own GIT repository for Avada. No problem, so I've created it, added all the files with my own <code>composer.json</code> file:</p>
  
  <pre><code>{
      "name": "username/wordpress-avada-theme",
      "type": "wordpress-theme"
  }
  </code></pre>
  
  <p>Pretty simple, added a GIT tag with the version and it can be installed. Very nice! But... I've to maintain this by myself, if Avada releases a new version I've to remove all files from my Avada repo, add the new files with a new version number tag and then I can install the new version with Composer.</p>
  
  <p>Another problem: plugins, Avada comes with some plugins which needs to be installed:</p>
  
  <ul>
  <li>Fusion Core</li>
  <li>Layerslider</li>
  <li>Revolution Slider</li>
  </ul>
  
  <p>So I need 3 more repositories and I've to maintain them all if a new version comes out. So I've contacted <a href="https://theme-fusion.com/" rel="noreferrer">Theme Fusion</a>, the creators of the theme. I don't think they doesn't work with version control and it's true, they use GIT but they are not allowed to give me access because of the conditions of Envato.</p>
  
  <p>What other options do I have? I'm now just using Composer for Wordpress itself and all free plugins but I'd like to use it for my "premium" stuff too. Composer should make things easier, but when I've to maintain those repo's it's not. So for now I've putted Avada and it's plugins in the project repo but it doesn't feel good.</p>
  
  <p><strong>EDIT:</strong> Meanwhile I've found some interesting stuff in the Envato API which could make this possible, see my <a href="https://github.com/outlandishideas/wpackagist/issues/129" rel="noreferrer">issue on the wpackagist repository</a> which is a Composer mirror of the Wordpress plugin and theme directory.</p>