Description
🛡️ MSW MU Watchdog
Author: MySimpleWebsite.co.za
Purpose:
Automatically disable plugins that cause fatal PHP errors during activation, keeping the site online and logging what went wrong.

🖥️ Server & PHP Requirements
| Requirement | Minimum |
|---|---|
| PHP Version | 7.2+ |
| Error Handling | register_shutdown_function() enabled |
| File System | Write access to database (options table) |
| Memory Limit | 64 MB |
| Cron | ❌ Not required |
⚠️ Requires PHP fatal errors to not be suppressed
🧩 WordPress Requirements
| Requirement | Version |
|---|---|
| WordPress | 5.2+ (Recovery Mode compatible) |
| Multisite | Supported |
| MU Plugins | Required |
⚙️ How It Works
-
Loads before all plugins as a MU-plugin
-
Records the last activated plugin
-
Registers a shutdown handler
-
On fatal error:
-
Identifies offending plugin
-
Deactivates it automatically
-
Logs crash details
-
Crash logs stored in:
📍 Where You Use It
-
No UI
-
Runs silently in the background
-
Logs viewable via database or future admin UI
🧾 What Gets Logged
-
Timestamp
-
Plugin file
-
Error message
-
File + line number
-
User ID
-
Request URI
✅ Benefits
-
Prevents white-screen lockouts
-
Eliminates FTP emergency fixes
-
Enables safe plugin testing
-
Complements WordPress Recovery Mode



