1- # Dwnload EDD Software License Manager [ ![ Build Status] ( https://travis-ci.org/dwnload/EddSoftwareLicenseManager.svg?branch=master )] ( https://travis-ci.org/dwnload/EddSoftwareLicenseManager )
1+ # EDD Software License Manager
2+
3+ [ ![ PHP from Packagist] ( https://img.shields.io/packagist/php-v/dwnload/edd-software-license-manager.svg )] ( )
4+ [ ![ Latest Stable Version] ( https://img.shields.io/packagist/v/dwnload/edd-software-license-manager.svg )] ( https://packagist.org/packages/dwnload/edd-software-license-manager )
5+ [ ![ Total Downloads] ( https://img.shields.io/packagist/dt/dwnload/edd-software-license-manager.svg )] ( https://packagist.org/packages/dwnload/edd-software-license-manager )
6+ [ ![ License] ( https://img.shields.io/packagist/l/dwnload/edd-software-license-manager.svg )] ( https://packagist.org/packages/dwnload/edd-software-license-manager )
7+ ![ Build Status] ( https://github.com/dwnload/WpSettingsApi/actions/workflows/main.yml/badge.svg )
8+ [ ![ codecov] ( https://codecov.io/gh/dwnload/WpSettingsApi//branch/develop/graph/badge.svg )] ( https://codecov.io/gh/dwnload/WpSettingsApi/ )
9+
210A PHP class abstraction for managing WordPress plugin licenses and auto-updates that are sold on an Easy Digital Downloads store.
311
412## Package Installation (via Composer)
513
614To install this package, edit your ` composer.json ` file:
715
8- ``` js
16+ ``` json
917{
1018 "require" : {
11- " dwnload/edd-software-license-manager" : " ^1.3 .0"
19+ "dwnload/edd-software-license-manager" : " ^2 .0"
1220 }
1321}
1422```
@@ -20,31 +28,16 @@ Now run:
2028### How to use this package
2129
2230``` php
23- use Dwnload\EddSoftwareLicenseManager\Edd;
24-
25- // In the root of your plugin
26- $args = [
27- 'api_url' => trailingslashit( https://plugingarden.dwnload.io ),
28- 'plugin_file' => __FILE__,
29- 'api_data' => [
30- 'version' => (string) $version, // current version number
31- 'license' => (string) $license_key, // license key (used get_option above to retrieve from DB)
32- 'item_name' => 'Super Cool Plugin', // name of this plugin (matching your EDD Download title)
33- 'item_id' => (int) 10,
34- 'author' => 'Austin Passy', // author of this plugin
35- 'beta' => (bool) isset( $use_beta ),
36- ],
37- 'item_id' => (int) 10,
38- 'name' => plugin_basename( __FILE__ ),
39- 'slug' => basename( __FILE__, '.php' ),
40- 'version' => (string) $version,
41- 'wp_override' => false,
42- 'beta' => (bool) isset( $use_beta ),
31+ $license = \get_option(\Dwnload\EddSoftwareLicenseManager\Edd\AbstractLicenceManager::LICENSE_SETTING, []);
32+ $data = [
33+ 'license' => $license[$plugin_id]['license'] ?? '',
34+ 'item_name' => 'Custom Login Style Pack #1', // Name of this plugin (matching your EDD Download title).
35+ 'author' => 'Frosty Media',
36+ 'item_id' => (int),
37+ 'version' => '1.0.0',
4338];
44-
45- if ( is_admin() ) {
46- ( new Init() )
47- ->add( new PluginUpdater( $args )
48- ->initialize();
49- }
39+ \TheFrosty\WpUtilities\Plugin\Plugin $plugin
40+ ->add(new Edd\LicenseManager($plugin, $data))
41+ ->add(new Edd\PluginUpdater('https://frosty.media/', __FILE__, $data))
42+ ->initialize();
5043```
0 commit comments