ointel_checks filter
Add, remove, or modify checks in the health engine.
phpadd_filter( 'ointel_checks', function( array $checks ): array {
$checks[] = [
'id' => 'my_custom_check',
'category' => 'Environment',
'label' => 'My Custom Check',
'status' => 'ok', // critical | warning | info | ok
'message' => 'Everything looks good.',
'detail' => 'Optional additional detail.',
'score_impact' => 0,
];
return $checks;
} );
ointel_snapshot_data filter
Add custom data fields to every snapshot.
phpadd_filter( 'ointel_snapshot_data', function( array $data ): array {
$data['woocommerce_product_count'] = wp_count_posts( 'product' )->publish ?? 0;
return $data;
} );
ointel_alert_conditions filter
Add custom alert conditions that fire after every scan.
phpadd_filter( 'ointel_alert_conditions', function( array $conditions ): array {
$conditions[] = [
'type' => 'my_custom_alert',
'message' => function( array $checks, array $health ): string {
return 'My custom alert triggered. Score: ' . $health['score'];
},
];
return $conditions;
} );
The should_fire logic for custom conditions is not called automatically — you must hook into ointel_alert_conditions and handle firing in your own plugin by calling OIntel_Alerts::evaluate() or OIntel_DB::insert_alert() directly.
ointel_report_sections filter
Add custom sections to HTML reports.
phpadd_filter( 'ointel_report_sections', function( array $sections ): array {
$sections[] = [
'title' => 'WooCommerce Checks',
'checks' => [
[ 'label' => 'Products', 'status' => 'ok', 'message' => '142 published products', 'detail' => '' ],
],
];
return $sections;
} );
