Support » Plugin: Google Analytics Post Pageviews » Cache needs to be manually emptied

  • Resolved jukd

    (@jukd)


    Hi there,

    It seems like the pageviews cache needs to be manually emptied every day or else the stats won’t be up to date.
    The cache time I’m using is One Hour but it happens with the others too. I tried to play with the settings but it won’t help.
    I’ve also tried to manually refresh the API Token but this part seems to be working just fine.
    I don’t have any error message either.

    Do you have any idea why does the cache do that?
    Would it be possible to have an option making the cache empty itself?

    Merci d’avance 😉

    https://wordpress.org/plugins/google-analytics-post-pageviews/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author maximevalette

    (@maximevalette)

    Hi,

    > Would it be possible to have an option making the cache empty itself?

    It’s exactly the purpose of the cache expiration setting, the transient expires itself according to the duration you set.

    Playing with this setting won’t do anything directly since the transient expiration date is set once based on the setting, so if you set a 24 hour expiration the new transient will expire in 24 hours no matter if you change the setting to 1 hour just after.

    jukd

    (@jukd)

    Hi,

    I understand how the cache works.
    The problem I have is that no matter what time I choose for the cache to expire it doesn’t empty itself, I have to do it manually. I’ve always set it to one hour and it suddenly stopped working.

    Thanks

    Plugin Author maximevalette

    (@maximevalette)

    Maybe there’s something wrong with your WordPress setup, since as you said it worked before.

    getbrett

    (@getbrett)

    I am experiencing the same issue, the cache must be manually purged. It was previously working and has since broken (I am uncertain when, I suspect around the time WP 4.1 rolled out).

    Changing cache time doesn’t work, it’s been set to one hour and not changed since initial setup, but it will never clear on its own anymore.

    getbrett

    (@getbrett)

    Bug is on line 516:

    set_transient($gaTransName, $totalResult, 60 * 60 * $options[‘gapp_cache’]);

    (60 minutes expiration is instead translated to 3600 minutes/60 hours)

    Change line to:

    set_transient($gaTransName, $totalResult, 60 * $options[‘gapp_cache’]);

    (60 * 60 = 1 hour as expected)

    Plugin Author maximevalette

    (@maximevalette)

    Thanks for catching that! Just pushed the fix. Please update and let me know.

    getbrett

    (@getbrett)

    Plugin is working as expected with that change 🙂

    Plugin Author maximevalette

    (@maximevalette)

    Awesome!

    jukd

    (@jukd)

    Great!
    Thanks getbrett!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Cache needs to be manually emptied’ is closed to new replies.