WP_REST_Server::READABLE, 'callback' => array( $this, 'get_report' ), 'permission_callback' => $this->require_cap( 'agyl_manage' ), ) ); register_rest_route( self::REST_NAMESPACE, '/capabilities/rescan', array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'rescan' ), 'permission_callback' => $this->require_cap( 'agyl_manage' ), ) ); } /** * GET /capabilities. */ public function get_report(): WP_REST_Response { return $this->respond( $this->detector->report() ); } /** * POST /capabilities/rescan — force a fresh scan. */ public function rescan(): WP_REST_Response { return $this->respond( $this->detector->detect( true ) ); } }