WPLMNETClient.Framework 1.0.6

dotnet add package WPLMNETClient.Framework --version 1.0.6                
NuGet\Install-Package WPLMNETClient.Framework -Version 1.0.6                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WPLMNETClient.Framework" Version="1.0.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WPLMNETClient.Framework --version 1.0.6                
#r "nuget: WPLMNETClient.Framework, 1.0.6"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install WPLMNETClient.Framework as a Cake Addin
#addin nuget:?package=WPLMNETClient.Framework&version=1.0.6

// Install WPLMNETClient.Framework as a Cake Tool
#tool nuget:?package=WPLMNETClient.Framework&version=1.0.6                

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)

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.


       Configuration configuration = default(Configuration);
       ILicenseManager licenseManager = default(ILicenseManager);
       License license = default(License);
       public void Main()
       {
           // create configuration object
           configuration = new Configuration();
           configuration.PostURL = "http://chucknorris.co";
           configuration.ActivationKey = "abc";
           configuration.SecretKey = "123";
           // create license manager
           licenseManager = LicenseManagerFactory.New(configuration);
           // create license object 
           license = new License();
           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 action
           license.RegisterDomain();



       
           ActivateLicenseKey();
       }


       
       public void ActivateLicenseKey()
       {
           var licenseResponse = licenseManager.PerformAction(WordPressLicenseManagerNETClient.Consts.Action.Activate, license);
           if (licenseResponse.Success == false)
               throw new Exception(licenseResponse.Message);
           else
               Assert.IsTrue(licenseResponse.Success);
       }

Acknowledgement

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

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on WPLMNETClient.Framework:

Package Downloads
ProductLicensing

Wordpress Software License Class Library

BlueByte.Licensing

Licensing Components for Blue Byte Systems Inc products

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.6 2,203 12/4/2021
1.0.5 303 11/6/2021

.NET Framework client for the WordPress License Manager plugin.