Title: CodeFaeries Views Metrics
Author: Long Watch Studio - Code Faeries
Published: <strong>2026 年 5 月 27 日</strong>
Last modified: 2026 年 5 月 27 日

---

搜索插件

![](https://ps.w.org/codefaeries-views-metrics/assets/banner-772x250.png?rev=3550577)

![](https://ps.w.org/codefaeries-views-metrics/assets/icon-256x256.png?rev=3550577)

# CodeFaeries Views Metrics

 作者：[Long Watch Studio – Code Faeries](https://profiles.wordpress.org/lwsdevelopers/)

[下载](https://downloads.wordpress.org/plugin/codefaeries-views-metrics.1.0.2.zip)

 * [详情](https://cn.wordpress.org/plugins/codefaeries-views-metrics/#description)
 * [评价](https://cn.wordpress.org/plugins/codefaeries-views-metrics/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/codefaeries-views-metrics/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/codefaeries-views-metrics/#developers)

 [支持](https://wordpress.org/support/plugin/codefaeries-views-metrics/)

## 描述

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 including Fast AJAX 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.

## 区块

该插件提供了 2 个区块.

 *   Post Views Display the view count for the current post. Part of Views Metrics
   plugin – track and display post views with detailed analytics.
 *   Most Viewed Posts Display a list of the most viewed posts with customizable
   period filters. Part of Views Metrics plugin for comprehensive view tracking.

## 安装

 1. Upload the `codefaeries-views-metrics` folder to the `/wp-content/plugins/` directory,
    or install directly through the WordPress plugin screen.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress.
 3. Navigate to **Views Metrics** in the WordPress admin menu.
 4. 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), REST API, or Fast AJAX(
   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

## 常见问题

### Does this plugin require WooCommerce?

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.

### Which tracking method should I use?

If your site uses a caching plugin (WP Rocket, W3 Total Cache, LiteSpeed Cache, 
etc.), choose **Fast AJAX**. It records views asynchronously and works correctly
even when pages are served from cache. For sites without caching, **PHP (Standard)**
is the simplest option.

### How does the unique visit throttle work?

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.

### Is the plugin GDPR compliant?

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.

### Can I exclude bots and crawlers from view counts?

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.

### Can I import views from another plugin?

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.

### How do I display the view counter manually?

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.

### Does it work on multisite?

Yes. Views Metrics supports multisite with network-wide activation. Tables are created
for each site automatically, including newly created sites.

## 评价

此插件暂无评价。

## 贡献者及开发者

「CodeFaeries Views Metrics」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Long Watch Studio – Code Faeries ](https://profiles.wordpress.org/lwsdevelopers/)

[帮助将「CodeFaeries Views Metrics」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/codefaeries-views-metrics)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/codefaeries-views-metrics/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/codefaeries-views-metrics/)，或通过
[RSS](https://plugins.trac.wordpress.org/log/codefaeries-views-metrics/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/codefaeries-views-metrics/)。

## 更新日志

#### 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.

## 额外信息

 *  版本 **1.0.2**
 *  最后更新：**3 天前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 5.0 或更高版本 **
 *  已测试的最高版本为 **7.0**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/codefaeries-views-metrics/)
 * 标签
 * [analytics](https://cn.wordpress.org/plugins/tags/analytics/)[statistics](https://cn.wordpress.org/plugins/tags/statistics/)
   [tracking](https://cn.wordpress.org/plugins/tags/tracking/)[views](https://cn.wordpress.org/plugins/tags/views/)
   [woocommerce](https://cn.wordpress.org/plugins/tags/woocommerce/)
 *  [高级视图](https://cn.wordpress.org/plugins/codefaeries-views-metrics/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/codefaeries-views-metrics/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/codefaeries-views-metrics/reviews/)

## 贡献者

 *   [ Long Watch Studio – Code Faeries ](https://profiles.wordpress.org/lwsdevelopers/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/codefaeries-views-metrics/)