Who's Online Plugin (discourse-whos-online)

Summary: discourse-whos-online displays a list of users currently active on the site

:link: GitHub: https://github.com/discourse/discourse-whos-online
:arrow_right: Install: Follow the plugin installation guide.

Features

:information_source: Think carefully before installing this plugin. Discourse is designed for asynchronous discussion, and a list of online users can be harmful for some communities

It can also optionally display a user’s online status on their avatar. Either with a “ring”, “glow”, or with a “flair” icon in the top left.
45 39 10

The plugin uses the MessageBus to keep up-to-date, so user status is reflected in real-time. Users which have enabled the “hide profile and presence” setting will not be displayed. You can customize a number of things using the available site settings and language strings:

Configuration

These are available in the “plugins” section of the admin settings panel.

  • whos_online_active_timeago: maximum “last seen” for which users are considered online (minutes)
  • whos_online_collapse_threshold: number of users before the avatars overlap each other (see gif above). Set very high to disable this feature
  • whos_online_maximum_display: the maximum number of avatars to display. The numeric counter will still count higher than this. The choice of who gets displayed is currently inconsistent
  • whos_online minimum_display: the minimum number of avatars to display. Below this, a “no users online” message is displayed
  • whos_online_hide_below_minimum_display: if enabled, the widget will be entirely hidden when the number of users is less than minimum_display
  • whos_online_display_public: should the plugin be displayed to people who aren’t logged in? Defaults to true.
  • whos_online_display_min_trust_level: the minimum trust level that this plugin is displayed to. Defaults to 0
  • whos_online_avatar_indicator: choose how to display online status on user avatars. Defaults to “ring”
  • whos_online_avatar_indicator_topic_lists: display avatar indicators in mobile topic lists, and the “Categories & Latest” view. Defaults to off.
  • whos_online_count_only: when enabled, only the count will be displayed. Online user identities will not be revealed

:speech_balloon: Frontend Language Strings

These are available in the admin panel under CustomizeText Content (search for whos_online)

  • js.whos_online.no_users | “No users currently online”:The message displayed when the number of users < whos online minimum display setting.
  • js.whos_online.title | “Online ({{count}})”: The text displayed before the list of avatars. {{count}} is the number of users online.
  • js.whos_online.tooltip | “Users seen in the last 5 minutes”: the text displayed on mouseover of the text.
127 Likes

At the moment, I’d recommend staying away from this plugin if you have more than ~50 concurrent users. That said, there are reports of people who have it working with many more users, and people who report issues with fewer users.

We are hoping to rewrite some parts of this plugin in the next few weeks/months so that it scales better, and we can remove the #experimental tag.

26 Likes

Hi, so this plugin made my forum actually usable. It was a tiny change but now people are actually using the chat and having real convos on the boards. This should seriously be added as a default option to Discourse. Thank you!

15 Likes

I hate to be annoying, but any update on this? I’m talking to the owners of a discourse forum I am active on about adding this and their requirement is that the plugin must be removed from the experimental phase before it is added.

Would you consider the plugin experimental for forums with <40 users per day? The forum I’m on has fairly low load.

3 Likes

We like this plugin, but on just updating to the latest discourse version I got this error which broke the main discourse pages (although not the admin page)

Unhandled Promise Rejection: Error: Could not find module `ember` imported from `discourse/plugins/discourse-whos-online/discourse/components/whos-online

This was in latest Safari on a Mac, using 2.8.0.beta6
Disabling the whos-online plugin and rebuilding everything solves the error. Would love to be able to reenable soon though.

5 Likes

Did you update the plugin at the same time? Old versions of the plugin are not compatible with the latest version of Discourse (fixes were made in this commit). But if you have the latest version of the plugin, things should be working ok.

5 Likes

I have a question about this please:

What’s the expensive code / work here?

Is the number of people online the issue? Or the number of people that could see this plugin?

Eg. If a busy forum used this but only 4x staff users had access to it, would it still be an expensive plugin?

I also note this was started in 2016, yet in 2021 it’s still experimental. I’m guessing that’s not likely to ever change now? :thinking:

1 Like

The problem is primarily with the number of concurrently ‘online’ people.

Good news though: I’ve been working on a re-write of this plugin, and it’s very nearly ready to merge. If anyone is keen to try it out, the work is on the ‘v2’ branch on GitHub (and the PR can be found here). The changes are mostly behind-the-scenes, so nothing too exciting. But it should scale much better on larger sites.

We’re testing this internally, and hoping to merge in the next couple of weeks. I’ll post here, and update the OP, when that’s done.

18 Likes

Hi, @david any news or ETA? :slight_smile: Thank you.

2 Likes

The change is now merged, and I’ve removed the #experimental tag from this topic.

Let us know if you have any feedback on the change!

18 Likes

We’ve put the plugin back in our forum and it has performed well so far, even with some heavy traffic sometimes.

Is the plugin now open to new/improved features? :grin: (or at least in the near future)

4 Likes

Great - glad to hear it’s performing well!

I can’t guarantee whether we’ll be able to implement them, but always open to suggestions!

4 Likes

Love this plugin. Noticed that on mobile the flair dot is misaligned.

3 Likes

But they are aligned correctly on the “current”’page.

2 Likes

Are you using a custom theme? The first screenshot doesn’t look like out-the-box Discourse

6 Likes

Using the Material Design theme.

2 Likes

Does the README.md need updating on the repo @david ? :thinking:

(ref: This plugin was originally designed for a small discourse community, and has not been optimized for large sites)

4 Likes

Of course, no problem, I’ve suggested it before:

  • include a “who’s viewing what” option, meaning when 100 users are online and 70 of them are reading a certain topic then it could be mentioned like “70 viewing” right after the topic title (similar behavior in category view, but for the whole category)… with or without threshold (so that just topics above a certain amount of users reading it get the notice).

This is a feature we had back in the days with the old SMF that was particularly useful for users to get what people were reading… it’s basically a measure of popularity for the topic, and sometimes more useful than total amount of replies or total reads.

Another feature I would suggest is to place the list of avatars somewhere else not to take the focus out of the topic list, but I understand that with discourse not having a “fixed footer” (at least as long the topic list just keeps rolling) it will be kind of hard, so I won’t suggest this for now. :sweat_smile:

2 Likes