Linux 软件免费装
Banner图

Nonce Failure Explainer — Diagnose "Are You Sure You Want To Do This?"

开发者 shahzaibhassan
更新时间 2026年8月22日 04:15
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

ajax debugging troubleshooting nonce security check failed

下载

1.1.0 1.2.0 1.0.0

详情介绍:

If WordPress has shown you "Are you sure you want to do this?", "Security check failed", "The link you followed has expired", or a bare 403 on an AJAX request, a nonce check failed. WordPress will not tell you which nonce, or why. This plugin does. It watches every nonce check on your site, records the ones that genuinely block something, and states the most likely cause along with the specific thing to check next. The errors this diagnoses Causes it distinguishes What it records For each failure: What it never records Function arguments are excluded from the stack trace capture, so sensitive values are never even loaded into memory during attribution. Three sections Design Read-only. The plugin observes and explains; it never alters a request, extends a nonce lifetime, or changes site behaviour in any way. Storage is a single non-autoloaded option capped at 200 events with a seven-day expiry, so it cannot grow unbounded on a busy site. Nothing is sent anywhere. There is no external service, no telemetry, no phone-home, no upsell, and no premium version.

安装:

  1. Upload the plugin to /wp-content/plugins/nonce-failure-explainer, or install it through the Plugins screen.
  2. Activate it.
  3. Reproduce the failing request.
  4. Visit Nonce Failures in the admin menu.

屏幕截图:

  • One failure opened: the diagnosis, the specific thing to check next, and the request it came from.
  • Causes and fixes. A failure links straight to its own entry, which arrives already open.
  • The state a healthy site stays in, with how to reproduce the failure you are chasing.
  • The settings on this installation that decide whether a nonce verifies at all.

升级注意事项:

1.2.0 Fixes false positives. 1.1.0 recorded harmless non-blocking nonce checks as confirmed failures, which on a busy site crowded out the real ones. Recommended for everyone.

常见问题:

Why does WordPress say "Are you sure you want to do this?"

Because a nonce check failed. WordPress puts a one-time token into admin forms and links to prove a request came from your own page, rather than being forged by another site while you are logged in. When that token is missing, expired, or does not match, WordPress blocks the request and shows that message — without saying which of those it was. This plugin records the failure and tells you which.

What is a nonce in WordPress?

A "number used once": a short-lived token WordPress adds to forms and action links to protect against cross-site request forgery. Nonces expire after 24 hours by default, which is why a page left open overnight often fails on submit.

Does this fix nonce failures?

No, and deliberately so. It is a diagnostic tool. Automatically extending nonce lifetimes or bypassing checks would weaken the protection nonces exist to provide. It tells you where the fault is; fixing it stays a decision you make.

Why is my log empty?

That is the expected result on a healthy site, and since version 1.2.0 it is considerably more likely. The plugin now records only checks that actually blocked a request. Reproduce the failing request and it will be captured.

Will it slow my site down?

The recorder only does work when a check actually fails. There is no cost on successful requests, and events are written once per request rather than once per event.

Why does it say "possible cause" rather than telling me exactly what happened?

Because WordPress does not distinguish an expired nonce from one generated for a different action — both simply fail to match. Where the cause can be established as fact, the plugin says "Confirmed". Where it is inference, it says so.

Is it safe on a production site?

Yes. It is read-only, stores no secrets, and caps its own storage. The clearing action is capability-checked and nonce-protected.

Does it work with multisite?

Yes. The log is per-site, and uninstalling clears it across every site in the network.

Can I stop it recording a particular nonce action?

Yes. Add the action string to the noncfaex_muted_actions filter and it is ignored entirely.

更新日志:

1.2.0 1.1.0 1.0.0