=== Debug Log Manager Tool ===
Contributors: pyrobd
Donate link:
Tags: debug, log, developer, tools,remote debug
Requires at least: 5.6
Tested up to: 6.8
Stable tag: 3.0.4
Requires PHP: 5.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Debug Log Manager Tool is a WordPress debugging console for managing debug constants, reading logs, inspecting stack traces, running guarded terminal commands, and isolating plugin conflicts from the dashboard.

== Description ==

A comprehensive debugging toolkit for WordPress developers, agencies, and site administrators. This plugin gives you control over WordPress debugging without editing wp-config.php files or using FTP.

= Quick Demo =

[youtube https://youtu.be/D4K5zsLnILw]

= Key Features =

* **Debug Constants Manager**: Toggle WP_DEBUG, WP_DEBUG_LOG, WP_DEBUG_DISPLAY, SCRIPT_DEBUG, and SAVEQUERIES without manually editing wp-config.php.
* **Modern Debug Log Viewer**: View, search, filter, group, and clear debug log entries from a compact WordPress admin interface.
* **Readable Timeline Rows**: Scan log entries with severity labels, occurrence counts, plugin/source hints, exact timestamps, and copy-as-JSON actions.
* **Stack Trace Analysis**: Format PHP stack traces and database call chains so long fatal errors are easier to read.
* **Large Log File Preview**: Open the current debug log file inside a modal and safely read the latest 1 MB of large files.
* **Query Inspector**: Examine database queries when SAVEQUERIES is enabled, including SQL, caller, execution time, and stack trace details.
* **WP-CLI Style Terminal**: Run guarded WordPress-style commands directly from the browser with command history and auto-completion.
* **Terminal Settings**: Enable or disable terminal access and database commands from a dedicated settings screen.
* **Safe Mode**: Temporarily isolate plugin conflicts by keeping selected plugins active and restoring the previous state when Safe Mode is turned off.
* **Email Notifications**: Configure notification email settings, daily summaries, and test email delivery for debug activity.
* **Admin Bar Debug Toggle**: Quickly enable or disable WP_DEBUG from the WordPress admin bar.
* **Dashboard Widget**: See recent debug log activity from the WordPress dashboard.
* **Custom Log Path Support**: Use filters to customize the debug log location.
* **Hardened Admin Routes**: AJAX actions use nonce and capability checks, with guarded file path handling for debug log access.

= Debug Constants Available =

* **WP_DEBUG** - Default Value: true - Enables WordPress debug mode
* **WP_DEBUG_LOG** - Default Value: true - Saves all errors to a debug.log file
* **SCRIPT_DEBUG** - Default Value: false - Uses development versions of core JS and CSS files
* **WP_DEBUG_DISPLAY** - Default Value: false - Controls whether debug messages display on screen
* **SAVEQUERIES** - Default Value: false - Saves database queries for analysis

= Developer Tools =

* **Terminal Commands**: Use WP-CLI style commands like `wp core version` or `wp plugin list`
* **Database Explorer**: Run SELECT queries and view results in a formatted table
* **Stack Trace Analysis**: Visualize error stack traces for easier debugging
* **Hook Inspector**: View all registered hooks and their callbacks
* **Environment Detection**: Development features are automatically hidden in production
* **Copy JSON**: Copy structured log entries for support tickets or developer handoff
* **File Viewer**: Inspect the debug log file without leaving the WordPress admin screen

> **Developer API**: Apply custom filters like `apply_filters('wp_debuglog_log_file_path', $file);` to extend functionality

Please note: Constant values will be restored on plugin deactivation as it was before activating the plugin.


== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/debug-log-config-tool` directory, or install the plugin through the WordPress plugins screen directly.
1. Activate the plugin through the 'Plugins' screen in WordPress
1. Go to Tools-> Debug Logs screen to see the debug logs or access it from the top navbar.


== Frequently Asked Questions ==

= Do I need file manager/FTP or modify wp-config.php? =

No, just activate the plugin and turn off/on debug mode from plugin settings

= Can I see full debug in dashboard?  =

Yes you can see a simple log in dashboard widget and nicely formatted view in the plugin

= What does safe mode do?  =
Safe mode will deactivate all the plugin except the selected one. When you turn safe mode off it will restore all the previous activated plugin.

== Screenshots ==
1. **Debug log timeline with filters, grouped events, and file tools**
2. **Terminal and database debugging commands**
3. **Safe Mode and settings screens**

== Changelog ==

= 3.0.4 =
- Refreshed the plugin directory banner and icon with a softer visual style.

= 3.0.3 =
- Refreshed plugin directory assets and feature documentation.

= 3.0.2 =
- Improved debug log time labels so older entries show exact dates instead of misleading relative age text.
- Normalized the plugin name spelling on public plugin metadata.

= 3.0.1 =
- Maintenance release with refreshed plugin metadata.

= 3.0.0 =
- Hardened AJAX route verification to fail closed for invalid requests, missing permissions, and bad nonces.
- Added a guarded debug log file viewer endpoint with wp-content path containment and latest 1 MB reads for large files.
- Improved debug log migration safety by checking file containment, readability, and writability without overwriting the original default log.
- Reworked the admin interface with a compact top navigation, cleaner WordPress admin page spacing, and suppressed third-party notices on the plugin screen.
- Improved debug log readability with structured timeline rows, stack trace formatting, database call-chain formatting, safer text rendering, and cleaner expand/collapse behavior.
- Refined Safe Mode, Notifications, Terminal, Terminal Settings, and Overview screens for a more consistent settings-page experience.
- Fixed missing terminal settings routes, unresolved PrimeVue component registrations, Safe Mode submit state handling, admin-bar debug toggle styling, modal z-index, loader sizing, and empty feature icons.

= 2.0.1 =
- Fix typo
- Fix memory issue

= 2.0.0 =
- Added WP-CLI style command structure in terminal (e.g., `wp core version`)
- Added database commands with WP-CLI syntax (`wp db query`, `wp db tables`, etc.)
- Added terminal settings page to enable/disable terminal and database features
- Added super admin restriction for database commands
- Added support for SQL queries with proper security measures
- Added stack trace visualization for better error analysis
- Help command to show commands by category with organized sections
- Enhanced security for terminal commands (preventing SQL injection, restricting destructive commands)
- Quick Debug Toggle from admin bar (WP_DEBUG)

= 1.5.3 =
- Fix footer text on all page

= 1.5.2 =
- Added query logs

= 1.5 =
- Fixed Vulnerability of debug log file. Generating random file for debug.
- Added a new safe mode which will turn off all plugins excluding selected ones.

= 1.4.5 =
- Fixed refresh

= 1.4.2 =
- New Constants
- Removed database dependency

= 1.4.4 =
- Fixed Refresh Log
- Added dashboard widget
- Clean UI
- Refresh Log
- Email Notification

= 1.0.0 =
- Initial Version
