Add error output for debugging statistics page

This commit is contained in:
2026-01-22 00:03:41 +01:00
parent 79b9c2cefd
commit 89c5a40f56

View File

@@ -301,10 +301,14 @@ class AnalyticsController
*/
public function renderStatisticsPage(): void
{
$stats = $this->licenseManager->getStatistics();
// Use PHP rendering directly for stability
$this->renderStatisticsPageFallback($stats);
try {
$stats = $this->licenseManager->getStatistics();
$this->renderStatisticsPageFallback($stats);
} catch (\Throwable $e) {
echo '<div class="wrap"><h1>License Statistics - Error</h1>';
echo '<div class="notice notice-error"><p><strong>Error:</strong> ' . esc_html($e->getMessage()) . '</p>';
echo '<p><strong>File:</strong> ' . esc_html($e->getFile()) . ':' . esc_html($e->getLine()) . '</p></div></div>';
}
}
/**