=== SSP Debug ===
Contributors: stupidsimpleplugins.com, jimmyredline80
Donate link: https://www.stupidsimpleplugins.com/
Tags: debug, logging, error-log, exceptions, troubleshooting
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Log PHP errors, exceptions, and shutdown fatals with size limits, timezone options, ignore list, download & clear controls, and an admin log viewer.

== Description ==

**SSP Debug** provides a complete error logging system built directly into WordPress, helping site owners and developers identify problems without needing access to server error logs.

= Key points =
* Toggle logging on/off.
* Choose **All** or **Fatal-only** (E_ERROR/E_PARSE/etc.).
* Capture **uncaught exceptions** and **shutdown fatals**.
* Append contextual details (URL, IP, User Agent, User ID) when using **Detailed** format.
* Select a **timezone** for timestamps (site default, UTC, or friendly region names).
* Limit log size (MB) with automatic truncation when the limit is exceeded.
* Maintain a custom **ignore list** (substrings or regex) to filter noise.
* Include/exclude sources by scope: **MU-plugins**, **Plugins**, **Themes**, **Core/Other**.
* **Download** the current log as a file.
* **Clear** the log from the admin screen.
* Optional **Showcase** tab that includes static links to related plugins.

Logs are stored in `wp-content/ssp-debug.log`.  
The admin interface is located under **SSP Debug** in your WordPress dashboard.

This plugin follows WordPress coding standards (escaping, nonces, WP_Filesystem, `wp_date()`), is internationalization-ready, and stores everything locally.

== Features ==

* Enable/disable logging  
* All vs. Fatal-only levels  
* Exception & shutdown fatal capture  
* Detailed context mode  
* Timezone selection  
* Size limit with auto-truncate  
* Scope filtering (MU/Plugins/Themes/Core)  
* Ignore list (substring or regex)  
* Download log  
* Clear log  
* Translation ready  
* Admin UI  

== Installation ==

1. Upload the plugin folder to:  
   `wp-content/plugins/ssp-debug/`
2. Ensure the main file is:  
   `wp-content/plugins/ssp-debug/ssp-debug.php`
3. Activate **SSP Debug** from **Plugins → Installed Plugins**.
4. Go to **SSP Debug** in the left admin menu to configure settings and view logs.

== Frequently Asked Questions ==

= Where is the log file located? =  
`wp-content/ssp-debug.log`

= Does it replace PHP’s native error_log? =  
No. It registers handlers for PHP errors, uncaught exceptions, and shutdown fatals and writes them to its own file.

= What’s “Detailed” format? =  
It appends context (URL, IP, User Agent, User ID) to each entry.

= Will this slow down my site? =  
Logging is lightweight, but **All** mode can increase disk writes. Use **Fatal-only** in production.

= How does size limiting work? =  
When the log exceeds your MB limit, it truncates to about 70% of that size, keeping the most recent entries.

= Can I ignore noisy messages? =  
Yes. Add substrings or regex (e.g., `/deprecated/i`) to the **Ignore list**; matching entries are filtered out.

= Is multisite supported? =  
Yes. Logs are saved in `wp-content/ssp-debug.log`; settings are per-site.

== Screenshots ==

1. Dashboard and settings page  
2. Log viewer with download/clear options  
3. Showcase tab (static, text-only links)

== External Services ==

This plugin includes an optional **About/Showcase tab** containing standard hyperlinks to pages on **stupidsimpleplugins.com**.  
- No data is transmitted automatically.  
- No background connections are made by the plugin.  
- When a user clicks one of these links, the browser opens the destination page on StupidSimplePlugins.com.  
- These links are provided solely for informational and navigational purposes.  

For transparency, here are the relevant policies for that website:  
- Terms of Service: https://www.stupidsimpleplugins.com/terms-and-conditions/  
- Privacy Policy: https://www.stupidsimpleplugins.com/privacy-policy/

== Privacy ==

When **Detailed** format is enabled, requests may log the current request’s URL, IP address, User Agent, and (if logged in) User ID.  
This information is written only to the local file `wp-content/ssp-debug.log` and never transmitted externally.  
The log can be cleared or downloaded at any time from the plugin’s admin page.

== Localization ==

* Text domain: `ssp-debugging`  
* Domain path: `/languages`  
* Load translations from `languages/ssp-debugging-{locale}.mo`

== Changelog ==

= 1.0.0 =
* Initial release.
* Logging for PHP errors, exceptions, and shutdown fatals.
* Options for all/fatal level, detailed context, timezone selection, size limit with truncation, scopes, and ignore list.
* Download and clear controls.
* Optional showcase tab with external link disclosure.
* Translation-ready; no external updaters.

== Upgrade Notice ==

= 1.0.0 =
Initial public release.
