'hookbird_endpoint_action', 'do' => $hookbird_do, 'id' => $hookbird_id, ), admin_url( 'admin-post.php' ) ), 'hookbird_endpoint_action' ); }; $hookbird_kinds = array( 'slack' => __( 'Channel messages', 'hookbird' ), 'discord' => __( 'Channel messages', 'hookbird' ), 'telegram' => __( 'Bot messages', 'hookbird' ), 'teams' => __( 'Channel cards', 'hookbird' ), 'googlechat' => __( 'Space messages', 'hookbird' ), 'n8n' => __( 'Start a workflow', 'hookbird' ), 'make' => __( 'Start a scenario', 'hookbird' ), 'zapier' => __( 'Start a Zap', 'hookbird' ), 'custom' => __( 'Signed JSON to any URL', 'hookbird' ), ); // Totals across endpoints for the last 24 hours. $hookbird_tot = array( 'success' => 0, 'failed' => 0, 'pending' => 0, ); foreach ( $stats as $hookbird_s ) { foreach ( $hookbird_tot as $hookbird_k => $hookbird_v ) { $hookbird_tot[ $hookbird_k ] += isset( $hookbird_s[ $hookbird_k ] ) ? (int) $hookbird_s[ $hookbird_k ] : 0; } } $hookbird_live = count( array_filter( $endpoints, static function ( $hookbird_e ) { return 'active' === Admin::state( $hookbird_e ); } ) ); $hookbird_done = $hookbird_tot['success'] + $hookbird_tot['failed']; $hookbird_rate = $hookbird_done ? round( 100 * $hookbird_tot['success'] / $hookbird_done ) : null; $hookbird_steps = count( array_filter( wp_list_pluck( $checklist, 'done' ) ) ); $hookbird_presets_grid = static function () use ( $presets, $hookbird_kinds ) { ?>
$hookbird_preset ) : ?>

  1. ' : ''; ?>

/
0, 'failed' => 0, 'pending' => 0, 'avg_ms' => 0, ); $hookbird_edit = admin_url( 'admin.php?page=hookbird-edit&id=' . $hookbird_id ); $hookbird_events = $hookbird_endpoint['events']; $hookbird_total = $hookbird_stat['success'] + $hookbird_stat['failed']; ?>
' . esc_html__( 'All events', 'hookbird' ) . ''; } else { foreach ( array_slice( $hookbird_events, 0, 2 ) as $hookbird_event ) { $hookbird_def = Registry::get( $hookbird_event ); echo '' . esc_html( $hookbird_def ? $hookbird_def['label'] : $hookbird_event ) . ''; } if ( count( $hookbird_events ) > 2 ) { /* translators: %d: number of additional events. */ echo '' . esc_html( sprintf( __( '+%d more', 'hookbird' ), count( $hookbird_events ) - 2 ) ) . ''; } } if ( ! empty( $hookbird_endpoint['conditions']['rules'] ) ) { echo '
' . esc_html( sprintf( /* translators: %d: number of conditions. */ _n( 'Filtered by %d condition', 'Filtered by %d conditions', count( $hookbird_endpoint['conditions']['rules'] ), 'hookbird' ), count( $hookbird_endpoint['conditions']['rules'] ) ) ) . '
'; } ?>
$hookbird_endpoint['last_success_at'] ) ) : ?>