Coder Social home page Coder Social logo

update-scripts's Introduction

WP Updatr - Update Scripts

WP Updatr allows you to offer automatic updates to your customers when using premium WordPress plugins and themes (or for any that aren't hosted on WordPress.org really).

Using WP Updatr

This update script requires you to have registered an account on WP Updatr. This services allows you to offer updates without having to serve them off of your own server. It's also been made possible to release updates in under a minute - It's SUPER Easy!

Usage - Plugins

Include the class.plugin-wp-updatr.php file at the top of your plugin's core file.

if( !class_exists('WPUpdatrPlugins') ){
  require_once plugin_dir_path( __FILE__ ).'class.plugin-wp-updatr.php';
}

Instantiate the WPUpdatrPlugins Class with your customer's $license_key and $product_key. Make use of namespacing to ensure that no conflicts arise between your plugin and others. Change myPluginAlias to something unique to your plugin.

use WPUpdatrPlugins as myPluginAlias;

new myPluginAlias\WPUpdatrPlugins( $license_key, $product_key );

License Key

$license_key - This key is created when a customer purchases or proceeds through the checkout process of your chosen integration (Woocommerce, Paid Memberships Pro, Easy Digital Downloads).

You will need to build in a 'Settings' or 'API Key' field in your plugin to store this value, where your customer can enter in their API key.

The easiest steps would be to save it in an update_option so that you initialize the code as follows:

use WPUpdatrPlugins as myPluginAlias;

new myPluginAlias\WPUpdatrPlugins( get_option( 'myplugin_api_key' ), $product_key );

Product Key

$product_key - This key is created when you create a product in the WP Updatr Dashboard on the Products Page.

This value will be hard coded and should not be changed once your plugin is released to your customers. This key is prefixed with ELP- and will look similar to this:

use WPUpdatrPlugins as myPluginAlias;

new myPluginAlias\WPUpdatrPlugins( get_option( 'myplugin_api_key' ), 'ELP-' );

Usage - Themes

Include the below snippet in your theme's functions.php file. The $api_key and $product_key variables will function the same as when used in a plugin.

use WPUpdatrThemes as myThemeAlias;

function my_wp_updatr_theme_license() {
  
  require( get_stylesheet_directory() . '/class.theme-wp-updatr.php' ); 

  /**
   * $api_key - Customer API Key they receive after making a purchase
   * $product_key - Obtained from your WP Updatr Dashboard for that specific product
   */

  $theme = new myThemeAlias\WPUpdatrLicenseControlThemes( $api_key, $product_key );

  // $license = $theme->verify_license();

}
add_action( 'after_setup_theme', 'my_wp_updatr_theme_license' );

Verify Your Setup

Run a test purchase through your website to obtain a customer API key for yourself. Include that in your plugin's API key field and set your product API key.

To verify if your API key is valid and paired to the correct product, run the following:

use WPUpdatrPlugins as myPluginAlias;
$license = new myPluginAlias\WPUpdatrPlugins( get_option( 'myplugin_api_key`, 'ELP-' );

$object = $license->verify_license();

var_dump($object);

$object returns an object on success. null on error.

WP Updatr Plans

WP Updatr offers a variety of plans to suit the needs of all businesses.

Starter Plus Professional
Up to 200 Licenses Up to 1 000 Licenses 1 000+ Licenses
Unlimited Products Unlimited Products Unlimited Products
Unlimited Updates Unlimited Updates Unlimited Updates
Comprehensive Reporting Comprehensive Reporting Comprehensive Reporting

Pricing & More Information

Support & Contributing

For queries related to the WP Updatr service, please get in touch with us directly.

For any issues or questions related to the update scripts, feel free to open an issue and we'll address it ASAP.

update-scripts's People

Contributors

jarrydlong avatar

Watchers

 avatar

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.