Giter Club home page Giter Club logo

dlm-wp-updater's Introduction

Digital License Manager WordPress Updater

Updater package for WordPress that utilizes the Digital License Manager PRO REST API for update checks and update downloads. It can be integrated in every plugin that you want to provide updates through Digital License Manager PRO.

Requirements

  1. WordPress 4.0+
  2. Digital License Manager PRO (on your plugin update server site)

Configuration

  1. Login to your Digital License Manager store.
  2. Go to "License Manager" > "Software" > "Add New" and create software item.
  3. Obtain the software ID and then proceed with the next step Installation.

Installation

The PHP package can be imported either with Composer or manually with including the autoload.php file:

composer install ideologix/dlm-wp-updater

or manually, first download the package and save it to your plugin, then include it as follows:

require_once 'path/to/dlm-wordpress-updater/autoload.php';

Integration

The following example explains how to use the library within your PRO/Premium plugin.

use \IdeoLogix\DigitalLicenseManagerUpdaterWP\Main;

try {
    $instance = new Main( array(
        'id'              => 'The software ID',
        'name'            => 'The software Name',
        'file'            => '/path/to/wp-content/plugins/your-plugin/your-plugin.php', // Tip: use __FILE__ to define it in your-plugin.php
        'basename'        => 'your-plugin/your-plugin.php', // Tip: use plugin_basename( __FILE__ ) in your-plugin.php
        'version'         => YOUR_PLUGIN_VERSION, // Tip: Define this in your-plugin.php file and increment with every release.
        'url_settings'    => 'https://url-to-your-plugin/settings-page',
        'url_purchase'    => 'https://url-to-your-website/purchase-page',
        'consumer_key'    => 'ck_XXXXXXXXXXXXXXXXX',
        'consumer_secret' => 'cs_XXXXXXXXXXXXXXXXX',
        'api_url'         => 'https://yourwoocommercesite.com/wp-json/dlm/v1/',
        'prefix'          => 'dlm',
    ) );
} catch (\Exception $e) {
    error_log('Error: ' . $e->getMessage());
}

// Important: To display the activation form in your settings page (url_settings), use the renderActivationForm() method like bellow.
// Note: If you want to override the activation form, you can extend the Activator class with your own class and override the renderActivationForm() method.
$instance->getActivator()->renderActivationForm();

dlm-wp-updater's People

Contributors

gdarko avatar pondermatic avatar

Stargazers

 avatar  avatar

Watchers

 avatar

dlm-wp-updater's Issues

HTTP cached response is not used by prepareInfo() or prepareValidateLicense()

IdeoLogix\DigitalLicenseManagerUpdaterWP\Http\Client::prepareInfo() and IdeoLogix\DigitalLicenseManagerUpdaterWP\Http\Client::prepareValidateLicense() set HTTP responses in the cache, but never return a cached entry if it hasn't timed out. This causes a request to the DLM software server 1 (or more) times on the WP admin plugin and update pages.

I am happy to work on this issue and submit a pull request if it's OK with you, @gdarko.

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.