I was curious about this too, so I created this code. You can add this to the theme functions.php (if you or your developer knows what to do) or in your own plugin, but that requires a developer to make ??
Note: This is experimental code that won’t be updated, so use at your own risk.
It looks like this (not perfect but it works on every page):
add_action('admin_bar_menu', function ($wp_admin_bar) {
global $wpdb;
if (!class_exists("burst_statistics")) {
return;
}
$icon = '<img src="https://burst-statistics.com/wp-content/uploads/2021/02/cropped-burst-favicon-32x32.png" style="width: 16px; height: 16px; vertical-align: middle; margin: -2px 4px 0 0;" />';
$stats = array();
// Live stats
$table_name = $wpdb->prefix . 'burst_statistics';
$time_start = strtotime('10 minutes ago');
$time_now = time();
$on_page_offset = apply_filters("burst_on_page_offset", 60);
$live_value = $wpdb->get_var("SELECT count(*) FROM (SELECT DISTINCT(uid) AS uid FROM $table_name WHERE time > $time_start AND ( (time + time_on_page / 1000 + $on_page_offset) > $time_now)) AS active_visitors");
$stats[] = sprintf('Live: %d', (int) $live_value ?: 0);
// Page stats
if ($post = get_post()) {
$burst_total_pageviews_count = get_post_meta($post->ID, 'burst_total_pageviews_count', true);
$stats[] = sprintf('Pageviews: %d', (int) $burst_total_pageviews_count ?: 0);
}
$wp_admin_bar->add_node(array(
'id' => 'admin-bar-burst',
'title' => sprintf('%s %s', $icon, implode(' | ', $stats)),
'href' => (function_exists('burst_admin_url') ? burst_admin_url() : admin_url()) . '?page=burst#dashboard',
));
}, 999);