@@ -4,7 +4,7 @@ A lite, UI-free Freemius SDK for Foxe Labs WordPress plugins. The library handle
44update delivery, and addon listing by talking to the Freemius API directly. It deliberately ships no admin screens —
55host plugins build their own UI and call into this library for the underlying logic.
66
7- 📖 ** Full documentation:** [ docs.foxelabs.com/software/wp-libraries/wp-freemius-client/overview ] ( https://docs.foxelabs.com/software/wp-libraries/wp-freemius-client/overview )
7+ 📖 ** Full documentation:** [ docs.foxelabs.com] ( https://docs.foxelabs.com/software/wp-libraries/wp-freemius-client/overview )
88
99## Requirements
1010
@@ -23,47 +23,11 @@ The library autoloads under the `FoxeLabs\Freemius\` namespace via PSR-4.
2323## Upgrading from 2.x
2424
2525> [ !WARNING]
26- > ** 3.0.0 renames the option that stores every license activation, and the library does not migrate it for you.**
27- > Skip the migration and there is no error: licenses silently read as inactive, activation UI resets, and premium
28- > update delivery stops.
26+ > 3.0.0 renames the option that stores license activations, and the library does not migrate it for you. Host plugins
27+ > must migrate the data themselves, or licenses will silently read as inactive.
2928
30- This release was renamed from ` duckdev/freemius-plugin-licensing ` , and the stored data moved with it:
31-
32- | | 2.x | 3.x |
33- | ---| ---| ---|
34- | Package | ` duckdev/freemius-plugin-licensing ` | ` foxelabs/wp-freemius-client ` |
35- | Namespace | ` DuckDev\Freemius\ ` | ` FoxeLabs\Freemius\ ` |
36- | Activation option | ` duckdev_freemius_activation_data ` | ` foxelabs_freemius_activation_data ` |
37-
38- The library performs no writes of its own — host plugins own the lifecycle — so each plugin must move the option in its
39- own upgrade routine. The stored shape did not change, so a straight copy is enough:
40-
41- ``` php
42- $legacy = get_option( 'duckdev_freemius_activation_data', null );
43-
44- if ( is_array( $legacy ) && ! empty( $legacy ) ) {
45- $current = get_option( 'foxelabs_freemius_activation_data', null );
46-
47- // Never clobber an activation created since the upgrade.
48- if ( ! is_array( $current ) || empty( $current ) ) {
49- update_option( 'foxelabs_freemius_activation_data', $legacy );
50- }
51-
52- delete_option( 'duckdev_freemius_activation_data' );
53- }
54- ```
55-
56- Three things to get right, whatever shape your upgrade routine takes:
57-
58- * ** Run it before the first read** — it must land before anything calls ` Freemius::get_instance() ` and reads a license.
59- * ** Don't clobber** — only write the new key when it is empty, or a site that already activated on 3.0 gets rolled back.
60- * ** Copy, verify, then delete** — use the options API, not a raw ` UPDATE wp_options SET option_name ` , which bypasses the
61- options cache and any persistent object cache.
62-
63- The ` duckdev_freemius_{plugin_id}_* ` transients need no migration — they are 24-hour addon caches that repopulate on the
64- next API call.
65-
66- 📖 Full recipe: [ Migrating from 2.x] ( https://docs.foxelabs.com/software/wp-libraries/wp-freemius-client/installation#migrating-from-2-x )
29+ See [ Migrating from 2.x] ( https://docs.foxelabs.com/software/wp-libraries/wp-freemius-client/installation#migrating-from-2-x )
30+ for the migration recipe.
6731
6832## Architecture
6933
0 commit comments