Flagged and hidden posts, whisper authors showing up in wordpress

If you take a look at the screenshots below, you can see the flagged and hidden post is showing in wordpress. Also more people are listed as participating in the discussion than there actually are. These are people who whispered in the topic.

I am on an older version of the wp-discourse plugin but i don’t know if that should be an issue. It seems to me this should be addressed on the discourse side anyway, so the hidden post and whisper authors are not exposed via the API.

Here’s how it looks in wordpress:

Here’s how it looks in discourse:

2 Likes

FYI just realizing that the 6 people mentioned also liked the post. Three of them are involved in the whisper conversation too but they did :heart: it. Maybe the whisperer avatars are actually not leaking out via the wordpress comments.

1 Like

Thanks for reporting this. I’m seeing two separate issues. The first issue is that hidden posts are being returned by the TopicViewWordpressSerializer. We need to either stop returning hidden posts, or add the hidden property to the data that is returned from Discourse. This would allow the plugin to handle hidden posts.

The second issue is that the list of topic participants that is returned by Discourse is set based on which participants the user making the request can see. Since the plugin is requesting Discourse topics as an admin user, staff users who have created whisper posts in the topic are being returned in the participants list. I’m going to have to look into this some more.

5 Likes

Do we ever need to display those hidden posts on the Wordpress side? If not, seems a waste to be sending them over the wire.

3 Likes

Hidden posts have been removed from the posts that are returned by the WordPress route. If you are on the latest version of Discourse, they will no longer show up in the WordPress comments.

The issue with the participants section is harder to deal with. The list of participants that is returned depends on the username that the API request for the Discourse comments is made with. Assuming you are using the All Users API credentials in the plugin’s Connection settings, the participants list will include users who have created whispers.

I am going to add an option to the plugin to allow the participants section to be excluded from the comments area. If you are not able to update the version of the WP Discourse plugin that you are using, you could remove the participants section by customizing the replies_html template.

3 Likes