Multisite-Language-Switcher icon indicating copy to clipboard operation
Multisite-Language-Switcher copied to clipboard

Memory leakage when list of the users rendered in settings panel

Open limestreet opened this issue 3 years ago • 0 comments

Hi, on plugin settings page -> wp-admin/options-general.php?page=MslsAdmin in "Advanced Settings" section there is a field "Reference user". Field renders list of users which sometimes becomes very long and not usable. Additional problem caused by this approach is memory leakage - in case of tens of thousands of users rendering of the page may take several GB of memory... And often - in case of memory limit - it may throw fatal error and not render settings at all. Function causing the problem is located here -> https://github.com/lloc/Multisite-Language-Switcher/blob/master/includes/MslsAdmin.php#L321

Maybe it would be better to use AJAX call to get users like WP does by default here -> wp-admin/network/site-new.php

Thanks!

limestreet avatar Jan 21 '22 12:01 limestreet