=== ViewCounter ===
Contributors: hurrellcpu
Donate link: https://github.com/sponsors/hurrell-cpu
Tags: views, view counter, post views, analytics, privacy
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Fast, privacy-first post/page view tracking for WordPress with PHP, JavaScript, and REST counting modes.

== Description ==

**Know what's working. Skip the guesswork.**

ViewCounter is a fast, privacy-first WordPress plugin that tracks and reports accurate post, page, and custom post type view counts — entirely inside WordPress. No external analytics and no third-party tracking scripts.

Whether you're an editorial team wanting quick "what's working" visibility, a developer building popular-content widgets, or an agency managing dozens of sites, ViewCounter gives you the data you need without the bloat you don't.

= Key Features =

* **Accurate View Counting** — Three modes (PHP, JavaScript, REST API) so counts stay reliable even behind aggressive page caching
* **Privacy-First** — View tracking data stays on your server. No third-party analytics scripts. Paid license validation can call your configured license server, but tracked view data remains local
* **Dashboard & Reporting** — Full admin dashboard with charts, date ranges, KPIs, top content, CSV/JSON dashboard exports, and print-ready reports
* **Smart Exclusions** — Filter bots, logged-in users, specific roles, and IP/CIDR ranges. Count interval controls prevent inflation
* **One-Click Import** — Migrate from WP-PostViews, Post Views Counter, Statify, and Page Views Count with dry-run mode
* **Developer Ready** — REST endpoints, helper functions, shortcodes, Gutenberg block, and hooks for custom integrations

= Display Options =

Display view counts using any combination of:

* **Automatic placement** — before or after content, per post type
* **Shortcode** — `[view_counter]` (plus compatibility aliases `[viewcounter]` and `[view-counter]`) with optional `post_id`, `format`, `label`, `before`, and `after` attributes
* **Gutenberg Block** — native block editor support
* **PHP helper** — `vc_get_post_views( $post_id )` for theme templates
* **REST API** — `/wp-json/view-counter/v1/posts/{id}` and `/wp-json/view-counter/v1/top`

= Admin Features =

* Sortable **Views column** in wp-admin post lists
* View count in the **Publish box** on edit screens
* Manual **count adjustment** per post via meta box
* **Dashboard widget** with monthly graph and top posts
* Full **plugin dashboard** with charts, 12-month trend, and all-time rankings

= Paid Features =

Upgrade with a paid license to unlock advanced capabilities:

* **Advanced Reporting** — post type filtering, weekday breakdowns, report annotations
* **Scheduled Reports** — automatic weekly/monthly email reports with report attachments
* **Branded Report Exports** — add your logo, company details, and custom footer to print-ready reports
* **Advanced Imports** — full historical data windows and detailed diagnostics
* **Support tiers** — Standard support on Single, Priority support on Multi and Agency
* **Agency Branding** — client-ready report branding presets and white-label report output on Agency licenses

Free core features are free forever — no artificial limits, no nag screens. Paid licenses unlock power-user and agency workflows inside the same plugin.

= Privacy =

ViewCounter does not send view data to external analytics services. View counts are stored locally in your WordPress database using aggregate daily tables and post meta. By default, the plugin does not set tracking cookies; an optional transient deduplication cookie is used only when count interval controls are enabled. Paid license validation can contact your configured license server, but tracked view data remains local. ViewCounter is designed for privacy-friendly WordPress setups; always review your own compliance obligations.

== Installation ==

= From WordPress.org (recommended) =

1. Go to **Plugins → Add New** in your WordPress admin
2. Search for **"ViewCounter"**
3. Click **Install Now**, then **Activate**
4. Visit **ViewCounter → Dashboard** to see your stats

= Manual Upload =

1. Download the `.zip` file from this page
2. Go to **Plugins → Add New → Upload Plugin**
3. Choose the zip file and click **Install Now**
4. Activate the plugin

= Configuration =

ViewCounter works out of the box with sensible defaults. To customize:

1. Go to **ViewCounter → Settings**
2. Choose which post types to track
3. Select your counting mode (PHP, JavaScript, or REST API)
4. Configure exclusions (bots, logged-in users, IPs)
5. Set display preferences

= Migrating from Another Plugin =

