WordPress.org

Ready to get started?Download WordPress

Forums

Popular Posts Tabbed Widget for Jetpack
[resolved] Double Posts Displayed on Selected (12 posts)

  1. zgambler
    Member
    Posted 1 year ago #

    Here's my site: http://soundisstyle.com

    Whenever I'm viewing a single post, that post I'm on shows up in the second slot of the popular list, no matter if it was originally on the list or not (sometimes resulting in duplicates). Is that normal / how can I fix it?

    http://wordpress.org/extend/plugins/popular-posts-tab-widget-for-jetpack/

  2. ksm730
    Member
    Posted 1 year ago #

    I am having the same issue, except the active post shows in the first slot on the popular or latest post list. Any help is appreciated! http://modernlywed.com

  3. Enterpr1se
    Member
    Posted 1 year ago #

    I have same problem too.
    When I get into first page, last post in will show as the most popular post.
    When I get into any post, that post will become the most popular post.
    Is there any solution?
    Thanks
    http://www.enterpr1se.info

  4. Ryann Micua
    Member
    Plugin Author

    Posted 1 year ago #

    hmmmm.. I can't duplicate your issues. I also use the plugin on my web site: http://pogidude.com/

    Only thing I can think of is that something is filtering the post queries either through another plugin or the theme itself.

    OR

    It could be the update to the plugin. In the popular posts widget, there is an option to select a default date range. Could you guys try *saving* the widget again? that could be what's wrong with @ksm730 and @Enterpr1se. But that's just a hunch.

    Another thing I do to check that the popular posts list is correct is I go to Jetpack Stats in the admin, look at the Top Posts and Pages widget, and click on Summaries. It will initially list popular posts for the last 7 days by default. Oh yeah, this will also list pages too, whereas my plugin only lists blog posts.

  5. Enterpr1se
    Member
    Posted 1 year ago #

    I tried all date range, daily, weekly, monthly and all, it have same issues.

    I tried click on Summaries and it display correctly. But the most popular post is "Home page / Archives", will it afferect?

    When I load the post / home age, the popular posts will have duplicate problem, if I click on "TODAY, WEEK, MONTH, ALL", the plugin will load again and display correctly.

  6. Enterpr1se
    Member
    Posted 1 year ago #

    After some tests, I believe the plugin haven't filter out "Home page / Archives"
    When that page is not in top 5 (I set the plugin display top 5 only), the Popular Posts Tabbed work normal. If the "Home page / Archives" in top 5, the post you watching will replace the "Home page / Archives" position.

    This will only happen when the page load.
    After the page finished loading, you click on the plugin "today", "week", etc, it will not use the post you watching to replace "Home page / Archives" position

  7. Ryann Micua
    Member
    Plugin Author

    Posted 1 year ago #

    Not really sure about the filtering thing since there's nothing to filter. Here's how the popular tab works:

    1. Get the list of popular posts in the last X days. Depending on your settings, it could be all, 30, 7, or 1 day. This is done using the stats_get_csv() function from Jetpack itself. What the plugin gets in return is a mixed list of pages and posts ordered by number of views. Limit of posts/pages list returned is 50.

    2. The plugin then grabs all the post IDs from the list and store it as a comma separated list of IDs. This is for step #3.

    3. call get_posts() function passing in the list of IDs (which is list returned by jetpack stats) for the function to know which posts to get. This is not stored anywhere. This is only done for WP's built-in caching system. This is in preparation for the next step which could be resource intensive if we don't do this step.

    4. From the list of popular posts (from #1), for each item on the list do the following: get all data for the current item i.e. title, ID, type etc..., if it is NOT a blog post, continue on to the next item. If it is a blog post, store all the needed data for this item, then go to the next item on the list. Repeat until you get 5 blog posts (or whatever setting you set).

    The only place where the order of the posts are manipulated is in #1, and that is done using a JetPack function. The only other thing I can think of is because the JetPack function caches it's data. also, how long have you had Jetpack activated? Just checked out your site and the widget is showing the list consistently now. I assume you have set the Popular Posts Date Range to Daily?

  8. Ryann Micua
    Member
    Plugin Author

    Posted 1 year ago #

    Hi @all, the double posts issue was my fault :D sorry. One tiny detail I forgot regarding the homepage thanks to @Enterpr1se for helping me pointed to the right direction.

    anyway, I've created a patch, but I can't get it to WordPress.org so I've uploaded the patched version at http://pogidude.com/plugins/popular-posts-tabbed-widget-for-jetpack/ for now. I'll push out an official update as soon as I can.

    Thanks all for!

  9. Ryann Micua
    Member
    Plugin Author

    Posted 1 year ago #

    I can't get it to wordpress.org yet as I'm currently on the road. no dev tools :D

  10. Enterpr1se
    Member
    Posted 1 year ago #

    Thanks so much, it works great now, no more double post.
    So happy I can help you debug :-)

  11. Enterpr1se
    Member
    Posted 1 year ago #

    May I ask the plugin will affected by time zone?
    It seems the plugin will not update at midnight (jetpack data had updated), but the plugin will update at the morning, at about 9am in my time zone (+8)

    I tried clear all cache, both w3tc and browser cache, but no luck.
    I will do more test to figure out what happen.

  12. Ryann Micua
    Member
    Plugin Author

    Posted 1 year ago #

    If you downloaded the patched version from http://pogidude.com/plugins/popular-posts-tabbed-widget-for-jetpack/ you won't see any update notice since since I haven't changed the version numbers.

    I'll push out an official update via wordpress.org and you should see the update notice by then.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.