• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Tips and Tricks HQ

  • Home
  • Projects
    • All Projects
    • Simple WP Shopping Cart
    • WP Express Checkout Plugin
    • Accept Stripe Payments
    • WP Download Monitor
    • Easy HTTPS Redirection
    • WP Security and Firewall Plugin
    • WP eStore Plugin
    • WP Affiliate Platform
    • WP eMember
  • Products
    • All Products
    • Checkout
  • Support
    • Support Portal
    • Customer Only Forum
    • WP eStore Documentation
    • WP Affiliate Software Documentation
    • WP eMember Documentation
  • Contact

Software License Manager & Product Communication

Home » Blog » Software License Manager & Product Communication

Last updated: August 4, 2018 by TheAssurer





Important Note: The intended audience for this article are software developers, with an intermediate level (2+ years) understanding of Internet and programming concepts.

Previously, we introduced the concept of Software License Managers (SLM); and the important role they play, both in increasing product sales and protecting intellectual property.

In this article, we’re going to discuss how a typical software product communicates with an SLM; specifically the Software License Manager Plugin for WordPress.  All further references to the term SLM will refer to this specific plugin.

You’ve Got a Secret

You can’t allow just anyone to communicate with the SLM.  When the SLM is first installed, it creates 2 secret keys:



  1. The “License Creation” secret key, used to seed the license key generator.
  2. The “License Verification” secret key, used to authenticate license activation/deactivation messages.
SLM Secret Keys
SLM Secret Keys

The License Verification key is the only way for the SLM “to know” that a message is really coming from a product, that is authorized to communicate with the SLM.  It also means that if you ever reinstall the SLM on another server (using the same domain name), you must use the same key; otherwise previously licensed products will be unable to properly communicate with the SLM.  So, WRITE IT DOWN.

Only you, the SLM and any software products that use that specific SLM should know the License Verification key.  For high value products, written in human readable code (PHP or Javascript), you might consider the use of a code obfuscation tool to ensure the security of the License Verification key.

As briefly noted, once you begin distributing your product; not only must you use the same License Verification key, but also the same Internet domain/URL for the SLM.  Once you begin distributing your licensed products; the License Verification key and the Internet URL for the SLM must never change.  Keeping the URL used by the SLM a secret, is not critical; but it is best not to publicize what the URL is, in order to minimize Denial of Service attacks.

Talk to Me

Products communicate with the SLM using the HTTP Get or POST method.  If the product is say, a WordPress plugin; you might use the wp_remote_get() function.  Or you could use the more secure HTTP POST method and communicate with the SLM using the PHP curl_exec() function.  If your product is an Android application you’d use the HttpURLConnection class; or  the NSURLConnection class for iOS.

All responses from the SLM are in the form of a JSON (JavaScript Object Notation) message:

{ "result" : string , "message" : string }

Let’s Play Computer

The best way to understand the messaging process, is to manually practice passing messages to the SLM using your Internet browser; allowing you to emulate the HTTP Get method.  The specific values for the required parameters, used in these examples will differ from your own.

Prerequisites

Manually create a license key on the SLM, using the “Add/Edit Licenses” menu.  You’ll also need to know the URL of the SLM, and its License Verification secret key.

  • slm_url = http://example.com/wp
    This is the URL of your SLM.
  • secret_key = 55622f04c0ce17.41911005
    This is the License Verification secret key.
  • license_key = 556bbc693638d
    • This is a license key that has been issued to a customer.
    • Typically, the customer would be prompted, via a product settings form, for this information.  The information is needed to both activate and deactivate the product license.
  • registered_domain = “”
    • If you were going to lock a license to a specific domain, as in the case of a WordPress plugin product, this would be the URL of the customer’s WordPress installation.
    • In the case of an Android or iOS application, this parameter should be an empty string.
      • DO NOT omit this parameter, as the default NULL string IS NOT EQUAL to an “empty string.”

Example of Retrieve License Details and Check it

The following HTTP Get will retrieve the details of a key so you can check it:

http://example.com/wp/?secret_key=55622f04c0ce17.41911005&slm_action=slm_check&license_key=556bbc693638d
{"result":"success","message":"License key details retrieved.","status":"active"}

