# wp-optimize/2.2.11/includes/updraftcentral.php

WP-Optimize – Cache, Compress images, Minify &amp; Clean database to boost page speed &amp; performance, version 2.2.11. 42 lines.

- Page: https://pluginprobe.com/plugins/wp-optimize/2.2.11/code/includes/updraftcentral.php
- Raw: https://pluginprobe.com/plugins/wp-optimize/2.2.11/raw/includes/updraftcentral.php
- Modified: 2018-02-20T11:52:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-optimize/2.2.11/code/includes/updraftcentral.php#L10-L20`.

```php
<?php

if (!defined('WPO_PLUGIN_MAIN_PATH')) die('No direct access allowed');

/**
 * This file is the bootstrapper for UpdraftCentral integration: i.e. it registers what is necessary to deal with commands in the wpoptimize namespace.
 */
class WP_Optimize_UpdraftCentral {

	public function __construct() {
		add_action('updraftplus_remotecontrol_command_classes', array($this, 'updraftplus_remotecontrol_command_classes'));
		add_action('updraftcentral_command_class_wanted', array($this, 'updraftcentral_command_class_wanted'));
	}
	
	/**
	 * Register our class
	 *
	 * @param string $command_classes Passing over an arrya of command classes.
	 */
	public function updraftplus_remotecontrol_command_classes($command_classes) {
		if (is_array($command_classes)) $command_classes['wpoptimize'] = 'UpdraftCentral_WP_Optimize_Commands';
		return $command_classes;
	}
	
	/**
	 * Load the class when required
	 *
	 * @param string $command_php_class Passing over if there are any command classes.
	 */
	public function updraftcentral_command_class_wanted($command_php_class) {
		if ('UpdraftCentral_WP_Optimize_Commands' == $command_php_class) {
			// This fragment is only needed for compatibility with UD < 1.12.30 - thenceforth, the class can be assumed to exist.
			if (!class_exists('UpdraftCentral_Commands')) {
				include_once(apply_filters('updraftcentral_command_base_class_at', UPDRAFTPLUS_DIR.'/central/commands.php'));
			}
			include_once(WPO_PLUGIN_MAIN_PATH.'includes/class-updraftcentral-wp-optimize-commands.php');
		}
	}
}

new WP_Optimize_UpdraftCentral();

```
