public function check_secret($request)
{
$body = $request->get_json_params();
// For now, mimic original plugin's "authentication" method. This needs to be better.
if (!isset($body['secret']) || !hash_equals(\WP_CRON_CONTROL_SECRET, $body['secret'])) {
return new \WP_Error('no-secret', __('Secret must be specified with all requests', 'automattic-cron-control'), array('status' => 400));
}
return true;
}