Changeset 3304125
- Timestamp:
- 06/01/2025 03:28:14 AM (10 months ago)
- Location:
- fatal-plugin-auto-deactivator
- Files:
-
- 6 added
- 8 edited
- 1 copied
-
tags/1.1.0 (copied) (copied from fatal-plugin-auto-deactivator/trunk)
-
tags/1.1.0/fatal-plugin-auto-deactivator.php (modified) (4 diffs)
-
tags/1.1.0/includes/class-admin.php (added)
-
tags/1.1.0/includes/class-fatal-error-handler.php (modified) (1 diff)
-
tags/1.1.0/includes/class-plugin-lifecycle.php (added)
-
tags/1.1.0/includes/class-utils.php (added)
-
tags/1.1.0/languages/fatal-plugin-auto-deactivator.pot (modified) (3 diffs)
-
tags/1.1.0/readme.txt (modified) (6 diffs)
-
trunk/fatal-plugin-auto-deactivator.php (modified) (4 diffs)
-
trunk/includes/class-admin.php (added)
-
trunk/includes/class-fatal-error-handler.php (modified) (1 diff)
-
trunk/includes/class-plugin-lifecycle.php (added)
-
trunk/includes/class-utils.php (added)
-
trunk/languages/fatal-plugin-auto-deactivator.pot (modified) (3 diffs)
-
trunk/readme.txt (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fatal-plugin-auto-deactivator/tags/1.1.0/fatal-plugin-auto-deactivator.php
r3300057 r3304125 4 4 * Plugin URI: https://wordpress.org/plugins/fatal-plugin-auto-deactivator/ 5 5 * Description: Automatically deactivates plugins that cause fatal errors to prevent site crashes. 6 * Version: 1. 0.16 * Version: 1.1.0 7 7 * Author: Linkon Miyan 8 8 * Author URI: https://profiles.wordpress.org/rudlinkon/ … … 11 11 * Text Domain: fatal-plugin-auto-deactivator 12 12 * Domain Path: /languages 13 * Requires at least: 5. 213 * Requires at least: 5.3 14 14 * Requires PHP: 7.0 15 15 * Tested up to: 6.8 … … 23 23 // Define plugin constants 24 24 if ( ! defined( 'FPAD_VERSION' ) ) { 25 define( 'FPAD_VERSION', '1. 0.1' );25 define( 'FPAD_VERSION', '1.1.0' ); 26 26 } 27 27 … … 35 35 36 36 /** 37 * Load plugin text domain for translations38 */39 function fpad_load_textdomain() {40 load_plugin_textdomain( 'fatal-plugin-auto-deactivator', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );41 }42 43 add_action( 'plugins_loaded', 'fpad_load_textdomain' );44 45 /**46 37 * Include required files 47 38 */ 48 39 require_once FPAD_PLUGIN_DIR . 'includes/class-fatal-error-handler.php'; 49 40 require_once FPAD_PLUGIN_DIR . 'includes/class-dropin-manager.php'; 41 require_once FPAD_PLUGIN_DIR . 'includes/class-admin.php'; 42 require_once FPAD_PLUGIN_DIR . 'includes/class-plugin-lifecycle.php'; 43 require_once FPAD_PLUGIN_DIR . 'includes/class-utils.php'; 50 44 51 45 /** 52 * Plugin activation hook46 * Initialize plugin classes 53 47 */ 54 function fpad_activate() { 55 // Install the drop-in 56 $dropin_manager = new FPAD_Dropin_Manager(); 57 $dropin_manager->install_dropin(); 58 } 59 60 register_activation_hook( __FILE__, 'fpad_activate' ); 48 FPAD_Utils::init(); 49 FPAD_Admin::init(); 50 FPAD_Plugin_Lifecycle::init(); 61 51 62 52 /** 63 * Plugin deactivation hook53 * Register plugin hooks 64 54 */ 65 function fpad_deactivate() { 66 // Remove the drop-in 67 $dropin_manager = new FPAD_Dropin_Manager(); 68 $dropin_manager->remove_dropin(); 69 } 70 71 register_deactivation_hook( __FILE__, 'fpad_deactivate' ); 72 73 /** 74 * Check if the drop-in is installed and working 75 */ 76 function fpad_check_dropin() { 77 $dropin_manager = new FPAD_Dropin_Manager(); 78 79 // If the drop-in is not installed, try to install it 80 if ( ! $dropin_manager->is_dropin_installed() ) { 81 $dropin_manager->install_dropin(); 82 } 83 } 84 85 add_action( 'admin_init', 'fpad_check_dropin' ); 86 87 /** 88 * Display admin notice for deactivated plugins 89 */ 90 function fpad_admin_notices() { 91 if ( ! current_user_can( 'activate_plugins' ) ) { 92 return; 93 } 94 95 $deactivated_plugins = get_option( 'fpad_deactivated_plugins', [] ); 96 97 if ( empty( $deactivated_plugins ) ) { 98 return; 99 } 100 101 foreach ( $deactivated_plugins as $key => $plugin_data ) { 102 $plugin_file = $plugin_data['plugin']; 103 $plugin_data_obj = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_file ); 104 $plugin_name = $plugin_data_obj['Name'] ?: $plugin_file; 105 $error_message = $plugin_data['error']['message']; 106 107 echo '<div class="notice notice-error is-dismissible">'; 108 echo '<p>' . sprintf( 109 /* translators: 1: Plugin name, 2: Error message */ 110 esc_html__( 'Fatal Plugin Auto Deactivator has deactivated "%1$s" due to a fatal error: %2$s', 'fatal-plugin-auto-deactivator' ), 111 '<strong>' . esc_html( $plugin_name ) . '</strong>', 112 esc_html( $error_message ) 113 ) . '</p>'; 114 echo '</div>'; 115 } 116 117 // Clear the notices after displaying them 118 update_option( 'fpad_deactivated_plugins', [] ); 119 } 120 121 add_action( 'admin_notices', 'fpad_admin_notices' ); 122 123 /** 124 * Register uninstall hook 125 */ 126 register_uninstall_hook( __FILE__, 'fpad_uninstall' ); 127 128 /** 129 * Clean up plugin data on uninstall 130 */ 131 function fpad_uninstall() { 132 // Remove the drop-in 133 $dropin_manager = new FPAD_Dropin_Manager(); 134 $dropin_manager->remove_dropin(); 135 136 // Delete plugin options 137 delete_option( 'fpad_deactivated_plugins' ); 138 delete_option( 'fpad_deactivation_log' ); 139 } 55 register_activation_hook( __FILE__, array( 'FPAD_Plugin_Lifecycle', 'activate' ) ); 56 register_deactivation_hook( __FILE__, array( 'FPAD_Plugin_Lifecycle', 'deactivate' ) ); 57 register_uninstall_hook( __FILE__, array( 'FPAD_Plugin_Lifecycle', 'uninstall' ) ); -
fatal-plugin-auto-deactivator/tags/1.1.0/includes/class-fatal-error-handler.php
r3300057 r3304125 332 332 margin: 0; 333 333 word-break: break-word; 334 white-space: pre-wrap; 334 335 } 335 336 .fpad_error_location { -
fatal-plugin-auto-deactivator/tags/1.1.0/languages/fatal-plugin-auto-deactivator.pot
r3300057 r3304125 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Fatal Plugin Auto Deactivator 1. 0.0\n"5 "Project-Id-Version: Fatal Plugin Auto Deactivator 1.1.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/fatal-plugin-auto-deactivator\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-05- 24T19:00:51+00:00\n"12 "POT-Creation-Date: 2025-05-31T22:02:00+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 41 41 42 42 #. translators: 1: Plugin name, 2: Error message 43 #: fatal-plugin-auto-deactivator.php:11043 #: includes/class-admin.php:52 44 44 msgid "Fatal Plugin Auto Deactivator has deactivated \"%1$s\" due to a fatal error: %2$s" 45 45 msgstr "" 46 47 #: includes/class-admin.php:69 48 #: includes/class-admin.php:121 49 msgid "Fatal Plugin Auto Deactivator Log" 50 msgstr "" 51 52 #: includes/class-admin.php:70 53 msgid "Fatal Plugin Log" 54 msgstr "" 55 56 #: includes/class-admin.php:92 57 msgid "View Log" 58 msgstr "" 59 60 #: includes/class-admin.php:113 61 msgid "Fatal Plugin Auto Deactivator log cleared successfully." 62 msgstr "" 63 64 #: includes/class-admin.php:129 65 msgid "Clear Log" 66 msgstr "" 67 68 #: includes/class-admin.php:134 69 msgid "No plugin deactivations have been logged yet." 70 msgstr "" 71 72 #: includes/class-admin.php:171 73 msgid "Date" 74 msgstr "" 75 76 #: includes/class-admin.php:172 77 msgid "Plugin" 78 msgstr "" 79 80 #: includes/class-admin.php:173 81 msgid "File" 82 msgstr "" -
fatal-plugin-auto-deactivator/tags/1.1.0/readme.txt
r3300057 r3304125 2 2 Contributors: rudlinkon 3 3 Tags: fatal error, plugin deactivation, error handling, site protection, crash prevention 4 Requires at least: 5. 24 Requires at least: 5.3 5 5 Tested up to: 6.8 6 Stable tag: 1. 0.16 Stable tag: 1.1.0 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 17 17 ### Key Features 18 18 19 * **Automatic Error Detection**: Monitors for fatal PHP errors in real-time 20 * **Smart Plugin Identification**: Identifies which plugin is causing the fatal error 21 * **Instant Deactivation**: Automatically deactivates the problematic plugin 19 * **Automatic Error Detection**: Monitors for fatal PHP errors in real-time using WordPress drop-in technology 20 * **Smart Plugin Identification**: Identifies which plugin is causing the fatal error through stack trace analysis 21 * **Instant Deactivation**: Automatically deactivates the problematic plugin during the shutdown phase 22 22 * **Detailed Admin Notifications**: Provides clear notifications about which plugin was deactivated and why 23 * **Error Logging**: Records detailed information about the error for troubleshooting 23 * **Persistent Error Logging**: Records detailed information about errors in a permanent log for troubleshooting 24 * **Error Log Management Page**: Dedicated admin page to view, manage, and clear error logs with detailed history 24 25 * **Zero Configuration**: Works right out of the box with no setup required 25 26 * **Custom Error Page**: Displays a user-friendly error page with a reload button instead of the white screen of death 27 * **Debug-Aware Display**: Shows detailed error information only when WP_DEBUG_DISPLAY is enabled for security 28 * **Drop-in Management**: Automatically installs and manages WordPress fatal-error-handler.php drop-in 26 29 27 30 ### How It Works 28 31 29 When a fatal error occurs on your WordPress site, this plugin:32 This plugin uses WordPress's built-in drop-in system to provide the most reliable error handling possible. When activated, it: 30 33 31 1. Captures the error details during the shutdown phase 32 2. Identifies which plugin is responsible for the error 33 3. Automatically deactivates only that specific plugin 34 4. Logs the action for reference 35 5. Displays an admin notice with details when you next log in 36 6. Shows a user-friendly error page to visitors instead of the white screen of death 34 1. **Installs a Drop-in**: Creates a `fatal-error-handler.php` file in your wp-content directory 35 2. **Monitors for Errors**: WordPress automatically uses this drop-in when fatal errors occur 36 3. **Captures Error Details**: Records the error message, file, and line number during the shutdown phase 37 4. **Identifies the Plugin**: Analyzes the error stack trace to determine which plugin caused the issue 38 5. **Deactivates Safely**: Automatically deactivates only the problematic plugin 39 6. **Logs Everything**: Stores detailed error information in a permanent log for troubleshooting 40 7. **Notifies Admins**: Displays clear admin notices with error details when you next log in 41 8. **Shows User-Friendly Pages**: Displays a custom error page with reload button instead of the white screen of death 37 42 38 Th is prevents the dreaded "white screen of death" and keeps your site operational while you address the underlying issue.43 The drop-in approach ensures maximum reliability since it operates at the WordPress core level, even when other plugins fail. 39 44 40 45 ### Use Cases … … 53 58 1. Upload the `fatal-plugin-auto-deactivator` folder to the `/wp-content/plugins/` directory 54 59 2. Activate the plugin through the 'Plugins' menu in WordPress 55 3. That's it! The plugin works automatically with no configuration needed 60 3. The plugin will automatically install the required drop-in file (`fatal-error-handler.php`) in your wp-content directory 61 4. That's it! The plugin works automatically with no configuration needed 62 63 **Note**: The plugin requires write permissions to your wp-content directory to install the drop-in file. If activation fails, check your file permissions. 56 64 57 65 == Frequently Asked Questions == … … 89 97 This plugin specifically targets fatal PHP errors that would normally make your site inaccessible. It doesn't handle warnings, notices, or other non-fatal errors. 90 98 99 = What is a drop-in and why does this plugin use one? = 100 101 A drop-in is a special type of WordPress file that replaces core functionality. This plugin uses the `fatal-error-handler.php` drop-in to ensure it can handle errors even when other plugins fail. The drop-in is automatically installed when you activate the plugin and removed when you deactivate it. 102 103 = Will the drop-in conflict with other plugins? = 104 105 No, the drop-in is specifically designed for fatal error handling and won't conflict with other plugins. If another plugin tries to install its own fatal error handler drop-in, this plugin will detect it and avoid overwriting it. 106 107 = Why do I see detailed error information sometimes but not others? = 108 109 For security reasons, detailed error information (file paths, line numbers, error messages) is only displayed when WP_DEBUG_DISPLAY is enabled in your WordPress configuration. When disabled, visitors see a generic error message while administrators still receive detailed notifications in the dashboard. 110 111 = Where are the error logs stored? = 112 113 Error logs are stored in your WordPress database as options. The plugin maintains both temporary logs (for admin notifications) and permanent logs (for troubleshooting history). You can view these through your WordPress admin dashboard. 114 91 115 == Screenshots == 92 116 … … 97 121 98 122 == Changelog == 123 124 = 1.1.0 - 01/06/2025 = 125 - Added: New "Fatal Plugin Log" admin subpage under Tools for comprehensive error management 126 - Added: Detailed log table showing date, time, plugin, file, line number, and error message 127 - Added: "Clear Log" functionality with nonce protection 128 - Added: "View Log" action link on plugin list for quick access 129 - Added: Enhanced error type detection (Fatal, Parse, Core, etc.) 130 - Added: Security checks during drop-in file install and management 131 - Improved: Validation, sanitization, and formatting of error messages with monospace font 132 - Improved: UI styling using WordPress admin standards and alternating row colors 133 - Improved: Codebase optimized for better performance 134 - Few minor bug fixes & improvements 99 135 100 136 = 1.0.1 - 25/05/2025 = … … 107 143 == Upgrade Notice == 108 144 109 = 1. 0.1=110 We have improved security and fixed few bugs. Please update to the latest version.145 = 1.1.0 = 146 We have added a dedicated admin subpage for viewing and managing error logs. Please update to the latest version. -
fatal-plugin-auto-deactivator/trunk/fatal-plugin-auto-deactivator.php
r3300057 r3304125 4 4 * Plugin URI: https://wordpress.org/plugins/fatal-plugin-auto-deactivator/ 5 5 * Description: Automatically deactivates plugins that cause fatal errors to prevent site crashes. 6 * Version: 1. 0.16 * Version: 1.1.0 7 7 * Author: Linkon Miyan 8 8 * Author URI: https://profiles.wordpress.org/rudlinkon/ … … 11 11 * Text Domain: fatal-plugin-auto-deactivator 12 12 * Domain Path: /languages 13 * Requires at least: 5. 213 * Requires at least: 5.3 14 14 * Requires PHP: 7.0 15 15 * Tested up to: 6.8 … … 23 23 // Define plugin constants 24 24 if ( ! defined( 'FPAD_VERSION' ) ) { 25 define( 'FPAD_VERSION', '1. 0.1' );25 define( 'FPAD_VERSION', '1.1.0' ); 26 26 } 27 27 … … 35 35 36 36 /** 37 * Load plugin text domain for translations38 */39 function fpad_load_textdomain() {40 load_plugin_textdomain( 'fatal-plugin-auto-deactivator', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );41 }42 43 add_action( 'plugins_loaded', 'fpad_load_textdomain' );44 45 /**46 37 * Include required files 47 38 */ 48 39 require_once FPAD_PLUGIN_DIR . 'includes/class-fatal-error-handler.php'; 49 40 require_once FPAD_PLUGIN_DIR . 'includes/class-dropin-manager.php'; 41 require_once FPAD_PLUGIN_DIR . 'includes/class-admin.php'; 42 require_once FPAD_PLUGIN_DIR . 'includes/class-plugin-lifecycle.php'; 43 require_once FPAD_PLUGIN_DIR . 'includes/class-utils.php'; 50 44 51 45 /** 52 * Plugin activation hook46 * Initialize plugin classes 53 47 */ 54 function fpad_activate() { 55 // Install the drop-in 56 $dropin_manager = new FPAD_Dropin_Manager(); 57 $dropin_manager->install_dropin(); 58 } 59 60 register_activation_hook( __FILE__, 'fpad_activate' ); 48 FPAD_Utils::init(); 49 FPAD_Admin::init(); 50 FPAD_Plugin_Lifecycle::init(); 61 51 62 52 /** 63 * Plugin deactivation hook53 * Register plugin hooks 64 54 */ 65 function fpad_deactivate() { 66 // Remove the drop-in 67 $dropin_manager = new FPAD_Dropin_Manager(); 68 $dropin_manager->remove_dropin(); 69 } 70 71 register_deactivation_hook( __FILE__, 'fpad_deactivate' ); 72 73 /** 74 * Check if the drop-in is installed and working 75 */ 76 function fpad_check_dropin() { 77 $dropin_manager = new FPAD_Dropin_Manager(); 78 79 // If the drop-in is not installed, try to install it 80 if ( ! $dropin_manager->is_dropin_installed() ) { 81 $dropin_manager->install_dropin(); 82 } 83 } 84 85 add_action( 'admin_init', 'fpad_check_dropin' ); 86 87 /** 88 * Display admin notice for deactivated plugins 89 */ 90 function fpad_admin_notices() { 91 if ( ! current_user_can( 'activate_plugins' ) ) { 92 return; 93 } 94 95 $deactivated_plugins = get_option( 'fpad_deactivated_plugins', [] ); 96 97 if ( empty( $deactivated_plugins ) ) { 98 return; 99 } 100 101 foreach ( $deactivated_plugins as $key => $plugin_data ) { 102 $plugin_file = $plugin_data['plugin']; 103 $plugin_data_obj = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_file ); 104 $plugin_name = $plugin_data_obj['Name'] ?: $plugin_file; 105 $error_message = $plugin_data['error']['message']; 106 107 echo '<div class="notice notice-error is-dismissible">'; 108 echo '<p>' . sprintf( 109 /* translators: 1: Plugin name, 2: Error message */ 110 esc_html__( 'Fatal Plugin Auto Deactivator has deactivated "%1$s" due to a fatal error: %2$s', 'fatal-plugin-auto-deactivator' ), 111 '<strong>' . esc_html( $plugin_name ) . '</strong>', 112 esc_html( $error_message ) 113 ) . '</p>'; 114 echo '</div>'; 115 } 116 117 // Clear the notices after displaying them 118 update_option( 'fpad_deactivated_plugins', [] ); 119 } 120 121 add_action( 'admin_notices', 'fpad_admin_notices' ); 122 123 /** 124 * Register uninstall hook 125 */ 126 register_uninstall_hook( __FILE__, 'fpad_uninstall' ); 127 128 /** 129 * Clean up plugin data on uninstall 130 */ 131 function fpad_uninstall() { 132 // Remove the drop-in 133 $dropin_manager = new FPAD_Dropin_Manager(); 134 $dropin_manager->remove_dropin(); 135 136 // Delete plugin options 137 delete_option( 'fpad_deactivated_plugins' ); 138 delete_option( 'fpad_deactivation_log' ); 139 } 55 register_activation_hook( __FILE__, array( 'FPAD_Plugin_Lifecycle', 'activate' ) ); 56 register_deactivation_hook( __FILE__, array( 'FPAD_Plugin_Lifecycle', 'deactivate' ) ); 57 register_uninstall_hook( __FILE__, array( 'FPAD_Plugin_Lifecycle', 'uninstall' ) ); -
fatal-plugin-auto-deactivator/trunk/includes/class-fatal-error-handler.php
r3300057 r3304125 332 332 margin: 0; 333 333 word-break: break-word; 334 white-space: pre-wrap; 334 335 } 335 336 .fpad_error_location { -
fatal-plugin-auto-deactivator/trunk/languages/fatal-plugin-auto-deactivator.pot
r3300057 r3304125 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Fatal Plugin Auto Deactivator 1. 0.0\n"5 "Project-Id-Version: Fatal Plugin Auto Deactivator 1.1.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/fatal-plugin-auto-deactivator\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-05- 24T19:00:51+00:00\n"12 "POT-Creation-Date: 2025-05-31T22:02:00+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 41 41 42 42 #. translators: 1: Plugin name, 2: Error message 43 #: fatal-plugin-auto-deactivator.php:11043 #: includes/class-admin.php:52 44 44 msgid "Fatal Plugin Auto Deactivator has deactivated \"%1$s\" due to a fatal error: %2$s" 45 45 msgstr "" 46 47 #: includes/class-admin.php:69 48 #: includes/class-admin.php:121 49 msgid "Fatal Plugin Auto Deactivator Log" 50 msgstr "" 51 52 #: includes/class-admin.php:70 53 msgid "Fatal Plugin Log" 54 msgstr "" 55 56 #: includes/class-admin.php:92 57 msgid "View Log" 58 msgstr "" 59 60 #: includes/class-admin.php:113 61 msgid "Fatal Plugin Auto Deactivator log cleared successfully." 62 msgstr "" 63 64 #: includes/class-admin.php:129 65 msgid "Clear Log" 66 msgstr "" 67 68 #: includes/class-admin.php:134 69 msgid "No plugin deactivations have been logged yet." 70 msgstr "" 71 72 #: includes/class-admin.php:171 73 msgid "Date" 74 msgstr "" 75 76 #: includes/class-admin.php:172 77 msgid "Plugin" 78 msgstr "" 79 80 #: includes/class-admin.php:173 81 msgid "File" 82 msgstr "" -
fatal-plugin-auto-deactivator/trunk/readme.txt
r3300057 r3304125 2 2 Contributors: rudlinkon 3 3 Tags: fatal error, plugin deactivation, error handling, site protection, crash prevention 4 Requires at least: 5. 24 Requires at least: 5.3 5 5 Tested up to: 6.8 6 Stable tag: 1. 0.16 Stable tag: 1.1.0 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 17 17 ### Key Features 18 18 19 * **Automatic Error Detection**: Monitors for fatal PHP errors in real-time 20 * **Smart Plugin Identification**: Identifies which plugin is causing the fatal error 21 * **Instant Deactivation**: Automatically deactivates the problematic plugin 19 * **Automatic Error Detection**: Monitors for fatal PHP errors in real-time using WordPress drop-in technology 20 * **Smart Plugin Identification**: Identifies which plugin is causing the fatal error through stack trace analysis 21 * **Instant Deactivation**: Automatically deactivates the problematic plugin during the shutdown phase 22 22 * **Detailed Admin Notifications**: Provides clear notifications about which plugin was deactivated and why 23 * **Error Logging**: Records detailed information about the error for troubleshooting 23 * **Persistent Error Logging**: Records detailed information about errors in a permanent log for troubleshooting 24 * **Error Log Management Page**: Dedicated admin page to view, manage, and clear error logs with detailed history 24 25 * **Zero Configuration**: Works right out of the box with no setup required 25 26 * **Custom Error Page**: Displays a user-friendly error page with a reload button instead of the white screen of death 27 * **Debug-Aware Display**: Shows detailed error information only when WP_DEBUG_DISPLAY is enabled for security 28 * **Drop-in Management**: Automatically installs and manages WordPress fatal-error-handler.php drop-in 26 29 27 30 ### How It Works 28 31 29 When a fatal error occurs on your WordPress site, this plugin:32 This plugin uses WordPress's built-in drop-in system to provide the most reliable error handling possible. When activated, it: 30 33 31 1. Captures the error details during the shutdown phase 32 2. Identifies which plugin is responsible for the error 33 3. Automatically deactivates only that specific plugin 34 4. Logs the action for reference 35 5. Displays an admin notice with details when you next log in 36 6. Shows a user-friendly error page to visitors instead of the white screen of death 34 1. **Installs a Drop-in**: Creates a `fatal-error-handler.php` file in your wp-content directory 35 2. **Monitors for Errors**: WordPress automatically uses this drop-in when fatal errors occur 36 3. **Captures Error Details**: Records the error message, file, and line number during the shutdown phase 37 4. **Identifies the Plugin**: Analyzes the error stack trace to determine which plugin caused the issue 38 5. **Deactivates Safely**: Automatically deactivates only the problematic plugin 39 6. **Logs Everything**: Stores detailed error information in a permanent log for troubleshooting 40 7. **Notifies Admins**: Displays clear admin notices with error details when you next log in 41 8. **Shows User-Friendly Pages**: Displays a custom error page with reload button instead of the white screen of death 37 42 38 Th is prevents the dreaded "white screen of death" and keeps your site operational while you address the underlying issue.43 The drop-in approach ensures maximum reliability since it operates at the WordPress core level, even when other plugins fail. 39 44 40 45 ### Use Cases … … 53 58 1. Upload the `fatal-plugin-auto-deactivator` folder to the `/wp-content/plugins/` directory 54 59 2. Activate the plugin through the 'Plugins' menu in WordPress 55 3. That's it! The plugin works automatically with no configuration needed 60 3. The plugin will automatically install the required drop-in file (`fatal-error-handler.php`) in your wp-content directory 61 4. That's it! The plugin works automatically with no configuration needed 62 63 **Note**: The plugin requires write permissions to your wp-content directory to install the drop-in file. If activation fails, check your file permissions. 56 64 57 65 == Frequently Asked Questions == … … 89 97 This plugin specifically targets fatal PHP errors that would normally make your site inaccessible. It doesn't handle warnings, notices, or other non-fatal errors. 90 98 99 = What is a drop-in and why does this plugin use one? = 100 101 A drop-in is a special type of WordPress file that replaces core functionality. This plugin uses the `fatal-error-handler.php` drop-in to ensure it can handle errors even when other plugins fail. The drop-in is automatically installed when you activate the plugin and removed when you deactivate it. 102 103 = Will the drop-in conflict with other plugins? = 104 105 No, the drop-in is specifically designed for fatal error handling and won't conflict with other plugins. If another plugin tries to install its own fatal error handler drop-in, this plugin will detect it and avoid overwriting it. 106 107 = Why do I see detailed error information sometimes but not others? = 108 109 For security reasons, detailed error information (file paths, line numbers, error messages) is only displayed when WP_DEBUG_DISPLAY is enabled in your WordPress configuration. When disabled, visitors see a generic error message while administrators still receive detailed notifications in the dashboard. 110 111 = Where are the error logs stored? = 112 113 Error logs are stored in your WordPress database as options. The plugin maintains both temporary logs (for admin notifications) and permanent logs (for troubleshooting history). You can view these through your WordPress admin dashboard. 114 91 115 == Screenshots == 92 116 … … 97 121 98 122 == Changelog == 123 124 = 1.1.0 - 01/06/2025 = 125 - Added: New "Fatal Plugin Log" admin subpage under Tools for comprehensive error management 126 - Added: Detailed log table showing date, time, plugin, file, line number, and error message 127 - Added: "Clear Log" functionality with nonce protection 128 - Added: "View Log" action link on plugin list for quick access 129 - Added: Enhanced error type detection (Fatal, Parse, Core, etc.) 130 - Added: Security checks during drop-in file install and management 131 - Improved: Validation, sanitization, and formatting of error messages with monospace font 132 - Improved: UI styling using WordPress admin standards and alternating row colors 133 - Improved: Codebase optimized for better performance 134 - Few minor bug fixes & improvements 99 135 100 136 = 1.0.1 - 25/05/2025 = … … 107 143 == Upgrade Notice == 108 144 109 = 1. 0.1=110 We have improved security and fixed few bugs. Please update to the latest version.145 = 1.1.0 = 146 We have added a dedicated admin subpage for viewing and managing error logs. Please update to the latest version.
Note: See TracChangeset
for help on using the changeset viewer.