licenseManager = $licenseManager; $this->registerHooks(); } /** * Register WordPress hooks */ private function registerHooks(): void { add_action('wp_dashboard_setup', [$this, 'registerDashboardWidget']); } /** * Register the dashboard widget */ public function registerDashboardWidget(): void { if (!current_user_can('manage_woocommerce')) { return; } wp_add_dashboard_widget( 'wclp_license_statistics', __('License Statistics', 'wc-licensed-product'), [$this, 'renderWidget'] ); } /** * Render the dashboard widget content */ public function renderWidget(): void { $stats = $this->licenseManager->getStatistics(); $licensesUrl = admin_url('admin.php?page=wc-licenses'); ?>