Is there any way to retrieve the most viewed articles of the main category of the post ?
]]>Hello and thank you for this great plugin!
My theme has a default counter which is not accurate and I want to replace it by this plugin.
I found the code in my theme as follow:
$output = '<span class="fa fa-eye"></span><span class="c5-views">' . $this->custom_number_format($count) . '</span>';
return $output;
}
I believe the counter is this portion:
$this->custom_number_format($count)
But when I replace it by:
get_post_meta( $post->ID, 'jetpack-post-views', true )
It doesn’t print anything.
Your help is highly appreciated!
I can see for a specific post from phpmyadmin that
jetpack-post-views-Day: 43
jetpack-post-views-Week: 43
jetpack-post-views-Month: 9
jetpack-post-views-day: 0
Is this normal?
Also is there any workaround with the 500 limit? I’ve read many posts but there not seems to be any answer.
If it is not possible to bypass the limitation how would you suggest to get the number of views for each post?
I want the text in the sidebar to be changed. I use the plugin in german that is called ?Jetpack: Beitragsaufrufe-Widget“.
For example the following text is displayed:
Gefüllte Ente klassisch mit Semmelkn?del – 646Ansichten
First the recipe title in blue, then the counted views in black.
How can I change the layout into:
? recipe title (number of views)
with a bullet point, without ?Ansichten“ (=?views“) and the whole text in blue?
Do I have to change a CSS file?
Best
Thobie
]]>Hi,
I hope you are having a good day
The plugin is just suddenly not working now and when visit the settings page and add appropriate details it still shows
Function stats_get_csv() exists
Can connect using Blog URI
Can connect using Blog ID
all in read color, ??
Thanks,
ryscript
Hi,I recently moved from WordPress.com to www.remarpro.com. Before the move I had read clearly that I would be able to move my Total Site Views from my old WordPress.com to www.remarpro.com blog . However, even after installing this plugin, I am only able to display total views of my new blog in www.remarpro.com (NailArtandBeauty.com). My old blog had around 75,000 site views. As of today I am able to see the consolidated “Total Site Views” from my previous blog (TheNailArtandBeautyDiaries.wordpress.com)and new blog (NailArtandBeauty.com) in my “Site Stats” section of “JetPack”.
But I am not able to display my “Total Views” on my new blog even after putting the “Site Stats” Widget. I can only see the new blogs stats which is around 18000 . But when I see total “All Time Views” on Site Stats
it is 86000+ , which is a combined views from my previous blog. I want to show THIS (86000+) on my site for my readers to see. This is what I had in my WordPress.com
Pls help me with this issue, I am kinna regretting the move to www.remarpro.com with this issue.
]]>Hello,
I am having a problem when total views are not updating. They stopped updating on 18/03/2014, 8 days ago. In the settings, all 3 options work fine. I am using the latest version of wordpress and the plugin and i have 330 posts.
]]>I have a site built on the Vantage theme, with a Listings CPT, and a number of custom fields.
I’ve installed Post-views, getting all green lights, but when I look at where i put the php code, it just says ‘array’.
Only other note is I am putting it on an list of posts based on an author signing in to see them. But its essentially a archive list using
while ( $listings->have_posts() ) : $listings->the_post();
so i don’t see that being much of a problem.
Any ideas on why its showing ‘array’? I’ve checked that jetpack is recording stats for the posts i’m checking.
]]>Hi there, I have alot of posts on my site and tried to activate this plugin but received this error message: Plugin could not be activated because it triggered a fatal error. Any ideas on this and how to get the plugin activated? Thanks in advance.
]]>Sorry if I’m just missing something obvious, but is there a way to reset all the counts easily?
Thanks.
]]>Hi Steven!
I have the following problem on my website.
I have a miltiauthor website and we recieve a lot of posts from our authors. Our editor uses the sheduled post function becouse it saves time for us.
Unfortunately when we started using sheduled post function I found out that published posts do not disply unlimited jetpack statistic. I use the following function:
get_post_meta( $post->ID, ‘jetpack-post-views’, true );
Although when I publush posts manually everything is fine.
I try to solve this problem by manually updating already published post. Only then the post count shows up.
I looked into database and saw that in the postmeta table after scheduled publishing of the post the ‘jetpack-post-views’ item is not created. Althought there are ‘jetpack-post-views-(daily,monthly,yearly)’ items.
Also when I preview any post which have not been published yet, I do not see post count.
I think this happens because the function that creates item in the postmeta database table is triggered only when the post in published manualy.
Could you please investigate this issue and advice how I can modify the code to trigger database updating function for scheduled posts published.
]]>Hello Steven, I fear something is not being correctly updated.
I’m having an issue similar to others reported here. Example:
I posted several articles in the last week, and it even get comments, but your counter show 0 visits for any of them.
I went to /wp-content/plugins/jetpack-post-views.php and set $DEBUG = true. I have 578 public posts, but the DEBUG info is telling that you are able to retrieve 598 using the JetPack API. And debug info is showing that those articles had more than 3 visits each. Althoug your plugin is showing zero.
I see the custom fields for those articles and i.e. they show:
jetpack-post-views = 0
jetpack-post-views-Day = 1
jetpack-post-views-Month = 3
jetpack-post-views-Week = 4
jetpack-post-views-Year = 3
The API is showing
[views] => 1
And in the posts list, your plugin show 0 visits.
I tested this for several other posts and the latest published show this issue on 5/7 posts.
In the other hand, there are old, very popular posts, where this mismatch doesnt happen. Example:
– API says: [views] => 44496
– Post page says: 44496
– Custom field: jetpack-post-views = 44496
I have latest version of WordPress, your plugin and JetPack plugin. is this a bug? May be that your plugin is not really updating the custom fields? I use Cloudflare for basic CDN and W3 Total Cache to cache html pages only. May some of the above effect the collecting of stats? A couple months ago this worked ok.
Any ideas?
Thanks
Validation errors with the widget.
Simple fix,
$alt_text = get_post_meta($post->ID, '_wp_attachment_image_alt', true);
Then adding that into the <img>
Lots of validation errors using the plugin. Mostly because the title
element needs to be URL Encoded.
Simple fix –
$title = urlencode(get_the_title( $post->ID ));
Cheers for the great plugin, really useful ??
]]>Hello!
I think the plugin should not try to retrieve anything during activation.
I have a website with 20k+ posts and while trying to activate, it always times out.
I think you should simply add a “pre-loader” in the plugin setup page, where admin can decide how many posts to check for views at a time, and then launch the view checker… otherwise it will keep crashing.
Is there an easy way to get rid of the separator lines in the Post Views widget?
I can’t seem to find the CSS that controls this.
Thanks,
Michael
]]>Hi Steven.
Great plugin. far away from my first attempt to do something like. ??
BTW, in my +9k posts blog the plugin is working ok, except for jetpack-post-views
custom field not being updated. The rest of customs are updating ok.
Any tips?
Best!
R
Hi everybody ??
I’ve noticed that the views count (after every post) is different from the real count in the dashboard.
I think there is a problem of updating.. Does anyone why?
Thanks!
]]>I’m trying to use this plugin in conjunction with the Code Snippets plugin so I don’t have to edit the underlying theme’s code. (My theme updates fairly frequently.) Thus I’m trying to put the view # code in the post text itself, not the underlying PHP code.
The normal
echo get_post_meta( $post->ID, ‘jetpack-post-views’, true );
code doesn’t work, I’m assuming because the $post variable doesn’t exist in the post text scope.
I then tried
echo get_post_meta( (int)the_ID(), ‘jetpack-post-views’, true );
but that only outputs the post ID. Running
echo (int)the_ID();
prints the post ID fine, so I know it’s getting the post ID okay. What’s going on?
]]>Hi ??
I’ve installed the plugin and added the widget with top posts.
Is it possible to view top pages too (in the same widget)?
Thanks a lot!
]]>Hi ??
I’m having troubles putting the code in the functions.php , can you help me? I would really appreciate it..
I’m talking about this code: <?php echo get_post_meta( $post->ID, 'jetpack-post-views', true ); ?>
and I think to have to put it here
// New PostFooter
function replacement_postfooter($postfooter) {
global $id, $post;
if ($post->post_type == 'page' && current_user_can('edit_posts')) { /* For logged-in "page" search results */
$postfooter = '<div class="entry-utility">' . thematic_postfooter_posteditlink();
$postfooter .= "</div><!-- .entry-utility -->\n";
} elseif ($post->post_type == 'page') { /* For logged-out "page" search results */
$postfooter = '';
} else {
if (is_single()) {
$postfooter = '<div class="entry-utility">' . thematic_postfooter_postcategory() . thematic_postfooter_posttags();
} else {
$postfooter = '<div class="entry-utility">' . thematic_postfooter_postcomments() . thematic_postfooter_postcategory() . thematic_postfooter_posttags();
}
$postfooter .= "</div><!-- .entry-utility -->\n";
$postfooter .= '<div class="divider"> </div>';
return $postfooter;
}
}
add_filter('thematic_postfooter','replacement_postfooter');
but I don’t know how nor where! ??
I hope you do, thanks a lot!
P.S. Beautiful plugin, I needed it!
Had a suggestion for this plugin.
With sites with more than 500 posts, say 24,000, this wouldn’t be too feasible.
What if you were to update the view count only when a post is viewed. Then, set a transient say for an hour or 24 hours depending on post age so next time the post is accessed, a function will check for the transient to see whether it should update or not.
]]>Is there any way to output the Total Number of Views on all posts?
]]>When we updated to version 1.09 on 12/8 our server crashed due to heavy load caused by the Object Cache. Not sure if it was the plugin, but it was the only thing I changed that day.
We disabled object cache on the server and things were fine. But since then no posts have updated their stats. I’ve updated the plugin to 1.10 earlier today but the stats for all the recent posts after 12/8 when we installed 1.09 are still showing as zero.
Jetpack Stats are tracking fine and all three connections are green in the settings page. Our site is large and has over 6000 posts.
Any help would be appreciated! Thanks,
]]>Hi,
Is it possible to sort views only by custom post type? I would like to exclude pages/posts.
Cheers
]]>I installed your plugin and it’s pretty awesome ??
Unfortunately it wasn’t updating the posts views(even after a couple of hours – I even made sure that the cron was actually running).
So, I looked at your code and I enabled debug and then I saw that cached data was returned to me – meaning I was only seeing stats for 2 posts, even though in the Jetpack stats I was seeing that more posts have views.
Initially I thought that the Jetpack Stats function is caching somewhere(even though the cache was never coming from the DB option cache), so I disabled the check for the stats_get_csv()
function so that the plugin would use your custom requests.
Here comes another small issue that I found – you set the default value for the blog_uri
option to get_bloginfo( 'wpurl' )
and that is different from home_url( '/' )
when you have your WordPress files in a different location. It seems though that Jetpack cares about the URL of the home page of the blog – so you should instead be using home_url( '/' )
.
After playing around with the custom requests I noticed that I’m always getting the same exact result. The problem in this case was that you were always querying for days=-1 – and it seems like wordpress.com has a pretty sturdy caching system(that’s to be expected), so you never get new results.
What I did to make things easier was to add a new property to the class called apiArgs
– it’s an array of key/value pairs and makes it much easier to construct URL’s, by utilizing WordPress’ add_query_arg()
function ??
So a couple of tweaks here and there and everything is working perfect on my end. Of course I don’t expect you to take my word for granted and I advise you on testing the code yourself, so that nothing goes wrong if you update the plugin and it suddenly breaks for someone.
You can find a diff of the latest version of the plugin(1.0.8) and my patched version here – https://www.diffchecker.com/gnc3km9f
If you have any questions about the patch, feel free to comment here.
]]>I installed this plugin and have two widgets, one for a Today’s Popular Post and Week’s Popular Posts. Everyday, sometime in the afternoon, all the stats inside the Today’s Popular Posts widget disappears, only to re-appear in the morning, I think after midnight. The Weekly stats works just fine, so I know it’s not a WordPress.com connection problem. Not sure what is causing and I am out of answers. I am connected to WordPress.com using an API key. FYI, I am on the Pacific time zone, just in case it’s related to the time zones.
]]>Hi,
I followed the instructions for installation and now it’s showing the total # of hits for each post at the top of the post, but it just has a number. How can I make it say “Total Views: #” ?
I have to change the line of code in my single.php file, right?
]]>The posts stats on the right hand side quit updating a while back. I tried removing & readding the widget but it didn’t fix it…?
]]>Jetpack Top Posts & Pages takes up the entire length of my sidebar when adding it to my page. It lists the first top post and then has a bunch of unused space between the first top post and second top post. Top posts two-10 are perfectly spaced – no issues there. I’m just trying to rid of the excessive space between top posts one and two. How to minimize the height of the widget and the excessive spacing between the top posts listed within the widget?
relaxedthairapy.com
]]>