| Server IP : 185.252.147.100 / Your IP : 216.73.217.33 Web Server : nginx/1.27.3 System : Linux mitrofanov.ru 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 User : mitr ( 1000) PHP Version : 8.2.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/html/ephotel.ru/wordpress/wp-content/mu-plugins/ |
Upload File : |
<?php
if ( ! function_exists( 'plugin_log' ) ) {
function plugin_log( $entry, $mode = 'a', $file = 'plugin' ) {
// Get WordPress uploads directory.
$upload_dir = wp_upload_dir();
$upload_dir = $upload_dir['basedir'];
$log_dir = $upload_dir.'/plugin_log';
if (!file_exists($log_dir)) {
mkdir($log_dir, 0755, true);
}
// If the entry is array, json_encode.
if ( is_array( $entry ) ) {
$entry = json_encode( $entry );
}
// Write the log file.
$file = $log_dir . '/' . $file . '.log';
$file = fopen( $file, $mode );
$bytes = fwrite( $file, current_time( 'mysql' ) . "::" . $entry . "\n" );
fclose( $file );
return $bytes;
}
}