| @@ -23,8 +23,14 @@ | ||
| 23 | 23 | return [ 'GET' ]; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public function GET() { |
| 27 | + $error = $this->verify_capability(); | |
| 28 | + | |
| 29 | + if ( $error ) { | |
| 30 | + return $error; | |
| 31 | + } | |
| 32 | + | |
| 27 | 33 | try { |
| 28 | 34 | return $this->respond_success_json( Stats::calculate_global_stats() ); |
| 29 | 35 | } catch ( Throwable $t ) { |
| 30 | 36 | return $this->respond_error_json([ |