SCHWEIS
Server: LiteSpeed
System: Linux premium103.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User: aaasepid (956)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //proc/self/cwd/new/wp-content/plugins/extendify/app/Shared/Controllers/AutoUpdateController.php
<?php

/**
 * Controller for enabling plugin auto-updates.
 */

namespace Extendify\Shared\Controllers;

defined('ABSPATH') || die('No direct access.');

use Extendify\Shared\Services\AutoUpdate\AutoUpdate;

/**
 * Opts a plugin we installed into WordPress auto-updates.
 */

class AutoUpdateController
{
    /**
     * Enable auto-updates for a plugin we just installed.
     *
     * @param \WP_REST_Request $request - The request.
     * @return \WP_REST_Response
     */
    public static function enable($request)
    {
        $plugin = sanitize_text_field((string) $request->get_param('plugin'));
        if (AutoUpdate::isEnabled() && $plugin) {
            // The WP install response gives the plugin file without its ".php".
            AutoUpdate::enableAutoUpdateForPlugin(plugin_basename($plugin . '.php'));
        }

        return new \WP_REST_Response(['success' => true]);
    }
}