Jetpack: Widget Visibility causing 500 errors because of large amount of users

Created on 20 Mar 2017  路  6Comments  路  Source: Automattic/jetpack

From 3099909-t

In the file called
/wp-content/plugins/jetpack/modules/widget-visibility/widget-conditions.php,
Line 54 the following line of code occurs:*

$authors = get_users( array( 'orderby' => 'name', 'exclude_admin' => true) );

This breaks my website and was the reason why it wasn't loading. This is
because I have 160,000 WordPress users. This code calls ALL users from the
database and instantiates them as WP_User objects. Please rewrite this line
of code to first retrieve all Usermeta where their roles match an
Author-style role and THEN query users matched against those User ID's, and
not the other way around. This would reduce the number of users returned
from 160,000 to 3. "

Widget Visibility [Pri] High [Type] Bug

Most helpful comment

@aheckler They have 20,000 users on the site?! Worth asking if they are legit users or not, and if not, to use this plugin to clean up (and they should turn off registration too, if not needed):

https://wordpress.org/plugins/user-spam-remover/

All 6 comments

Another one in 3110225-t ; 70,000 Subscribers but only 20 or so authors.

@richardmtl Can you please ask those users to test this patch? It should solve it.

6699

One of the users mentioned above - confirm patch allows the Widgets & Customizer to load. Thanks for the quick response

FWIW I'm running into this quite a lot, with users who happen to happen thousands of users .Most of the people in these tickets just have spam users, so I am telling them to deactivate registrations on Settings -> General, and to try cleaning up spam users with this plugin, which seems to have worked for others:

https://wordpress.org/plugins/user-spam-remover/

3134527-t, solved by update to 4.8 馃憤

@aheckler They have 20,000 users on the site?! Worth asking if they are legit users or not, and if not, to use this plugin to clean up (and they should turn off registration too, if not needed):

https://wordpress.org/plugins/user-spam-remover/

Was this page helpful?
0 / 5 - 0 ratings