Skip to content

Widget Visibility causing 500 errors because of large amount of users #6698

@richardmtl

Description

@richardmtl

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. "

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions