• Hi,

    I noticed that stats values bellow some pages/posts remain at small numbers (for example “1”, “5”, etc.). I searched for the cause and I found that these items have duplicated “views” meta_key. Several items had 5 or 7 meta_keys “views”. And when any item had more than one meta_key “views”, then function the_views() showed only “1” views (on frontend and also in administration) even if the value for duplicated meta_key was right, for example 3456.

    Any idea, why meta_key is duplicated sometimes?

    Thank you for your help!

    https://www.ads-software.com/plugins/wp-postviews/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Lester Chan

    (@gamerz)

    Actually, I have no idea why some meta_key will be duplicated, by right it shouldn’t because in the code I am already passing in unique to true to WP. I know some rare users encounter this, but on my 3 installation of WP and my development, so far I have not encountered it yet.

    Thread Starter pavelevap

    (@pavelevap)

    Thank you for your answer!

    Yes, I went through plugin code and I did not found any related issues. I thought using add_post_meta() for publish_post action can make problems, but there is also true parameter, so new meta should not be created. I thought somebody publish post, then mark it as draft and then publish it once again…

    Do you have some details about other affected users? Maybe we have similar environment or something else…

    I am using W3 Total Cache, maybe somehow related?

    Plugin Author Lester Chan

    (@gamerz)

    ” I thought somebody publish post, then mark it as draft and then publish it once again” – I don’t think so because if you publish it again the add_post_meta() will fail.

    On 1 of my site, I am using W3 Total Cache, but I add post meta to the ignored query stem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Some posts and pages do not count’ is closed to new replies.