=== Simple Post View Counter – Clean and Fast Post View Analytics ===
Contributors: sadhanpal
Donate link: https://buymeacoffee.com/sadhan
Tags: post views, post counter, view counter, popular posts, most viewed posts
Requires at least: 6.7
Tested up to: 6.8
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Lightweight post view counter with a widget and shortcodes. Track post views automatically, stop double-counting, and display popular content easily.

== Description ==

**Simple Post View Counter** is a lightweight yet powerful plugin to track how many times your WordPress posts are viewed.

### Key Features
- ✅ Automatic post view tracking (AJAX-based, works even in incognito mode)
- ✅ Prevents double-counting on refresh
- ✅ Built-in bot detection
- ✅ Display views before content, after content, beside meta, or manually
- ✅ "Most Viewed Posts" widget with customizable display
- ✅ Shortcodes for displaying most viewed posts and individual post views
- ✅ Admin settings page with statistics (total views, average views, top posts, etc.)
- ✅ Views column in admin post list (sortable by views)
- ✅ Exclude admin views from tracking
- ✅ Works with caching plugins

### Shortcodes
- `[post_views]` → Display view count for current post  
  Options: `post_id`, `format="%s views"`
- `[most_viewed_posts]` → Display a list of most viewed posts  
  Options: `limit="5"`, `show_count="yes"`, `show_excerpt="no"`

### Example Usage
- `[most_viewed_posts]` → Show top 5 posts
- `[most_viewed_posts limit="10" show_count="yes"]` → Show 10 posts with view counts
- `[post_views]` → Show current post’s view count

### Widgets
Go to **Appearance → Widgets** and add the **Most Viewed Posts** widget to your sidebar.

### Video Tutorial
[youtube https://www.youtube.com/watch?v=10d_wyQn-Lk&pp=0gcJCckJAYcqIYzv]

### Theme Function
```php
<?php echo spvc_get_post_views(); ?>


== Installation ==

Upload the plugin files to the /wp-content/plugins/simple-post-view-counter/ directory, or install the plugin via the WordPress plugins screen directly.

Activate the plugin through the Plugins screen in WordPress.

Go to Settings → Post Views to configure options.

Add the Most Viewed Posts widget, use shortcodes, or call the function in your theme.

== Frequently Asked Questions ==

= Does it work with caching plugins? =
Yes, view counting is AJAX-based, so it works properly with caching.

= Will it count admin views? =
By default, admin views are excluded (you can enable/disable this in settings).

= Can I show the view counter anywhere manually? =
Yes, use the [post_views] shortcode or the spvc_get_post_views() function in your theme.

= Does it prevent bots from inflating the count? =
Yes, it includes basic bot detection and ignores common crawlers.

== Screenshots ==
1. screenshot-1.png
2. screenshot-2.png
3. screenshot-3.png


== Changelog ==

= 1.0.0 =

Initial release

Automatic view tracking

Shortcodes [post_views] and [most_viewed_posts]

Widget for most viewed posts

Admin settings page with statistics

Prevents double counting on refresh

Works in incognito/private mode

Basic bot detection

== Upgrade Notice ==

= 1.0.0 =
First stable release – recommended update for all users.

== Credits ==

Developed by Sadhan Pal

== License ==

This plugin is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.