One of the features that I was keen on adding into the plugin is an interface to import and export the data from the Top 10 tables as well as plugin settings. I’m excited about this release as it finally gives users of Top 10 the ability to more easily deploy the plugin across multiple sites.

Export and Import

This is now part of Top 10 v2.7.0 and can be found under the new sub-menu.

Top 10 v2.7.0 - Import Export Interface
Top 10 v2.7.0 – Import Export Interface

The first section allows you to export the plugin settings to a .json file which can then be either re-imported into the same site or a completely new site.

The second section allows you to export the tables in which Top 10 stores the counts. There are two tables – Overall and Daily. The tables are exported as CSV files which you can edit in Excel or any other compatible software. Be careful when editing the Daily CSV file as Excel may reformat the date. The correct date format is “YYYY-MM-DD HH:00:00”.

Recreate tables

I have also added yet another button in the Tools page. This button will allow you to fully reinitialise the Top 10 tables. Although this has been tested, please make sure you fully backup your database before hitting the button below. You can also export the tables using the buttons above.

Top 10 v2.7.0 - Recreate Database
Top 10 v2.7.0 – Recreate Database

This button performs these steps:

  1. Create two temporary database tables with the contents of the two tables
  2. Delete the Top 10 database tables
  3. Recreate the Top 10 database tables
  4. Import the counts from the temporary tables into the freshly created Top 10 database tables
  5. Delete the temporary database tables

Changes in Top 10 v2.7.0

  • Features:
    • Recreate the Top 10 database tables. You can find the button in the Tools page. Backup your database first
    • New export/import interface to export and import the Top 10 tables and settings
  • Enhancements:
    • tptn_views shortcode adds a new parameter ‘count’ to explicitly set the count type. Choose from daily, total or overall. This is overridden if daily is set to 0 (backwards compatibility)

Download Top 10 v2.7.0