Skip to content

Commit 872ec18

Browse files
committed
Rebrand to FoxeLabs and rename to wp-freemius-client
The library moved from duckdev to foxelabs and is renamed from freemius-plugin-licensing to wp-freemius-client, matching the wp-* naming used by the sibling libraries. * Package duckdev/freemius-plugin-licensing -> foxelabs/wp-freemius-client * Namespace DuckDev\Freemius\ -> FoxeLabs\Freemius\ * Point the GitHub and docs URLs at the new org and path * Bump to 3.0.0 — the namespace rename is breaking
1 parent f19569a commit 872ec18

42 files changed

Lines changed: 237 additions & 237 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Freemius Plugin Licensing
1+
# WP Freemius Client
22

3-
A lite, UI-free Freemius SDK for Duck Dev WordPress plugins. The library handles license activation, deactivation,
3+
A lite, UI-free Freemius SDK for Foxe Labs WordPress plugins. The library handles license activation, deactivation,
44
update delivery, and addon listing by talking to the Freemius API directly. It deliberately ships no admin screens —
55
host plugins build their own UI and call into this library for the underlying logic.
66

7-
📖 **Full documentation:** [docs.duckdev.com/wp-libraries/freemius-plugin-licensing/overview](https://docs.duckdev.com/wp-libraries/freemius-plugin-licensing/overview)
7+
📖 **Full documentation:** [docs.foxelabs.com/software/wp-libraries/wp-freemius-client/overview](https://docs.foxelabs.com/software/wp-libraries/wp-freemius-client/overview)
88

99
## Requirements
1010

@@ -15,15 +15,15 @@ host plugins build their own UI and call into this library for the underlying lo
1515
## Installation
1616

1717
```console
18-
composer require duckdev/freemius-plugin-licensing
18+
composer require foxelabs/wp-freemius-client
1919
```
2020

21-
The library autoloads under the `DuckDev\Freemius\` namespace via PSR-4.
21+
The library autoloads under the `FoxeLabs\Freemius\` namespace via PSR-4.
2222

2323
## Architecture
2424

2525
The library is organised as a small dependency-injection container wired up by the entry class
26-
`DuckDev\Freemius\Freemius`. The folder layout mirrors the namespace:
26+
`FoxeLabs\Freemius\Freemius`. The folder layout mirrors the namespace:
2727

2828
```
2929
src/
@@ -67,7 +67,7 @@ Initialise the container by calling `Freemius::get_instance()` with your Freemiu
6767

6868
```php
6969
// Assuming Composer's autoload.php has been included.
70-
$freemius = \DuckDev\Freemius\Freemius::get_instance(
70+
$freemius = \FoxeLabs\Freemius\Freemius::get_instance(
7171
12345, // Your Freemius product ID.
7272
array(
7373
'slug' => 'loggedin', // Your plugin's unique Freemius slug.
@@ -145,30 +145,30 @@ $addons = $freemius->addon()->get_addons( true ); // Force refresh.
145145
```
146146

147147
Each entry is enriched with a `link` field (Freemius checkout URL) and an `is_premium` boolean. Use the
148-
`duckdev_freemius_format_addon_data` filter to add or rewrite fields per addon.
148+
`foxelabs_freemius_format_addon_data` filter to add or rewrite fields per addon.
149149

150150
## Hooks
151151

152152
### Actions
153153

154154
| Hook | Arguments | When |
155155
|---------------------------------------|--------------------------|---------------------------------------|
156-
| `duckdev_freemius_license_activated` | `array $activation, bool $success` | After a successful activation. |
157-
| `duckdev_freemius_license_deactivated`| `array $activation, bool $success` | After a successful deactivation. |
156+
| `foxelabs_freemius_license_activated` | `array $activation, bool $success` | After a successful activation. |
157+
| `foxelabs_freemius_license_deactivated`| `array $activation, bool $success` | After a successful deactivation. |
158158

159159
### Filters
160160

161161
| Hook | Arguments | Use |
162162
|--------------------------------------------|-------------------------------------------------|------------------------------------------------------------------|
163-
| `duckdev_freemius_api_request_args` | `array $args, string $method, string $url, array $data, array $headers` | Tweak the request arguments before they reach `wp_remote_request()`. |
164-
| `duckdev_freemius_api_request_verify_ssl` | `bool $verify, Client $client` | Disable SSL verification (typically only in local dev). |
165-
| `duckdev_freemius_format_addon_data` | `array $addon, Addon $service` | Rewrite or augment each addon entry before it is returned. |
163+
| `foxelabs_freemius_api_request_args` | `array $args, string $method, string $url, array $data, array $headers` | Tweak the request arguments before they reach `wp_remote_request()`. |
164+
| `foxelabs_freemius_api_request_verify_ssl` | `bool $verify, Client $client` | Disable SSL verification (typically only in local dev). |
165+
| `foxelabs_freemius_format_addon_data` | `array $addon, Addon $service` | Rewrite or augment each addon entry before it is returned. |
166166

167167
## Security Notes
168168

169169
* The library does **not** verify nonces or capabilities. Host plugins MUST do that before forwarding form input to
170170
`License::activate()` / `License::deactivate()`.
171-
* The license key is stored in the `duckdev_freemius_activation_data` option (an autoload-safe option keyed by plugin
171+
* The license key is stored in the `foxelabs_freemius_activation_data` option (an autoload-safe option keyed by plugin
172172
ID). It is blanked from storage on deactivation.
173173

174174
## License

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
"name": "duckdev/freemius-plugin-licensing",
3-
"version": "2.0.2",
2+
"name": "foxelabs/wp-freemius-client",
3+
"version": "3.0.0",
44
"type": "library",
5-
"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+
"description": "Lite version of the Freemius SDK for managing plugin licensing and updates using Freemius APIs, specifically developed for use with Foxe Labs plugins.",
66
"keywords": [
77
"freemius",
88
"plugins",
99
"updates",
1010
"licensing"
1111
],
12-
"homepage": "https://github.com/duckdev/freemius-plugin-licensing",
12+
"homepage": "https://github.com/foxelabs/wp-freemius-client",
1313
"license": "GPL-2.0+",
1414
"optimize-autoloader": true,
1515
"authors": [
1616
{
1717
"name": "Joel James",
1818
"email": "me@joelsays.com",
19-
"homepage": "https://duckdev.com",
19+
"homepage": "https://foxelabs.com",
2020
"role": "Developer"
2121
}
2222
],
@@ -41,12 +41,12 @@
4141
},
4242
"autoload": {
4343
"psr-4": {
44-
"DuckDev\\Freemius\\": "src/"
44+
"FoxeLabs\\Freemius\\": "src/"
4545
}
4646
},
4747
"autoload-dev": {
4848
"psr-4": {
49-
"DuckDev\\Freemius\\Tests\\": "tests/"
49+
"FoxeLabs\\Freemius\\Tests\\": "tests/"
5050
}
5151
},
5252
"scripts": {

phpcs.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset name="DuckDev Freemius Plugin Licensing">
2+
<ruleset name="FoxeLabs Freemius Plugin Licensing">
33
<description>WordPress coding standards adapted for a PSR-4 library.</description>
44

55
<file>src</file>

src/Api/ApiFactory.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@
1919
*
2020
* Custom call sites can also use {@see make_signed()} directly.
2121
*
22-
* @link https://duckdev.com/
22+
* @link https://foxelabs.com/
2323
* @license http://www.gnu.org/licenses/ GNU General Public License
2424
* @author Joel James <me@joelsays.com>
2525
* @since 1.0.0
2626
* @package Freemius
2727
* @subpackage Api
2828
*/
2929

30-
namespace DuckDev\Freemius\Api;
30+
namespace FoxeLabs\Freemius\Api;
3131

3232
// If this file is called directly, abort.
3333
defined( 'WPINC' ) || die;
3434

35-
use DuckDev\Freemius\Contracts\ApiClientInterface;
36-
use DuckDev\Freemius\Data\ApiKeys;
37-
use DuckDev\Freemius\Data\Plugin;
35+
use FoxeLabs\Freemius\Contracts\ApiClientInterface;
36+
use FoxeLabs\Freemius\Data\ApiKeys;
37+
use FoxeLabs\Freemius\Data\Plugin;
3838

3939
/**
4040
* Class ApiFactory.
@@ -65,7 +65,7 @@ public function __construct( ?RequestSigner $signer = null ) {
6565
/**
6666
* Build an unauthenticated client.
6767
*
68-
* Used by {@see \DuckDev\Freemius\Services\License} for the
68+
* Used by {@see \FoxeLabs\Freemius\Services\License} for the
6969
* activate.json / deactivate.json endpoints which accept a
7070
* license key in the body and do not require signing.
7171
*
@@ -127,7 +127,7 @@ public function make_for_plugin( Plugin $plugin ): ApiClientInterface {
127127
* @since 2.0.0
128128
*
129129
* @param string $install_id Install ID returned by the activation response.
130-
* @param ApiKeys $keys Install key pair (from {@see \DuckDev\Freemius\Data\Activation::api_keys()}).
130+
* @param ApiKeys $keys Install key pair (from {@see \FoxeLabs\Freemius\Data\Activation::api_keys()}).
131131
*
132132
* @return ApiClientInterface
133133
*/

src/Api/Client.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@
1212
* Subclasses (see {@see SignedClient}) override {@see build_headers()}
1313
* to inject authentication.
1414
*
15-
* @link https://duckdev.com/
15+
* @link https://foxelabs.com/
1616
* @license http://www.gnu.org/licenses/ GNU General Public License
1717
* @author Joel James <me@joelsays.com>
1818
* @since 1.0.0
1919
* @package Freemius
2020
* @subpackage Api
2121
*/
2222

23-
namespace DuckDev\Freemius\Api;
23+
namespace FoxeLabs\Freemius\Api;
2424

2525
// If this file is called directly, abort.
2626
defined( 'WPINC' ) || die;
2727

28-
use DuckDev\Freemius\Contracts\ApiClientInterface;
28+
use FoxeLabs\Freemius\Contracts\ApiClientInterface;
2929
use WP_Error;
3030

3131
/**
@@ -280,7 +280,7 @@ protected function perform_http_request( string $method, string $url, array $dat
280280
* @param array $data Request body.
281281
* @param array $headers Request headers.
282282
*/
283-
$args = apply_filters( 'duckdev_freemius_api_request_args', $args, $method, $url, $data, $headers );
283+
$args = apply_filters( 'foxelabs_freemius_api_request_args', $args, $method, $url, $data, $headers );
284284

285285
$response = wp_remote_request( $url, $args );
286286

@@ -290,7 +290,7 @@ protected function perform_http_request( string $method, string $url, array $dat
290290
/**
291291
* Whether to verify the SSL certificate of `api.freemius.com`.
292292
*
293-
* Filterable via `duckdev_freemius_api_request_verify_ssl` for the
293+
* Filterable via `foxelabs_freemius_api_request_verify_ssl` for the
294294
* rare case where a local dev environment needs to disable it.
295295
*
296296
* @since 2.0.0
@@ -306,6 +306,6 @@ protected function verify_ssl(): bool {
306306
* @param bool $verify Should verify?
307307
* @param Client $client Current client instance.
308308
*/
309-
return (bool) apply_filters( 'duckdev_freemius_api_request_verify_ssl', true, $this );
309+
return (bool) apply_filters( 'foxelabs_freemius_api_request_verify_ssl', true, $this );
310310
}
311311
}

src/Api/RequestSigner.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* without WordPress in the loop.
99
*
1010
* Two header schemes are produced depending on the supplied
11-
* {@see \DuckDev\Freemius\Data\ApiKeys}:
11+
* {@see \FoxeLabs\Freemius\Data\ApiKeys}:
1212
*
1313
* - `FS` — standard scheme. Used when the pair contains distinct
1414
* public and secret keys (install / user scope).
@@ -19,20 +19,20 @@
1919
* The signature input is `METHOD\nMD5(body)\nCONTENT_TYPE\nDATE\nRESOURCE_URL`
2020
* matching the official Freemius SDK behaviour.
2121
*
22-
* @link https://duckdev.com/
22+
* @link https://foxelabs.com/
2323
* @license http://www.gnu.org/licenses/ GNU General Public License
2424
* @author Joel James <me@joelsays.com>
2525
* @since 1.0.0
2626
* @package Freemius
2727
* @subpackage Api
2828
*/
2929

30-
namespace DuckDev\Freemius\Api;
30+
namespace FoxeLabs\Freemius\Api;
3131

3232
// If this file is called directly, abort.
3333
defined( 'WPINC' ) || die;
3434

35-
use DuckDev\Freemius\Data\ApiKeys;
35+
use FoxeLabs\Freemius\Data\ApiKeys;
3636

3737
/**
3838
* Class RequestSigner.

src/Api/SignedClient.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@
33
* Signed Freemius API client.
44
*
55
* Extends {@see Client} with FS / FSP authenticated headers. Each
6-
* instance carries its own {@see \DuckDev\Freemius\Data\ApiKeys}
6+
* instance carries its own {@see \FoxeLabs\Freemius\Data\ApiKeys}
77
* pair — the credentials are never shared between clients, which is
88
* the fix for the credential-leak bug that the singleton-based
99
* pre-refactor `Api::get_auth_instance()` suffered from.
1010
*
1111
* Instances are normally obtained from {@see ApiFactory} rather than
1212
* constructed directly.
1313
*
14-
* @link https://duckdev.com/
14+
* @link https://foxelabs.com/
1515
* @license http://www.gnu.org/licenses/ GNU General Public License
1616
* @author Joel James <me@joelsays.com>
1717
* @since 1.0.0
1818
* @package Freemius
1919
* @subpackage Api
2020
*/
2121

22-
namespace DuckDev\Freemius\Api;
22+
namespace FoxeLabs\Freemius\Api;
2323

2424
// If this file is called directly, abort.
2525
defined( 'WPINC' ) || die;
2626

27-
use DuckDev\Freemius\Data\ApiKeys;
27+
use FoxeLabs\Freemius\Data\ApiKeys;
2828

2929
/**
3030
* Class SignedClient.

src/Contracts/ApiClientInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
* API client contract.
44
*
55
* Describes the minimal verb surface that the Freemius API clients in
6-
* the {@see \DuckDev\Freemius\Api} namespace expose to the rest of
6+
* the {@see \FoxeLabs\Freemius\Api} namespace expose to the rest of
77
* the library. Services depend on this interface rather than on a
88
* concrete client so they can be unit-tested with a mock.
99
*
1010
* Every method returns either the decoded JSON payload as an
1111
* associative array or a {@see \WP_Error} when the request fails or
1212
* the API returns an error envelope.
1313
*
14-
* @link https://duckdev.com/
14+
* @link https://foxelabs.com/
1515
* @license http://www.gnu.org/licenses/ GNU General Public License
1616
* @author Joel James <me@joelsays.com>
1717
* @since 1.0.0
1818
* @package Freemius
1919
* @subpackage Contracts
2020
*/
2121

22-
namespace DuckDev\Freemius\Contracts;
22+
namespace FoxeLabs\Freemius\Contracts;
2323

2424
// If this file is called directly, abort.
2525
defined( 'WPINC' ) || die;

src/Contracts/CacheInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
* `is_duplicate_request()` / `set_request_time()` helpers from the
1414
* pre-refactor base class.
1515
*
16-
* @link https://duckdev.com/
16+
* @link https://foxelabs.com/
1717
* @license http://www.gnu.org/licenses/ GNU General Public License
1818
* @author Joel James <me@joelsays.com>
1919
* @since 1.0.0
2020
* @package Freemius
2121
* @subpackage Contracts
2222
*/
2323

24-
namespace DuckDev\Freemius\Contracts;
24+
namespace FoxeLabs\Freemius\Contracts;
2525

2626
// If this file is called directly, abort.
2727
defined( 'WPINC' ) || die;

src/Contracts/ServiceInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/**
33
* Service contract.
44
*
5-
* Every service registered with the {@see \DuckDev\Freemius\Freemius}
5+
* Every service registered with the {@see \FoxeLabs\Freemius\Freemius}
66
* container implements this interface. Two responsibilities are
7-
* captured here: exposing the {@see \DuckDev\Freemius\Data\Plugin}
7+
* captured here: exposing the {@see \FoxeLabs\Freemius\Data\Plugin}
88
* the service belongs to, and a deferred {@see ServiceInterface::boot()}
99
* hook where WordPress filters/actions are registered.
1010
*
@@ -13,20 +13,20 @@
1313
* library safe to wire up early in the request lifecycle and trivial
1414
* to test in isolation.
1515
*
16-
* @link https://duckdev.com/
16+
* @link https://foxelabs.com/
1717
* @license http://www.gnu.org/licenses/ GNU General Public License
1818
* @author Joel James <me@joelsays.com>
1919
* @since 1.0.0
2020
* @package Freemius
2121
* @subpackage Contracts
2222
*/
2323

24-
namespace DuckDev\Freemius\Contracts;
24+
namespace FoxeLabs\Freemius\Contracts;
2525

2626
// If this file is called directly, abort.
2727
defined( 'WPINC' ) || die;
2828

29-
use DuckDev\Freemius\Data\Plugin;
29+
use FoxeLabs\Freemius\Data\Plugin;
3030

3131
/**
3232
* Interface ServiceInterface.
@@ -51,7 +51,7 @@ public function get_plugin(): Plugin;
5151
/**
5252
* Register WordPress hooks for the service.
5353
*
54-
* Called once by {@see \DuckDev\Freemius\Freemius::boot()} after
54+
* Called once by {@see \FoxeLabs\Freemius\Freemius::boot()} after
5555
* every service has been constructed. Implementations may early
5656
* return when there is nothing to register (for example when the
5757
* host plugin is the free build).

0 commit comments

Comments
 (0)