[Andrew] Moderator Panel

[Andrew] Moderator Panel 1.9.4

No permission to download
I'd like to check with you about how efficient the queries are. Quite a few addons we use have had slow queries and we had to contact the authors to request optimisation. We have 430,000 members.
That is a great callout. Here is what I can tell you.

Only three of the queries used don't use the finder system, so the efficiency of those queries should be inline with other XF queries. The three queries don't use finder still use "fetchAll" and prepared statements. When I run the queries with Sequel Pro on my test board (about a dozen users) it takes 9.9ms. When I run the query using Sequel Pro on my main board (16.4k users, 4,7m posts) it takes 99ms. When I run the query a second time, it takes about 25% of the time it took to run the original query.

If you are able to, run this query in whatever SQL tool you use and let me know how it performs.

SQL:
select xf_user.user_id, xf_user.username, xf_user.message_count, count(xf_user_ignored.ignored_user_id) as ignored_count
from xf_user
inner join xf_user_ignored on xf_user.user_id = xf_user_ignored.ignored_user_id
group by xf_user.user_id, xf_user.username, xf_user.message_count, xf_user.warning_points
having count(xf_user_ignored.ignored_user_id) > 0
order by ignored_count desc
limit 40
 
Would you be able to include an overview of the the NixFifty tickets per user?
I am not sure if I will end up incorporating other add-ons within this them. I would first want to make sure it was ok with the original add-on developer, but it could present challenges of keeping up with updates.
 
AndrewSimm updated [Andrew] Moderator Panel with a new update entry:

Version 1.1.1

FIXED: Ban reason not showing when add-on enabled
FIXED: Not all data on "most" lists were show commas when over 999
FIXED: Most reported and most ignored queries used sum instead of count in HAVING section of query
ADDED: Admin panel option to show/hide spam cleaners users from banned users list
ADDED: Admin panel option to show/hide banned users from most warned users list
ADDED: Admin panel option to show/hide banned users from most reported users list
ADDED: Admin panel option to...

Read the rest of this update entry...
 
I am not sure if I will end up incorporating other add-ons within this them. I would first want to make sure it was ok with the original add-on developer, but it could present challenges of keeping up with updates.
Oops! You’re right. I can imagine that I’d be quite a lot of “administration” task to constantly check the updates of other supported plugins and see if they work ok with yours.

Anyways, great job! Looking forward to new features! 😄
 
That is a great callout. Here is what I can tell you.

Only three of the queries used don't use the finder system, so the efficiency of those queries should be inline with other XF queries. The three queries don't use finder still use "fetchAll" and prepared statements. When I run the queries with Sequel Pro on my test board (about a dozen users) it takes 9.9ms. When I run the query using Sequel Pro on my main board (16.4k users, 4,7m posts) it takes 99ms. When I run the query a second time, it takes about 25% of the time it took to run the original query.

If you are able to, run this query in whatever SQL tool you use and let me know how it performs.

SQL:
select xf_user.user_id, xf_user.username, xf_user.message_count, count(xf_user_ignored.ignored_user_id) as ignored_count
from xf_user
inner join xf_user_ignored on xf_user.user_id = xf_user_ignored.ignored_user_id
group by xf_user.user_id, xf_user.username, xf_user.message_count, xf_user.warning_points
having count(xf_user_ignored.ignored_user_id) > 0
order by ignored_count desc
limit 40
Query took 0.0148 seconds
Looks good. Thanks for the reply. I've never heard of the Nixfifty addon you're referring to.
 
@AndrewSimm

1606066798751.png


Moderator Panel 1.1.1​


Server error log



  • LogicException: Unknown relation or alias SpamCleanerLog accessed on xf_user
  • src/XF/Mvc/Entity/Finder.php:761

  • Generated by: me
  • Nov 22, 2020 at 6:41 PM


Stack trace​


#0 src/XF/Mvc/Entity/Finder.php(657): XF\Mvc\Entity\Finder->join()
#1 src/addons/Andrew/ModeratorPanel/Pub/Controller/ModeratorPanel.php(58): XF\Mvc\Entity\Finder->with()
#2 src/XF/Mvc/Dispatcher.php(350): Andrew\ModeratorPanel\Pub\Controller\ModeratorPanel->actionIndex()
#3 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass()
#4 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch()
#5 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop()
#6 src/XF/App.php(2300): XF\Mvc\Dispatcher->run()
#7 src/XF.php(465): XF\App->run()
#8 index.php(20): XF::runApp()
#9 {main}


Request state​


array(4) {
["url"] => string(16) "/moderatorpanel/"
["referrer"] => string(41) "https://www.my.tld/moderatorpanel/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}

:unsure:

Settings:
1606067143299.png
 
@AndrewSimm

View attachment 240282


Moderator Panel 1.1.1​


Server error log



  • LogicException: Unknown relation or alias SpamCleanerLog accessed on xf_user
  • src/XF/Mvc/Entity/Finder.php:761

  • Generated by: me
  • Nov 22, 2020 at 6:41 PM


Stack trace​


#0 src/XF/Mvc/Entity/Finder.php(657): XF\Mvc\Entity\Finder->join()
#1 src/addons/Andrew/ModeratorPanel/Pub/Controller/ModeratorPanel.php(58): XF\Mvc\Entity\Finder->with()
#2 src/XF/Mvc/Dispatcher.php(350): Andrew\ModeratorPanel\Pub\Controller\ModeratorPanel->actionIndex()
#3 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass()
#4 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch()
#5 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop()
#6 src/XF/App.php(2300): XF\Mvc\Dispatcher->run()
#7 src/XF.php(465): XF\App->run()
#8 index.php(20): XF::runApp()
#9 {main}


Request state​


array(4) {
["url"] => string(16) "/moderatorpanel/"
["referrer"] => string(41) "https://www.my.tld/moderatorpanel/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}

:unsure:

Settings:
View attachment 240283
What page are you on when this appears?
 
The only thing I would like now is that users with the status moderated are also shown separately in a list :D
 
How do you flag users to be moderated?
There are 2 ways:

1.)
We move the user, in addition to the primary user group, to a secondary user group "Moderated", which contains the corresponding rights.

2.)
We use the system of warnings, (/admin.php?warnings/) where the user is moved to the secondary user group "moderated" for a certain time in addition to the standard/primary user group.
 
Last edited:
There are 2 ways:

1.)
We move the user, in addition to the primary user group, to a secondary user group "Moderated", which contains the corresponding rights.

2.)
We use the system of warnings, (/admin.php?warnings/) where the user is moved to the secondary user group "moderated" for a certain time in addition to the standard/primary user group.
Gotcha, so this would requires the creation of a new user group and that user group identified in settings.
 
Gotcha, so this would requires the creation of a new user group and that user group identified in settings.

Can't wait to try this out. I second this suggestion, very common to have an in moderation user group for those in the penalty box.
 
Top Bottom