jeherve / jp-post-views

Display the number of views for each one of your posts, as recorded by Jetpack Stats.
https://wordpress.org/plugins/post-views-for-jetpack/
3 stars 0 forks source link

Add sortable column of views in posts list #5

Open jeherve opened 7 years ago

jeherve commented 7 years ago

sortable, entry in the posts list to see how many hits have every one received since ever created.

https://wordpress.org/support/topic/feature-request-530/

jeherve commented 7 years ago

Also suggested here: https://wordpress.org/support/topic/add-the-jetpack-stat-data-as-column-in-post-admin-view/

jeherve commented 6 years ago

Also suggested here: https://wordpress.org/support/topic/admin-show-counter/

phamquangbaoplus commented 4 years ago

Hello, any update?

jeherve commented 4 years ago

Also suggested here: https://wordpress.org/support/topic/custom-column-at-posts/

jeherve commented 3 years ago

Also suggested here: https://wordpress.org/support/topic/show-post-views-in-all-post-view/

jeherve commented 3 years ago

For anyone following, a potential issue has stopped me from quickly implementing this so far: the Jetpack plugin caches the stats value for each post in its own entry in the options table. Updating stats for all posts to display the column would end up being quite taxing for sites with a lot of posts.

I can think of 2 ways around this at the moment:

  1. Query the API directly without going through the Jetpack plugin, but that would mean implementing the connection to the WordPress.com API from scratch, thus "re-inventing the wheel" a bit.
  2. See if the Jetpack plugin itself can be modified to not cache the data in the options table when it is already stored in post meta like with tihs plugin.

There may be better alternatives I haven't thought of yet though. I'll update the issue once I figure this out.

jeherve commented 2 years ago

This also came up in https://wordpress.org/support/topic/specify-page-for-post-view-count/

omriamos commented 2 years ago

the Jetpack plugin caches the stats value for each post in its own entry in the options table. Updating stats for all posts to display the column would end up being quite taxing for sites with a lot of posts.

To be honest, as an owner of a pretty big website (over 22,000 posts), I don't think one more postmeta row for each post is such a big deal. I think it's a non-issue. Yet, if it's something you're trying to avoid, maybe just set the value for posts that are actually being viewed on the active posts page (the first page, usually) , and ignore posts from previous pages as long as no one is trying to access them?

jeherve commented 2 years ago

I don't think one more postmeta row for each post is such a big deal.

I would agree. However, in this case the data is cached as transients, one for each post. In practice, that means your site's options table would significantly grow, and that is in my opinion more problematic than post meta.

maybe just set the value for posts that are actually being viewed on the active posts page (the first page, usually) , and ignore posts from previous pages as long as no one is trying to access them?

Yes, that's something I have considered. 👍

jeherve commented 1 year ago

Also in https://wordpress.org/support/topic/sortable-posts-list-column/