CodeFaeries Views Metrics
CodeFaeries Views Metrics
Description
CodeFaeries Views Metrics provides comprehensive view tracking for any post type including posts, pages, WooCommerce products, and custom post types. Built with clean, modern code architecture and extensive customization options.
Works with or without WooCommerce – This plugin is fully functional for any WordPress site, whether you use WooCommerce or not. WooCommerce integration is completely optional and provides bonus features when available.
Key Features
- Universal Tracking – Works with posts, pages, WooCommerce products, and any custom post type
- Dashboard Widget – At-a-glance statistics with interactive chart on WordPress dashboard
- Gutenberg Blocks – Post Views and Most Viewed Posts blocks for the block editor
- Most Viewed Posts Widget – Sidebar widget to display popular content
- Smart Exclusions – Exclude crawlers, AI bots, logged-in users, guests, specific roles, categories, or individual posts
- Flexible Display – Show counters before content, after content, or manually via shortcode with customizable text
- Role-Based Visibility – Control which user roles can see view counters
- Role-Based Counting – Exclude specific roles from being counted (admins and shop managers by default)
- Performance Optimized – Multiple tracking methods (PHP, JavaScript, REST API) including async modes for cached sites
- WooCommerce Integration – Sort products by most viewed on shop pages
- Quick/Bulk Edit – Manually adjust view counts directly from admin lists
- Import Tool – Migrate view data from WP-PostViews or other plugins
- GDPR Compliant – IP anonymization options and privacy policy snippet
- Developer Friendly – Clean, well-documented code with filters and hooks
- Admin Integration – View counts in post/product listing pages with sorting
- Real-Time Statistics – Dashboard showing total, today, yesterday, weekly, and monthly views
Third-Party Libraries
This plugin uses the following third-party libraries:
Chart.js
- License: MIT License — https://opensource.org/licenses/MIT
- Source: https://github.com/chartjs/Chart.js
- Version: 4.5.0
- Usage: renders interactive charts in the admin dashboard widget and the post-list column chart modal.
Select2
- License: MIT License — https://opensource.org/licenses/MIT
- Source: https://github.com/select2/select2
- Version: 4.0.13
- Usage: enhances the searchable dropdowns on the plugin settings page.
Installation
- Upload the
codefaeries-views-metricsfolder to the/wp-content/plugins/directory, or install directly through the WordPress plugin screen. - Activate the plugin through the ‘Plugins’ menu in WordPress.
- Navigate to Views Metrics in the WordPress admin menu.
- Configure your tracking and display settings.
Configuration
- Post types – Select which post types to track (posts, pages, products, etc.)
- Tracking method – PHP (Standard), JavaScript (AJAX), or REST API (the async modes are recommended for cached sites)
- Unique visit throttle – Prevent counting duplicate views from the same user within a time period
- Counter position – Before/after content or manual via
[cfvm_views_counter]shortcode - Exclusions – Exclude crawlers, AI bots, specific roles, categories, posts, or IP addresses
Faq
No. Views Metrics works with any WordPress site. WooCommerce is completely optional. When WooCommerce is installed, you get bonus features like product view tracking and a “Sort by most viewed” option on the shop page.
If your site uses a caching plugin (WP Rocket, W3 Total Cache, LiteSpeed Cache, etc.), choose JavaScript (AJAX) or REST API. These record views asynchronously and keep counting correctly even when pages are served from cache. For sites without caching, PHP (Standard) is the simplest option.
The throttle prevents the same visitor from inflating view counts. When set to e.g. 1 hour, a second page view from the same user within that hour is not counted. Set to 0 to count every page view.
Yes. You can choose how IP addresses are stored: full (best duplicate detection), anonymized (last octet removed), or disabled (no IP storage at all). A ready-to-use privacy policy snippet is provided under Advanced settings.
Yes. By default, crawlers (Googlebot, Bingbot, etc.) and AI bots (GPTBot, ClaudeBot, Google Extended, etc.) are excluded. You can also exclude logged-in users, guests, specific roles, categories, posts, and IP addresses.
Yes. Go to Views Metrics > Advanced and use the Import tool. It supports WP-PostViews (views meta key), Post Views Counter (post_views_count), or any custom meta key. Preview the import before running it.
Use the [cfvm_views_counter] shortcode. It supports attributes for period (today, week, month, total), custom text with a {count} placeholder, and more. Two Gutenberg blocks are also available: Post Views and Most Viewed Posts.
Yes. Views Metrics supports multisite with network-wide activation. Tables are created for each site automatically, including newly created sites.
Reviews
Changelog
1.0.3 – 2026-06-16
- Fixed: a PHP notice on the settings page on sites without WooCommerce — the searchable dropdowns now load their own library instead of relying on WooCommerce.
- Fixed: the tracking method description was cut off and now explains which method to use with a caching plugin.
1.0.2 – 2026-05-11
- Compatibility: minimum PHP requirement lowered to 7.3 — the plugin now runs on a wider range of hosts.
- Code quality: additional WordPress Plugin Check findings resolved.
- Changed: shortcode renamed from
[cf-views]to[cfvm_views_counter].
1.0.1
- Fixed: stability fixes at plugin startup — internal services now initialize reliably alongside the shared toolkit.
- Fixed: cleanup cron now scheduled correctly on activation; admin bar caches invalidated when needed.
- Fixed: Fast AJAX bootstrap and multisite hooks hardened; admin code cleanup.
1.0.0
- Code quality: passes WordPress Plugin Check and PHPCS WordPress Coding Standards cleanly.
- Improved: input sanitization and output escaping reviewed across the codebase.
- Improved: error logging now gated behind
WP_DEBUG(no log noise in production).
0.0.3
- New: Dashboard widget with an interactive chart and statistics.
- New: Gutenberg blocks “Post Views” and “Most Viewed Posts”.
- New: “Most Viewed Posts” sidebar widget.
- New: Quick Edit and Bulk Edit support for view counts.
- New: import tool for migrating from WP-PostViews and similar plugins.
- New: IP anonymization modes (full, anonymized, disabled) and a privacy-policy snippet generator.
- New: sortable Views column in admin post lists.
- Improved: admin UI with modern pill-style tabs.
0.0.2
- Changed: shortcode renamed from
[post-views]to[cf-views]. - New: shortcode attributes —
period,text,hide_zero,class. - New: “Exclude roles from count” setting.
- New: WooCommerce “Most viewed” sort option.
- Improved: default exclusions now cover crawlers, AI bots, administrators, and shop managers.
- Improved: counter hides automatically when count is zero.
- Fixed: Fast AJAX tracking mode.
0.0.1
First release. Tracks views across post types with bot detection, role-based visibility, shortcodes, a statistics dashboard, and WooCommerce integration.