| 开发者 | posterna |
|---|---|
| 更新时间 | 2026年11月5日 00:39 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
posterna_get_verdict() and the posterna_verdict action.posterna folder to wp-content/plugins/.No. Version 1.0 only labels and counts. It never blocks, throttles or challenges a request, a crawler or a sign-up. Enforcement may come in a later version, as a setting you turn on yourself.
Pages served from a full-page cache (a caching plugin, your host's cache or a CDN) never run PHP, so no WordPress plugin sees those requests. Posterna counts only the requests that reach WordPress. "Check my setup" lists the caches it detects. Logged-in users, wp-admin, WP-Cron and WP-CLI are not counted either.
Your site is behind a proxy or load balancer, and WordPress sees the proxy's address instead of the visitor's. Real crawlers then fail their checks. In Settings, choose the header your host or proxy sets to the visitor's address (for example cf-connecting-ip behind Cloudflare, together with Cloudflare's published address ranges), or the number of proxies in front of the site. "Check my setup" shows the result.
Posterna recommends a header only where the host's own documentation confirms its proxy sets it:
cf-connecting-ip, with Cloudflare's published address ranges (https://www.cloudflare.com/ips/) as the proxy ranges, so the header is read only from Cloudflare. Documentation: https://developers.cloudflare.com/support/troubleshooting/restoring-visitor-ips/restoring-original-visitor-ips/The request names an agent in the directory, for example Googlebot, but its address is not one the operator publishes and its reverse DNS does not match. That is how scrapers that pretend to be well-known crawlers usually look. Make sure the client address setting is right before you trust these numbers.
No. Everything in the plugin works without an account and without contacting any server. The connection to posterna.com is optional and only adds this site to a dashboard there.
posterna_get_verdict() returns the verdict for the current request as an array with verdict and, when set, operator, agent, purpose, method, reason, note and error. It returns null in WP-CLI and WP-Cron.
The posterna_verdict action fires once per labeled request, on init, with the same array:
add_action( 'posterna_verdict', function ( $verdict ) { if ( 'claimed_failed' === $verdict['verdict'] ) { // For example, skip expensive work for a fake crawler. } } );
The verdict is also available to other code as the request headers X-Agent-Verdict, X-Agent-Operator, X-Agent-Purpose and X-Agent-Method (in $_SERVER as HTTP_X_AGENT_VERDICT and so on). Posterna removes any such headers a client sends before setting them.
In our tests the check took between 0.3 and 0.7 milliseconds per request (median), and it runs before the theme loads. Counting adds one small database write per counted request. Reverse DNS lookups and directory updates run in WP-Cron, never during a page load. "Check my setup" shows how long the check took on your own request.
From the Posterna operator directory, built from each operator's own documentation and published IP lists and keys, plus community records from the ai.robots.txt project. See "Data and credits" below.