index.php
index.php is the main public-facing status page renderer. It is responsible for:
-
Loading configuration and monitored services
-
Reading uptime and incident data from JSON files
-
Calculating per-service and overall platform status
-
Rendering uptime statistics and charts
-
Generating SEO metadata (Open Graph, Twitter Cards, JSON-LD)
-
Displaying short-term and long-term status history
This file does not perform monitoring. It only reads and visualizes data produced by external monitoring scripts.
Requirements
-
PHP 8.0+
-
Web server (Apache / Nginx)
-
Writable/readable JSON files:
-
status.json -
long-status.json(optional)
-
-
JavaScript enabled (Chart.js via CDN)
File Dependencies
Required Includes
| File | Description |
|---|---|
config.php |
Core site configuration, SEO templates, branding |
theme-config.php |
Theme and CSS configuration |
sites.php |
List of monitored services |
status.json |
Short-term status history (2-minute checks) |
long-status.json |
Aggregated daily history (optional) |
based-info.php |
Optional developer info card |
Data Sources
status.json
-
Stores per-service status checks
-
Interval: every 2 minutes
-
Used for:
-
uptime calculation
-
incident detection
-
per-service charts (last ~6 hours)
-
long-status.json
-
Aggregated daily status
-
Used for long-term history visualization
-
Enabled only if
$enableLongHistory === true
Processing Flow
1. Load Configuration
The script loads site branding, SEO templates, monitoring settings, and theme preferences.
4. Uptime Calculation
Uptime is calculated as:
-
up+maintenance= available -
down= unavailable -
Final uptime rounded to 2 decimal places
Overall Platform Status
The global status is derived from all services:
| Condition | Overall Status |
|---|---|
| Any service in Outage | Outage |
| No outage, at least one degraded | Degraded |
| All services operational | Operational |
Associated colors:
-
Operational →
#065f46 -
Degraded →
#92400e -
Outage →
#991b1b
Charts & Visualization
Per-Service Charts
-
Rendered using Chart.js
-
Displays status over time:
-
1→ Up -
0.5→ Maintenance -
0→ Down
-
Daily Status Chart
-
Enabled via
$enableLongHistory -
Displays daily operational state over the selected period
SEO & Social Sharing
The page dynamically generates:
-
<title>and<meta description> -
Canonical URL
-
Open Graph tags (Facebook, LinkedIn)
-
Twitter Card metadata
-
Structured Data (JSON-LD)
All SEO values reflect the current real-time status.
Optional Features
Developer Info Card
Enabled only when:
Loads:
Can be completely removed without affecting functionality.