Giter Club home page Giter Club logo

thewebsolver / tws-license-manager-client Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 442 KB

The Web Solver License Manager Client extends the functionality of License Manager for WooCommerce. This plugin/framework is to be included inside the selling plugin for license activation/deactivation.

Home Page: https://github.com/TheWebSolver/tws-license-manager-client

License: GNU General Public License v3.0

PHP 93.51% CSS 6.49%
wordpress woocommerce plugin framework license-manager client client-server

tws-license-manager-client's Introduction

GPL License LinkedIn

Logo

TWS License Manager Client

HANDLE PREMIUM PLUGIN LICENSES WITH YOUR OWN LICENSING SERVER BUILT ON WORDPRESS & WOOCOMMERCE

This plugin is to be included in the plugin being sold (client plugin) so user who purchase the plugin can easily activate/deactivate their license.

Installation (via Composer):

Inside client plugin

To install this plugin, edit your composer.json file:

"require": {
	"thewebsolver/tws-license-manager-client": "dev-master"
}

Then from terminal, run:

$ composer install

On Server

License Manager for WooCommerce must be installed and activated on server WordPress installation for this client to interact, validate, activate/deactivate license.

Also, Server Manager must be used to activate/deactivate/validate/renew licenses.

License Form Screenshots:

License form was added as submenu of Settings menu.

License Not Activated Status

not active

License Active Status

active

License Deactive Status

inactive

License Expired Status

expired

Example Codes:

  • Server docs on License Manager and Server Manager.
  • CLIENT.md contains all the codes that will intialize license manager client, add submenu page to display activation/deactivation form and get response back from license manager server when valid data are submitted.

In brief, you must make changes to codes shown in CLIENT.md file:

  • Set server URL Client_Plugin::SERVER_URL where your license manager server is (License Manager for WooCommerce plugin is installed, and activated) and installed Server Manager as a plugin (composer method recommended),
  • Set parent menu slug Client_Plugin::PARENT_SLUG (or create your own menu/submenu page, which is the recommended way),
  • Set cunsumer key, consumer secret, validation fields and their error message inside method Client_Pligin::start() Generate them on server.

To test license key, there must be a valid license key generated on server with proper WooCommerce Checkout checkout and order status changed to completed.

Contact

----------------------------------
DEVELOPED-MAINTAINED-SUPPPORTED BY
----------------------------------
███║     ███╗   ████████████████
███║     ███║   ═════════██████╗
███║     ███║        ╔══█████═╝
 ████████████║      ╚═█████
███║═════███║      █████╗
███║     ███║    █████═╝
███║     ███║   ████████████████╗
╚═╝      ╚═╝    ═══════════════╝

Shesh Ghimire - @hsehszroc

tws-license-manager-client's People

Contributors

hsehszroc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dexit

tws-license-manager-client's Issues

The document is very confusing

Thanks for creating the plugin but I can not make it work.

The document is very confusing.

I have some problems:

  • const SERVER_URL = 'test.tws'; , What is "test.tws" ? if it a domain why you dont put: yoursite.com, mysite.com, ect? So, I need set http/https or not http/https?
  • 'slug' => 'my-plugin-with-license-manager-client', : slug for what?
  • ->hash_with( 'server-secret-key' ) : What is "server-secret-key"? Or "server-secret-key" is just "server-secret-key"?
    ==> I open the Manager.php and see "The secret key set on the server.", Where to set this string? I have installed "https://github.com/TheWebSolver/tws-license-manager-server" but I dont see this option to set.

After I submit the license key, the notice show: "Request was made outside of license form.", this message from the server.

How to fix it?

Thanks

Verify query parameter existence.

Query parameter may already have ? present in the URL. Verify and add it accordingly.

Method name: Http_Client::build_url_query()
Filesource: Includes/Component/Http_Client.php

if (!empty($parameters)) {
            if (false !== strpos($url, '?')) {
                $url .= '&' . \http_build_query($parameters);
            } else {
                $url .= '?' . \http_build_query($parameters);
            }
        }

Mabe PHP < 7.1 issue?

When I try to use PHP 5.6 I get this notice:

2021/11/14 14:17:31 [error] 27406#0: *250323 FastCGI sent in stderr: "PHP message: PHP Fatal error: Default value for parameters with a class type hint can only be NULL in XX...Includes/API/Manager.php on line 268

Client activation

Hello Mate,
Thank you for developing this awesome stuff,
While integration, i am getting error message on activation Request was made outside of license form.

please have a look at result output

object(WP_Error)#1702 (3) { ["errors"]=> array(1) { ["license_server_error"]=> array(1) { [0]=> string(41) "Request was made outside of license form." } }

test validation is working fine with debug on.

error in composer

I edited the composer.json file and this message appears in the terminal

"Root package 'thewebsolver/tws-license-manager-client' cannot require itself in its composer.json
Did you accidentally name your root package after an external package?"

Error with new version (3.0.X) of License Manager for WooCommerce

It looks like there are new method in SECTION_ORDER_STATUS

Error Details

An error of type E_ERROR was caused in line 57 of the file /home/X/domains/X.com/public_html/wp-content/plugins/licenses/tws-license-manager-server-master/Includes/Component/Order.php. Error message: Uncaught Error: Undefined class constant 'SECTION_ORDER_STATUS' in /home/X/domains/X.com/public_html/wp-content/plugins/licenses/tws-license-manager-server-master/Includes/Component/Order.php:57
Stack trace:
#0 /home/X/domains/X.com/public_html/wp-content/plugins/licenses/tws-license-manager-server-master/Includes/Component/Order.php(46): TheWebSolver\License_Manager\Component\Order->handle_order_status_transition()
#1 /home/X/domains/X.com/public_html/wp-content/plugins/licenses/tws-license-manager-server-master/Includes/Server.php(123): TheWebSolver\License_Manager\Component\Order->instance()
#2 /home/X/domains/X.com/public_html/wp-content/plugins/licenses/tws-license-manager-server-master/Includes/Server.php(107): TheWebSolver\License_Manager\Server->init_instances()

I really appreciate your work
Thanks for your help!

Usage of esc_url_raw() Instead of esc_url()

In the file /Includes/API/Manager.php, you are using the function esc_url_raw() for escaping, which "sanitizes a URL for database or redirect usage." Neither of those situations are happening when you are using it. You should use esc_url() instead.

Logical Error

Can you review this:
Filename: Includes/API/Manager.php
Line: 1611
Code: if ( isset( $data[ $this->dirname ][ $key ] ) && 'email' === $data[ $this->dirname ][ $key ] )

Issue: 'email' === $data[ $this->dirname ][ $key ] how will this condition will ever work? 'email' === $key should be there $data[ $this->dirname ][ $key ] will return the email address not the email key, same goes with order_id and slug condition.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.