New addon providing additional statistics for moderation #1518

Merged
MrPetovan merged 1 commit from mexon/friendica-addons:mat/ratioed-plugin into develop 2024-06-23 14:13:35 +02:00
Contributor

This partly came out of a suggestion about a moderation tool, that partly overlapped with a tool I was after. This certainly doesn't address the original idea. In particular, it doesn't proactively provide warnings or notices, and it's not even possible to sort by the statistics. It does, however, expose some more information that may be useful. It provides something like the classic "ratio": number of comments divided by the number of likes/boosts, all over the last 24 hours. Over "2" is considered concerning, and those users are highlighted. It also exposes the number of block notifications received for that user. Blocks aren't dated, so that's a lifetime tally.

The first attached screenshot shows the new tab, called "Behaviour". Of the users, Pizzazz is highlighted, indicating that there's a problem. In the second screenshot, you can see that she received 11 comments in the last 24 hours and 4 reactions, for a ratio of 2.8. In the third screenshot, for comparison, Stormer has 5 comments and 4 reactions, for a ratio of 1.3.

This plugin as it stands is at best only barely over the threshold of being useful. It would never work on a site with thousands of active users. That would require a more complicated implementation. Perhaps it could be implemented as a hook when each post is received that updates statistics, or perhaps a cron job running once per hour could do it all in a batch. Either way, you'd need a way to retrieve users sorted by these additional metrics, which is a hard problem.

However, this might provide some inspiration for other people to implement something more interesting, and perhaps a sandbox to add more creative metrics.

This depends on this change in core to add the necessary hook.

This partly came out of [a suggestion about a moderation tool](https://xoxo.zone/@fraying/112644787955619828), that partly overlapped with a tool I was after. This certainly doesn't address the original idea. In particular, it doesn't proactively provide warnings or notices, and it's not even possible to sort by the statistics. It does, however, expose some more information that may be useful. It provides something like the classic "ratio": number of comments divided by the number of likes/boosts, all over the last 24 hours. Over "2" is considered concerning, and those users are highlighted. It also exposes the number of block notifications received for that user. Blocks aren't dated, so that's a lifetime tally. The first attached screenshot shows the new tab, called "Behaviour". Of the users, Pizzazz is highlighted, indicating that there's a problem. In the second screenshot, you can see that she received 11 comments in the last 24 hours and 4 reactions, for a ratio of 2.8. In the third screenshot, for comparison, Stormer has 5 comments and 4 reactions, for a ratio of 1.3. This plugin as it stands is at best only barely over the threshold of being useful. It would never work on a site with thousands of active users. That would require a more complicated implementation. Perhaps it could be implemented as a hook when each post is received that updates statistics, or perhaps a cron job running once per hour could do it all in a batch. Either way, you'd need a way to retrieve users sorted by these additional metrics, which is a hard problem. However, this might provide some inspiration for other people to implement something more interesting, and perhaps a sandbox to add more creative metrics. This depends on [this change](https://github.com/friendica/friendica/pull/14248) in core to add the necessary hook.
mexon added 1 commit 2024-06-22 19:08:03 +02:00
Owner

Thank you for your work!

Thank you for your work!
MrPetovan merged commit 38ea90104d into develop 2024-06-23 14:13:35 +02:00
MrPetovan requested changes 2024-06-23 14:15:57 +02:00
@ -0,0 +28,4 @@
/**
* @brief Uninstallation hook for ratioed plugin
*/
function ratioed_uninstall() {
Owner

If your uninstall method only removes hooks, it's redundant with the default uninstall behavior which is to remove all hooks.

If your `uninstall` method only removes hooks, it's redundant with the default uninstall behavior which is to remove all hooks.
@ -0,0 +59,4 @@
]);
}
class Ratioed extends Friendica\Module\Moderation\Users\Active
Owner

Please move this class to its own separate file.

Please move this class to its own separate file.
Owner

I realize I clicked on the merge button a little too early, and my review came after, sorry about the timing mistake.

I realize I clicked on the merge button a little too early, and my review came after, sorry about the timing mistake.
Author
Contributor

I realize I clicked on the merge button a little too early, and my review came after, sorry about the timing mistake.

No worries, I'll implement your suggested changes in another PR. Meanwhile, this plugin won't work well without the corresponding change in core, so have a look at that.

> I realize I clicked on the merge button a little too early, and my review came after, sorry about the timing mistake. No worries, I'll implement your suggested changes in another PR. Meanwhile, this plugin won't work well without [the corresponding change in core](https://github.com/friendica/friendica/pull/14248), so have a look at that.
Author
Contributor

New PR here: #1519. I also think this addon should have some help text, so I'll do that in another PR later.

New PR here: https://git.friendi.ca/friendica/friendica-addons/pulls/1519. I also think this addon should have some help text, so I'll do that in another PR later.
Sign in to join this conversation.
No description provided.