SLSWC caches many API responses and license queries in WordPress transients. Each cache has a filter that sets how long the cached value lives. All cache expiry filters accept and return an int (seconds).
Most of these caches are only written when Cache API responses is enabled at Settings > General (off by default). The Composer packages.json cache is always used when the Composer repository is enabled.
Server Filters
| Hook | Default | Description | File |
|---|---|---|---|
slswc_get_product_details_cache_expiry | 12h | Product details cache | class-slswc-api.php |
slswc_check_license_cache_expiry | 12h | License check cache | class-slswc-api.php |
slswc_check_for_update_cache_expiry | 12h | Update check cache | class-slswc-api.php |
slswc_activate_license_cache_expiry | 12h | Activation cache | class-slswc-api.php |
slswc_deactivate_license_cache_expiry | 12h | Deactivation cache | class-slswc-api.php |
slswc_customer_licenses_cache_expiry | 12h | Customer licenses list | class-slswc-api.php |
slswc_licenses_where_cache_expiry | 12h | Filtered licenses query | class-slswc-api.php |
slswc_get_expiring_licenses_cache_expiry | 12h | Expiring licenses | class-slswc-api.php |
slswc_is_license_expiring_cache_expiry | 12h | License expiry check | class-slswc-api.php |
slswc_total_licenses_cache_expiry | 12h | Total license count | class-slswc-api.php |
slswc_total_activations_cache_expiry | 12h | Total activations count for a product | class-slswc-api.php |
slswc_license_stats_cache_expiry | 1h | License stats summary | class-slswc-api.php |
slswc_licenses_for_order_cache_expiry | 12h | Licenses for an order item, and licenses for a product | class-slswc-api.php |
get_licensed_customer_ids_cache_expiry | 12h | Licensed customer IDs (note: no slswc_ prefix) | class-slswc-api.php |
get_licensed_customer_details_cache_expiry | 12h | Licensed customer details (note: no slswc_ prefix) | class-slswc-api.php |
slswc_get_expiring_customers_cache_expiry | 12h | Customers with expiring licenses | class-slswc-api.php |
slswc_signup_count_cache_expiry | 12h | Signup count for a date range | class-slswc-api.php |
slswc_renewal_count_cache_expiry | 12h | Renewal count for a date range | class-slswc-api.php |
slswc_get_customers_within_range_cache_expiry | 12h | Customer range query | class-slswc-api.php |
slswc_get_customers_at_start_cache_expiry | 12h | Customers at period start | class-slswc-api.php |
slswc_get_customers_at_end_cache_expiry | 12h | Customers at period end | class-slswc-api.php |
slswc_get_license_cache_expiry | 12h | Single license cache | class-slswc-license.php |
slswc_composer_packages_cache_expiry | 1h | Composer packages.json | class-slswc-composer-repository.php |
Tip:
slswc_deactivate_license_cache_expiry,slswc_get_expiring_customers_cache_expiry,slswc_signup_count_cache_expiryandslswc_renewal_count_cache_expiryare built from the plugin's configurable prefix. If you change the prefix with theslswc_slugfilter, these four hook names change with it. The other names are fixed.
Client Library Filters
The client library caches the local plugin and theme lists. These are documented with the other client hooks in the Hooks Reference: slswc_plugins_cache_expiry and slswc_themes_cache_expiry (default 2 hours each).
Customizing Cache Expiry
Reduce cache TTL for license checks during development, or increase it for high-traffic production sites:
// Reduce all license-related caches to 1 hour during development.
add_filter( 'slswc_check_license_cache_expiry', function ( $seconds ) {
if ( wp_get_environment_type() === 'development' ) {
return HOUR_IN_SECONDS;
}
return $seconds;
} );
// Extend Composer packages cache to 6 hours on production.
add_filter( 'slswc_composer_packages_cache_expiry', function ( $seconds ) {
return 6 * HOUR_IN_SECONDS;
} );