diff --git a/lib/internal/Magento/Framework/Interception/PluginListGenerator.php b/lib/internal/Magento/Framework/Interception/PluginListGenerator.php index 0c77360162227..67a19360e2d9e 100644 --- a/lib/internal/Magento/Framework/Interception/PluginListGenerator.php +++ b/lib/internal/Magento/Framework/Interception/PluginListGenerator.php @@ -1,13 +1,15 @@ reader = $reader; $this->scopeConfig = $scopeConfig; @@ -140,6 +149,7 @@ public function __construct( $this->logger = $logger; $this->directoryList = $directoryList; $this->scopePriorityScheme = $scopePriorityScheme; + $this->appState = $appState ?? ObjectManager::getInstance()->get(State::class); } /** @@ -366,9 +376,12 @@ public function trimInstanceStartingBackslash(&$plugins) public function filterPlugins(array &$plugins) { foreach ($plugins as $name => $plugin) { - if (empty($plugin['instance'])) { + if (!isset($plugin['instance'])) { unset($plugins[$name]); - $this->logger->info("Reference to undeclared plugin with name '{$name}'."); + // Log the undeclared plugin when it is not disabled or when the app is in Developer mode. + if ($this->appState->getMode() === State::MODE_DEVELOPER || !($plugin['disabled'] ?? false)) { + $this->logger->debug("Reference to undeclared plugin with name '{$name}'."); + } } } }