Hi betagoo,
thank you for reporting this. As it stands, I have never taken performance into consideration in the plugin; although the plugin enables you to fill a menu up with nothing but categories and posts, it has not been tested with such huge scenarios.
The plugin will perform one get_posts call per taxonomy that is ‘unfolded’. I will look into it later, to see if I can reduce the number of queries by building one single superquery. For now, there isn’t much I can do for you.
Question: Those 1200 queries, in what timeframe and how many page requests does this involve? Do you have any idea?
Kind regards,
Diana
I just read up on a few techniques to speed things up, I will look into it for the next version of the plugin. Again, thank you for reporting.
Kind regards,
Diana
If you want test my website, pelase write to me at [Email redacted]
I will send You full access to my website.
This is page for test, so You can do everything.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
@betagoo, Please don’t solicit private support from these forums.
I don’t need private support.
I wanted help plugin author.
I can give him environment for tests.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
The author is doing their best to support you here on the forums. The question was;
Those 1200 queries, in what timeframe and how many page requests does this involve? Do you have any idea?
I can not diagnoze cause of the problem.
But, problem now is solved.
I use Transients to cache menu.
Hi betagoo,
I indeed read something about Transients. Did you change any code in the plugin to use Transients? (I have never worked with Transients before, tips are welcome 🙂 )
Kind regards,
Diana
I did not modify the plugin.
In first occurrence of menu I use transients.
$header_menu_query = get_transient( 'header_menu_query_');
if( $header_menu_query === false )
{
$header_menu_query = wp_nav_menu( array( 'menu' => $menu_id, 'container' => '', 'items_wrap' => '%3$s', 'echo' => 0 ) );
set_transient( 'header_menu_query_', $header_menu_query, YEAR_IN_SECONDS );
}
echo $header_menu_query;
Hi betagoo,
the use of transients was what I wanted to investigate. Thank you for sharing!
Unfortunately, there is no suitable point in time inside the plugin where I can perform this caching and retrieving (other plugins might edit the menu as well) so this is indeed the best and only option: To cache the entire menu using transients.
I’ll add it to the plugin FAQ.
Kind regards,
Diana