Skip to content

Latest commit

History

52 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

WordPressLicenseManagerNETClient

A .NET client for software License Manager (https://wordpress.org/plugins/software-license-manager/).

A better fork of the software license manager wordpress plugin with woocommerce integration can be found here (https://github.com/Arsenal21/software-license-manager)

Are your binaires signed?

Starting version 1.0.6, WPLMNETClient.Framework.dll and WPLMNETClient.dll and their dependencies are signed.

NuGet

.NET Standard 2.0 NuGet

Install-Package WPLMNETClient

.NET Framework 4.7.2 NuGet

Install-Package WPLMNETClient.Framework

Examples

Actions

Four actions are available. You can create a new license, activate/deactivate a license or check the metadata of an existing license.

Configuration class

The configuration class is where you stored the credentials required. The secret key is only required to create a new license. The activation key is required to complete the other actions.

Sample

This sample shows how to activate a pending license. Deactivation and creation of license is very similar to this example.

Configurationconfiguration=default(Configuration);ILicenseManagerlicenseManager=default(ILicenseManager);Licenselicense=default(License);publicvoidMain(){// create configuration objectconfiguration=newConfiguration();configuration.PostURL="http://chucknorris.co";configuration.ActivationKey="abc";configuration.SecretKey="123";// create license managerlicenseManager=LicenseManagerFactory.New(configuration);// create license object license=newLicense();license.Email="charles@chucknorris.co";license.Key="password123";license.FirstName="Chuck";license.LastName="Norris";license.CompanyName="Chuck Norris Unlimited Liability Co";license.MaximumDomainAllowed=1;// you must call RegisterDomain before you perform an actionlicense.RegisterDomain();ActivateLicenseKey();}publicvoidActivateLicenseKey(){varlicenseResponse=licenseManager.PerformAction(WordPressLicenseManagerNETClient.Consts.Action.Activate,license);if(licenseResponse.Success==false)thrownewException(licenseResponse.Message);elseAssert.IsTrue(licenseResponse.Success);}

Acknowledgement

Thanks to https://github.com/xavave for his contributions.

About

A .NET client for the Software License Manager WordPress Plugin (https://wordpress.org/plugins/software-license-manager/)

Resources

Stars

5 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages