• Dear Sir,

    The Top Ten plugin stops working after installing WPRocket.

    What is the best settings to make it work with WPRocket?

    I appreciate your support.

    Cheers

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter daro2013

    (@daro2013)

    Update: Top 10 plugin works on the background and inside Admin bar. But it does not show view count increase on Front end using this code is the single file:

    <?php echo do_shortcode(“[tptn_views]”); ?>

    When I cleared WPRocket, it shows count increases, but not live count as shown inside WP Admin.

    Is there any way of showing view counts on Front End?

    Cheers

    Plugin Author Ajay

    (@ajay)

    I don’t have WP Rocket, so not able to debug.

    Can you try activating: Counter/Tracker > Always display latest post count

    Thread Starter daro2013

    (@daro2013)

    Hi Sir,

    I am very sorry for very late reply as I thought no one has seen my message or reponded to it.

    Yes, I activated Counter/Tracker –> Always display latest post count

    but the Top Ten plugin does not update its count on the single page:

    Can I send you, by email, the details with credentials so that you could help debug it?

    Cheers
    Thon

    Plugin Author Ajay

    (@ajay)

    @daro2013

    I’m afraid I won’t be able to do that with credentials. However, with the setting on, if you can post the link here, I’ll take a look.

    Thread Starter daro2013

    (@daro2013)

    Hi sir,

    Thank you for your reply.

    Here is the page where I place Top Ten plugin post view counter:

    https://www.bn3dfgt5.info/item/khmer-supermarket/

    If you refresh the page above, the Top Ten plugin stops counting the post views after I installed WP-Rocket plugin. If I remove or deactivate WP-Rocket, Top Ten plugin starts to count again.

    I very appreciate if you help guide on how to fix the above issue.

    Cheers

    Plugin Author Ajay

    (@ajay)

    @daro2013

    I just checked that page and can see that the tracking is working – I checked the ajax response on the page and it gives the necessary output.

    But I don’t see how you’ve done that output which shows the number of views. It looks like a custom install?

    Thread Starter daro2013

    (@daro2013)

    Hi Ajay,

    Thank you for your help.

    I have used The plugin’s short code to display the number of post view count like below:

    <?php echo do_shortcode(“[tptn_views]”); ?>

    in a php template file.

    Is that correct code?

    Cheers

    Plugin Author Ajay

    (@ajay)

    Hi, sorry I missed that – you had said it earlier.

    I think that is the issue as the shortcode calculates and then WP Rocket will cache the page.

    Do you know if there is a way for WP Rocket to exclude caching of certain shortcodes?

    Thread Starter daro2013

    (@daro2013)

    Hi Ajay,

    I did ask them about that issue, but one of the wp-rocket seems not be able to fix it.

    Update: I did try the FRESH installation of the theme without other custom codes in functions.php and stylesheet, it seems working here:

    https://akmj3ewu.info/item/le-colonial/

    You can refresh the above page, the count keeps increasing – Top Ten plugin does work very well.

    Then I tried to deactivate all third party plugins and remove all custom codes from the live site, Top Ten plugin still does not work or count the number of post views?

    There must be a culprit somewhere in the codes which can be fixed?

    Cheers

    Plugin Author Ajay

    (@ajay)

    In that fresh install, do you have WP Rocket installed and is this caching the page properly? I did notice the count updating.

    Can you please also check what is different that that piece of code, including the few surrounding items.

    I’ve never used WP Rocket so no idea how it works.

    One option would be write custom Ajax code to pull out the count from the database.

    Thread Starter daro2013

    (@daro2013)

    Hi Ajay,

    Yes, WP Rocket is installed on that fresh theme website above. Top Ten plugin works well without issue, but it does not work on my live site with the same WP Rocket installed and activated.

    Please note that if I remove WP Rocket on my live site, Top Ten plugin does work. It seems that not the custom codes or third party plugins cause such issue; WP Rocket may cause random issues?

    Cheers

    Plugin Author Ajay

    (@ajay)

    It is actually weird to me that it works on your fresh install with WP Rocket enabled. While I don’t know WP Rocket, I’d expect it to cache the page completely including the code for the counter.

    If I look at your main site, I see this when I view the source of your page:
    <!-- This website is like a Rocket, isn't it? Performance optimized by WP Rocket. Learn more: https://wp-rocket.me - Debug: cached@1606293240 -->

    I don’t see this in your fresh install.

    Is that code for the counter same as the shortcode you pasted above in your previous replies?

    Can I understand what you mean by custom codes?

    I googled a bit and WP Rocket doesn’t support fragment caching so you’ll ajax to display the count live.

    One thing I am thinking of is to just use:

    
    <?php echo_tptn_post_count(); ?>
    

    You have the setting to always display the latest count active which is positive.

    Thread Starter daro2013

    (@daro2013)

    Hi Jay,

    Custom codes i mentioned are some custom codes created in functions.php and other php and javascript files created in child theme.

    I did try your code:

    <?php echo_tptn_post_count(); ?>

    and also set Ajax as you suggested. Top Ten does not count.

    Cheers

    Plugin Author Ajay

    (@ajay)

    It doesn’t look like it is live on the site:

    https://github.com/WebberZone/top-10/blob/master/includes/counter.php#L99

    You should see script codes rather than the number View counts: 76

    Can you disable WP rocket and check. You can enable it again once done

    Thread Starter daro2013

    (@daro2013)

    Hi sir,

    I have disabled WP Rocket. Top Ten plugin is now working – it increases the number of post views each time a browser is refreshed.

    Cheers

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Top Ten plugin stopping working after installing WPRocket’ is closed to new replies.