| 开发者 | nolidev |
|---|---|
| 更新时间 | 2026年9月23日 23:28 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
wp-content, called drop-ins: db-error.php, maintenance.php and php-error.php. It loads them itself, before any plugin, which is the only way to show something when the database is down.
The plugin copies one static file shipped in its own folder (dropins/drop-in.php) under these three names. No code is generated. The content of the pages (texts, colors, logo) is saved as a JSON file in wp-content/uploads/offair/, and the drop-in reads it when a page has to be shown. What visitors must not see, such as the alert recipient and the history, is kept next to it in a private folder whose name cannot be guessed.
What you get
db-error.php, maintenance.php or php-error.php it did not add itself. If one already exists, it tells you and waits for your decision.
Developers
offair_settings filters the settings before the page content is built.offair_data filters the page content before it is saved for the drop-in.offair_incident_resolved fires once a database outage is over, with the times of the first and last pages shown.offair/db-error.php, offair/maintenance.php and offair/php-error.php in the active theme or its parent. The variables they receive are listed in the documentation on GitHub.wp offair status, generate [--force], remove [--force], preview <db|maintenance|php>, history.wp-content under the three names WordPress expects, and saves the page content in wp-content/uploads/offair/. If wp-content is not writable, download the drop-ins from the settings page and upload them yourself, once.No. It does not let you put your site offline. It styles the screens WordPress shows on its own when the database is down, while updates are installed and after a fatal error. It works alongside any maintenance mode or coming soon plugin.
Because WordPress only looks for these drop-ins there, and loads them before any plugin. That is the only way to show a page when the database is down. The three files are identical copies of dropins/drop-in.php from the plugin folder. They are removed when the plugin is deactivated or uninstalled.
The database is precisely what may be unreachable when the page is shown. The content is saved in the uploads folder, in offair/pages.json, and contains only what the visitors see on the page. The alert settings and the history are kept in a private folder next to it.
Yes. Pages already in the cache keep being served normally during an outage, which is what you want. Only requests that reach PHP see the outage page, and that page is sent with headers that prevent it from being cached.
No. If the web server or PHP itself is down, nothing on the site can run. Only your host can show a page in that case.
Another plugin or a person placed a file with the same name in wp-content. The plugin leaves it untouched. Open the Advanced tab to replace it if you want to.
No. The database and update pages never depend on it, and the PHP error page works without it as long as PHP does not print errors on screen, which is the normal configuration of a live site. There is one combination WordPress cannot handle: errors printed on screen (usually because WP_DEBUG and WP_DEBUG_DISPLAY are enabled) together with output buffering off. PHP then sends the raw error and the headers before WordPress runs its handler, so no error page, branded or not, can be shown. The settings page and Site Health detect this combination and explain the two fixes: disable WP_DEBUG_DISPLAY on a live site, or set output_buffering to 4096 in the PHP configuration.
Only if you turn on the email alert, and only to the address you choose. The alert is sent by your own server. Nothing else leaves it: there is no tracking, no update check and no external asset.
While the database is down WordPress cannot run, so the alert is sent with the mail function of PHP, not through your email plugin. Some hosts block it and some inboxes file it as spam. Use the test button in the Database error tab: the test travels exactly the same way. The report sent once the site is back goes through WordPress, like your other emails. It leaves once the error page has not been shown for five minutes, at the next scheduled check or as soon as someone opens the admin.
The date, the page and the HTTP status, once a minute at most, each time a visitor sees one of the pages. Nothing about the visitors themselves. The history is kept for 180 days and removed when the plugin is uninstalled. An outage while nobody visits the site cannot be seen.
Yes. Add offair/db-error.php, offair/maintenance.php or offair/php-error.php to your theme or child theme. The page then uses your template instead of the built-in one. It receives the texts, colors and logo from the settings, the built-in markup and an escaping function. WordPress is not loaded when these pages are shown, so a template can only use plain PHP. If a template fails, the built-in page is shown instead.
Yes. The drop-ins are shared by every site of the network, so the settings live in the network admin under Settings, Offair. Each site still gets its own page, found from the address the visitor asked for: its title, its logo or site icon, its language, its timezone and the templates of its own theme. The design, the colors and the texts are shared by the network.
offair_incident_resolved action and wp offair history command.