{"id":328527,"date":"2026-06-19T05:27:22","date_gmt":"2026-06-19T05:27:22","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/naveencodes-safe-mode\/"},"modified":"2026-06-19T07:42:41","modified_gmt":"2026-06-19T07:42:41","slug":"naveencodes-safe-mode","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/naveencodes-safe-mode\/","author":16310057,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.2","stable_tag":"1.0.2","tested":"7.0","requires":"6.5","requires_php":"8.0","requires_plugins":null,"header_name":"NaveenCodes Safe Mode","header_author":"Naveen Goyal","header_description":"Emergency recovery layer that detects fatal plugin and theme errors, restores access, logs the incident, and notifies administrators.","assets_banners_color":"382b19","last_updated":"2026-06-19 07:42:41","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/naveencodes-safe-mode\/","header_author_uri":"https:\/\/naveencodes.com\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":42,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"shinu1503","date":"2026-06-19 05:26:41"},"1.0.1":{"tag":"1.0.1","author":"shinu1503","date":"2026-06-19 07:40:04"},"1.0.2":{"tag":"1.0.2","author":"shinu1503","date":"2026-06-19 07:42:41"}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3578067,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3578067,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3578067,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3578067,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.0.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3578067,"resolution":"1","location":"assets","locale":"","width":1706,"height":260},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3578067,"resolution":"2","location":"assets","locale":"","width":1706,"height":851},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3578067,"resolution":"3","location":"assets","locale":"","width":1690,"height":653},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3578067,"resolution":"4","location":"assets","locale":"","width":1705,"height":867}},"screenshots":{"1":"Admin notice shown after automatic recovery \u2014 confirms what failed and what action was taken.","2":"Error Logs \u2014 filterable table of every fatal error with source, file, line, and recovery status.","3":"Recovery History \u2014 chronological record of every recovery action and its outcome.","4":"Settings \u2014 toggle recovery, auto-disable, theme fallback, email notifications, and retention controls."}},"plugin_section":[],"plugin_tags":[22682,267815,13383,54705,267816],"plugin_category":[],"plugin_contributors":[232463],"plugin_business_model":[],"class_list":["post-328527","plugin","type-plugin","status-publish","hentry","plugin_tags-fatal-error","plugin_tags-plugin-recovery","plugin_tags-recovery","plugin_tags-safe-mode","plugin_tags-theme-recovery","plugin_contributors-shinu1503","plugin_committers-shinu1503"],"banners":{"banner":"https:\/\/ps.w.org\/naveencodes-safe-mode\/assets\/banner-772x250.png?rev=3578067","banner_2x":"https:\/\/ps.w.org\/naveencodes-safe-mode\/assets\/banner-1544x500.png?rev=3578067","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/naveencodes-safe-mode\/assets\/icon-128x128.png?rev=3578067","icon_2x":"https:\/\/ps.w.org\/naveencodes-safe-mode\/assets\/icon-256x256.png?rev=3578067","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/naveencodes-safe-mode\/assets\/screenshot-1.png?rev=3578067","caption":"Admin notice shown after automatic recovery \u2014 confirms what failed and what action was taken."},{"src":"https:\/\/ps.w.org\/naveencodes-safe-mode\/assets\/screenshot-2.png?rev=3578067","caption":"Error Logs \u2014 filterable table of every fatal error with source, file, line, and recovery status."},{"src":"https:\/\/ps.w.org\/naveencodes-safe-mode\/assets\/screenshot-3.png?rev=3578067","caption":"Recovery History \u2014 chronological record of every recovery action and its outcome."},{"src":"https:\/\/ps.w.org\/naveencodes-safe-mode\/assets\/screenshot-4.png?rev=3578067","caption":"Settings \u2014 toggle recovery, auto-disable, theme fallback, email notifications, and retention controls."}],"raw_content":"<!--section=description-->\n<p>NaveenCodes Safe Mode helps restore access after fatal plugin or theme crashes. It detects fatal PHP shutdown errors, identifies whether the source is a plugin or theme, performs the configured recovery action, records detailed logs, stores recovery history, shows persistent admin notices, and emails administrators.<\/p>\n\n<p>The plugin does not modify, rewrite, or repair user code. Version 1 is focused only on detection, disabling, recovery, logging, and notification.<\/p>\n\n<h3>Version 1 Architecture<\/h3>\n\n<ul>\n<li>Namespace: <code>NaveenCodes\\SafeMode<\/code><\/li>\n<li>Prefix: <code>ncsm_<\/code><\/li>\n<li>Text domain: <code>naveencodes-safe-mode<\/code><\/li>\n<li>Bootstrap: <code>naveencodes-safe-mode.php<\/code><\/li>\n<li>Autoloading: lightweight PSR-4 style autoloader for <code>includes\/<\/code><\/li>\n<li>Composition root: <code>includes\/Core\/Plugin.php<\/code><\/li>\n<li>Service boundaries:\n\n<ul>\n<li><code>Core<\/code>: activation, deactivation, settings, plugin bootstrapping<\/li>\n<li><code>Database<\/code>: custom table schema<\/li>\n<li><code>Recovery<\/code>: shutdown detection, source detection, queueing, plugin\/theme recovery, notifications<\/li>\n<li><code>Logging<\/code>: error logs and recovery history persistence<\/li>\n<li><code>Admin<\/code>: dashboard, logs, history, settings, notices, coming soon UI<\/li>\n<li><code>Helpers<\/code>: focused WordPress helper utilities<\/li>\n<li><code>Interfaces<\/code>: shared service contracts<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<h3>Database Schema<\/h3>\n\n<pre><code>wp_ncsm_logs\n<\/code><\/pre>\n\n<ul>\n<li><code>id<\/code><\/li>\n<li><code>timestamp<\/code><\/li>\n<li><code>error_type<\/code><\/li>\n<li><code>error_message<\/code><\/li>\n<li><code>file_path<\/code><\/li>\n<li><code>line_number<\/code><\/li>\n<li><code>source_type<\/code><\/li>\n<li><code>source_name<\/code><\/li>\n<li><code>action_taken<\/code><\/li>\n<li><p><code>recovery_status<\/code><\/p>\n\n<p>wp_ncsm_recovery_history<\/p><\/li>\n<li><p><code>id<\/code><\/p><\/li>\n<li><code>timestamp<\/code><\/li>\n<li><code>source_type<\/code><\/li>\n<li><code>source_name<\/code><\/li>\n<li><code>recovery_action<\/code><\/li>\n<li><code>recovery_result<\/code><\/li>\n<\/ul>\n\n<h3>Recovery Workflow<\/h3>\n\n<ol>\n<li>Register a shutdown function early on <code>plugins_loaded<\/code>.<\/li>\n<li>Inspect <code>error_get_last()<\/code> on shutdown.<\/li>\n<li>Continue only for fatal, parse, compile, core, user, or recoverable fatal errors.<\/li>\n<li>Detect source from the error file path:\n\n<ul>\n<li><code>wp-content\/plugins\/...<\/code> becomes a plugin source.<\/li>\n<li><code>wp-content\/themes\/...<\/code> becomes a theme source.<\/li>\n<li>Anything else is stored as Unknown Source.<\/li>\n<\/ul><\/li>\n<li>Check recovery queue attempts for the source.<\/li>\n<li>If the source is a plugin and plugin auto-disable is enabled, deactivate the faulty plugin.<\/li>\n<li>If the source is the active theme and theme recovery is enabled, switch to the configured fallback theme.<\/li>\n<li>Log the error and recovery action.<\/li>\n<li>Store recovery history.<\/li>\n<li>Add a persistent admin notice.<\/li>\n<li>Send an administrator email when enabled.<\/li>\n<\/ol>\n\n<h3>WordPress Hooks<\/h3>\n\n<ul>\n<li><code>plugins_loaded<\/code> boots the plugin.<\/li>\n<li><code>register_shutdown_function()<\/code> detects fatal shutdown errors.<\/li>\n<li><code>admin_menu<\/code> registers the admin pages.<\/li>\n<li><code>admin_enqueue_scripts<\/code> loads admin assets.<\/li>\n<li><code>admin_notices<\/code> renders persistent recovery notices.<\/li>\n<li><code>admin_post_ncsm_save_settings<\/code> saves settings.<\/li>\n<li><code>admin_post_ncsm_export_logs<\/code> exports logs.<\/li>\n<li><code>admin_post_ncsm_dismiss_notice<\/code> dismisses recovery notices.<\/li>\n<\/ul>\n\n<h3>Admin Pages<\/h3>\n\n<ul>\n<li>Dashboard: protection status, statistics, and recovery workflow.<\/li>\n<li>Error Logs: fatal error log table, filters, and CSV export.<\/li>\n<li>Recovery History: source, action, result, and timestamp.<\/li>\n<li>Settings: recovery toggles, notifications, fallback theme, retention, maximum attempts.<\/li>\n<li>Coming Soon: Version 2 feature previews only.<\/li>\n<\/ul>\n\n<h3>Settings<\/h3>\n\n<ul>\n<li>Enable Recovery<\/li>\n<li>Enable Plugin Auto Disable<\/li>\n<li>Enable Theme Recovery<\/li>\n<li>Enable Email Notifications<\/li>\n<li>Fallback Theme Selector<\/li>\n<li>Log Retention Period<\/li>\n<li>Maximum Recovery Attempts<\/li>\n<\/ul>\n\n<h3>Coming Soon<\/h3>\n\n<p>The following features are displayed as UI-only cards and are not implemented in Version 1:<\/p>\n\n<ul>\n<li>Automatic Rollback<\/li>\n<li>Update Sandbox Testing<\/li>\n<li>Code Snippet Protection<\/li>\n<li>AI Error Analysis<\/li>\n<li>Slack Notifications<\/li>\n<li>Cloud Backups<\/li>\n<li>Uptime Monitoring<\/li>\n<li>One Click Restore<\/li>\n<\/ul>\n\n<h3>Security<\/h3>\n\n<p>Version 1 uses capability checks, nonces, sanitization, escaping, WordPress database APIs, and prepared SQL for dynamic values. It performs no tracking, no hidden data collection, no remote code execution, and no unsafe file rewriting.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>naveencodes-safe-mode<\/code> folder to <code>\/wp-content\/plugins\/<\/code>.<\/li>\n<li>Activate the plugin from the WordPress Plugins screen.<\/li>\n<li>Go to Safe Mode &gt; Settings and choose a fallback theme.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"does%20this%20plugin%20fix%20broken%20php%20code%3F\"><h3>Does this plugin fix broken PHP code?<\/h3><\/dt>\n<dd><p>No. It only detects fatal errors, disables faulty plugins or switches broken themes, logs what happened, and notifies administrators.<\/p><\/dd>\n<dt id=\"can%20it%20recover%20from%20every%20crash%3F\"><h3>Can it recover from every crash?<\/h3><\/dt>\n<dd><p>No recovery plugin can guarantee recovery from all fatal errors. WordPress must load NaveenCodes Safe Mode before the crash occurs so its shutdown handler can run.<\/p><\/dd>\n<dt id=\"does%20version%201%20include%20rollback%20or%20ai%20analysis%3F\"><h3>Does Version 1 include rollback or AI analysis?<\/h3><\/dt>\n<dd><p>No. Those appear only in the Coming Soon section.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Fixed: Plugin URI corrected to the WordPress.org plugin page \u2014 \"View plugin\" now links correctly in the plugins list.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Added: Maa tribute in the WP admin footer \u2014 shown on every Safe Mode screen, matching all other NaveenCodes plugins.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial Version 1 release.<\/li>\n<li>Fatal error detection.<\/li>\n<li>Plugin auto-disable recovery.<\/li>\n<li>Theme fallback recovery.<\/li>\n<li>Recovery queue and attempt limits.<\/li>\n<li>Custom error logs and recovery history tables.<\/li>\n<li>Admin dashboard, logs, history, settings, notices, email notifications, and Coming Soon UI.<\/li>\n<\/ul>","raw_excerpt":"Emergency recovery layer for WordPress fatal plugin and theme errors.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/328527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=328527"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/shinu1503"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=328527"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=328527"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=328527"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=328527"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=328527"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=328527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}