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.
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”.
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.
This button performs these steps:
- Create two temporary database tables with the contents of the two tables
- Delete the Top 10 database tables
- Recreate the Top 10 database tables
- Import the counts from the temporary tables into the freshly created Top 10 database tables
- Delete the temporary database tables
Changes in Top 10 v2.7.0
- 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
tptn_viewsshortcode 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)