{"id":70023,"date":"2017-06-12T15:04:17","date_gmt":"2017-06-12T15:04:17","guid":{"rendered":"https:\/\/en-gb.wordpress.org\/plugins\/woocommerce-sml-software-licence-manager-key-generator\/"},"modified":"2017-06-12T15:04:17","modified_gmt":"2017-06-12T15:04:17","slug":"woo-sml","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/woo-sml\/","author":13515033,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0","stable_tag":"trunk","tested":"4.8.28","requires":"3.5.1","requires_php":"","requires_plugins":"","header_name":"Woocommerce SML (Software licence manager) Key generator","header_author":"Aaron Bowie (We are AG)","header_description":"Auto generate licence keys for WooCommerce orders using the Software licence manager plugin","assets_banners_color":"","last_updated":"2017-06-12 15:04:17","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/www.weareag.co.uk","rating":0,"author_block_rating":0,"active_installs":10,"downloads":670,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq"],"tags":[],"upgrade_notice":{"":"<ul>\n<li>nothing yet<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[26437,26438,14374,64354,64355],"plugin_category":[],"plugin_contributors":[129880,83362],"plugin_business_model":[],"class_list":["post-70023","plugin","type-plugin","status-closed","hentry","plugin_tags-software-license","plugin_tags-software-license-manager","plugin_tags-wc","plugin_tags-wc-license","plugin_tags-wc-software-license","plugin_contributors-agdesignstudio","plugin_contributors-goback2","plugin_committers-agdesignstudio"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/woo-sml.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Seamless integration between Woocommerce 3.0+ and Software License Manager Plugin.<\/p>\n\n<p>This is an updated version of Woocommerce Software License Manager By Omid Shamlu to work with the latest WooCommerce (3.0+)<\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li>Automatically creates license keys for each sale with WC<\/li>\n<li>Licensing is optional and can be activated\/deactivated individually<\/li>\n<li>Send generated license keys to your customers within your existing email notifications<\/li>\n<\/ul>\n\n<h4>Sample code<\/h4>\n\n<pre><code>&lt;?php\n\/*\n  Plugin Name: License Checker\n  Version: v1.0\n  Plugin URI: http:\/\/wp-master.ir\n  Author: Omid Shamloo\n  Author URI: http:\/\/wp-master.ir\n  Description: Sample plugin to show you how you can interact with the software license manager API from your WordPress plugin or theme\n *\/\n\n\n\/\/ This is the secret key for API authentication. You configured it in the settings menu of the license manager plugin.\ndefine('YOUR_SPECIAL_SECRET_KEY', 'YOUR_SPECIAL_SECRET_KEY'); \/\/Rename this constant name so it is specific to your plugin or theme.\n\n\/\/ This is the URL where API query request will be sent to. This should be the URL of the site where you have installed the main license manager plugin. Get this value from the integration help page.\ndefine('YOUR_LICENSE_SERVER_URL', 'http:\/\/wp-master.ir'); \/\/Rename this constant name so it is specific to your plugin or theme.\n\n\/\/ This is a value that will be recorded in the license manager data so you can identify licenses for this item\/product.\ndefine('YOUR_ITEM_REFERENCE', 'YOUR_ITEM_REFERENCE'); \/\/Rename this constant name so it is specific to your plugin or theme.\n\nadd_action('admin_menu', 'slm_sample_license_menu');\n\nfunction slm_sample_license_menu() {\n    add_options_page('Sample License Activation Menu', 'Sample License', 'manage_options', 'youlice_classesence', 'sample_license_management_page');\n}\n\nfunction sample_license_management_page() {\n    echo '&lt;div class=\"wrap\"&gt;';\n    echo '&lt;h2&gt;Sample License Management&lt;\/h2&gt;';\n\n    \/*** License activate button was clicked ***\/\n    if (isset($_REQUEST['activate_license'])) {\n        $license_key = $_REQUEST['sample_license_key'];\n        \/\/ Send query to the license manager server\n        $lic    = new youlice_class($license_key , YOUR_LICENSE_SERVER_URL , YOUR_SPECIAL_SECRET_KEY );\n        if($lic-&gt;active()){\n            echo 'You license Activated successfuly';\n        }else{\n            echo $lic-&gt;err;\n        }\n\n    }\n\n    $lic = new youlice_class($license_key , YOUR_LICENSE_SERVER_URL , YOUR_SPECIAL_SECRET_KEY );\n    if($lic-&gt;is_licensed()){\n        echo 'Thank You Phurchasing!';\n    }else{\n        ?&gt;\n        &lt;form action=\"\" method=\"post\"&gt;\n            &lt;table class=\"form-table\"&gt;\n                &lt;tr&gt;\n                    &lt;th style=\"width:100px;\"&gt;&lt;label for=\"sample_license_key\"&gt;License Key&lt;\/label&gt;&lt;\/th&gt;\n                    &lt;td &gt;&lt;input class=\"regular-text\" type=\"text\" id=\"sample_license_key\" name=\"sample_license_key\"  value=\"&lt;?php echo get_option('sample_license_key'); ?&gt;\" &gt;&lt;\/td&gt;\n                &lt;\/tr&gt;\n            &lt;\/table&gt;\n            &lt;p class=\"submit\"&gt;\n                &lt;input type=\"submit\" name=\"activate_license\" value=\"Activate\" class=\"button-primary\" \/&gt;\n            &lt;\/p&gt;\n        &lt;\/form&gt;\n        &lt;?php\n    }\n\n\n    echo '&lt;\/div&gt;';\n}\n\n\nclass youlice_class{\n    public $lic;\n    public $server;\n    public $api_key;\n    private $wp_option  = 'product_1450';\n    private $product_id = 'My_product_name_OR_ID';\n    public $err;\n    public function __construct($lic=false , $server , $api_key){\n        if($this-&gt;is_licensed())\n            $this-&gt;lic      =   get_option($this-&gt;wp_option);\n        else\n            $this-&gt;lic      =   $lic;\n\n        $this-&gt;server   =   $server;\n        $this-&gt;api_key  =   $api_key;\n    }\n    \/**\n     * check for current product if licensed\n     * @return boolean\n     *\/\n    public function is_licensed(){\n        $lic = get_option($this-&gt;wp_option);\n        if(!empty( $lic ))\n            return true;\n        return false;\n    }\n\n    \/**\n     * send query to server and try to active lisence\n     * @return boolean\n     *\/\n    public function active(){\n        $url = YOUR_LICENSE_SERVER_URL . '\/?secret_key=' . YOUR_SPECIAL_SECRET_KEY . '&amp;slm_action=slm_activate&amp;license_key=' . $this-&gt;lic . '&amp;registered_domain=' . get_bloginfo('siteurl').'&amp;item_reference='.$this-&gt;product_id;\n        $response = wp_remote_get($url, array('timeout' =&gt; 20, 'sslverify' =&gt; false));\n\n        if(is_array($response)){\n            $json = $response['body']; \/\/ use the content\n            $json = preg_replace('\/[\\x00-\\x1F\\x80-\\xFF]\/', '', utf8_encode($json));\n            $license_data = json_decode($json);\n        }\n        if($license_data-&gt;result == 'success'){\n            update_option( $this-&gt;wp_option, $this-&gt;lic );\n            return true;\n        }else{\n            $this-&gt;err = $license_data-&gt;message;\n            return false;\n        }\n    }\n\n    \/**\n     * send query to server and try to deactive lisence\n     * @return boolean\n     *\/\n    public function deactive(){\n\n    }\n\n}\n<\/code><\/pre>\n\n<blockquote>\n  <p><strong>Please note<\/strong><br \/>\n  The license validation part for your distributed plugins and themes is not part of this plugin. Therefore please take a look into the Software License Manager documentation.<\/p>\n  \n  <p><strong>incompatibility issue with iThemes Security<\/strong><br \/>\n  If you have installed \"iThemes Security\" , so uncheck <strong>Long URL Strings<\/strong> where Software License Manager is installed<\/p>\n<\/blockquote>\n\n<h4>Credits<\/h4>\n\n<ul>\n<li><a href=\"https:\/\/wordpress.org\/plugins\/woocommerce\/\">Woocommerce<\/a><\/li>\n<li><a href=\"https:\/\/wordpress.org\/plugins\/software-license-manager\/\">Software License Manager<\/a><\/li>\n<li><a href=\"https:\/\/wordpress.org\/plugins\/edd-software-license-manager\/\">EDD Software License Manager<\/a><\/li>\n<li><a href=\"https:\/\/wordpress.org\/plugins\/wc-software-license-manager\/\">Woocommerce Software License Manager<\/a> - Omid Shamloo<\/li>\n<\/ul>\n\n<h3>Configuration<\/h3>\n\n<p>The plugin is really simple and well structured so you don\u2019t have to prepare a lot in order to get it working.<\/p>\n\n<ol>\n<li>After the successful installation you will find a prepared options page here: \u201cWooCommerce\u201d &gt; \u201cSettings\u201d &gt; \u201cProducts\u201d &gt; \u201cWoo License Manager\u201d<\/li>\n<li>Enter your Software License Manager API credentials<\/li>\n<li>Go to your Products and activate licensing where it's required<\/li>\n<\/ol>\n\n<!--section=installation-->\n<p>The installation and configuration of the plugin is as simple as it can be.<\/p>\n\n<h4>Using The WordPress Dashboard<\/h4>\n\n<ol>\n<li>Navigate to the 'Add New' in the plugins dashboard<\/li>\n<li>Search for 'wc software license manager'<\/li>\n<li>Click 'Install Now'<\/li>\n<li>Activate the plugin on the Plugin dashboard<\/li>\n<\/ol>\n\n<h4>Uploading in WordPress Dashboard<\/h4>\n\n<ol>\n<li>Navigate to the 'Add New' in the plugins dashboard<\/li>\n<li>Navigate to the 'Upload' area<\/li>\n<li>Select plugin zip file from your computer<\/li>\n<li>Click 'Install Now'<\/li>\n<li>Activate the plugin in the Plugin dashboard<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><p>The installation and configuration of the plugin is as simple as it can be.<\/p>\n\n<h4>Using The WordPress Dashboard<\/h4>\n\n<ol>\n<li>Navigate to the 'Add New' in the plugins dashboard<\/li>\n<li>Search for 'wc software license manager'<\/li>\n<li>Click 'Install Now'<\/li>\n<li>Activate the plugin on the Plugin dashboard<\/li>\n<\/ol>\n\n<h4>Uploading in WordPress Dashboard<\/h4>\n\n<ol>\n<li>Navigate to the 'Add New' in the plugins dashboard<\/li>\n<li>Navigate to the 'Upload' area<\/li>\n<li>Select plugin zip file from your computer<\/li>\n<li>Click 'Install Now'<\/li>\n<li>Activate the plugin in the Plugin dashboard<\/li>\n<\/ol><\/dd>\n<dt>Is it necessary to install both plugins on the same WordPress installation?<\/dt>\n<dd><p>No! That's one of the biggest benefits of this integration. Woocommerce and the Software License Manager can be installed on different sites.<\/p><\/dd>\n<dt>Can I use this plugin to validate the generated license keys?<\/dt>\n<dd><p>No! The license validation part for your distributed plugins and themes is not part of this plugin. Therefore please take a look into the Software License Manager documentation.<\/p><\/dd>\n\n<\/dl>","raw_excerpt":"Seamless integration between Woocommerce 3.0+ and Software License Manager.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/70023","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=70023"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/agdesignstudio"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=70023"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=70023"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=70023"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=70023"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=70023"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=70023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}