{"id":222969,"date":"2025-03-05T09:14:34","date_gmt":"2025-03-05T09:14:34","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/site-stats-dashboard\/"},"modified":"2025-03-06T07:39:32","modified_gmt":"2025-03-06T07:39:32","slug":"site-stats-dashboard","status":"publish","type":"plugin","link":"https:\/\/bal.wordpress.org\/plugins\/site-stats-dashboard\/","author":23230275,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0","stable_tag":"1.0","tested":"6.7.5","requires":"5.2","requires_php":"7.2","requires_plugins":null,"header_name":"Site Stats Dashboard","header_author":"Michal Szatkowski","header_description":"Simple dashboard that displays site statistics (post count, comment count, visit count) in the admin panel.","assets_banners_color":"","last_updated":"2025-03-06 07:39:32","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/profiles.wordpress.org\/szatek\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":321,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"szatek","date":"2025-03-06 07:39:32"}},"upgrade_notice":[],"ratings":[],"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[107,434,166,522,1105],"plugin_category":[36,44],"plugin_contributors":[239128],"plugin_business_model":[],"class_list":["post-222969","plugin","type-plugin","status-publish","hentry","plugin_tags-comments","plugin_tags-dashboard","plugin_tags-posts","plugin_tags-stats","plugin_tags-visits","plugin_category-analytics","plugin_category-discussion-and-community","plugin_contributors-szatek","plugin_committers-szatek"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/site-stats-dashboard.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Site Stats Dashboard is a simple WordPress plugin that displays your website\u2019s statistics in the admin panel. It shows:<\/p>\n\n<ul>\n<li>The number of published posts.<\/li>\n<li>The number of approved comments.<\/li>\n<li>The total visit count (each front-end page load is counted).<\/li>\n<\/ul>\n\n<p>The plugin uses the WordPress REST API to provide the statistics and renders the admin dashboard using React via the <code>wp.element<\/code> package.<\/p>\n\n\n\n<h3>Features<\/h3>\n\n<ul>\n<li><strong>Admin Dashboard:<\/strong> A dedicated admin page accessible from the WordPress dashboard under the \"Site Stats\" menu.<\/li>\n<li><strong>Live Statistics:<\/strong> Displays post count, comment count, and visit count.<\/li>\n<li><strong>REST API Integration:<\/strong> Provides a custom REST API endpoint (<code>ssds\/v1\/stats<\/code>) that returns the site statistics.<\/li>\n<li><strong>React-Based UI:<\/strong> Uses React (via the built-in <code>wp.element<\/code> library) for the admin dashboard interface.<\/li>\n<li><strong>Visit Tracking:<\/strong> Tracks every front-end page load to increment the visit counter.<\/li>\n<\/ul>\n\n\n\n<h3>Usage<\/h3>\n\n<ul>\n<li><strong>Admin Panel:<\/strong> Once activated, click on the \"Site Stats\" menu item in the WordPress admin sidebar to see the statistics.<\/li>\n<li><strong>REST API:<\/strong><br \/>\nThe plugin registers a REST API endpoint at:\nhttp:\/\/your-site-url\/wp-json\/ssds\/v1\/stats<\/li>\n<\/ul>\n\n<p>This endpoint returns a JSON response with the keys <code>post_count<\/code>, <code>comment_count<\/code>, and <code>visit_count<\/code>.<\/p>\n\n<p><strong>Note:<\/strong> Access to the REST API endpoint is restricted to users with the <code>manage_options<\/code> capability (typically administrators).<\/p>\n\n<ul>\n<li><strong>Visit Tracking:<\/strong><br \/>\nEvery 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.<\/li>\n<\/ul>\n\n\n\n<h3>License<\/h3>\n\n<p>This plugin is licensed under the <a href=\"https:\/\/www.gnu.org\/licenses\/gpl-2.0.html\">GPLv2 or later<\/a>.<\/p>\n\n\n\n<h3>Additional Notes<\/h3>\n\n<ul>\n<li>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).<\/li>\n<li>Ensure you are logged in as an administrator (or a user with the <code>manage_options<\/code> capability) when accessing the plugin dashboard or the REST API endpoint.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li><p><strong>Download and Upload:<\/strong><\/p>\n\n<ul>\n<li>Download the plugin files and unzip the archive.<\/li>\n<li>Upload the entire <code>site-stats-dashboard<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory on your WordPress site.<\/li>\n<\/ul><\/li>\n<li><p><strong>Activate the Plugin:<\/strong><\/p>\n\n<ul>\n<li>Go to the <strong>Plugins<\/strong> page in your WordPress admin panel.<\/li>\n<li>Find <strong>Site Stats Dashboard<\/strong> in the list and click <strong>Activate<\/strong>.<\/li>\n<\/ul><\/li>\n<li><p><strong>Access the Dashboard:<\/strong><\/p>\n\n<ul>\n<li>In the admin panel, navigate to <strong>Site Stats<\/strong> (located in the left-hand menu) to view the statistics dashboard.<\/li>\n<\/ul><\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='does%20the%20plugin%20track%20unique%20visitors%3F'><h3>Does the plugin track unique visitors?<\/h3><\/dt>\n<dd><p>No, the current implementation simply increments the counter on each page load. It does not differentiate between unique and repeat visitors.<\/p><\/dd>\n<dt id='what%20statistics%20does%20the%20plugin%20display%3F'><h3>What statistics does the plugin display?<\/h3><\/dt>\n<dd><p>It displays:\n- The total number of published posts (only the default \"post\" post type).\n- The total number of approved comments.\n- The total number of page visits (incremented on every front-end load).<\/p><\/dd>\n<dt id='can%20i%20extend%20this%20plugin%3F'><h3>Can I extend this plugin?<\/h3><\/dt>\n<dd><p>Yes, the plugin is designed as a starting point. You can modify or extend it to track additional statistics or refine the visit tracking logic (e.g., counting only unique visitors).<\/p>\n\n<\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h3>1.0<\/h3>\n\n<ul>\n<li>Initial release:<\/li>\n<li>Admin page to display site statistics.<\/li>\n<li>REST API endpoint for fetching stats.<\/li>\n<li>React-based admin interface.<\/li>\n<li>Front-end visit tracking.<\/li>\n<\/ul>","raw_excerpt":"Simple dashboard that displays site statistics (post count, comment count, visit count) in the admin panel.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/222969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=222969"}],"author":[{"embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/szatek"}],"wp:attachment":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=222969"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=222969"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=222969"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=222969"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=222969"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=222969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}