403Webshell
Server IP : 162.0.217.223  /  Your IP : 216.73.216.153
Web Server : LiteSpeed
System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : mypckeys ( 1539)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/mypckeys/public_html/wp-content/plugins/woocommerce-currency-switcher/classes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mypckeys/public_html/wp-content/plugins/woocommerce-currency-switcher/classes/cron.php
<?php

if (!defined('ABSPATH'))
    die('No direct access allowed');

/**
 * WordPress cron substitute
 *
 * @author realmag777
 * @site https://pluginus.net
 */

final class PN_WP_CRON_WOOCS {

    public $actions = array();
    public $cron_key = null;

    public function __construct($key)
    {
        $this->cron_key = $key;
        $this->actions = get_option($this->cron_key, array());
    }

    public function process()
    {
        if (!empty($this->actions))
        {
            $now = time();
            foreach ($this->actions as $action_hook => $event)
            {
                if ($event['next'] <= $now)
                {
                    $_REQUEST['woocs_cron_running'] = true;//just marker for another applications
                    do_action($action_hook);

                    if ((int) $event['recurrence'] > 0)
                    {
                        $event['next'] = $now + $event['recurrence'];
                        $this->actions[$action_hook] = $event;
                        $this->update();
                    } else
                    {
                        $this->remove($action_hook);
                    }
                }
            }
        }
    }

    public function attach($hook, $start_time, $recurrence)
    {
        //recurrence - is in seconds
        if ($recurrence > 0)
        {
            $next = $start_time + $recurrence;
            $this->actions[$hook] = array(
                'start_time' => $start_time,
                'next' => $next,
                'recurrence' => $recurrence
            );
            $this->update();
        }
    }

    public function reset($hook, $recurrence)
    {
        $this->attach($hook, time(), $recurrence);
    }

    public function is_attached($hook, $recurrence = 0)
    {

        if (isset($this->actions[$hook]) AND $recurrence !== 0)
        {
            if ((int) $this->actions[$hook]['recurrence'] !== $recurrence)
            {
                //if recurrence change - change it immediately in $this->actions array
                return false;
            }
        }


        return isset($this->actions[$hook]);
    }

    public function remove($hook)
    {
        unset($this->actions[$hook]);
        $this->update();
    }

    public function update()
    {
        update_option($this->cron_key, $this->actions);
    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit