Skip to content

New Garbage Collector system and various bug fixes

Compare
Choose a tag to compare
@swashata swashata released this 30 Oct 12:02
· 94 commits to master since this release
8a2bb8f

We are pleased to announce the release of v2.6.0 of our WP SDK, of which the main highlight is the new Garbage Collector system. You can find more details below.

Garbage Collector

Following our efforts to reduce the storage space required by the Freemius SDK, we’ve introduced a Garbage Collector system. The system will proactively check for inactive products and will clean their data from the storage.

Since this is a new beta feature, it is currently opt-in only. To turn on the system, you need to define the following constant before you load the Freemius integration code:

if ( ! defined( 'WP_FS__ENABLE_GARBAGE_COLLECTOR' ) ) {
    define( 'WP_FS__ENABLE_GARBAGE_COLLECTOR', true );
}

It can be placed inside the main plugin file or functions.php of a theme before the require of Freemius SDK.

By default, the Garbage Collector will run once every day and will clear data of any plugins/themes that have not been active for more than 1 week.

You can configure the expiration time with another constant:

// Set expiration time to 30 days
if ( ! defined( 'WP_FS__GARBAGE_COLLECTOR_EXPIRATION_TIME_SECS' ) ) {
    define( 'WP_FS__GARBAGE_COLLECTOR_EXPIRATION_TIME_SECS', ( 30 * 24 * 60 * 60 ) );	
}

We invite the community to enable this on their product and help us test it in the wild. Please note that:

  1. Enabling the Garbage Collector in one product will result in it being activated for all Freemius products in the same WordPress instance.
  2. Since the initial activation of the Garbage Collector system, all inactive data will stay for WP_FS__GARBAGE_COLLECTOR_EXPIRATION_TIME_SECS time before being deleted.
  3. In the next release, we will make the Garbage Collector system activated by default.

Fix conflict between new block theme loader

We found an issue in WP 6.3 where previewing a block theme became broken. We’ve identified the root cause and have included a fix.

Fixed retrieval of affiliate email address

If the user hadn’t opted in, we relied on the application form to determine their email. There was an error in the system that didn’t account for the email address from the form. This has been fixed.

Fixes of PHP 8.2 related notice

We found an edge case where configuring the navigation with tabs could trigger a PHP notice. Similarly, we found another use case in which the site is configured with relative URLs that could trigger another kind of PHP notice while trying to parse the URL. We’ve identified the causes and have included a fix.

License activation link in the duplication website notice

We found a regression where the license activation link in the duplication website notice (clone resolution) wasn’t working. We fixed it and also improved the UX to show a spinner while the system is working.