| Server IP : 141.193.213.10 / Your IP : 216.73.216.216 Web Server : nginx System : Linux pod-400555 6.8.0-1055-gke #61-Ubuntu SMP Tue May 26 22:57:42 UTC 2026 x86_64 User : fpm200079 ( 200079) PHP Version : 8.2.35 Disable Function : apache_child_terminate,apache_get_modules,apache_get_version,apache_getenv,apache_note,apache_setenv,disk_free_space,disk_total_space,diskfreespace,dl,exec,fastcgi_finish_request,link,opcache_compile_file,opcache_get_configuration,opcache_invalidate,opcache_is_script_cached,opcache_reset,passthru,pclose,pcntl_exec,popen,posix_getpid,posix_getppid,posix_getpwuid,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,realpath_cache_get,shell_exec,show_source,symlink,system MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /nas/content/live/bartislaw/wp-content/mu-plugins/wpengine-common/ |
Upload File : |
<?php
/**
* @todo File doc needed
*/
/**
* @todo Class doc needed
*/
class Monitor_Admin_Ajax {
/**
* The single instance of this class
*
* @var Monitor_Admin_Ajax
*/
protected static $instance = null;
/**
* The location of the log file to write to
*
* @var string
*/
protected $log_file = '';
/**
*
* @return Monitor_Admin_Ajax The instance of this class
*/
public static function get_instance() {
if ( null === static::$instance ) {
static::$instance = new static();
}
return static::$instance;
}
/**
* Constructor.
*
* Set up various things needed for this class
*/
protected function __construct() {
// Set up the path to the log file
$this->log_file = WP_CONTENT_DIR . '/__wpe_admin_ajax.log';
}
/**
* Generate a message that can be written to the log file
*
* @return string The message to write
*/
protected function _create_message() {
$message = sprintf(
'** %1$s | %2$s | %3$s \n%4$s\n%5$s\n',
date( 'r' ),
$_SERVER['REMOTE_ADDR'],
$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
print_r( $_POST, true ),
print_r( $_REQUEST, true )
);
return $message;
}
/**
* Write a message to the log file
*
* @param string $message The message to write to the log
*/
protected function _write_log( $message ) {
// Crerate the file if it doesn't exist
if ( ! is_file( $this->log_file ) ) {
$start_log_date = date( 'l jS \of F Y h:i:s A' );
file_put_contents( $this->log_file, "--- log file start $start_log_date ---\n" );
}
// Now write to the file
file_put_contents( $this->log_file, "\n$message\n\n", FILE_APPEND );
}
/**
* Write data to the log file
*/
public function write_log() {
$this->_write_log( $this->_create_message() );
}
}