Top 10 v2.4.1

I’ve been working on Top 10 v2.4.0 for a long time where the main focus of this release has been to get a more compatible tracker. Today, I’m happy to say that I have pushed through the release and you can now upgrade your favourite popular posts plugin as you normally would from within your WordPress Dashboard Updates screen. This version adds two new features, fixes several bugs, has cleaner code as per WordPress Coding Standards and also deprecates some functions.

New tracker

Two months back I released v2.3.2 which fixed a security issue and also required me to remove the faster performance tracker. This was needed to ensure continued hosting with and respecting their guidelines. v2.4.0 is the first step towards building an addon that will bring back the faster tracker. This addon will be available for free from this website in the near future.

For now, you have two options for the tracker. Try both to see which delivers a better performance to your site. The first uses an external .js file that can be cached by browsers. The second is the old query style format. From my testing, both have similar performance. But, do toggle between both options to see which performs better. For the brave at heart, you can also adapt this gist which is the old source code for the faster tracker.

Update: It is recommended that you whitelist the tracker in W3 Total Cache, WP Super Cache, etc. You need to whitelist tptn_tracker and top-10-tracker.js

Now you can “offset” your posts

Another very useful feature that I’ve added in v2.4.0 is the ability to offset the list of posts by a specific number. This is available via the shortcode or in the widget.

Using the offset you can now display posts starting from a different position e.g. display posts from 11 to 20 by setting it to offset to 10. It also helps if you would like to display multiple versions of the widget with different starting points.

Widget in Top 10 v2.4.0
Widget in Top 10 v2.4.x

As usual, if you’re looking for support, please create a new post in the Top 10 support forum. And, do blog, tweet and tell the whole world about this release.

Detailed list of changes in Top 10 v2.4.0

  • Features:
    • New tracker using a properly enqueued .js file. Two inbuilt options to use query variables or ajaxurl to process the counts
    • Shortcode and the widget now have an added parameter for ‘offset’. This is useful if you would like to display different widgets/shortcodes but not always start from the first post
  • Bug fixes:
    • Attachments now work with the widget and elsewhere
    • New tracker now works when jQuery is loaded in the footer
    • Don’t add tracker code when previewing in customizer
    • Doesn’t report an error if no author is assigned to a post
  • Deprecated:
    • tptn_add_tracker and tptn_add_viewed_count have been deprecated. These should no longer be needed with the new tracker option.
    • wick script in Settings page which was used for fetching category slugs. You should now use the category name (prompted automatically). Slugs will be automatically converted into names.


  1. Top 10 v2.4.0 broke my blogs. I updated three different sites and encountered the same problem each time. WordPress now deactivates this plugin for causing a fatal error.

      1. Thanks for the quick reply.

        I got a new fatal error.

        Parse error: syntax error, unexpected T_FUNCTION in […] /wp-content/plugins/top-10/admin/class-stats.php on line 556

        Loved this plugin before. Hope to keep using it.

          1. These are both extremely old versions of php and mysql and it is strongly recommended that you upgrade from this.

            I’m not in a position to test on this. But, let me see what I can do to fix the error.

  2. hi , is it possible change format number, for example 2.2k to 2200 total view.
    thank you

Comments are closed.