The Optimization page will allow you to do some basic maintenance tasks related to WP Statistics.
The optimization page looks like this:
It has six tabs; Resources/Information, Export, Purging, Database, Updates, and Historical.
The Resources/Information page has 4 subsections to it; Resources, Version Info, File Info, and Client Info.
The Resources section contains some resource usage information.
Memory usage in PHP
The number of bytes of memory WordPress is currently using. This number is highly transitive and should only be used as a genera guide line. Pages like the overview page use more memory than others.
PHP Memory Limit
The maximum amount of memory that PHP will allow a script to use before terminating the script. This value is set in the php.ini file and must be set high enough to allow WP Statistics to load and manipulate data in the statistics charts.
Number of rows in the wp_statistics_useronline table
The number of rows in the users online table.
Number of rows in the wp_statistics_visit table
The number of rows in the visits table.
Number of rows in the wp_statistics_visitor table
The number of rows in the visitors table.
Number of rows in the wp_statistics_exclusions table
The number of rows in the exclusions table.
Number of rows in the wp_statistics_pages table
The number of rows in the pages table.
Number of rows in the wp_statistics_historical table
The number of rows in the historical table.
The Version Info section contains the various versions of the software installed on your server.
WP Statistics Version
The version of the plug-in.
The version of PHP.
PHP Safe Mode
Is PHP running in safe mode. Note this is the value in php.ini, so even though PHP 5.4 and above deprecated safe mode, you may still have the value set in php.ini. If you do, you should remove it.
PHP IPv6 Enabled
Is PHP compiled with IPv6 support. You may see warning messages in your PHP log if it is not and you receive HTTP headers with IPv6 addresses in them.
The version of jQuery.
The PHP cURL Extension version you are running. cURL is required for the GeoIP code, if it is not installed GeoIP will be disabled.If the gzopen() function is installed. gzopen() is required for the GeoIP database to be downloaded successfully.
If the gzopen() function is installed. gzopen() is required for the GeoIP database to be downloaded successfully.
The File Info section contains information about the GeoIP and browscap files. Browscap has two files, the raw ini file downloaded from browscap.org and a cache file generated by the browscap library to improve performance on loading and lookups.
The file size and date of the GeoIP database installed on your system.
The file size and date of the browscap.ini installed on your system.
browscap Cache File
The file size and date of the browscap cache file installed on your system.
The Client Info section contains some information about your current session.
The IP address you are currently connected from.
Your user agent string.
The detected browser you are running.
The detected browser version you are running.
The detected platform you have.
The Export page allows you to export the data from the database to a flat file. This is useful if you want to do additional analysis on the data or need to migrate to another statistics plug-in.
You can export from the three primary data tables.
XML, CSV, TSV
The format to export to.
XML will export an XML formatted file.
CSV will export a comma separated value file.
TSV will export a tab separated value file.
Include Header Row
Include a header row as the first line of the exported file.
The Purging page has 2 subsections to it; Data and Delete User Agent Types.
The Data section allows you to purge information from the database..
This will delete ALL data from the selected tables. Only do this if you are absolutely sure you want to reset all of your statistics.
Purge records older than
Deleted user statistics data older than the selected number of days. Minimum value is 30 days. Since WP Statistics 8.2 the pruned data will be summarized in to the historical database.
Purge visitors with more than
Deleted user statistics data where the user has more than the defined number of hits in a day. This can be useful to clear up old data when your site has been hit by a bot.
This will remove the visitor and their hits to the site, however it will not remove individual page hits as that data is not recorded on a per use basis.
Minimum value is 10 hits.
Delete User Agent Types
The Delete User Agent Types section allows you to delete various user agent types from the database. This can be used to remove robots or other types of agents that are not real users.
This will delete ALL visitors with the selected agent type.
This will delete ALL visitors with the selected platform.
The Database page allows you to rerun the install routine or add a unique index to the Visitors table to protect against duplicate entries.
If for some reason you have had to delete one or more tables from the database server (perhaps a corrupt table or recovering from an incomplete backup) WP Statistics will warn you that the tables are missing however it will only run the database install/upgrade code during a version change.
This option will let you re-run the WP Statistics setup routine without having to manipulate the WordPress options table or the WP Statistics code.
This should only be done as a last resort.
There are two indexes that older installs of WP Statistics do not have on the tables in the database. Adding these during the setup process can cause timeout’s and so they are available to be added manually by the administrator.
If you do not have these indexes you will be presented with a button to add each index to the table.
WP Statistics 9.5 added a new table and code to better handle referrers and search words, however converting older installs requires a manual upgrade, presented here if required.
The Updates page allows you to update data in the database for GeoIP and Hash IP addresses.
Selecting the “Update Now!” button will try and update any missing geolocation information in the visitors table. This can also be automated with the Statistics->Settings->GeoIP->Populate missing GeoIP after update of GeoIP DB setting.
Note if you have selected to hash the IP addresses then this will not function for those entires with hashed values.
Hash IP Addresses
Selecting the “Update Now!” button will replace all IP addresses in the database with hash values.
You will not be able to recover the IP addresses in the future to populate location information if this is selected.
The Historical page allows you to configure the values to add to the total visits and visitors for your site. These values are auto incremented when any purging of data is done. Purging data also records page hits, however there is no user interface available for changing the values for page entries.
Note that if you use the purge function in the optimization page you should reload the page before editing these numbers as they will not be accurate.
A number of visitors to add to the total number of visitors to your site. This is useful if you have migrated from another statistics plugin or have purged data in the past to give an accurate total visitors count for your site.
A number of visits to add to the total number of visits to your site. This is useful if you have migrated from another statistics plugin or have purged data in the past to give an accurate total visits count for your site.
Check out this article to learn more about all the available options.