Installation of Premium Plugins Via Composer

Home Forums Welcome! Pre-Sales Questions Installation of Premium Plugins Via Composer

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1175643
    Philip Newcomer
    Guest

    Hi guys, not sure if this is the correct place to post but I couldn’t find anywhere more appropriate. 🙂 Can you please pass this ticket over to Zach Tirrel. I asked Sara Tirrel, who works at the same agency as I do, to pass a feature request on to Zach, and Zach told her it was already possible and I should open a ticket for the details. So that’s what this is about.

    I’m wondering how to install your premium plugins (which don’t have a public repository) via the Composer dependency manager. Ideally being able to give Composer a URL which when a valid license key is included, would respond with a ZIP file of the plugin. That would allow us to keep the plugin code out of our client’s repositories, and install/update the premium plugins in our deployment process via Composer.

    Does that make sense? The only documentation I could find on this was https://theeventscalendar.com/support/forums/topic/installation-with-composer/ which is now out of date.

    Thanks in advance for your help!

    #1175663
    Zach Tirrell
    Keymaster

    Hey Philip!

    I’m happy to look into this. I’m pretty sure this is possible now, but I need to poke around a bit to see exactly how the request needs to be formed. I’ll get back to you shortly.

    #1176362
    Zach Tirrell
    Keymaster

    I dug around a bit and the URL that gets hit for a download is like this:

    https://theeventscalendar.com/?pu_get_download=1&pu_request_plugin={plugin-slug}&version={version-number}&pu_install_key={license-key}

    You should be able to configure Composer with the plugin slug (ex: events-calendar-pro), the version number you want (ex: 4.3), and your valid license key. This request should in turn deliver you a ZIP file.

    This isn’t something we are directly exposing (though it’s all there in the code) so there is the risk that we could change the API or hostname for the update service in the future, but generally this should work and it’s certainly not something we change with any frequency.

    Please let me know if this works out as you are hoping.

    #1176702
    Philip Newcomer
    Guest

    Thanks for the response Zach! This is working perfectly when I download the file via the browser or curl, but when Composer tries the download, the download progress counts up to 95% and then errors out, reporting “Content-Length mismatch”. This happens three times before Composer gives up. Here is my composer.json file, and the verbose log from the “composer update” command:
    https://gist.github.com/philipnewcomer/d82bf7d533d62d109041e12d13aa2efc
    https://gist.github.com/philipnewcomer/ca9cac8a8f11e3e5f559a691a6512f82

    (I’ve snipped the license keys from the Gist.) I’m not using a proxy, VPN, or anything that I know of that would be interfering with the download. Any ideas?

    #1176968
    Zach Tirrell
    Keymaster

    This was really weird. There was a small bug in the output buffering for the code generating the ZIPs. It was subtle enough not to corrupt the ZIPs, but added 3 bytes to the file size. Composer was having none of that, but the more general way WordPress fetches them (or direct curl calls) had no issue at all.

    I patched that oddness and now Composer is fetching for me without difficulty.

    Let us know if this clears it up and gets you what you needed.

    #1177043
    epwebmaster
    Participant

    Awesome, this is now working perfectly for me in Composer. Thanks for looking into this, Zach!

    #1177044
    Philip Newcomer
    Guest

    ^ Whoops, I posted that while logged into the client’s account. Thanks again!

    #1178509
    Leah
    Member

    Thank you Phillip!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Installation of Premium Plugins Via Composer’ is closed to new replies.