Discourse Yearly Review Plugin


(Simon Cossar) #1

The Discourse Yearly Review plugin creates a topic that summarizes the previous year’s activity on a forum. Have a look at 2018: The Year in Review to see the topic it created for activity on meta.

The topic displays data in two sections - users and topics. The users section includes:

  • Most Time Reading
  • Most Topics Created
  • Most Replies Created
  • Most Replied to
  • Most Likes Given
  • Most Likes Received
  • Most Visits
  • Users who have been granted a featured badge (the badge is set by the yearly review featured badge Site Setting

The topics section includes:

  • Most Read
  • Most Liked
  • Most Replied to
  • Most Popular
  • Most Bookmarked

The plugin sets thresholds for deciding which topics to display. There need to be a minimum of 10 likes or replies, 5 bookmarks, a score of 10, or one hour’s read time before a topic will be displayed. Categories used in this section are taken from the 5 best public categories that have been set in the yearly review categories Site Setting. If this setting is not configured, the 5 best public categories from the forum will be chosen. “Best” is determined by the category topics_year count. Topics created in read restricted categories are not included in the topics section.

The plugin has a yearly review exclude staff setting. It is enabled by default. When enabled, staff members are excluded from the users section and topics created by staff are excluded from the topics section.

The featured badge is set by the yearly review featured badge setting. A maximum of 15 badge users are displayed. If more than 15 users have been granted the badge, a link to the badge’s page is displayed. If the yearly review featured badge is not configured, this section will not be displayed.

The topic is published automatically through a background job. The job checks that the plugin is enabled and that it is within the first ‘n’ days of the first month of the year (the ‘n’ number of days is currently set to 8, this may need to be bumped up.) It then checks to see if a topic with the title yearly_review.topic_title has already been published by the system user. If all checks pass, the topic is published to the category set in the yearly review publish category setting. If this is not configured, the topic will be published to the Uncategorized category.

If you wish to view the topic before making it public, set the yearly review publish category to a private category.

If you don’t want to wait for the background job to be run, you can publish the topic from the rails console with:

Jobs::YearlyReview.new.execute(force: true)


  • The data is displayed in HTML tables. Tables are wrapped in div tags that have data-review-topic-users="true' and data-review-featured-topics="true" attributes. This allows the tables to be styled when they are displayed on Discourse. The styles are not copied when emails for the topics are created. Emails sent out for the topic don’t look great.

  • emojis in titles are not rendered in the featured topic links

Let me know if you have any concerns or suggestions for the plugin.

2018: The Year in Review
Discourse 2.2.0.beta8 Release Notes
Leaderboard Plugin
(AstonJ) #2

This is awesome, thanks!

We post an annual update and I am planning to include most of the info from this into it (or as a separate post beneath our main update).

One thing that I think would be really nice, is if the system sends a notification to all those included.

A quick question… presumably you can run this multiple times? So I could run a test run on one day then run the final version a few days later?

(Diego Barreiro) #3

How to fill this setting? :sweat_smile:
With the badge id or with the link?

(Simon Cossar) #4

A notification will be sent to any users mentioned in the users section. It would be possible to update the plugin to send them a custom notification as well.

The topic will be published as long as certain conditions are met - the plugin is enabled, it is within the first ‘n’ days of the first month of the year, and a topic doesn’t already exist with the title set by yearly_review.topic_title (the default translation for this is “%{year}: The Year in Review”. To publish the topic multiple times, you can either edit the topic title after it’s been published, or run the job from the console with:

Jobs::YearlyReview.new.execute(force: true)

Ideally, the plugin would allow the topic to be published by clicking a button on the UI, but we’re already a few days into 2019 and I wanted to get this released.

The yearly review featured badge setting takes the name of the badge. For example, on meta it is set to ‘Tech Support’. I’ll update the setting’s description to make this clear.

(Tobias Eigen) #5

I like it! Nice job. Here are a few things I noticed:

  • it is possible to test out settings by running sidekiq job, then deleting the message it generates, then changing settings and then running the sidekiq job. That helps!
  • If people are mentioned in the topic, they would likely appreciate being notified - currently they are not.
  • In 2018, several people left our organization, and so are no longer in the moderator or admin staff groups. They appear too prominently in the year in review. Could specific users be excluded? Or members of specific groups?
  • it would be loverly if the featured badge could be a comma separated list, to have more than one featured badge.

(Simon Cossar) #6

Yes, you can run the job at any time and a topic will be published. You don’t have to delete the initial topic first - the checks the plugin runs are all bypassed when you run the job with force: true

They should be notified, but people are reporting that they aren’t. Is it from testing on your own site that you’re finding notifications aren’t being sent, or is it from the topic we created on meta?

No, currently the only way to do this would be to edit the topics’ HTML.

This wouldn’t be a difficult change to make.

(Tobias Eigen) #7

Thanks, Simon!

I am referring to the topic on meta. So far on my site I am only running this in a private category for testing.

Another hack that occurred to me is to temporarily add the users to moderators list, run the job, then remove them again.

(AstonJ) #8

Another quick suggestion, is it possible to exclude people by username please?

I’d love to be able to include all moderators but exclude myself :slight_smile:

(Jeff Atwood) #9

This is not planned. I’d focus on small tweaks so we can get this released, versus scope creeping it. We can always do a V2 later (we have a whole year, after all…)

(Bart) #10

I can confirm I wasn’t notified here on Meta. Perhaps that’s because I appeared in the top posts sections and those don’t have a @mention on them?

(Jeff Atwood) #11

I’m not overly concerned about mentions here. That’s not the point.

It’s possible mentions were jacked up by the way this post was published as a hidden staff topic first.

(Dave McClure) #12

I created an annual review post already just listing a snapshot of topics from /top, but I’m looking forward to giving this a spin and sharing it too for last year when it’s ready :slight_smile:

(Kenny DuBose) #13

Whenever it’s deemed well to do so, I’d like to voice a +1 for being able to filter out certain usernames. I think this will be a broadly applicable filter that many could use to filter whatever a site owner would consider an “outlier” for their own use cases and desires.

(Evgeny) #14

Great plugin! :right_anger_bubble:

I have a localization question. What is the best way to add translation to the plugin?

Can we translate using transifex.com? I unfortunately do not have the opportunity to see now, because access until January 12 to the network is limited.

(Tobias Eigen) #15

Me too. Also the ability to exclude specific topics, categories and groups.

(Keith Guerrette) #16

I know this is called “Yearly Review” but it just occurred to me that I’d love to be able to share these types of summaries at different intervals too - quarterly?

Regardless, thanks for this! I’m excited to share it with everyone!

(Keith Guerrette) #17

What is ‘n’ set to? Have I already missed the window? I’ve enabled the plugin, but no post thus far. Should I just trigger one manually?

(Alexander Wright) #18

Add to this the ability to filter out those with a particular badge, please.

Excellent work! It’s already started to stimulate conversation on my forum about how much time some people are spending there!

(Simon Cossar) #19

The plugin is currently set to publish the topic up until the end of the first week of 2019 - in UTC time. That ends today. I’m going to make a small update to the plugin today that bumps this period up another week or two. There’s no harm in running the job manually.

(Kenny DuBose) #21

I’d use that as well.