Cronix PRO provides a set of WordPress actions and filters so you can hook into its behavior, extend functionality, and integrate with other systems — without modifying plugin files.
#Actions
Actions fire at specific points in the Cronix PRO lifecycle. Use add_action() to hook into them.
| Hook | When it fires | Parameters |
|---|---|---|
cronix_event_tracked |
After an execution is recorded in the log | $hook (string), $log_entry (array) |
cronix_health_calculated |
After the health score is computed | $score (int), $factors (array) |
cronix_orphan_detected |
When an orphaned hook is found | $hook (string) |
cronix_notification_sent |
After a notification is dispatched | $channel (string), $alert_type (string), $data (array) |
cronix_chain_step_complete |
After a chain step finishes | $chain_id (int), $step_index (int), $status (string) |
cronix_snapshot_taken |
After a snapshot is saved | $snapshot_id (int), $name (string) |
cronix_quota_breached |
When a resource quota limit is exceeded | $source (string), $violation_type (string), $value (mixed) |
Example — log a message whenever an event fails:
add_action( 'cronix_event_tracked', function( $hook, $log_entry ) {
if ( $log_entry['status'] === 'error' ) {
error_log( "Cronix: $hook failed: " . $log_entry['error_message'] );
}
}, 10, 2 );
#Filters
Filters let you modify data before Cronix PRO uses it. Use add_filter() to hook into them.
| Filter | What it controls | Parameters |
|---|---|---|
cronix_health_factors |
Modify health score factors before calculation | $factors (array) |
cronix_notification_data |
Modify notification payload before sending | $data (array), $channel (string) |
cronix_log_retention_days |
Override the log retention period | $days (int) |
cronix_overdue_threshold_minutes |
Override the overdue detection threshold | $minutes (int) |
cronix_excluded_hooks |
Add hooks that Cronix PRO should ignore entirely | $hooks (array) |
cronix_safe_mode_exclusions |
Hooks to keep running even in Safe Mode | $hooks (array) |
cronix_health_score |
Modify the final computed score before display | $score (int) |
cronix_plugin_detection |
Customize which plugin a hook is attributed to | $source (string), $hook (string) |
Example — exclude an internal maintenance hook from the Events Manager:
add_filter( 'cronix_excluded_hooks', function( $hooks ) {
$hooks[] = 'my_internal_maintenance_hook';
return $hooks;
});
Example — add a custom field to Slack notification payloads:
add_filter( 'cronix_notification_data', function( $data, $channel ) {
if ( $channel === 'slack' ) {
$data['site_env'] = defined( 'WP_ENV' ) ? WP_ENV : 'production';
}
return $data;
}, 10, 2 );
$accepted_args count in add_filter(). For example, cronix_notification_data passes 2 parameters, so use: add_filter( 'cronix_notification_data', 'my_function', 10, 2 ).Last updated
Was this article helpful?