HEX
Server: nginx/1.22.0
System: Linux iZuf6jdxbygmf6cco977lcZ 5.10.84-10.4.al8.x86_64 #1 SMP Tue Apr 12 12:31:07 CST 2022 x86_64
User: root (0)
PHP: 7.4.29
Disabled: passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen
Upload Files
File: /data/wwwroot/wordpress/wp-content/plugins/flamingo/includes/cron.php
<?php

/**
 * The file that defines the cron job functionality
 *
 * @since 2.1
 *
 */


// call when WP loads
add_action( 'wp', 'flamingo_schedule_activation', 10, 0 );

/**
 * Create schedule event for cron job, if its already not exists
 *
 * @since 2.1
 *
 * @see wp_next_scheduled(), wp_schedule_event()
 *
 */
function flamingo_schedule_activation() {
	if ( ! wp_next_scheduled( 'flamingo_daily_cron_job' ) ) {
		wp_schedule_event( time(), 'daily', 'flamingo_daily_cron_job' );
	}
}


// deactivate cron job on deactivation of the plugin on plugin's deactivation
register_deactivation_hook( __FILE__, 'flamingo_schedule_deactivate' );

/**
 * Function to deactivate the cron job
 *
 * @since 2.1
 *
 * @see wp_next_scheduled(), wp_unschedule_event()
 *
 */
function flamingo_schedule_deactivate() {

	// when the last event was scheduled
	$timestamp = wp_next_scheduled( 'flamingo_daily_cron_job' );

	// unschedule previous event if any
	wp_unschedule_event( $timestamp, 'flamingo_daily_cron_job' );
}


// hook flamingo_schedule_function to schedule event
add_action( 'flamingo_daily_cron_job', 'flamingo_schedule_function', 10, 0 );

/**
 * Function to run for cron job
 *
 * @since 2.1
 *
 * @see flamingo_schedule_move_trash()
 *
 */
function flamingo_schedule_function() {

	// run function move spam to trash
	flamingo_schedule_move_trash();
}