Skip to content

Commit 1872eaa

Browse files
authored
Merge pull request #1 from duckdev/dev
Create v1.0.0
2 parents a903ee3 + 5bc8880 commit 1872eaa

File tree

9 files changed

+1421
-2
lines changed

9 files changed

+1421
-2
lines changed

README.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,58 @@
1-
# Plugin Licensing
2-
A premium licensing module developed exclusively for Duck Dev plugins.
1+
# Freemius Plugin Licensing
2+
3+
This is a lite version of the main Freemius SDK, specifically developed for use in Duck Dev WordPress plugins. This
4+
library focuses exclusively on managing plugin license activation, deactivation, and updates. It does not provide any
5+
user interface, so your plugin will need to create its own UI and use this library to handle the logic.
6+
7+
## Requirements
8+
9+
* PHP version 7.4 or higher.
10+
* WordPress 5.0+
11+
12+
## Installation
13+
14+
This library should be installed and included in your WordPress plugin using Composer.
15+
16+
```console
17+
composer require duckdev/freemius-licensing-sdk
18+
```
19+
20+
## Usage
21+
22+
### Initialization
23+
24+
Initialize the Freemius SDK by calling the static `DuckDev\Freemius\Freemius::get_instance()` method with your plugin's
25+
details.
26+
27+
```php
28+
// Assuming Composer's autoload.php has been included.
29+
$freemius = DuckDev\Freemius\Freemius::get_instance(
30+
12345, // Your Freemius product ID.
31+
array(
32+
'slug' => 'loggedin', // Your plugin's unique Freemius slug.
33+
'main_file' => LOGGEDIN_FILE, // The path to your plugin's main file.
34+
'public_key' => 'pk_XXXXXXXXXXXXXXXXX', // Your plugin's public key.
35+
)
36+
);
37+
```
38+
39+
### License Activation
40+
41+
To activate a license, call the `activate()` method on the `license()` object with the user's license key.
42+
43+
```php
44+
$freemius->license()->activate( 'XXXX-XXXX-XXXX' );
45+
```
46+
47+
### License Deactivation
48+
49+
To deactivate a license, simply call the `deactivate()` method.
50+
51+
```php
52+
$freemius->license()->deactivate();
53+
```
54+
55+
### Updates
56+
57+
The library will automatically handle plugin updates as long as a valid license is active. No additional code is
58+
required to check for and apply updates.

composer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "duckdev/freemius-plugin-licensing",
3+
"type": "library",
4+
"description": "Lite version of the Freemius SDK for managing plugin licensing and updates using Freemius APIs, specifically developed for use with Duck Dev plugins.",
5+
"keywords": [
6+
"freemius",
7+
"plugins",
8+
"updates",
9+
"licensing"
10+
],
11+
"homepage": "https://github.com/duckdev/freemius-plugin-licensing",
12+
"license": "GPL-2.0+",
13+
"optimize-autoloader": true,
14+
"authors": [
15+
{
16+
"name": "Joel James",
17+
"email": "[email protected]",
18+
"homepage": "https://duckdev.com",
19+
"role": "Developer"
20+
}
21+
],
22+
"require": {
23+
"php": ">=7.4"
24+
},
25+
"config": {
26+
"platform": {
27+
"php": "7.4"
28+
}
29+
},
30+
"autoload": {
31+
"classmap": [
32+
"src/"
33+
]
34+
}
35+
}

0 commit comments

Comments
 (0)