Linux 软件免费装
Banner图

Error Sniffing Pug - Tells you what broke

开发者 service2client
更新时间 2026年8月18日 23:35
捐献地址: 去捐款
PHP版本: 7.0 及以上
WordPress版本: 7.0
版权: GPLv2 or later
版权网址: 版权信息

标签

debugging crash troubleshooting fatal error error handler

下载

0.4.3 0.4.4

详情介绍:

When WordPress hits a fatal error, the usual result is a blank "There has been a critical error on this website" page and a cryptic line buried in a log file you have to go find. Pug catches that moment and turns it into something you can act on. What you get How Pug captures fatals Pug uses WordPress' own drop-in mechanism. On activation it installs wp-content/fatal-error-handler.php, which core loads earlier than any plugin — that is what lets Pug see a fatal that happens before normal plugins have even loaded. It subclasses core's handler and then hands control straight back to WordPress, so Recovery Mode and the recovery email keep working exactly as they do without Pug. Deactivating the plugin removes the drop-in and stops capture; deleting the plugin removes everything. What Pug does not do

安装:

  1. Upload the error-sniffing-pug folder to /wp-content/plugins/, or install the ZIP through Plugins → Add New → Upload.
  2. Activate the plugin. On activation Pug installs its capture drop-in at wp-content/fatal-error-handler.php.
  3. Visit Tools → Pug Crash Reports to see captured fatals, and Tools → Pug Settings to set a notification email, write custom messages, or run the conflict scanner.
Pug needs wp-content to be writable so it can install its drop-in. If it can't, it will tell you in the admin and fall back to WordPress' default behavior.

屏幕截图:

  • Customize error messages to be user friendly, and per plugin instructions of what to do.
  • Connects the Admin to the plugin authors Github page.

升级注意事项:

0.4.2
  • Removed the "Hosting provider list" (managed messages)
0.4.1 The custom crash screen has been removed; you'll now hear about captured fatals through the notification email and a new admin notice. No action needed. 0.3.0 Adds an optional custom crash screen and shows plugin display names. Re-save the crash-screen settings after updating so the screen file refreshes.

常见问题:

Will this slow down my site?

No. Pug does its work on the admin side and on the error path only. On a normal page load it does almost nothing; the diagnosis, help links, and reports are all generated when you open a crash report, not on every request.

What are the extra files in wp-content?

fatal-error-handler.php is Pug's capture drop-in, installed on activation. It is a standard WordPress drop-in location — the only path from which core will load a custom fatal handler. Pug installs, updates, and removes it for you, and will never overwrite one that belongs to another plugin.

What if another plugin already uses the fatal-error-handler drop-in?

Only one fatal-error-handler.php can exist. If another plugin got there first, Pug will not overwrite it, and Pug's capture will not run. Pug tells you this in the admin so you can decide which one to keep.

Does it work on older PHP?

Pug supports PHP 7.0 and newer. On PHP older than 7.0 it deactivates its own code quietly rather than causing errors.

Is my crash data sent anywhere automatically?

No. Diagnosis is done locally. The bug report for a plugin author is copy-and-paste — you send it, Pug doesn't. The notification email goes only to the address you configure, through your own site's mail.

How do I find out when a crash happens?

Two ways, both private to you: point Pug at a notification email and it writes to you shortly after a fatal is captured, and the next time you open wp-admin Pug shows a dismissible notice linking to the report. Nothing is ever shown to your visitors.

更新日志:

0.4.2 0.4.1 0.3.0