Well, after about an hour of working with the plugin, and eventually deciding to more or less rewrite the entire thing, there is some progress:

Unfortunately, there is no great way to filter by category in the SQL query, but the results can be culled so only discussions within the category are shown. Not ideal, but better than nothing. Maybe there is a way around it, will need to look later.
At least the new plugin is sort of working :smile: