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

Decrease Largo_Related resource use #676

Merged
merged 9 commits into from Apr 29, 2015

Conversation

benlk
Copy link
Collaborator

@benlk benlk commented Apr 28, 2015

Changes:

  • get_series_posts() and get_term_posts() no longer query for -1 infinite posts in every series associated with the current post, but instead query for the number of posts that will need to be outputted. The previous behavior was to query for the entire collection of posts (sorted by the sort order determined in the series custom landing page), loop over it until the current post was found, and then add posts after that. Now, it queries for the requested number of posts, asking for posts that were published after the current post.
  • Creates Largo_Related::have_enough_posts(), which returns true if the number of posts stored in Largo_Related->post_ids is more than the number of related posts that were requested. This utility method replaces count($this->post_ids) >= $this->number in many places.
  • Unrelated to Largo_Related, fixes a missing argument for is_series_landing() in the Largo Author Bio widget.
  • Empty tests for inc/related-content.php

Why

See #671: Largo_Related was querying for all the posts posts in every series or in every category that a post was in.

@benlk benlk changed the title 671 decrease largo related resource use Decrease Largo_Related resource use Apr 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants