=== WP Output Log File ===
Plugin Name: WP Output Log File
Contributors: reiji-sato
Tags: debug, debugging, log, developer, error
Requires at least: 5.0
Tested up to: 7.1
Stable tag: 1.3.0
Requires PHP: 5.6
Donate link: https://www.sofplant.com/

License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Manage log files with custom directory and filename. Download and delete logs regardless of WP_DEBUG.

== Description ==

Manage WordPress log files independently of WP_DEBUG mode.
You can specify the output directory and file name, download log files, and delete them as needed.

By specifying a date format in the file name, you can split logs daily or monthly.

HTML tags are stripped from log messages by default. Turn off the "Strip HTML Tags" option to record raw XML or HTML responses (e.g. payment gateway results) as-is.


== Installation ==

Just install from your WordPress "Plugins > Add New" screen and all will be well. Manual installation is very straightforward as well:

1. Upload the zip file and unzip it in the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
1. Go to `Settings > WP Output Log File` and activate the options you want.

= Example =

You can write custom WordPress code, for example in your theme's functions.php file.

if ( function_exists( 'wo_log' ) ) { 
   wo_log( "Your message" ); // string

   wo_log( ['a' => 1, 'b' => 2, 'c' => 3 ] ); // other data types
}



== Screenshots ==

== Changelog ==

= 1.3.0 =
* Tested up to WordPress 7.1 and PHP 8.5.
* Added "Strip HTML Tags" option to Settings (default: on, same behavior as before). Turn it off to log XML/HTML responses such as payment gateway results as-is; previously tag stripping could remove them entirely.
* Fixed: fatal error in wo_log() when WordPress is loaded from WP-CLI (log file suffix list was not registered as a global).
* Changed: log lines are now written with file_put_contents( FILE_APPEND | LOCK_EX ) instead of error_log(), so concurrent requests cannot interleave lines. Output format is unchanged.
* Changed: the generated .htaccess now uses Apache 2.4 syntax (Require all denied) with an Apache 2.2 fallback in IfModule blocks. An existing .htaccess created by an earlier version (Order deny,allow / Deny from all) is migrated automatically when the Settings screen is opened; customized files are left untouched.

= 1.2.2 =
* Added translation files for internationalization support

= 1.2.1 =
* Fixed: Access Protect feature now works on servers requiring FTP credentials
* Fixed: FS_CHMOD_FILE undefined error on some PHP 8.4 environments
* Fixed: Compatibility with WordPress 6.8.3 and PHP 8.4.17
* Improved: More reliable file creation for security files (index.php, .htaccess)
* Changed PHP requirement from 7.4 to 5.6 for broader compatibility

= 1.2.0 =
* Tested up to WordPress 6.7
* Added PHP 7.4 minimum requirement
* Added internationalization (i18n) support
* Added Japanese translation
* Improved security for file download
* Fixed sanitization for log output (preserve newlines)
* Code quality improvements following WordPress Coding Standards

= 1.1.0 =
* Changed wo_log message parameter to accept any data type
* Deleted test file
* Changed error message color for write operations

= 1.0.1 =
* Fixed Compatibility with PHP 5.2 users
* Changed settings menu name to 'WP Output Log File'
* Change readme.txt
