HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/testingff/public_html/fdfctr/wp-content/plugins/wp-event-solution/base/cron.php
<?php
namespace Etn\Base;

Abstract class Cron{

    public function __construct(){
        $this->config();
    }

    /**
     * Register event
     */
    public  function config(){
        $hook_name      = $this->hook_name ;
        $recurrence     = $this->recurrence_action();

        // bind new corn event
        add_action( 'init', function() use ( $hook_name , $recurrence ) {
            if ( !wp_next_scheduled( $hook_name ) ) {
                wp_schedule_event( time() , $recurrence  , $hook_name );
            }
        } );

        // remove attendee of failed status 
        add_action( $hook_name ,[ $this , 'action_name' ] );
    }

    /**
     * run  in every corn schedule
     */
    public abstract function action_name();

    /**
     * corn schedule time
     */
    public abstract function recurrence_action();
}