I am creating a new Magento2 extension, and I want a way to restrict buyers, so that they can install it on one domain.

As I understand, the Magento2 marketplace is not a reference of extensions as it was in Magento 1, but now it stores the extensions and send them to the buyers when someone buys it.

If that is the case, I cannot add license to my extension since I have to provide the extension files to Magento marketplace in advance.

Is my assumption correct?

If yes, how do I license my extension? i.e. how to add license key or put license checks for the extension?

  • Not quite into marketplace extension licensing but i guess you get an info when anyone buys your extension and you could write something like "License info" in the Product description. Something like: "Contant <email here> with your ordernumber to get the License". – Marcel H. Feb 21 '17 at 18:55
  • @MarcelH. yes that can be done, however it adds a manual step, which doesn't look helpful for the customers. – Divakar Feb 26 '17 at 12:21

Regardless if this is allowed by magento rules or not, but technically speaking you need to implement a licence server and make your extension call this server on startup providing a license key, then you server will check if that key is active or not. if not your magento ext should behave accordingly.

this approach is easily hacked by just commenting that part of code. I found a way to hide licence check by encoding the code doing this check to base64 then doing eval($token); token variable is in reality a php code containing license check. this trick can full beginner devs but not experienced.

in general, it's impossible to do licencing on php (or other interpreted languges) software.

  • yeah makes sense, but eval etc are reported as malware by many antivirus/antimalware software. So they easily get attention of people. even without trying to find out, they get to know. – Divakar Mar 15 '18 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.