Support » Plugin: WP-PostViews » Any reason it would miss counts?

  • Had a situation earlier today where the view count stopped completely for about a half and hour.

    Once we hit edit, and then closed out without updating, it began counting again.

    We know this was getting views as the outbound link clicks for Facebook and Twitter posts (with the link being this post) were climbing in real time during that period.

    Not using a cache, only opcache at server level for php generation.

    We are using NGINX, but not caching full HTML pages. Just for static files like images.

    WP_CACHE is not set in config file.

    We are displaying the views via a manual call to the postmeta views column within the loop for each story.

    genesis_get_custom_field(‘views’) – which is just a fancy version of get_post_meta($post_id, $key, $single);

    So, is there any situation where page views could stop/hang, without any other kind of site error happening?

    Could the constant requests for data from the postmeta table for display purposes cause the miss of recording a view?

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

    (@gamerz)

    A view is counted when a page refresh is made. The action is hook onto wp_head. You can step through the function here https://github.com/lesterchan/wp-postviews/blob/master/wp-postviews.php#L50. You have to see which lines it breaks at.

    So, if wp_head finishes loading, then the view is counted, supposedly.

    RE:

    A view is counted when a page refresh is made.

    I assume you also mean when an initial page load is made? Like, if you directly jump into /2017/02/08/test-post-1234/ by typing it manually? That gets counted as well, correct?

    I’ve gotten no errors, silent or front facing. Nothing in logs. Just missed recording of views. Trying to figure out why.

    Plugin Author Lester Chan

    (@gamerz)

    I assume you also mean when an initial page load is made? Like, if you directly jump into /2017/02/08/test-post-1234/ by typing it manually? That gets counted as well, correct?

    Correct.

    I would suggest doing a var_dump() in the function I mentioned above to see if the function actually runs.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Any reason it would miss counts?’ is closed to new replies.