Prep Plugin for release on WordPress.org
Escape everything that should be escaped. Add nonce checks where needed. Sanitize all inputs. Apply Code style changes across the codebase. Correct many deprecation notices. Optimize load order of many filters.
This commit is contained in:
@ -65,7 +65,7 @@ class Logger extends AbstractLogger {
|
||||
*
|
||||
* Here we are converting the PHP error reporting level to the PSR-3 log level.
|
||||
*/
|
||||
$reporting_level = error_reporting();
|
||||
$reporting_level = error_reporting(); // phpcs:ignore WordPress.PHP
|
||||
|
||||
$psr_log_levels = [
|
||||
E_ERROR => LogLevel::ERROR,
|
||||
@ -131,7 +131,7 @@ class Logger extends AbstractLogger {
|
||||
}
|
||||
|
||||
// read file
|
||||
$content = file_get_contents($file);
|
||||
$content = file_get_contents($file); // phpcs:ignore WordPress.WP.AlternativeFunctions
|
||||
|
||||
// split into lines
|
||||
$arr_content = explode(PHP_EOL, $content);
|
||||
@ -280,13 +280,13 @@ class Logger extends AbstractLogger {
|
||||
protected function write_to_file($message) {
|
||||
|
||||
if ( ! file_exists($this->log_file)) {
|
||||
touch($this->log_file);
|
||||
touch($this->log_file); // phpcs:ignore WordPress.WP.AlternativeFunctions
|
||||
}
|
||||
|
||||
if ( ! is_writable($this->log_file)) {
|
||||
if ( ! is_writable($this->log_file)) { // phpcs:ignore WordPress.WP.AlternativeFunctions
|
||||
return;
|
||||
}
|
||||
|
||||
file_put_contents($this->log_file, $message, FILE_APPEND | LOCK_EX);
|
||||
file_put_contents($this->log_file, $message, FILE_APPEND | LOCK_EX); // phpcs:ignore WordPress.WP.AlternativeFunctions
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user