stock_alert_log.log not updating
-
Is anyone having issues with stock_alert_log.log not being updated?
Anybody have a need to be able to view this log file more easily from the WP admin screen?I’m also finding that writing to this log will slow down over time since the code loads all the contents of the log each time the doWooStockAlertLOG() function is called. On busy systems, that’s a LOT!
Not sure where to make a pull request, but perhaps the doWooStockAlertLOG() can be rewritten as follows:
function doWooStockAlertLOG($str) { $file = plugin_dir_path(__FILE__) . 'stock_alert_log.log'; $strToWrite = "$str" . "\r\n"; $strToWrite .= "-------------------------------------\r\n"; if (file_exists($file)) { // Append new content to the file file_put_contents($file, $strToWrite, FILE_APPEND); } else { // Create the log file and save the content file_put_contents($file, $strToWrite); } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘stock_alert_log.log not updating’ is closed to new replies.