Over the course of the past week, I’ve pushed through a couple of updates to Top 10. This version brings several new features, some bug fixes and enhancements to existing features. Below are some of the main additions to Top 10.

Caching

Top 10 v2.2 introduces an inbuilt caching system. Tapping into the Transients API, the plugin will cache the popular posts output for an hour which results in highly reduced queries for results after the first post. This is ideal for blogs with limited traffic and especially those that aren’t particular about displaying the post count. This will work in conjunction with caching plugins so turn one on and get the instant performance boost.

Top 10 Cache

You can enable this under General Options. The clear Cache button will, as the name suggests, clear the cache. Resaving the options page will also clear the cache.

New styles interface

Top 10 Styles

Top 10 has, in previous versions, included a default style. This was limited to a single style and you had limited flexibility in the size of the thumbnails or what could be displayed. The current version of the styles interface is smarter. Choose No Styles if you’re using your own styling system of choose Left Thumbs for a new optimised set of styles.

Limit posts by age

Published post age

By default, the popular posts list will display all your tracked posts irrespective of how old they are. This new option will allow you to limit the posts to a specific age. e.g. 365 will only show posts published in the last year. Note that all posts will continue to be tracked.

New meta box options

Top 10 Meta Box

Top 10 v2.2 introduces two additional options which I believe are very useful. The first one will simply turn off the popular posts on a the page/post that you select this on. The widget will no longer display. It’s for those select times when you want to exclude the display on certain posts.

The second option is more useful and complements the existing “Exclude post IDs” option. By selecting “Exclude this post…”, you will stop it from being displayed in the top posts list. This is especially useful if you’d like to exclude certain posts like landing pages, home page, blog page, etc. which the plugin will track because of their post type.

Admin Top Posts screen

The admin top posts screen has been revamped with a cleaner, sortable interface. Additionally, you also have the option to delete the counts either selectively or in bulk. Choose to sort the posts by either ascending or descending. Sorting the Daily column in descending order will show you the popular posts for the day (or custom period set in Settings).

Top 10 Admin Popular Posts View

Support, etc.

As usual, if you got a support query, then please create a new post at the WordPress.org support forum. It is the fastest way to get support as I monitor the forums regularly.

Detailed list of changes in v2.2.x

  • Features:
    • Caching system using the Transients API. By default, the cache is refreshed every hour
    • Styles interface lets you select between No styles, Left Thumbs (previously the default style) and Text Only
    • Option to limit posts only with a specified date range
    • Option in Top 10 meta box to exclude display of popular posts in widget if needed
    • Option in Top 10 meta box to exclude post from popular posts list
    • Cleaner interface to view popular posts in the admin area
  • Enhancements:
    • strict_limit is true by default for get_tptn_pop_posts()
    • Option to turn off the meta box for everyone or just non-admins
    • Contributors & above can also update the visit count in the meta box if this is enabled for them
    • Category exclusion now works via a filter function vs. multiple lookups, thereby reducing the number of database queries
  • Bug fixes:
    • Potential bug when the $wp variable was not detected in rare situations
    • In rare cases, category exclusion failed when term_id didn’t match term_taxonomy_id
  • Deprecated:
    • ald_tptn_rss: Use tptn_rss_filter instead
    • ald_tptn_hook deprecated and renamed to tptn_cron_hook
    • tptn_manage and tptn_manage_daily which were used to render the admin popular posts screens

Get more stuff like this

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.