Steven Lambert
Forum Replies Created
-
Forum: Plugins
In reply to: [Jetpack Post Views] Stats not updatingFrom what I can tell about the REST API, the “stats” calls do not give individual post view information, only site-wide views for each day. The “posts” calls do not give view information about a particular post either. Unless there is something I am missing, the REST API doesn’t give me individual post views like Jetpack’s API does.
Forum: Plugins
In reply to: [Jetpack Post Views] Stats not updatingI just wrote the WordPress developers and pointed them to this tread as well as the thread where I was told to use the post_ids (by Jetpack themselves). Hopefully this will lead to something that will resolve this issue.
Thanks for your help Marcelo and richardmtl.
Forum: Plugins
In reply to: [Jetpack Post Views] Stats not updatingThey don’t have offsets for their API, but they do allow a list of IDs. What that would mean is I would have to get every id for every post (a large call for large sites), then make my own offset function and ping the Jetpack API for every set of 500 posts, giving it a string of 500 ids.
However, this doesn’t work because of the max length of URL’s, and I would have to do less than 500 ids per call (I think somewhere around 200 would fit without problem). With a site of 2000 posts, that would mean 10 calls to the Jetpack API per hour. Combined with multiple sites, I don’t think they want that kind of traffic to the API every hour.
Forum: Plugins
In reply to: [Jetpack Post Views] Stats not updatingThe DEBUG info shows how many posts you have, but it doesn’t track how many posts I received from the Jetpack API. The Jetpack API doesn’t allow me to grab more than 500 posts at a time, and so blogs with more than 500 posts suffer from this problem.
Forum: Plugins
In reply to: [Jetpack Post Views] Don't display 'jetpack-post-views' for scheduled postIn my code I have a hook set on when the publish post button is activated that just adds the option to the post id and sets it to 0. I’m not sure how schedule posts operate, but I assume they have a similar hook that you could set the same thing for.
Here is the code for your reference:
add_action( 'publish_post', array( &$this, 'add_jetpack_meta' ) );
/* ADD JETPACK POST META ON POST PUBLISH */
function add_jetpack_meta() {
global $post;
add_post_meta( $post->ID, 'jetpack-post-views', 0, true );
}
Forum: Plugins
In reply to: [Jetpack Post Views] Reset CountsThe only way to reset the counts is to change your blog id with Jetpack.
I know previous members have posted that with lots of posts the plugin doesn’t work an activate. You may be experiencing the same problem. I’m still investigating if there is a possible solution when it comes to sites with more than 500 posts.
Forum: Plugins
In reply to: [Jetpack Post Views] Plugin cant be activated (20.000 posts on site)That sounds like a good idea with such a site as yours.
For your site, how would you be using the plugin? Would you want all 20k+ posts indexed, or only a subset of them indexed? Would you want to specify which posts were loaded via the pre-loader or just specify the number to load and which posts don’t matter?
Thanks for the suggestion and your help.
Forum: Plugins
In reply to: [Jetpack Post Views] get_post_meta function returning post ID, not view countThere are a few things you could try. You can try getting the global post variable before getting the post views by using
global $post
.If that doesn’t work, then you can try using
get_the_ID()
.the_ID()
prints the ID of the post and doesn’t return it for use, so that is probably why it isn’t working.Forum: Plugins
In reply to: [Jetpack Post Views] Wrong stats (not updated)The plugin only updates about every hour or so, so stats will not always be the most up to date.
Forum: Plugins
In reply to: [Jetpack Post Views] jetpack-post-views not updatingHey Raul, I’m glad that you like the plugin. What exactly do you mean by the jetpack-post-views custom field?
Forum: Plugins
In reply to: [Jetpack Post Views] Is it possible to view top pages too?At the moment, the plugin only handles posts. I haven’t decided yet if I want to support pages as well. I’ll think about it.
Forum: Plugins
In reply to: [Jetpack Post Views] Posts Stats no longer updating after v1.09If you have phpMyAdmin, you can go to the wp_postmeta table and type in this command:
DELETE FROM
wp_postmeta
WHEREmeta_key
LIKE ‘jetpack-post-views%’This will clean up all post meta from the database.
Forum: Plugins
In reply to: [Jetpack Post Views] Posts Stats no longer updating after v1.09Well I was hoping I fixed the uninstall script. Can you check your error logs to see if it is throwing any errors?
If you have access to PHPMyAdmin, you could do it that way, though I wouldn’t recommend it unless you’re familiar with MySQL.
Forum: Plugins
In reply to: [Jetpack Post Views] Total Number of Views on all postsIn the widget options, set “Number of posts to show” to 480.