• Resolved vicetias

    (@vicetias)


    Hi again,

    I noticed that your plugin is not saving the stats in the meta key called ‘_postviews’, also after putting <?php echo do_shortcode( ‘[jp_post_view]’ ); ?> in single.php I am getting ‘no views’ in many posts.

    • This topic was modified 4 years, 5 months ago by Yui. Reason: sitelink

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    This may happen if your site is not properly connected to WordPress.com; the API calls do not return any data about the post and the views do not get updated.

    I would recommend that you disconnect and reconnect your site to WordPress.com and see if that helps.

    If you still experience issues, could you let me know your site URL and give me some examples of posts that don’t get updated so I can take a closer look?

    Thank you.

    Thread Starter vicetias

    (@vicetias)

    Ok, I disconnected and reconnected my site, then I checked Php my admin and this is what I’m getting:

    Screenshot

    My site is not on full production yet and I’m currently counting my own views.

    Moderator note: Link unshortened and added to 1st message of this topic.
    This field is not available for unauth’d users and is not indexed by search engines.

    • This reply was modified 4 years, 5 months ago by vicetias.
    • This reply was modified 4 years, 5 months ago by vicetias.
    • This reply was modified 4 years, 5 months ago by vicetias.
    • This reply was modified 4 years, 5 months ago by vicetias.
    • This reply was modified 4 years, 5 months ago by vicetias.
    • This reply was modified 4 years, 5 months ago by Yui. Reason: sitelink
    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    It does appear to work well right now. You can see the number of views currently saved for your example post here, in the “views” field:
    https://tendenlandia.net/wp-json/wp/v2/posts/1525?field=views

    I did note, however, that you have quite aggressive caching on your site right now; this may impact what you’re seeing on the front end of your site as old information may remain visible for a long time.

    I don’t see those views on the post’s page right now though: I see you seem to be using 2 other plugins to output view counters, but I don’t see the output from my plugin on your site right now. It may just be a caching issue, or maybe you’ve removed the shortcode?

    I would recommend tweaking your site’s caching so it doesn’t get in the way of your tests.

    Thread Starter vicetias

    (@vicetias)

    I have a WordPress managed hosting by GoDaddy and they run their own cache system and I can’t change it.

    So are you saying cache is causing that _post_views field isn’t getting updated properly in the database?

    And you can go to the amp version of this post to see the counter since I only added the shortcode to amp single at the moment.

    The other activated plugin right now is BEA post views counter and saves its data in a separated table on the database. And even with other similar old plugins to yours that also collect Jetpack views gave me that issue.

    So, what can I do? I can’t use the _post_views meta key to sort posts with that result.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    are you saying cache is causing that _post_views field isn’t getting updated properly in the database?

    The field is updated properly, but when you query the field for results on your site, you get a cached version of the results that may not reflect what’s saved in your database.

    So, what can I do?

    It may be worth reaching out to GoDaddy’s support team, they may be able to help you find ways to have a less aggressive caching on your site.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not saving in post meta’ is closed to new replies.