# extendify/3.1.5/app/Shared/Controllers/AutoUpdateController.php

Extendify, version 3.1.5. 36 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.1.5/code/app/Shared/Controllers/AutoUpdateController.php
- Raw: https://pluginprobe.com/plugins/extendify/3.1.5/raw/app/Shared/Controllers/AutoUpdateController.php
- Modified: 2026-06-11T18:37:12+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/extendify/3.1.5/code/app/Shared/Controllers/AutoUpdateController.php#L10-L20`.

```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]);
    }
}

```
