HEX
Server: Apache/2.4.59 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2
System: Linux panel.ctvbarranquilla.com 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64
User: bastidas (1002)
PHP: 8.2.18
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen
Upload Files
File: /home/bastidas/web/bastidas.tv/public_html/wp-content/plugins/duplicator-pro/src/Core/Unistall.php
<?php

/**
 * Interface that collects the functions of initial duplicator Bootstrap
 *
 * @package   Duplicator
 * @copyright (c) 2022, Snap Creek LLC
 */

namespace Duplicator\Core;

use Duplicator\MuPlugin\MuGenerator;
use Duplicator\Utils\ExpireOptions;
use Duplicator\Utils\UsageStatistics\CommStats;
use Duplicator\Utils\UsageStatistics\PluginData;

/**
 * Uninstall class
 */
class Unistall
{
    /**
     * Registrer unistall hoosk
     *
     * @return void
     */
    public static function registreHooks()
    {
        if (is_admin()) {
            register_deactivation_hook(DUPLICATOR____FILE, array(__CLASS__, 'deactivate'));
        }
    }

    /**
     * Deactivation Hook:
     * Hooked into `register_deactivation_hook`.  Routines used to deactivate the plugin
     * For uninstall see uninstall.php  WordPress by default will call the uninstall.php file
     *
     * @return void
     */
    public static function deactivate()
    {
        MigrationMng::renameInstallersPhpFiles();

        //Logic has been added to uninstall.php
        //Force recalculation of next run time on activation
        //see the function \DUP_PRO_Package_Runner::calculate_earliest_schedule_run_time()
        \DUP_PRO_Log::trace("Resetting next run time for active schedules");
        $activeSchedules = \DUP_PRO_Schedule_Entity::get_active();
        ExpireOptions::deleteAll();
        foreach ($activeSchedules as $activeSchedule) {
            $activeSchedule->next_run_time = -1;
            $activeSchedule->save();
        }

        // Unschedule custom cron event for cleanup if it's scheduled
        if (wp_next_scheduled(\DUP_PRO_Global_Entity::CLEANUP_HOOK)) {
            // Unschedule the hook
            $timestamp = wp_next_scheduled(\DUP_PRO_Global_Entity::CLEANUP_HOOK);
            wp_unschedule_event($timestamp, \DUP_PRO_Global_Entity::CLEANUP_HOOK);
        }

        MuGenerator::remove();

        do_action('duplicator_pro_after_deactivation');
    }
}