Freemius / wordpress-sdk

https://freemius.com
GNU General Public License v3.0
258 stars 76 forks source link

Version 2.6.2 #680

Closed swashata closed 6 months ago

swashata commented 6 months ago

Enable garbage collector by default

Starting v2.6.2 we have enabled the garbage collector system by default. More information about it can be found here.

If for some reason you want to explicitly disable it (for example, while you are developing something locally), you can do so by defining this constant in your wp-config.php file.

// Disable Freemius WP-SDK Garbage Collector
if ( ! defined( 'WP_FS__ENABLE_GARBAGE_COLLECTOR' ) ) {
    define( 'WP_FS__ENABLE_GARBAGE_COLLECTOR', false );
}

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 ) );   
}