If you're switching from WP-PostViews, Post Views Counter, Statify, or Page Views Count:

1. Go to **ViewCounter → Imports**
2. Run a **Dry Run** first to preview what will be imported
3. Review the results, then click **Run Import** to commit
4. Deactivate (but don't delete) the old plugin until you've verified the import

= Paid Licenses =

1. Purchase a license at the ViewCounter website
2. Go to **ViewCounter → License**
3. Enter your license key and license email
4. Activate the license to unlock the features included in your plan

== Frequently Asked Questions ==

= Does it work with page caching plugins? =

Yes! Switch to JavaScript or REST API counting mode in Settings. These modes fire an asynchronous request after page load, so they work perfectly with WP Super Cache, W3 Total Cache, WP Rocket, LiteSpeed Cache, and any other full-page caching solution.

= Does ViewCounter use cookies? =

Only optionally — if you set a count interval greater than 0 minutes, a small transient cookie is used to prevent the same visitor from being counted repeatedly within that window. This cookie contains no personal data. If you set the interval to 0, no cookies are used at all.

= Can I migrate from WP-PostViews or Post Views Counter? =

Yes! ViewCounter includes one-click imports for WP-PostViews, Post Views Counter, Statify, and Page Views Count. A dry-run mode lets you preview the import before committing. The import uses a safe merge strategy — it keeps the larger count if data already exists.

= Does it support custom post types? =

Yes. Any public post type (posts, pages, products, portfolios, etc.) can be tracked. Select which types to count in Settings → Enabled Post Types.

= Is it multisite compatible? =

Yes. ViewCounter is fully multisite-ready and can be network activated or activated per site. Each site tracks its own views independently.

= What's the difference between Free and Pro? =

The free plugin includes everything you need: counting, exclusions, display tools, basic dashboard, reporting, CSV/JSON dashboard exports, and imports. Paid licenses add advanced reporting breakdowns, scheduled email reports, branded report exports, full historical import windows, and support tiers. Agency licenses add client branding presets and white-label report output. Free features are free forever.

= Does it impact site performance? =

ViewCounter is designed for high-traffic sites. In PHP mode, counting adds a single lightweight database query. In JS/REST mode, the counting request is asynchronous and non-blocking. Daily aggregation tables keep reporting queries fast even with millions of views.

= What about GDPR compliance? =

ViewCounter is designed for privacy-friendly WordPress sites. It keeps view data local, avoids third-party analytics scripts, and the optional count-interval cookie contains no identifying information. Paid license validation can contact your configured license server. Whether a consent banner or privacy-policy update is required depends on your site configuration and jurisdiction.

== Screenshots ==

1. Plugin Dashboard — monthly chart with stat cards, 12-month trend, and all-time top content
2. Reporting — date range filters, KPI comparison cards, daily trend chart, and top content rankings
3. Settings — counting mode selection, exclusion rules, and display configuration
4. Import — one-click migration with dry-run mode, diagnostics, and merge strategy
5. Dashboard Widget — compact monthly graph and top posts on the WP Dashboard
6. Views Column — sortable views column in wp-admin post lists

== Changelog ==

= 1.0.0 =
Release date: May 6, 2026

* Initial public release
* Core view counting with PHP, JavaScript, and REST API modes
* Bot, role, logged-in user, and IP/CIDR exclusions
* Count interval controls to prevent duplicate inflation
* Automatic display, shortcode, Gutenberg block, and PHP helper
* Admin dashboard with monthly chart, 12-month trend, and top content
* Reporting tab with date ranges, KPIs, daily chart, and top posts
* CSV and JSON export for dashboard data
* Print-ready report export for shareable reports
* One-click imports from WP-PostViews, Post Views Counter, Statify, and Page Views Count
* Dry-run mode and import diagnostics
* Sortable Views column in wp-admin post lists
* Publish box view count and manual adjustment meta box
* WP Dashboard widget with monthly graph
* REST API endpoints for tracking, post counts, top content, dashboard data, and admin count adjustment
* Multisite-ready and translation-ready
* Single-plugin freemium architecture with embedded license manager

== Upgrade Notice ==

= 1.0.0 =
Initial release. Install and start tracking views immediately.
