
內容簡介
Offair - Branded Error Pages 外掛可以替換 WordPress 預設的錯誤頁面,提供自訂的品牌頁面,讓使用者在網站出現問題時仍能保持專業形象,並正確回應 HTTP 狀態碼。
【主要功能】
• 自訂錯誤頁面樣式,四種佈局選擇
• 自動深色模式,根據訪客設備設定調整
• 支援多語言,內建多種語言翻譯
• 正確的 HTTP 回應碼,避免快取錯誤頁面
• 實時預覽功能,隨時查看修改效果
• 故障歷史記錄,方便追蹤問題
外掛標籤
開發者團隊
② 後台搜尋「Offair – Branded Error Pages」→ 直接安裝(推薦)
原文外掛簡介
When WordPress breaks, it shows screens of its own that no theme and no plugin can style, because they appear before any of them is loaded:
Error establishing a database connection, when the database is unreachable.
Briefly unavailable for scheduled maintenance, while WordPress installs updates.
There has been a critical error on this website, after a fatal PHP error.
Offair replaces these three screens with a calm page in your colors, with your logo and your words, and makes them answer with the right HTTP status so that search engines and caches treat the outage as temporary.
It also keeps a history of the outages your visitors ran into, and can email you when the database goes down, then again once the site is back.
This is not a maintenance mode or coming soon plugin. It does not take your site offline and it does not add a page you switch on. It only covers the moments when WordPress itself cannot serve your site.
How it works
WordPress looks for three special files in 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
Four layouts for the three screens: card, minimal, two columns or banner. Each shows the logo, the site name, the title, the message, a retry button and an incident line with the local time.
Automatic dark mode: the pages follow the light or dark setting of the device of the visitor, with an optional logo for dark backgrounds. They can also stay always light or always dark.
Your logo and colors, detected from the theme, the site icon and Elementor global colors when available, editable at any time.
Texts in the language of the site until you customize them. Translations included: French, German, Spanish, Italian, Portuguese (Brazil), Dutch, Polish, Russian and Japanese.
Correct HTTP answers: 503 with a Retry-After header for the database and update pages, 503 or 500 for PHP errors (your choice), plus no-cache headers so no cache ever keeps an error page.
No external dependency: system fonts, logo embedded in the content file, nothing loaded from the network.
A live preview beside the settings, rendered by the drop-in itself, exactly as visitors will see it. It follows what you type, and nothing is saved or written to your site until you save.
An email alert when the database goes down, off by default. The page itself sends it while WordPress cannot run, and WordPress sends a report once the site is back, with the duration of the outage. A test button shows whether your host delivers it.
A history of the outages, under Tools, Outage history: the date, the page and the HTTP status, recorded once a minute at most. For a PHP error, the error itself too: its message, file and line, which usually name the plugin or theme in cause. Nothing about your visitors is recorded.
A dashboard widget with the outages of the last 30 days, off by default, shown only to the roles you choose. Without it, a notice on the dashboard tells administrators about a database outage they missed.
Theme templates: a theme can design any of the three pages itself, with the texts, colors and logo from the settings.
A status box, a Site Health test and WP-CLI commands.
Clean removal: the drop-ins are removed when the plugin is deactivated, and everything is removed when it is uninstalled.
The plugin never replaces a 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.
Works with MainWP
If you manage your sites with MainWP, the free Offair for MainWP extension shows in your MainWP Dashboard the outages your visitors ran into on all your sites, in one place. An uptime monitor checks your sites from the outside every few minutes. Offair sees the short database outages and the fatal errors on a single page that such checks miss.
Nothing else is needed on the sites: when MainWP Child is active, Offair adds its outages to the regular MainWP synchronization, and only when the dashboard asks for it. The state of the pages already reaches MainWP through the Site Health test.
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.
Theme templates: 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-CLI: wp offair status, generate [--force], remove [--force], preview
