We'll create fresh WordPress site with Wibstats installed. You have 20 minutes to test the plugin after that site we'll be deleted.
Wibstats is a WordPress plugin that gives a WordPress site, or each blog in a WordPress MU or BuddyPress installation, their own visitor statistics. The data stored includes the page viewed, date and time of visit, visitors browser, operating system and screen resolution, and the geographic location of the visitor (country and city) where it is possible to determine that information.
The plugin uses freely available APIs from several providers to determine the geographic location of the visitor. One of the APIs is chosen randomly for each visit to spread the load across each of the API providers.
A range of graphs and tables are available to users to see the visitors to their blog. WordPress MU site administrators also have the option to easily view the statistics for any particular blog, as well as for the main site.
The plugin relies on the wp_footer
action, normally used in the footer.php file of the theme. Without this action no visitor statistics will be stored. Please check each template available to your end users to ensure they all use the wp_footer action
.
WibStats allows you to include statistics from your site in your blog posts and pages. This is done with shortcodes, simple bits of text that set some parameters for the information to display. For example:
[wibstats report="popularsearches"]
Will give you (for example);
Search Visitors
search 1 40%
search 2 30%
search 3 20%
search 4 10%
Please note these examples here are not formatted correctly (due to WordPress readme file restrictions). The proper code looks like this:
<div class="wibstats_report [name of the report]">
<table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1, column 1</td>
<td>Row 1, column 2</td>
</tr>
<tr>
<td>Row 2, column 1</td>
<td>Row 2, column 2</td>
</tr>
</tbody>
</table>
</div>
Want another example? OK:
[wibstats report="recentcountries"]
Gives:
Country Time
United Kingdom 9:22 pm
United States 9:21 pm
Portugal 9:18 pm
When showing country names WibStats will also show a small icon of the flag of that country.
There are quite a few different reports you can show (these go in the report="report-name-here"
bit).
popularcountries
popularcities
recentcountries
recentcities
popularbrowsers
popularplatforms
popularscreensizes
popularsearches
recentsearches
populardays
popularhours
popularmonths
popularreferrers
recentreferrers
session
A couple of other options allow you to configure these reports as they display on your posts/pages.
size
Sets the number of items you want to show (minimum 1, maximum 100)
cache
Sets how long you want the report to be cached for. Caching means that the report isn’t recalculated every time someone visits the page, meaning the page is a little bit faster to load.
The size
option is set in minutes, with “0” meaning not-cached-at-all (the report is recalculated every time someone visits the page it appears on) and “-1” for cached forever (the report is generated once then remains the same forever).
So, a couple more examples:
[wibstats report="popularcities" size="25"]
This shows the top 25 most popular cities to visit your blog.
[wibstats report="recentsearches" size="5" cache="0"]
This shows the top 5 latest search words which brought visitors to your blog, and is not cached at all.
[wibstats report="popularreferrers" size="50" cache="-1"]
This shows the top 50 most popular referring websites (sites that have a link to your blog) and is cached forever. This means the report will show what the top referring sites are now and will never be updated.
Any further ideas will be gratefully received.