HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/triad-infosec/wp-content/plugins/autoupdater/lib/Task/ExtensionsUpdatesRefresh.php
<?php
defined('AUTOUPDATER_LIB') or die;

class AutoUpdater_Task_ExtensionsUpdatesRefresh extends AutoUpdater_Task_Base
{
    protected $admin_privileges = true;
    protected $high_priority = false;
    /** @var AutoUpdater_Helper_SiteTransient */
    protected $site_transient;

    public function __construct($payload)
    {
        parent::__construct($payload);

        AutoUpdater_Loader::loadClass('Helper_SiteTransient');

        // Restore updates data if another plugin deleted it just before update
        $this->site_transient = new AutoUpdater_Helper_SiteTransient();
    }

    /**
     * @return array
     */
    public function doTask()
    {
        $type = $this->input('type', '');

        // get updates for exceptional extensions (it must be called here)
        AutoUpdater_Loader::loadClass('Helper_Extension');
        AutoUpdater_Helper_Extension::loadMasterSliderPro();

        switch ($type) {
            case 'plugin':
                wp_update_plugins();
                break;
            case 'theme':
                wp_update_themes();
                break;
            default:
                wp_update_plugins();
                wp_update_themes();
        }

        return array(
            'success' => true,
            'message' => 'Updates refreshed successfully',
        );
    }
}