Skip to content

Top 10 v3.2.2

I’m pleased to announce that the next major release of my popular posts plugin for WordPress a.k.a Top 10 v3.2.0 is now available for download or upgrade via the repository.

This version focuses heavily on improving compatibility with WordPress Multisite. Besides this, I’ve made several changes to Top_Ten_Query to add several more filters that should allow developers to override the query.

Multisite improvements

The biggest feature is the ability to pass a comma-separated set of blog IDs to blog_id parameter in order to pull the popular posts across all these blogs. You can use this feature in the shortcode or the block. In the block, you’ll need to pass this in the Other attributes field.

While this is an extremely powerful feature, it can also be resource intensive particularly if there are several blog IDs passed. Remember to turn caching ON!

Additionally, you will also find a new Tools page and Import/Export page in the Network Admin in addition to the Network wide popular posts. This has the same set of features as the corresponding pages you would find when browsing each site. The key difference is that the various buttons in the Network Admin screen apply to all sites of the network while that of the Site Admin screen only applies to the current site. This is a change from previous versions of the plugin where you ran the risk of emptying the entire Network from a single site.

Top_Ten_Query improvements

The changes to Top_Ten_Query in this version are geared towards developers or advanced users hoping to override the way the query works.

Top_Ten_Query is a wrapper for WP_Query and allows you to pass the various parameters of WP_Query as well as those of Top 10.

In this version, you have multiple new filters for each of the various SQL clauses similar to that of WP_Query. You can browse the code and search for apply_filters.

Popular Posts page in Admin/Network Admin

I’ve rewritten the queries for the Popular Posts pages in the Admin/Network Admin. If you have deleted previously tracked posts, then in this version you will likely see rows which have an Invalid Post ID.

You should be able to then select all of these post IDs and bulk delete them. A great way to clean up your popular post tables.

Note that this also impacts the WordPress dashboard widgets as they pull the same set of posts. If you have incorrect data then you’ll notice that this will show lesser posts.

Detailed changed in Top 10 v3.2


  • Enhancements/Modifications:
    • Dashboard widget will display the number of posts set in the Top 10 Settings page
  • Bug fixes:
    • Tax query parameter was not set in Top_Ten_Query
    • post_type parameter was not set in Top_Ten_Query
    • Parse error in some PHP installs prevented the plugin from being activated
    • Fixed missing stylesheet error when text_only style is selected
    • Only from categories option in the Widget now takes a comma-separated ID list only as the autocomplete was not compatible with the new widget interface


  • Enhancements/Modifications:
    • Modified behaviour of Popular Posts page and Admin Dashboard widgets to limit to public post types
  • Bug fixes:
    • Fixed: Fatal error: Uncaught Error: Call to undefined function restore_current_blog()


  • Features:
    • New setting in the Popular Posts block to select the style by block type
  • Multisite improvements:
    • Retrieve the popular posts across multiple blogs by passing multiple blog IDs to Top_Ten_Query
    • New Tools page and Import/Export page in Network Admin – you can find this in the Top 10 menu
    • Resetting the Popular Posts or Daily Popular Posts will apply to the current site in the Admin screen and across the network in the Network Admin screen
    • Exporting/Importing tables will apply to the current site in the Admin screen and across the network in the Network Admin screen
  • Top_Ten_Query improvements:
    • WP_Query’s arguments posts_per_page, post_type are prioritised
    • New filters: top_ten_query_date_query, top_ten_query_meta_query, top_ten_query_meta_query_relation, top_ten_query_tax_query_relation, top_ten_query_posts_fields, top_ten_query_posts_join, top_ten_query_posts_where, top_ten_query_posts_orderby, top_ten_query_posts_groupby
    • Cache key is generated from the query_args instead of just the input_query_args
  • Other Enhancements/Modifications:
    • New function: get_tptn_table(); Code has been refactored to use this function
    • Popular Posts page in Admin or Network Admin use the same class Top_Ten_Statistics_Table. Deleted Top_Ten_Network_Statistics_Table
    • Selecting “Text only” thumbnail setting or style will not display a thumbnail
    • Use moment.js bundled with WordPress
    • Updated ChartJS and ChartJS Data Labels plugin scripts to latest versions
  • Bug fix:
    • Scripts/styles didn’t load in Network posts page

Download Top 10

1 thought on “Top 10 v3.2.2”

  1. php-fpm7.2[14916]: ool www: PHP Parse error: syntax error, unexpected ‘)’ in /var/www/wp-content/plugins/top-10/includes/admin/admin.php on line 249

    it’s an error after the last update of your plugin
    I fix this error and it’s working fine

Comments are closed.

Get more stuff like this
in your inbox

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

Thank you for subscribing.

Something went wrong.