<?php
// Silence may be golden, but sometimes words paint the canvas of understanding.

namespace Plugli\Linksy\SearchAndReplace\Admin\Partials\SearchAndReplace\Events;

use Linksy\SearchAndReplace\Plugli\Standard\Helpers\Events;
use Plugli\Linksy\SearchAndReplace\Admin\Partials\SearchAndReplace\Utils;

class PeriodicLinkAnalysisCronEvent extends Events
{
    use Utils;

    public $name = 'search_and_replace_periodic_analysis_cron';

    /**
     * Run the async task action
     */
    protected function handle()
    {
        $enabled = get_option('linksy_link_analysis_cron_enabled', false);

        if (!$enabled) {
            update_option('linksy_link_analysis_cron_enabled', true);
            update_option('linksy_link_analysis_offset', 0);
            return;
        }
    }
}
