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

Term query is not cached causing lots of queries to be made #55

Closed
saadibrahim opened this issue Jun 1, 2016 · 1 comment
Closed

Term query is not cached causing lots of queries to be made #55

saadibrahim opened this issue Jun 1, 2016 · 1 comment

Comments

@saadibrahim
Copy link

Hi

https://github.com/torounit/custom-post-type-permalinks/blob/master/CPTP/Module/Permalink.php#L199

wp_get_post_terms isnt cached by default causing a lot of queries to be made, every time theres a get_permalink or the_permalink in the code it causes a lot of queries and slow down the site.. especially in a loop.

I changed it to get_the_terms (removing the third argument array( 'orderby' => 'term_id' )) which improved the performance quite a bit but I dont know what are the side effects of it.

Thanks!

@torounit
Copy link
Owner

torounit commented Jun 2, 2016

Oh Thanks Report!

Please send Pull Request!!

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

No branches or pull requests

2 participants