Yoast is breaking site: don’t clear cache on option update
-
Yoast is excessively clearing my caches on my website. This happens every time an administrator logs in after a set period of time. When the cache is cleared by Yoast my site will timeout due to the large cache my site maintains. There is no need to clear the cache here.
The issue is related to the option “last_known_no_unindexed” being updated on the “admin_init” action. This option update triggers a call to “WPSEO_Utils::clear_cache” as it is setup to filter on WP option changes. This call to clear_cache will then call my WP Super Cache function “wp_cache_clear_cache()” and trigger the whole cascade, locking my site.
elseif ( function_exists( 'wp_cache_clear_cache' ) ) { wp_cache_clear_cache(); }
Please correct this issue as I have to manually patch this broken functionality in your plugin for my site.
Most people will not notice this issue because their cache is small, which is probably why it has not been reported. This issue would have been introduced within the last few months, I noticed it a while ago but have just finally had the time today to track it down.
A full stacktrace of Yoast clearing the cache on admin login is below:
#0 /drive/www/emmywatch/wp-content/plugins/autoptimize/classes/autoptimizeCache.php(451): autoptimizeCache::clearall(false) #1 /drive/www/emmywatch/wp-includes/class-wp-hook.php(308): autoptimizeCache::clearall_actionless('') #0 /drive/www/emmywatch/wp-content/plugins/autoptimize/classes/autoptimizeCache.php(451): autoptimizeCache::clearall(false) #1 /drive/www/emmywatch/wp-includes/class-wp-hook.php(308): autoptimizeCache::clearall_actionless('') #2 /drive/www/emmywatch/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array) #3 /drive/www/emmywatch/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /drive/www/emmywatch/wp-content/plugins/wp-super-cache/wp-cache-phase2.php(2975): do_action('...') #5 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/inc/class-wpseo-utils.php(421): wp_cache_clear_cache() #6 /drive/www/emmywatch/wp-includes/class-wp-hook.php(310): WPSEO_Utils::clear_cache(Array) #7 /drive/www/emmywatch/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #8 /drive/www/emmywatch/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #9 /drive/www/emmywatch/wp-includes/option.php(570): do_action('...', Array, Array, '...') #10 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/inc/options/class-wpseo-options.php(507): update_option('...', Array) #11 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/inc/options/class-wpseo-options.php(311): WPSEO_Options::save_option('...', '...', Array) #12 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/helpers/options-helper.php(37): WPSEO_Options::set('...', Array) #13 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/analytics/user-interface/last-completed-indexation-integration.php(61): Yoast\WP\SEO\Helpers\Options_Helper->set('...', Array) #14 /drive/www/emmywatch/wp-includes/class-wp-hook.php(308): Yoast\WP\SEO\Analytics\User_Interface\Last_Completed_Indexation_Integration->maybe_set_indexables_unindexed_calculated('...', 0) #15 /drive/www/emmywatch/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array) #16 /drive/www/emmywatch/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #17 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/actions/indexing/abstract-indexing-action.php(98): do_action('...', '...', '...') #18 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/actions/indexing/abstract-link-indexing-action.php(89): Yoast\WP\SEO\Actions\Indexing\Abstract_Indexing_Action->get_total_unindexed() #19 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/helpers/indexing-helper.php(318): Yoast\WP\SEO\Actions\Indexing\Abstract_Link_Indexing_Action->get_limited_unindexed_count(26) #20 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/helpers/indexing-helper.php(335): Yoast\WP\SEO\Helpers\Indexing_Helper->get_limited_unindexed_count(25) #21 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/integrations/admin/background-indexing-integration.php(181): Yoast\WP\SEO\Helpers\Indexing_Helper->get_limited_filtered_unindexed_count(25) #22 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/integrations/admin/background-indexing-integration.php(139): Yoast\WP\SEO\Integrations\Admin\Background_Indexing_Integration->should_index_on_shutdown(25) #23 /drive/www/emmywatch/wp-includes/class-wp-hook.php(308): Yoast\WP\SEO\Integrations\Admin\Background_Indexing_Integration->register_shutdown_indexing('') #24 /drive/www/emmywatch/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #25 /drive/www/emmywatch/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #26 /drive/www/emmywatch/wp-admin/admin.php(175): do_action('...') "/tmp/trace2.txt" 28L, 3512B 1,1 Top #0 /drive/www/emmywatch/wp-content/plugins/autoptimize/classes/autoptimizeCache.php(451): autoptimizeCache::clearall(false) #2 /drive/www/emmywatch/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array) #3 /drive/www/emmywatch/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /drive/www/emmywatch/wp-content/plugins/wp-super-cache/wp-cache-phase2.php(2975): do_action('...') #5 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/inc/class-wpseo-utils.php(421): wp_cache_clear_cache() #6 /drive/www/emmywatch/wp-includes/class-wp-hook.php(310): WPSEO_Utils::clear_cache(Array) #7 /drive/www/emmywatch/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #8 /drive/www/emmywatch/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #9 /drive/www/emmywatch/wp-includes/option.php(570): do_action('...', Array, Array, '...') #10 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/inc/options/class-wpseo-options.php(507): update_option('...', Array) #11 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/inc/options/class-wpseo-options.php(311): WPSEO_Options::save_option('...', '...', Array) #12 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/helpers/options-helper.php(37): WPSEO_Options::set('...', Array) #13 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/analytics/user-interface/last-completed-indexation-integration.php(61): Yoast\WP\SEO\Helpers\Options_Helper->set('...', Array) #14 /drive/www/emmywatch/wp-includes/class-wp-hook.php(308): Yoast\WP\SEO\Analytics\User_Interface\Last_Completed_Indexation_Integration->maybe_set_indexables_unindexed_calculated('...', 0) #15 /drive/www/emmywatch/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array) #16 /drive/www/emmywatch/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #17 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/actions/indexing/abstract-indexing-action.php(98): do_action('...', '...', '...') #18 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/actions/indexing/abstract-link-indexing-action.php(89): Yoast\WP\SEO\Actions\Indexing\Abstract_Indexing_Action->get_total_unindexed() #19 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/helpers/indexing-helper.php(318): Yoast\WP\SEO\Actions\Indexing\Abstract_Link_Indexing_Action->get_limited_unindexed_count(26) #20 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/helpers/indexing-helper.php(335): Yoast\WP\SEO\Helpers\Indexing_Helper->get_limited_unindexed_count(25) #21 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/integrations/admin/background-indexing-integration.php(181): Yoast\WP\SEO\Helpers\Indexing_Helper->get_limited_filtered_unindexed_count(25) #22 /drive/www/emmywatch/wp-content/plugins/wordpress-seo/src/integrations/admin/background-indexing-integration.php(139): Yoast\WP\SEO\Integrations\Admin\Background_Indexing_Integration->should_index_on_shutdown(25) #23 /drive/www/emmywatch/wp-includes/class-wp-hook.php(308): Yoast\WP\SEO\Integrations\Admin\Background_Indexing_Integration->register_shutdown_indexing('') #24 /drive/www/emmywatch/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #25 /drive/www/emmywatch/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #26 /drive/www/emmywatch/wp-admin/admin.php(175): do_action('...') #27 /drive/www/emmywatch/wp-admin/index.php(10): require_once('...')
- The topic ‘Yoast is breaking site: don’t clear cache on option update’ is closed to new replies.