File: /home/vitanhod/www/wp-content/plugins/system-control/api/endpoints/class-sc-sync-endpoint.php
<?php
class SC_Sync_Endpoint {
public function register() {
register_rest_route(SC_REST_NAMESPACE, '/sync', [
'methods' => 'GET',
'callback' => [$this, 'get_sync_data'],
'permission_callback' => ['SC_Api_Auth', 'verify'],
]);
}
public function get_sync_data($request) {
$data = SC_Activator::gather_site_info();
$data['is_active'] = (bool)get_option('sc_is_active', 1);
$data['plugin_install_blocked'] = (bool)get_option('sc_plugin_install_blocked', false);
return rest_ensure_response($data);
}
}