'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 ) { ?>