Hi @hshah,
Thanks for this feedback, we’ve also noticed that the log file isn’t working properly, it will be fixed soon in our future releases.
I’ll keep you in touch when this feature will be available again 🙂
Cheers,
Charles
Thread Starter
hshah
(@hshah)
I ended up going through your code and have worked out what is wrong. In resmushit.inc.php the following returns FALSE if the file does not exist.
if( !is_writable(ABSPATH . RESMUSHIT_LOGS_PATH) ) {
return FALSE;
}
As soon as I went and created it, it immediately started writing to it 🙂
That check should actually be:
if( !is_writable(ABSPATH) ) {
// Do Something Here to Inform User
return FALSE;
}
Then extend the code that follows it with an else, and cater for the scenario of a file not existing:
if(file_exists(ABSPATH . RESMUSHIT_LOGS_PATH)){
if(filesize(ABSPATH . RESMUSHIT_LOGS_PATH) > RESMUSHIT_LOGS_MAX_FILESIZE) {
$logtailed = logtail(ABSPATH . RESMUSHIT_LOGS_PATH, 20);
$fp = fopen(ABSPATH . RESMUSHIT_LOGS_PATH, 'w');
fwrite($fp, $logtailed);
fclose($fp);
}
} else {
// Create New File
// Do Whatever Else
}
Thanks @hshah for reporting us this issue, we’ll integrate in the next release 🙂
We’ll keep you in touch when it’ll be available
Cheers,
Charles
Hi @hshah,
The fix has been pushed to the new release (0.3.1) of the plugin.
Thanks a lot for this report !
Feel free to write a review of our plugin, it would be greatful 🙂
Cheers,
Charles