Home › Forums › Welcome! › Pre-Sales Questions › Installation of Premium Plugins Via Composer
- This topic has 7 replies, 3 voices, and was last updated 7 years, 7 months ago by Leah.
-
AuthorPosts
-
October 12, 2016 at 3:03 pm #1175643Philip NewcomerGuest
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!
October 12, 2016 at 3:47 pm #1175663Zach TirrellKeymasterHey 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.
October 13, 2016 at 6:43 pm #1176362Zach TirrellKeymasterI 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.
October 14, 2016 at 10:13 am #1176702Philip NewcomerGuestThanks 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?
October 14, 2016 at 6:40 pm #1176968Zach TirrellKeymasterThis 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.
October 15, 2016 at 3:28 am #1177043epwebmasterParticipantAwesome, this is now working perfectly for me in Composer. Thanks for looking into this, Zach!
October 15, 2016 at 3:32 am #1177044Philip NewcomerGuest^ Whoops, I posted that while logged into the client’s account. Thanks again!
October 18, 2016 at 9:38 am #1178509LeahMemberThank you Phillip!
-
AuthorPosts
- The topic ‘Installation of Premium Plugins Via Composer’ is closed to new replies.