• Resolved rafibanek

    (@rafibanek)


    Hello, can someone help me and tell me why the WordPress Popular Posts plugin does not update the number of views of my posts on the website, although when I go to its settings, the number of posts looks correct. I also noticed that he does not count the views of my posts on social media, as if these links were not taken into account. What should I change in the plugin settings so that it returns to its previous state and the view counter under the articles on the website is constantly updated by WPP? e.g. the last article about a funeral on the website has about 100 views, while in the WPP plugin settings it has over 2,300 views, and on Facebook it has over 10,000 views. Why doesn’t it show me the actual number of views under the article headline or doesn’t it update it continuously? I didn’t have this problem before. It’s urgent! Please help!

    • This topic was modified 1 year, 3 months ago by rafibanek.
    • This topic was modified 1 year, 3 months ago by rafibanek.

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

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

    (@hcabrera)

    Hi @rafibanek,

    can someone help me and tell me why the WordPress Popular Posts plugin does not update the number of views of my posts on the website, although when I go to its settings, the number of posts looks correct.

    Just checked one of your articles and WordPress Popular Posts tracked my visit as expected.

    What makes you think it’s that not “updating” the views count?

    I also noticed that he does not count the views of my posts on social media, as if these links were not taken into account.

    WordPress Popular Posts only tracks views generated on your own site so I’m not sure what you mean.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Oh, I was too quick to comment.

    Why doesn’t it show me the actual number of views under the article headline or doesn’t it update it continuously? I didn’t have this problem before.

    It’s because you’re using a caching plugin on your site. More specifically, W3 Total Cache.

    Caching plugins basically generate a static HTML version of your posts & pages, that’s how your site can load faster than without using them.

    The side effect of this is that anything that’s not loaded on page dynamically (via AJAX) will not update until the page cache expires. And, from the looks of it, the views counter under your article headline is not being loaded via AJAX and so W3 Total Cache is rendering the cached version of the views count instead of the actual one you that see on the Stats page.

    The solution here is to update your theme so the views counter under the headline is rendered via AJAX. Please reach out to the developer who built your theme and ask them to implement this feature for you.

    • This reply was modified 1 year, 3 months ago by Hector Cabrera. Reason: reworded some bits for clarity
    Thread Starter rafibanek

    (@rafibanek)

    First of all, thank you @hcabrera for your quick reply. I’ll explain what I mean in a moment if I haven’t made myself clear. I am currently using the ColorMag Pro theme from ThemeGrill on my website. I noticed a certain pattern a long time ago – when I published my articles on Facebook that I had previously posted on the website, the number of views of these entries on my website increased very quickly. This is not currently the case, so I asked what the reason could be. I guess that’s why you’re linking to posts from your site on social media, to ultimately drive traffic to your site, right? You are right, I am using the W3 Total Cache plugin. It looks like the view counter under the article header is not being loaded via AJAX – that’s exactly what I mean, as everything was rendered on the fly before. See attachments – on the main page I only have 100 views of the article, and in the WPP plugin settings it shows me almost 2500 of the same post – and I don’t understand why under the heading it doesn’t show the number 2488, but 101! The ColorMag Pro theme is updated very frequently. I have already informed the manufacturer about my problem, but I do not yet have an answer on how to solve it. I understand that I can’t change it in the settings of the WPP plugin itself, can only a theme update help? Best regards @hcabrera and thank you for your time, Rafi

    Plugin Author Hector Cabrera

    (@hcabrera)

    I noticed a certain pattern a long time ago – when I published my articles on Facebook that I had previously posted on the website, the number of views of these entries on my website increased very quickly. This is not currently the case, so I asked what the reason could be. I guess that’s why you’re linking to posts from your site on social media, to ultimately drive traffic to your site, right?

    Ah, I see. In that case yes, you’re correct, traffic from external sites should count as well as long as your actual articles load in browser when the visitor clicks on a Facebook link for example. If that’s not the case you’ll want to document which articles are seemingly being affected, check for error codes on your browser console and/or server log, etc. to see whether there are any issues that could be preventing WPP from tracking some of these visits.

    It looks like the view counter under the article header is not being loaded via AJAX – that’s exactly what I mean, as everything was rendered on the fly before.

    I suppose you probably were not using a caching plugin before? Either that or something happened on the theme side. If I had to guess I’d say that it’s the former and that you’re noticing these views-count-not-updating issue now that W3 Total Cache is installed on your site.

    I understand that I can’t change it in the settings of the WPP plugin itself, can only a theme update help?

    Yes, the theme would need to somehow load the views counter via AJAX so it doesn’t get cached by W3TC.

    Alternatively, you could also:

    • consider disabling the W3TC plugin altogether, that way all of your content would be rendered dynamically instead of it being static, including the views counter (keep in mind though that you’d be trading page loading performance for a “live” views counter); or
    • consider reducing the W3TC’s page cache expiration time (eg. have it expire on an hourly basis), that way your views counter will only be cached for a short period of time (eg. one hour).

    The last option is what I would probably pick while waiting for a response from the ThemeGrill support team. If displaying live numbers is a must though then you’ll want to choose either of the other two solutions listed above.

    • This reply was modified 1 year, 3 months ago by Hector Cabrera. Reason: Reworded for clarity
    Thread Starter rafibanek

    (@rafibanek)

    Ah, I see. In that case yes, you’re correct, traffic from external sites should count as well as long as your actual articles load in browser when the visitor clicks on a Facebook link for example. If that’s not the case you’ll want to document which articles are seemingly being affected, check for error codes on your browser console and/or server log, etc. to see whether there are any issues that could be preventing WPP from tracking some of these visits.

    @hcabrera the problem applies to all articles I post on Facebook – the WPP plugin unfortunately does not count clicks on links on FB. By the way, how can I check the error codes in the browser console and/or server log – can you give an example using Firefox?

    I suppose you probably were not using a caching plugin before? Either that or something happened on the theme side. If I had to guess I’d say that it’s the former and that you’re noticing these views-count-not-updating issue now that W3 Total Cache is installed on your site.

    I was previously using the Lite Speed ​​​​Cache plugin and the views were constantly updated under the post headers, but I replaced it with W3 Total Cache as it is more recommended.

    consider reducing the W3TC’s page cache expiration time (eg. have it expire on an hourly basis), that way your views counter will only be cached for a short period of time (eg. one hour).

    when it comes to reducing the page cache expiration time in the W3TC plugin, where exactly can I find this option to set the cache to expire every hour?

    @hcabrera, ending our discussion, thank you again for all your advice, I will let you know when ThemeGrill responds to me

    Plugin Author Hector Cabrera

    (@hcabrera)

    @hcabrera the problem applies to all articles I post on Facebook – the WPP plugin unfortunately does not count clicks on links on FB.

    Could you please send me a message using my contact form to share more details about this? I’d like to see an example of this and I’m thinking that I might need to see an actual post on Facebook and maybe you’d prefer to handle that privately? (Unless you don’t mind posting a link to a FB post here in which case you don’t need to contact me privately.)

    By the way, how can I check the error codes in the browser console and/or server log – can you give an example using Firefox?

    Here’s Firefox official docs on opening (and using) the console.

    Regarding the server logs it’s probably best to check your hosting provider’s documentation. Some hosting providers have built-in tools that let you access server logs easily while others don’t. You may also want to consider reaching out to your hosting provider’s support team for assistance with this.

    What you need to do:

    1. Go to Facebook and click on one of your article links.
    2. Once the link loads, open the browser console and see if there are any error messages being logged. Document them somewhere (screenshots and/or screen recordings.)
    3. Optional but recommended, check your server logs as well and upload the contents to pastebin.com and share the link here.

    I was previously using the Lite Speed ​​​​Cache plugin and the views were constantly updated under the post headers, but I replaced it with W3 Total Cache as it is more recommended.

    when it comes to reducing the page cache expiration time in the W3TC plugin, where exactly can I find this option to set the cache to expire every hour?

    I guess you were probably using a lower cache lifetime with LSC then? Or perhaps you were having the same issue with LSC but you only really noticed it after switching to W3TC?

    Anyways, I believe that the cache expiration time for W3TC is set via Performance > Page Cache > Advanced > Garbage Collection Interval. Do reach out to the W3TC team to confirm though, I’m not 100% sure.

    Thread Starter rafibanek

    (@rafibanek)

    @hcabrera thank you very much for all your advice, I will contact you soon, Rafi from Poland

    Thread Starter rafibanek

    (@rafibanek)

    As for the garbage collection interval of the W3 Total Cache plugin, it was already set to 3600 seconds by default. I’m also attaching a screenshot from the browser console, but I don’t know if it will tell you anything.

    I will contact Theme Grill and ask them to update the MagPro theme so that the view counter under the header is rendered via AJAX. I will let you know what they answer, we will contact you if necessary, best regards, Rafi

    Plugin Author Hector Cabrera

    (@hcabrera)

    Marking this topic as resolved since OP’s issue is being caused by the theme caching the views count. The theme -as noted here– need to be updated so it loads its views counter via AJAX to avoid caching.

    Also, WPP was tracking visits from FB links normally after testing. OP probably has a different issue affecting their views statistics (probably caching related too.)

    OP, if you need assistance with anything else related to the plugin please feel free to leave a comment below.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘problem with updating post views’ is closed to new replies.