Git Product home page Git Product logo

lemon-squeezy-updater's Introduction

Lemon Squeezy WordPress Plugin Updater and License Manager

This library seamlessly integrates with WordPress plugins, adding a simple yet powerful licensing field directly into the WordPress plugins list. It enables effortless activation, deactivation, and management of plugin licenses through AJAX for a streamlined user experience. With just one line of code, this functionality can be added to any WordPress plugin, facilitating license validations against product_id, store_id, and variation_id to ensure legitimacy before activation. Additionally, it supports an optional renewal URL feature, guiding users to repurchase when licenses expire.

Alt text

Key Features:

  • License Activation and Validation: Simplifies the process of activating and validating license keys, ensuring that users are authorized to use the plugin. Validates against product_id, store_id, and variation_ids for enhanced security.
  • Seamless Updates: Automates the checking for plugin updates and manages the update process, ensuring plugins remain up-to-date effortlessly.
  • Easy Integration: Designed for high compatibility with various WordPress environments, it integrates smoothly into any plugin with minimal effort.
  • Secure API Communication: Utilizes secure API calls for communication with Lemon Squeezy for license management and update repositories, ensuring data protection.
  • Streamlined User Experience: Leverages AJAX for real-time license operations, providing a seamless experience without page reloads.
  • Renewal URL Support: Offers an optional renewal URL for expired licenses, directing users to repurchase, thus maintaining continuity and support.

Leverage the Lemon Squeezy WordPress Plugin Updater and License Manager to ensure your plugins are efficiently managed, securely licensed, and always up to date.

Minimum Requirements

  • PHP: 7.4 or later
  • WordPress: 6.4.3 or later

Important: The Lemon Squeezy - Better Endpoints plugin must be installed and active on your website to use this library.

Installation

To integrate the library into your WordPress plugin, use Composer:

composer require arraypress/lemon-squeezy-updater

Including the Library in Your Plugin

Include the Composer autoloader in your plugin to access the library functionalities:

require_once __DIR__ . '/vendor/autoload.php';

Example Integration

use ArrayPress\LemonSqueezy\Updater;

// Initialize the updater with your Lemon Squeezy store details
$updater = new Updater(
	__FILE__,
	'https://example.com/wp-json/lsq/v1',
	'1.0.0', // Optional. Leave empty to use the WordPress plugin version number
	'store_id', // Optional but recommended. Your Lemon Squeezy Store ID (12345)
	'product_id', // Optional but recommended. Your Lemon Squeezy Product ID (12345)
	'variation_id', // Optional. Your Lemon Squeezy Product Variation ID (12345)
	'https://example.com/my-plugin-page' // Optional. Expiration Renewal URL
);

if ( ! $updater->is_license_activated() ) {
 // Disable functionality in your plugin if not active
}

Contributions

Contributions to improve the library are welcome. Please submit pull requests or create issues on GitHub for any bugs or feature suggestions.

License

This library is licensed under the GPL-2.0-or-later. It is free to use and modify according to the terms of the GNU General Public License.

lemon-squeezy-updater's People

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.