Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.32.1
Your Ip: 216.73.216.223
User: mjbynoyq (1574) | Group: mjbynoyq (1570)
Safe Mode: OFF
Disable Function:
NONE

name : cron.php
<?php

class Brizy_Admin_Cloud_Cron {

	use Brizy_Admin_Cloud_SyncAware;

	const BRIZY_CLOUD_CRON_KEY = 'brizy-cloud-synchronize';


	public static function _init() {
		static $instance;

		if ( ! $instance ) {
			$instance = new self( Brizy_Admin_Cloud_Client::instance( Brizy_Editor_Project::get(), new WP_Http() ) );
		}

		return $instance;
	}

	/**
	 * Brizy_Admin_Cloud_Cron constructor.
	 */
	public function __construct( $client ) {

		$this->setClient( $client );

		add_action( self::BRIZY_CLOUD_CRON_KEY, array( $this, 'syncBlocksAction' ) );
		add_action( self::BRIZY_CLOUD_CRON_KEY, array( $this, 'syncLayoutsAction' ) );

		add_filter( 'cron_schedules', array( $this, 'addBrizyCloudCronSchedules' ) );


		if ( ! wp_next_scheduled( self::BRIZY_CLOUD_CRON_KEY ) ) {
			$interval = is_user_logged_in() ? '5minute' : 'hourly';

			if ( is_user_logged_in() ) {
				wp_schedule_event( time(), $interval, self::BRIZY_CLOUD_CRON_KEY );
			}
		}
	}

	public function syncLayoutsAction() {
		Brizy_Logger::instance()->debug('Sync layouts cron called');
		return $this->syncLayouts(1);
	}

	public function syncBlocksAction() {
		Brizy_Logger::instance()->debug('Sync blocks cron called');
		return $this->syncBlocks(1);
	}

	public function addBrizyCloudCronSchedules( $schedules ) {
		// Adds once weekly to the existing schedules.
		$schedules['5minute'] = array(
			'interval' => 300,
			'display'  => __( 'Once in 5 minutes' )
		);

		return $schedules;
	}
}
© 2025 XylotrechusZ