It will output the full details of the license key.

License Activation Example

The following HTTP Get will activate a license key:

http://example.com/wp/?secret_key=55622f04c0ce17.41911005&slm_action=slm_activate&license_key=556bbc693638d&registered_domain=""
{"result":"success","message":"License key activated"}

And if the license is activated too many times, an error occurs:

{"result":"error","message":"Reached maximum allowable domains"}

License Deactivation Example

The following HTTP Get will deactivate a license key:

http://example.com/wp/?secret_key=55622f04c0ce17.41911005&slm_action=slm_deactivate&license_key=556bbc693638d&registered_domain=""
{"result":"success","message":"The license key has been deactivated for this domain"}

And if the license is deactivated too many times, a warning will be returned:

{"result":"error","message":"The license key on this domain is already inactive"}

Now that you’ve mastered the basics of manually communicating with the SLM, using a browser to emulate messages sent/received with the HTTP Get method; you can feel confident using programming functions and classes, to integrate SLM communications into your software products.

Related Posts

  • License to Run – Introduction to Software License Managers
  • WordPress Action Hooks and Filter Hooks – An Introduction
  • How to Create a WordPress plugin
  • Adding a Custom Column to the Users Table in WordPress

Web Design,  Web Development,  Wordpress sell digital products,  sell premium plugins,  sell wordpress plugins,  wordpress developer tutorial,  Wordpress Plugin

Reader Interactions

Comments (3 responses)

  1. Pete says:
    July 24, 2015 at 7:04 am

    Thanks admin, didn’t see that. works a treat now.

  2. admin says:
    July 23, 2015 at 10:40 pm

    @Pete, Have you done step 4 from the following documentation? That email shortcode will add the license key in the purchase notification.
    https://www.tipsandtricks-hq.com/ecommerce/integrate-wp-estore-with-software-license-manager-plugin-3731

  3. Pete says:
    July 23, 2015 at 12:35 pm

    A license key is generated automatically from a purchase through the WP eStore plugin but the “License Key” is not being sent in the purchase confirmation email message from the WP eStore. How should the customer get the license key sent?

Leave a Reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Featured & Popular Articles

Video Answers to Top WordPress QuestionsWordPress Optimization Tips and Tricks for Better Performance and SpeedEssential WordPress Security Tips - Is Your Blog Protected?WordPress Simple PayPal Shopping Cart PluginTop 15 Search Engine Optimization (SEO) Techniques I Forget to DoList of the Best and Must Use WordPress PluginsHow do I Start a Blog and Make Money Online?Good Domain Name Picking Tips for Your Blog SetupFind Out Which WordPress Web Hosting Company Offers the Cheapest and Reliable Web Hosting Solution

Featured WordPress Plugins

WP Express Checkout Plugin
wordpress estore plugin
wordpress membership plugin
wordpress affiliate plugin

Recent Posts

  • How to Use Browser Developer Tools to Inspect Elements and [...]
  • Accept Donations via PayPal from Your WordPress Site Easil [...]
  • Buy Now Button Graphics for eCommerce Websites [...]
  • Subscription Button Graphics for eCommerce Websites [...]
  • Adding PayPal Payment Buttons to Your WordPress Sidebar Ea [...]

Comment & Socialize

  • @Rob, We have just released ...
    - admin
  • I installed the plugin a co ...
    - Rob
  • @Sebastian, We've released ...
    - admin
  • I've used this plugin on a ...
    - Sebastian Djupsjöbacka
  • @John, this plugin doesn't ...
    - admin

Check out our solutions

View our WordPress plugin collection and start using them on your site.

Our WordPress Solutions

Footer

Company

  • About
  • Privacy Policy
  • Terms and Conditions
  • Affiliate Login

Top WordPress Plugins

  • Simple Shopping Cart
  • PayPal Donations
  • WP Express Checkout
  • WP eStore
  • WP eMember

Blogging Tips

  • How to Start a Blog
  • Selecting a Good Domain
  • Cheap WP Hosting
  • WP Video Tutorials
  • Simple SEO Tips

Search


Keep In Touch

Copyright © 2025 | Tips and Tricks HQ