It is a simple and lightweight visit statistics system that records and displays the number of site visits without the need for plugins or heavy databases.
- This code I am sharing is database free and uses stored dates for calculations.
- The data is stored in the wp_options table and a visit is recorded each time a user logs in to the site.
- It uses cookies so that each user is counted only once per day and does not detect and count Google bots and search engines.
Add the stats.php file to the function.
require_once('stats.php');and Copy and paste its style codes to the end of the style.css file.
You can display statistics anywhere on your site template or page.
[site_stats]
or
<?php echo do_shortcode('[site_stats]')?>Only shows visits today or ...
[site_stats type="today"] // today, month, year, total