[Resolved] Double Posts Displayed on Selected
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?
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
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?
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.
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.
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.
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
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.
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?
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!
I can’t get it to wordpress.org yet as I’m currently on the road. no dev tools 😀
Thanks so much, it works great now, no more double post.
So happy I can help you debug 🙂
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.
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.
- The topic ‘[Resolved] Double Posts Displayed on Selected’ is closed to new replies.