paid_activity = new Paid_Activity(); // Webhook handler (registers its route on rest_api_init via Plugin). $this->webhook = new Monetization_Webhook(); } /** * Called by Plugin::register_rest_routes() on rest_api_init. */ public function register_rest_routes(): void { $this->paid_activity->register_rest_routes(); $this->webhook->register_rest_routes(); } }