Skip to content

Instantly share code, notes, and snippets.

@atwellpub
Created July 23, 2014 21:38
Show Gist options
  • Save atwellpub/ad7fb6438d84ceae0acb to your computer and use it in GitHub Desktop.
Save atwellpub/ad7fb6438d84ceae0acb to your computer and use it in GitHub Desktop.
How to add license handling and extension updating to your Inbound Now extensio
<?php
/** Define constants somewhere in plugin */
define('EXTENSION_CURRENT_VERSION', '1.0.5' );
define('EXTENSION_LABEL' , 'Extension Integration' );
define('EXTENSION_SLUG' , plugin_basename( dirname(__FILE__) ) );
define('EXTENSION_FILE' , __FILE__ );
define('EXTENSION_REMOTE_ITEM_NAME' , 'extension-integration' );
define('EXTENSION_URLPATH', plugins_url( ' ', __FILE__ ) );
define('EXTENSION_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
/** Setup Automatic Updating & Licensing */
add_action('admin_init', 'license_setup' );
/**
* Setups Software Update & Licenseing API
*/
function license_setup() {
/*PREPARE THIS EXTENSION FOR LICESNING*/
if ( class_exists( 'Inbound_License' ) ) {
$license = new Inbound_License( EXTENSION_FILE , EXTENSION_LABEL , EXTENSION_SLUG , EXTENSION_CURRENT_VERSION , EXTENSION_REMOTE_ITEM_NAME ) ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment