This site appears fast thanks to CloudFlare caching, but that does not assist logged in users who are burdened with 4-5 second page load times. Code Profiler (https://wordpress.org/plugins/code-profiler/), has suggested that Toolset is the cause, and most particularly that Toolset_Theme_Integration_Settings_Front_End_Controller::override_local_post_meta_value() is taking an inordinate amount of time (2.24s of that page load time).
Note that 2.24s is 4x higher than the next longest-running function in the list. That seems inordinate, but I do not know enough about Toolset internals to understand the purpose of that function or whether there is some way in which it could be further optimized (or what effect bypassing it might have).
I can see that there are quite a few calls made to that function on my own local test site, and depending on the complexity of the page or post being viewed, and what's on the page, they could add up.
The functionality relates to Toolset's integration with theme options for supported themes like Astra (which it seems you are using), where—if you have a Content Template for some content type—you can override the general theme settings for posts that use the template.
It works by intercepting the calls to get_postmeta on the page, and while some optimisation may be possible, I'm not sure a different approach is readily possible.
But maybe you are not using this feature?
If that's the case it may be that I can help disable it on your site.
I suggest you edit this plugin file directly and comment out these two lines (which should be lines 43 and 44): plugins/toolset-blocks/vendor/toolset/toolset-theme-settings/compatibility-modules/controllers/toolset-theme-integration-settings-front-end-controller.php
Thanks. Tried that, which revealed that the problem may be further up the stack, because removing those calls did not significantly change it but just bumped the problematic ones up to "Astra_Ext_Nav_Menu_Loader::get_megamenu_default" and "Elementor\Controls_Stack->is_control_visible" (which was, in fact, hitting that filter function a large number of times).
So likely, the filter isn't "slow" - but it is being called a huge amount of times....
I don't have access to the details you have, but it sounds like that succeeded in removing the Views theme integration as a source of the problem, and next you have problems with Astra and Elementor to look into.
I'm checking with the developers about removing those filter calls without editing the plugin file; they are added in such a way that it is difficult to remove them, and I'm awaiting clarification.
I'll get back to you when I have feedback from them.
OK, assuming you are not using the theme integration you can disable that section of code entirely by adding the following to your theme's functions.php file:
That will eliminate Toolset theme options as a source of delay on page loading, and you can then focus on anything else that is causing similar problems.
The topic ‘[Closed] override_local_post_meta_value causing significant performance degradation’ is closed to new replies.