This plugin enables you to display how many users are online on your WordPress site, with detailed statistics of where they are and who they are (Members/Guests/Search Bots).
WP-Admin -> Appearance -> Widgets
wp-content/themes/<YOUR THEME NAME>/sidebar.php
and add Anywhere:<?php if (function_exists('users_online')): ?>
<p>Users online: <div id="useronline-count"><?php users_online(); ?></div></p>
<?php endif; ?>
https://github.com/lesterchan/wp-useronline
I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.