Server : Apache System : Linux pod-100823:apache2_74:v0.5.7 5.4.0-1138-gcp #147~18.04.1-Ubuntu SMP Mon Oct 7 21:46:26 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33.7 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 Directory : /nas/content/live/attorneyexperi/wp-content/plugins/wp-rocket/inc/Engine/Debug/RUCSS/ |
<?php namespace WP_Rocket\Engine\Debug\RUCSS; use WP_Rocket\Admin\{Options, Options_Data}; use WP_Rocket\Event_Management\Subscriber_Interface; use WP_Rocket\Logger\Logger; class Subscriber implements Subscriber_Interface { /** * Plugin options instance. * * @var Options_Data */ protected $options; /** * Options instance. * * @var Options */ private $options_api; /** * Instantiate the class * * @param Options_Data $options Options instance. * @param Options $options_api Options instance. */ public function __construct( Options_Data $options, Options $options_api ) { $this->options = $options; $this->options_api = $options_api; } /** * Returns an array of events this listens to * * @return array */ public static function get_subscribed_events(): array { return [ 'rocket_last_rucss_job_added_time' => [ 'log_last_added_job_time', 10, 2 ], 'rocket_rucss_process_pending_jobs_start' => [ 'log_process_pending_job_start_time', 10, 1 ], 'rocket_rucss_process_pending_jobs_end' => [ 'log_process_pending_job_end_time', 10, 1 ], 'rocket_rucss_check_job_status_end' => [ 'log_check_job_status_end', 10, 1 ], 'rocket_rucss_process_on_submit_jobs_start' => [ 'log_process_on_submit_start', 10, 1 ], 'rocket_rucss_process_on_submit_jobs_end' => [ 'log_process_on_submit_end', 10, 1 ], ]; } /** * Saves the last time a new job was added to rucss table. * * @param mixed $is_success New job status: ID of inserted row if successfully added; false otherwise. * @param string $timestamp Current timestamp. * @return void */ public function log_last_added_job_time( $is_success, $timestamp ) { if ( Logger::debug_enabled() ) { if ( ! $is_success ) { return; } $this->options->set( 'last_rucss_job_added', $timestamp ); $this->options_api->set( 'debug', $this->options->get_options() ); } } /** * Saves the time when the process pending jobs started. * * @param string $timestamp Current timestamp. * @return void */ public function log_process_pending_job_start_time( $timestamp ) { if ( Logger::debug_enabled() ) { $this->options->set( 'rucss_process_pending_jobs_start', $timestamp ); $this->options_api->set( 'debug', $this->options->get_options() ); } } /** * Saves the time when the process pending jobs ended. * * @param string $timestamp Current timestamp. * @return void */ public function log_process_pending_job_end_time( $timestamp ) { if ( Logger::debug_enabled() ) { $this->options->set( 'rucss_process_pending_jobs_end', $timestamp ); $this->options_api->set( 'debug', $this->options->get_options() ); } } /** * Saves the time when the check job status ended. * * @param string $timestamp Current timestamp. * @return void */ public function log_check_job_status_end( $timestamp ) { if ( Logger::debug_enabled() ) { $this->options->set( 'rucss_check_job_status_end', $timestamp ); $this->options_api->set( 'debug', $this->options->get_options() ); } } /** * Saves the time when the process on submit jobs started. * * @param string $timestamp Current timestamp. * @return void */ public function log_process_on_submit_start( $timestamp ) { if ( Logger::debug_enabled() ) { $this->options->set( 'rucss_process_on_submit_jobs_start', $timestamp ); $this->options_api->set( 'debug', $this->options->get_options() ); } } /** * Saves the time when the process on submit jobs ended. * * @param string $timestamp Current timestamp. * @return void */ public function log_process_on_submit_end( $timestamp ) { if ( Logger::debug_enabled() ) { $this->options->set( 'rucss_process_on_submit_jobs_end', $timestamp ); $this->options_api->set( 'debug', $this->options->get_options() ); } } }