Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow more than 100 posts per page in queries #228

Open
rmccue opened this issue Oct 1, 2020 · 3 comments
Open

Allow more than 100 posts per page in queries #228

rmccue opened this issue Oct 1, 2020 · 3 comments
Labels

Comments

@rmccue
Copy link
Member

rmccue commented Oct 1, 2020

100 posts per page is a pretty low limit really, and in actuality we can allow probably another order of magnitude here. The 100 per page decision in the REST API that we made was on the basis that each could embed other items, so 100 would actually be many more than 100 queries.

In custom code though, that's not necessarily the case, and allowing more would not necessarily be a problem. As an example, the sitemaps in WP core could query up to 2000 posts at a time, and that's probably not going to be an issue; see humanmade/altis-seo#38 (comment)

Should we increase this limit?

@tfrommen tfrommen added the phpcs label Oct 19, 2020
@tfrommen
Copy link
Contributor

Since the limit (of currently 100 posts) is stored in a public property, it can be adapted on a per-project basis.

Do you mean we should do this in the HM standard already?

If yes, do you think 2000 is a good new value?
I'm wondering how often we make PHPCS ignore this rule...

@ntwb
Copy link
Contributor

ntwb commented Oct 30, 2020

I took a quick look at the HM repos, total of 19 ignores with these values:

1 x 150
1 x 250
1 x 300
6 x 500
5 x 1000
2 x 2000
1 x 5000
2 x 10000

@tfrommen
Copy link
Contributor

I did another search for anything beyond 1000.

No custom code is using more than 1000, and only a handful of third-party plugins are using more. I think changing the allowed maximum value to 1000 shuold be fine, but we could also go for something higher.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants