Helpful | Please Update Transient Expiration Time
-
Good Day,
Please update your file,
analytify-general.php
(code lines 69, 734, and 735), to shorten the analytify_transient expiration time from ten (10) hours to one (1) hour.Ten (10) hours is too long for busy websites and/or e-commerce websites.
To assist you, here’s what needs to be done:
- Affected File:
/wp-conten/plugins/wp-analytify/analytify-general.php
- Line 69 (replace with):
$this->transient_timeout = 60 * 60 * 1; // (was) 60 * 60 * 12
- Line 734 (replace with):
// if cache is on set cache time to 1 hour (was 10 hours) else 24 hours.
- Line 735 (replace with):
$cache_time = $this->settings->get_option( 'delete_dashboard_cache','wp-analytify-dashboard','off' ) === 'on' ? 60 * 60 * 1 : 60 * 60 * 24; // first parameter (was) 60 * 60 * 10 (ten hours)
The above will ensure Google Analytics stats shown in your dashboard and widgets are updated every hour, instead of ten hours.
Also, for websites hosted by SiteGround and/or using the plugin, SG Optimizer, the following is recommended to ensure the above works without a flaw:
- Disable MemCached (via Site Tools and within the plugin)
- Set Heartbeat as follows: Admin: Enabled (30s, 60s, 90s, or 120s); Posts and Pages: 120s, Frontend: Disabled
Useful: SiteGround Support indicated that for Transients to work properly, Heartbeat (Admin) needs to be enabled at all times — even though their plugin recommends disabling it.
We implemented the above 12 months ago with no issues. For those who are wondering, disabling Memcached should not significantly impact website performance. All the contrary, when Memcached is disabled, website performance could actually increase both in the back end and front end.
Hope this helps both you and the community.
Thank you!
- Affected File:
- The topic ‘Helpful | Please Update Transient Expiration Time’ is closed to new replies.