get_plugin_name()) // // N.B. You can add additional host plugins here. Just make sure that you will create // a host class for that particular plugin (see central/wp-optimize.php as an example). $mapped_classes = array( 'updraftplus' => 'UpdraftPlus_Host', 'wp-optimize' => 'WP_Optimize_Host', ); $path = $host_class = ''; foreach ($hosts as $plugin) { // Make sure that we have a registered host class with a valid file that exist $host_file = dirname(__FILE__).'/'.$plugin.'.php'; if (isset($mapped_classes[$plugin]) && file_exists($host_file)) { $path = $host_file; $host_class = $mapped_classes[$plugin]; break; } } // The host file was not found under this plugin thus, we let the other plugins // create or build the host plugin (global) variable instead. if (empty($path)) return null; if (!class_exists($host_class)) include_once($path); // Re-check host class once again just to make sure that we have the desired // class loaded before calling its instance method if (class_exists($host_class)) { return call_user_func(array($host_class, 'instance')); } return null; } } endif; global $updraftcentral_host_plugin; $updraftcentral_host_plugin = UpdraftCentral_Factory::create_host(); if ($updraftcentral_host_plugin) { $updraftcentral_host_plugin->load_updraftcentral(); }