HEX
Server: LiteSpeed
System: Linux server484.bertina.biz 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User: alvnails (1268)
PHP: 8.2.29
Disabled: mail
Upload Files
File: /home/alvnails/public_html/wp-content/plugins/string-locator/includes/REST/class-clean.php
<?php

namespace StringLocator\REST;

use StringLocator\Base\REST;

class Clean extends REST {

	protected $rest_base = 'clean';

	public function __construct() {
		parent::__construct();
	}

	public function register_rest_route() {
		register_rest_route(
			$this->namespace,
			$this->rest_base,
			array(
				'methods'             => 'POST',
				'callback'            => array( $this, 'clean' ),
				'permission_callback' => array( $this, 'permission_callback' ),
			)
		);
	}

	public function clean() {
		$scan_data = get_transient( 'string-locator-search-overview' );
		for ( $i = 0; $i < $scan_data->chunks; $i ++ ) {
			delete_transient( 'string-locator-search-files-' . $i );
		}

		wp_send_json_success( true );
	}

}

new Clean();