=== TINXDK WP - Log Viewer ===
Contributors: tinxdk
Tags: log, debug, debug.log, error log, woocommerce logs
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 8.2.35
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

View, search and colour-code the WordPress debug log from the admin, without ever loading a huge log file into memory.

== Description ==

Replaces the old "OpenDIMS WP LogViewer" plugin. Under Tools > Log Viewer you see the end of your log file, newest entry first, colour-coded by level (error/fatal, warning, notice, deprecated, other). Only the last N lines are read from the file (default 500, maximum 5000), so a log of several gigabytes does not exhaust PHP memory. Stack traces are shown under the timestamped line they belong to.

**Free edition** (no licence needed, fully usable):

* View `wp-content/debug.log` (or the path in `WP_DEBUG_LOG` when it is a path), newest first, last N lines only.
* Colour coding by level and text search.
* File size and last modified time; clear messages when the file is missing, empty or unreadable.
* Indicator when `WP_DEBUG` or `WP_DEBUG_LOG` is off, with the line to add to wp-config.php.

**Licensed edition** (licence key from https://tinxdkcloud.dk/wordpress-plugins/tinxdk-wp-log-viewer/#licens):

* Choose between more log files: debug.log, the PHP `error_log` file, `php_error.log` in the site root, `wp-content/error.log` and the WooCommerce log files. Only these whitelisted files can be chosen, never an arbitrary path.
* Level filter (error, warning, notice, deprecated, other).
* Download the log file and clear it (POST with nonce and a confirmation).
* Auto-refresh every 10, 30 or 60 seconds; it pauses while you type or select text.
* Dashboard widget with the number of errors in the latest log lines.
* Automatic plugin updates through the TINXDK licence server.

Licensed settings stay visible but disabled in the free edition; stored values are kept. Without contact to the licence server the licence keeps working for 7 days.

Licence activation: Tools > Log Viewer > License, enter the key (TINX-XXXX-XXXX-XXXX-XXXX) and click Activate. The site URL, plugin/WordPress/PHP versions and the key are sent to the licence server (licens.tinxdkcloud.dk) when activating, twice daily when validating and when checking for updates. Nothing else is sent.

Multisite: network-activate the plugin; the page is then found under Network admin > Settings > Log Viewer and needs the manage_network_options capability.

If the old "OpenDIMS WP LogViewer" plugin is still active, an admin notice asks you to deactivate it. The plugin has no public forms, so no ALTCHA is needed.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` and activate it.
2. Open Tools > Log Viewer. To get a log, add `define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );` to wp-config.php.

== Changelog ==

= 1.0.0 =
* First release: replaces "OpenDIMS WP LogViewer". Tail-only reading (no whole-file reads), newest first, colour coding, search, grouped stack traces and the WP_DEBUG indicator in the free edition.
* Licensed edition: more log files (whitelist), level filter, download, clear, auto-refresh, dashboard widget and automatic updates.
