Site Stats Dashboard is a simple WordPress plugin that displays your website’s statistics in the admin panel. It shows:
- The number of published posts.
- The number of approved comments.
- The total visit count (each front-end page load is counted).
The plugin uses the WordPress REST API to provide the statistics and renders the admin dashboard using React via the wp.element
package.
Features
- Admin Dashboard: A dedicated admin page accessible from the WordPress dashboard under the “Site Stats” menu.
- Live Statistics: Displays post count, comment count, and visit count.
- REST API Integration: Provides a custom REST API endpoint (
ssds/v1/stats
) that returns the site statistics. - React-Based UI: Uses React (via the built-in
wp.element
library) for the admin dashboard interface. - Visit Tracking: Tracks every front-end page load to increment the visit counter.
Usage
- Admin Panel: Once activated, click on the “Site Stats” menu item in the WordPress admin sidebar to see the statistics.
- REST API:
The plugin registers a REST API endpoint at:
http://your-site-url/wp-json/ssds/v1/stats
This endpoint returns a JSON response with the keys post_count
, comment_count
, and visit_count
.
Note: Access to the REST API endpoint is restricted to users with the manage_options
capability (typically administrators).
- Visit Tracking:
Every time a front-end page is loaded (excluding admin pages and AJAX requests), the plugin increments the visit counter. This means the visit count increases on every page load, not only for unique visitors.
License
This plugin is licensed under the GPLv2 or later.
Additional Notes
- The admin dashboard interface is built using React without a build process (JSX is not used). If you later decide to use JSX or more advanced React features, you’ll need to integrate a build system (e.g., webpack with Babel).
- Ensure you are logged in as an administrator (or a user with the
manage_options
capability) when accessing the plugin dashboard or the REST API endpoint.
Active installations0+
Weekly downloads
2-60.00%
Version1.0
Last updated3/6/2025
WordPress version5.2
Tested up to6.7.2
PHP version7.2
Tags
commentsdashboardpostsstatsvisits