Discourse Yearly Review

:discourse2: Summary Discourse Yearly Review creates a topic that summarizes the previous year’s forum activity. You can see the latest example for here on Meta in 2021: The Year in Review
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-yearly-review
:open_book: Install Guide How to install plugins in Discourse

Configuration

Initial Setup

Head to your /admin/plugins page to click the discourse-yearly-review :gear: Settings button.

  1. Enter categories to pull data from into the yearly review categories setting. If left blank, it will default to the top 5 public categories.

  2. Using the yearly review publish category setting, choose a destination category for the review to be posted.

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

  3. Then, enable the plugin using the yearly review enabled setting.

Features

As you can see at 2022: The Year in Review, data is displayed 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

Generating the Yearly Review

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. The topic is published automatically through a background job. The job checks that the plugin is enabled and that it is within the first 31 days of the first month of the year. 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.

Other Site Settings

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 so that staff members are excluded from the users section and topics created by staff are excluded from the topics section.

A featured badge can be set via the yearly review featured badge setting. A maximum of 15 badge users are displayed. If more than 15 users have been granted this 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.

Running the Yearly Review manually

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

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

If you want to generate a report for a specific year just add review_year: 'year', e.g.:

Jobs::YearlyReview.new.execute(force: true, review_year: '2021')

Issues

  • 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.

  • The first post in the generated topic is ≈ 40,000 characters due to using HTML. As a result, it cannot be edited unless you first increase the body character limit above this (see Body is limited to 32000 characters; you entered 43659)

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

CHANGELOG

  • 2020-11-20T06:00:00Z Added setting to include stats from private categories
  • 2020-11-20T06:00:00Z Added ability to turn off individual user stats
81 Likes

3 posts were split to a new topic: Include Chat stats in Discourse Yearly Review

Can this be run say Aug 2021 - Aug 2022, or for one month? Does it have to be a calendar year (Jan - Dec)?

1 Like

It can currently only be run for a calendar year. There have been a few requests to be able to create monthly review topics, so maybe that’s something that will be added in the future.

5 Likes

I’d be interested in a monthly version for sure.

1 Like

Looking at the topic it looks like you can already to this. Just run that every month. Provided you have access to the rails console.

2 Likes

Would that not just run a report of the last year to-to-date of the time it’s run?

1 Like

I’m thinking each month it would begin at 1 Jan and end at the month it’s run… maybe to the day/hour it’s run?
I don’t see it beginning before 1 January because it being a Yearly Review it’s coded to begin on 1 January and end on 31 December. I’m curious as to how it would treat the end date if it was before 31 December. It can’t run into the future.

1 Like

Hi I just recently enable this plugin on our site, just wondering when will the summary topic be generated?

1 Like

The summary topic is generated every year on the 1st of January.

2 Likes

What is the yearly review featured badge?

1 Like

You can set the badge’s name in the plugin’s settings:

Also, see: https://meta.discourse.org/t/discourse-yearly-review/105713#features-3

3 Likes

Thanks. Just to confirm - I can choose for example ‘anniversary’ and it’ll show 15 people who received it?

2 Likes

Yes, the users who received the badge will be shown in the topic.

5 Likes

Thank you I missed it

1 Like

This plugin option doesn’t provide any context.

Add user-identifying stats to the first post of the review topic

What kind of user-identifying stats are we exactly talking about? Usernames?

1 Like

The stats are:

Have a look at 2021: The Year in Review to see the review topic that was generated on Meta for 2021.

2 Likes

I know what it could generate, I just wonder what kind of influence that toggle has. When disabled, the plugin will not work at all? What would be the difference exactly?

1 Like

With that off, you will just see stats highlighting the top topics in the top categories. Users will still be associated with those, of course, but you won’t get statistics and totals like number of hours read, and so on.

3 Likes

Why the result doesn’t follow my language setting even if the plugin translation is done? Do I need some extra settings?

1 Like