[WordPress] 外掛分享: ReaderFlag – Report This Content Button

首頁 › 外掛目錄 › ReaderFlag – Report This Content Button
WordPress 外掛 ReaderFlag – Report This Content Button 的封面圖片
全新外掛
安裝啟用
—
尚無評分
剛更新
最後更新
—
問題解決
WordPress 6.6+ PHP 7.4+ v1.0.0 上架:2026-11-29

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「ReaderFlag – Report This Content Button」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

ReaderFlag puts a “Report this content” button on your posts, pages and public custom post types. A visitor picks a reason, adds an optional message, and sends it. You see every report in a list in wp-admin, change its status, and get an email for each new one (you can turn the emails off).
Features:

Popup, inline or link-only form. The popup is a native dialog with keyboard support and focus handling.
Works without JavaScript: the form falls back to a normal page that posts to the server.
Safe behind page caches (Batcache, edge caches): the form fetches a fresh token by POST when it opens, so no token is ever cached.
Reasons are editable. Name, email and message fields are each required, optional or hidden.
Spam protection with no setup: a honeypot, a signed single-use token, a minimum fill time and an optional built-in math question. You can switch to Cloudflare Turnstile, hCaptcha or Google reCAPTCHA (v2 or v3).
Reports list in wp-admin with filters, sorting, bulk actions (reviewed, resolved, dismissed, delete) and a CSV export.
A count column and a meta box on the post edit screens.
Block, shortcode, template function and action hook for placement.
Button and form styling in the settings, with a live preview. Everything is driven by CSS variables.
Privacy tools: personal data export and erase, suggested privacy policy text, an optional retention period and optional IP hashing.
Ready for translation on translate.wordpress.org.

The plugin makes no request to any other site unless you save the keys for a captcha service. See “External services” below.
External services
The plugin works fully on its own. If you choose a captcha service in the settings and save its keys, the visitor’s browser loads that service’s script, and your server sends it the visitor’s response token to check it. Nothing is sent before you save the keys, and the script loads only when a visitor opens the form. Use only the one you choose.
Cloudflare Turnstile
Used when the captcha is set to Turnstile and the site key and secret key are saved.

What is sent: the visitor’s browser loads https://challenges.cloudflare.com/turnstile/v0/api.js when the form opens. The browser sends the usual request data (IP address, browser details) to Cloudflare. When the report is sent, your server posts the Turnstile response token and the secret key to https://challenges.cloudflare.com/turnstile/v0/siteverify.
Terms of service: https://www.cloudflare.com/website-terms/
Privacy policy: https://www.cloudflare.com/privacypolicy/

hCaptcha
Used when the captcha is set to hCaptcha and the site key and secret key are saved.

What is sent: the visitor’s browser loads https://js.hcaptcha.com/1/api.js when the form opens and sends the usual request data to hCaptcha. When the report is sent, your server posts the hCaptcha response token and the secret key to https://api.hcaptcha.com/siteverify.
Terms of service: https://www.hcaptcha.com/terms
Privacy policy: https://www.hcaptcha.com/privacy

Google reCAPTCHA (v2 and v3)
Used when the captcha is set to reCAPTCHA v2 or v3 and the site key and secret key are saved.

What is sent: the visitor’s browser loads https://www.google.com/recaptcha/api.js when the form opens and sends the usual request data to Google. reCAPTCHA also collects information about the visitor’s use of the page. When the report is sent, your server posts the response token and the secret key to https://www.google.com/recaptcha/api/siteverify.
Terms of service: https://policies.google.com/terms
Privacy policy: https://policies.google.com/privacy

Privacy
When a visitor sends a report, the plugin stores the reason, the optional message, the optional name and email address, the reported post, the time, and the user account if the visitor is logged in. It stores a one-way hash of the IP address to limit abuse, unless you set “Visitor IP address” to “Do not store it” in the settings. The IP address itself is not stored.

Reports are kept until you delete them, or for the number of days you set in “Delete reports after (days)”.
The plugin adds a personal data exporter and an eraser to the WordPress privacy tools (Tools > Export Personal Data and Erase Personal Data), matched by email address.
It adds suggested text for your privacy policy page.
If you use a captcha service, the visitor’s browser talks to that service. See “External services”.
Removing the plugin keeps your reports unless you turn on “Delete all reports and settings when the plugin is deleted” in the settings first.

Developer hooks
All hooks are prefixed rtcb_.
Filters

rtcb_reasons( array $reasons ): the list of reasons shown in the form. Each item is array( 'key' => string, 'label' => string ). Items without a non-empty string key and a string label are dropped.
rtcb_form_fields( array $fields ): how each optional field behaves. An array with the keys message, name and email, each required, optional or hidden.
rtcb_validate_report( WP_Error $errors, array $row ): add validation errors before a report is saved. $row holds post_id, reason_key, reason_label, message, reporter_name, reporter_email, user_id, ip_hash and status. Add an error with the code reason, message, name, email or captcha to mark that field, or any other code for a form-level error. Only the error codes are used: the visitor sees the plugin’s own generic message for any code that is not one of those fields, and the message text you pass to WP_Error is never shown or stored. Return the WP_Error.
rtcb_should_display( bool $show, int $post_id, string $context ): return false to hide the button. $context is auto, shortcode, hook or block.
rtcb_capability( string $capability ): the capability needed to see and handle reports. Default moderate_comments.
rtcb_client_ip( string $ip ): the visitor’s IP address, for sites behind a proxy. Starts as a validated REMOTE_ADDR. Return a valid IP address, or an empty string.
rtcb_notification_email( array $args, array $row ): the notification before it is sent. $args has to (array of addresses), subject, message (plain text) and headers (array). $row is the report data. Return an empty to to send nothing.
rtcb_min_fill_seconds( int $seconds ): the shortest time, in seconds, between opening the form and sending it. Default 3.

Actions

rtcb_before_save_report( array $row ): fires after validation passes, just before the report is saved.
rtcb_report_saved( int $id, array $row ): fires after the report is saved, before the notification email is sent.
rtcb_render_button( array $args ): renders the button in place. $args may hold post_id, mode, text and align.

Template function
rtcb_the_button( array $args = array() ) echoes the button. It is the same as `do_action( 'rtcb_render_button', $args )`. Arguments: `post_id` (default: the current post), `mode` (`popup`, `inline` or `link`), `text` (button text) and `align` (`left`, `center` or `right`).

Shortcode
[report_this_content] with the attributes `post_id` (default: the current post), `mode` (`popup`, `inline` or `link`) and `text` (button text). Example: `[report_this_content mode="inline" text="Flag this"]`.

Block
The “ReaderFlag Report Button” block has the same options (mode, text, alignment) in the block sidebar.
Source code and build
All PHP, CSS and front-end JavaScript ship unminified. The block editor script blocks/report-button/build/index.js is compiled from the source in blocks/report-button/src/, which ships in the plugin too, with @wordpress/scripts. To rebuild it, run npm install and then npm run build in the plugin folder (the command is in the included package.json).

延伸相關外掛

文章
Filter
Mastodon