functions.php in /wp-content/mu-plugins/ | WordPress.org

[ad_1]

Hi, to deactivate plugins for certain pages I added

add_filter( ‘option_active_plugins’, ‘disable_specific_plugin’ );
function disable_specific_plugin($plugins){ ………

to functions.php in /wp-content/mu-plugins/.

It works fine, I just wonder why this code is being executed so often. When for testing purposes I added some output, I noticed that depending on the page it’s being executed between 50 and 100 times. I would have expected it to be executed either once or once for each plugin. Is there an explanation for this (or maybe a way to avoid it and thus improve the performance of the site)? Thanks in advance.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer