# hostinger/3.0.76/includes/Admin/Jobs/ActionScheduler.php

Hostinger Tools, version 3.0.76. 41 lines.

- Page: https://pluginprobe.com/plugins/hostinger/3.0.76/code/includes/Admin/Jobs/ActionScheduler.php
- Raw: https://pluginprobe.com/plugins/hostinger/3.0.76/raw/includes/Admin/Jobs/ActionScheduler.php
- Modified: 2025-07-22T10:37:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/hostinger/3.0.76/code/includes/Admin/Jobs/ActionScheduler.php#L10-L20`.

```php
<?php

namespace Hostinger\Admin\Jobs;

defined( 'ABSPATH' ) || exit;

class ActionScheduler {

    public const STATUS_PENDING  = 'pending';
    public const STATUS_COMPLETE = 'complete';
    public const STATUS_FAILED   = 'failed';

    public function get_group(): string {
        return defined( 'HOSTINGER_PLUGIN_SETTINGS_OPTION' ) ? HOSTINGER_PLUGIN_SETTINGS_OPTION : 'hostinger_tools';
    }

    public function schedule_single( int $timestamp, string $hook, $args = array() ): int {
        if ( ! function_exists( 'as_schedule_single_action' ) ) {
            return 0;
        }

        return as_schedule_single_action( $timestamp, $hook, $args, $this->get_group() );
    }

    public function schedule_immediate( string $hook, $args = array() ): int {
        if ( ! function_exists( 'as_schedule_single_action' ) ) {
            return 0;
        }

        return as_schedule_single_action( gmdate( 'U' ) - 1, $hook, $args, $this->get_group() );
    }

    public function has_scheduled_action( string $hook, $args = array() ): bool {
        if ( ! function_exists( 'as_next_scheduled_action' ) ) {
            return false;
        }

        return as_next_scheduled_action( $hook, $args, $this->get_group() ) !== false;
    }
}

```
