• Resolved Generosus

    (@generosus)


    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:

    1. Affected File: /wp-conten/plugins/wp-analytify/analytify-general.php
    2. Line 69 (replace with): $this->transient_timeout    = 60 * 60 * 1; // (was) 60 * 60 * 12
    3. Line 734 (replace with): // if cache is on set cache time to 1 hour (was 10 hours) else 24 hours.
    4. 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:

    1. Disable MemCached (via Site Tools and within the plugin)
    2. 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!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Generosus

    (@generosus)

    Update:

    Since the release of V5.0.2, affected code lines are 91, 1792, and 1793, respectively.

    Cheers ??

    Hi @generosus

    Reducing the time below 10 hours for transients expiration in the new GA4 is not recommended. The reason behind this recommendation is that the data in GA4 typically takes approximately 24 hours to process. Consequently, making new requests every hour would not be advantageous since the new data in GA4 becomes available only after this 24-hour processing period. However, we are hopeful that this processing time will decrease in the future.

    In response to user feedback and to provide greater flexibility, we have implemented a new filter in Analytify version 5.0.4 and above. By utilizing this filter, you can adjust the caching interval according to your specific requirements.

    To learn how to apply this new filter, please refer to the following documentation: Analytify Filters

    Let us know if you have any further questions.

    Thread Starter Generosus

    (@generosus)

    Hi @jawadwp,

    Excellent reply and technical solution.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Helpful | Please Update Transient Expiration Time’ is closed to new replies.