HEX
Server: LiteSpeed
System: Linux melbournecleaninggroup 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: www-data (33)
PHP: 7.3.33-1+focal
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/html/wp-content/plugins/backup-guard-platinum/com/core/notice/SGNoticeHandler.php
<?php

class SGNoticeHandler
{
	public function run()
	{
		$this->checkTimeoutError();
		$this->checkMigrationError();
		$this->checkRestoreNotWritableError();
		$this->checkLiteSpeedWarning();
		$this->checkTables();
		$this->checkPingFilePermission();
	}

	private function checkTimeoutError()
	{
		$pluginCapabilities = backupGuardGetCapabilities();
		if (SGConfig::get('SG_EXCEPTION_TIMEOUT_ERROR')) {
			if ($pluginCapabilities != BACKUP_GUARD_CAPABILITIES_FREE) {
				SGNotice::getInstance()->addNoticeFromTemplate('timeout_error', SG_NOTICE_ERROR, true);
			}
			else {
				SGNotice::getInstance()->addNoticeFromTemplate('timeout_free_error', SG_NOTICE_ERROR, true);
			}
		}
	}
	
	public function checkTables()
	{
		if (!checkAllMissedTables()) {
			SGNotice::getInstance()->addNoticeFromTemplate('missed_table', SG_NOTICE_ERROR, true);
		}
	}

	private function checkMigrationError()
	{
		if (SGConfig::get('SG_BACKUP_SHOW_MIGRATION_ERROR')) {
			SGNotice::getInstance()->addNoticeFromTemplate('migration_error', SG_NOTICE_ERROR, true);
		}
	}

	private function checkRestoreNotWritableError()
	{
		if (SGConfig::get('SG_BACKUP_SHOW_NOT_WRITABLE_ERROR')) {
			SGNotice::getInstance()->addNoticeFromTemplate('restore_notwritable_error', SG_NOTICE_ERROR, true);
		}
	}

	private function checkLiteSpeedWarning()
	{
		$server = '';
		if (isset($_SERVER['SERVER_SOFTWARE'])) {
			$server = strtolower($_SERVER['SERVER_SOFTWARE']);
		}

		//check if LiteSpeed server is running
		if (strpos($server, 'litespeed') !== false) {
			$htaccessContent = '';
			if (is_readable(ABSPATH.'.htaccess')) {
				$htaccessContent = @file_get_contents(ABSPATH.'.htaccess');
				if (!$htaccessContent) {
					$htaccessContent = '';
				}
			}

			if (!$htaccessContent || !preg_match('/noabort/i', $htaccessContent)) {
				SGNotice::getInstance()->addNoticeFromTemplate('litespeed_warning', SG_NOTICE_WARNING);
			}
		}
	}
	
	private function checkPingFilePermission()
	{
		if (file_exists(SG_PING_FILE_PATH) && !is_readable(SG_PING_FILE_PATH)) {
			SGNotice::getInstance()->addNoticeFromTemplate('ping_permission', SG_NOTICE_ERROR, true);
		}
	}
}