{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/jetpack/issues/6698","repository_url":"https://api.github.com/repos/Automattic/jetpack","labels_url":"https://api.github.com/repos/Automattic/jetpack/issues/6698/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/jetpack/issues/6698/comments","events_url":"https://api.github.com/repos/Automattic/jetpack/issues/6698/events","html_url":"https://github.com/Automattic/jetpack/issues/6698","id":215451537,"number":6698,"title":"Widget Visibility causing 500 errors because of large amount of users","user":{"login":"richardmtl","id":3676359,"avatar_url":"https://avatars3.githubusercontent.com/u/3676359?v=3","gravatar_id":"","url":"https://api.github.com/users/richardmtl","html_url":"https://github.com/richardmtl","followers_url":"https://api.github.com/users/richardmtl/followers","following_url":"https://api.github.com/users/richardmtl/following{/other_user}","gists_url":"https://api.github.com/users/richardmtl/gists{/gist_id}","starred_url":"https://api.github.com/users/richardmtl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardmtl/subscriptions","organizations_url":"https://api.github.com/users/richardmtl/orgs","repos_url":"https://api.github.com/users/richardmtl/repos","events_url":"https://api.github.com/users/richardmtl/events{/privacy}","received_events_url":"https://api.github.com/users/richardmtl/received_events","type":"User","site_admin":false},"labels":[{"id":70993200,"url":"https://api.github.com/repos/Automattic/jetpack/labels/Widget%20Visibility","name":"Widget Visibility","color":"006b75","default":false},{"id":470168693,"url":"https://api.github.com/repos/Automattic/jetpack/labels/[Pri]%20High","name":"[Pri] High","color":"ec9a71","default":false},{"id":70896532,"url":"https://api.github.com/repos/Automattic/jetpack/labels/[Type]%20Bug","name":"[Type] Bug","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-20T15:11:25Z","updated_at":"2017-03-20T16:07:34Z","closed_at":null,"body":"From 3099909-t\r\n\r\n> In the file called\r\n/wp-content/plugins/jetpack/modules/widget-visibility/widget-conditions.php,\r\nLine 54 the following line of code occurs:*\r\n\r\n`$authors = get_users( array( 'orderby' => 'name', 'exclude_admin' => true) );`\r\n\r\n>This breaks my website and was the reason why it wasn't loading. This is\r\nbecause I have 160,000 WordPress users. This code calls ALL users from the\r\ndatabase and instantiates them as WP_User objects. Please rewrite this line\r\nof code to first retrieve all Usermeta where their roles match an\r\nAuthor-style role and THEN query users matched against those User ID's, and\r\nnot the other way around. This would reduce the number of users returned\r\nfrom 160,000 to 3. \"\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Automattic/jetpack/issues/comments/287808450","html_url":"https://github.com/Automattic/jetpack/issues/6698#issuecomment-287808450","issue_url":"https://api.github.com/repos/Automattic/jetpack/issues/6698","id":287808450,"user":{"login":"richardmtl","id":3676359,"avatar_url":"https://avatars3.githubusercontent.com/u/3676359?v=3","gravatar_id":"","url":"https://api.github.com/users/richardmtl","html_url":"https://github.com/richardmtl","followers_url":"https://api.github.com/users/richardmtl/followers","following_url":"https://api.github.com/users/richardmtl/following{/other_user}","gists_url":"https://api.github.com/users/richardmtl/gists{/gist_id}","starred_url":"https://api.github.com/users/richardmtl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardmtl/subscriptions","organizations_url":"https://api.github.com/users/richardmtl/orgs","repos_url":"https://api.github.com/users/richardmtl/repos","events_url":"https://api.github.com/users/richardmtl/events{/privacy}","received_events_url":"https://api.github.com/users/richardmtl/received_events","type":"User","site_admin":false},"created_at":"2017-03-20T16:07:34Z","updated_at":"2017-03-20T16:07:34Z","body":"Another one in 3110225-t ; 70,000 Subscribers but only 20 or so authors."}}
{"actor":{"display_login":"richardmtl"}}