public function load_plugins($plugins_enabled, $required_plugins = array())
    {
        foreach ($plugins_enabled as $plugin_name) {
            $this->load_plugin($plugin_name);
        }

        // check existance of all required core plugins
        foreach ($required_plugins as $plugin_name) {
            $loaded = false;
            foreach ($this->plugins as $plugin) {
                if ($plugin instanceof $plugin_name) {
                    $loaded = true;
                    break;
                }
            }

            // load required core plugin if no derivate was found
            if (!$loaded) {
                $loaded = $this->load_plugin($plugin_name);
            }

            // trigger fatal error if still not loaded
            if (!$loaded) {
                rcube::raise_error(array(
                    'code' => 520, 'type' => 'php',
                    'file' => __FILE__, 'line' => __LINE__,
                    'message' => "Requried plugin $plugin_name was not loaded"), true, true);
            }
        }
    }