PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.2.3
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.2.3
4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 3.8.0 All 110 releases
wp-optimize / includes / updraftcentral.php

updraftcentral.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 4.2.3, at includes/updraftcentral.php

43 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('WPO_PLUGIN_MAIN_PATH')) die('No direct access allowed');
4
5 /**
6 * This file is the bootstrapper for UpdraftCentral integration: i.e. it registers what is necessary to deal with commands in the wpoptimize namespace.
7 */
8 class WP_Optimize_UpdraftCentral {
9
10 public function __construct() {
11 add_filter('updraftplus_remotecontrol_command_classes', array($this, 'updraftcentral_remotecontrol_command_classes'));
12 add_filter('updraftcentral_remotecontrol_command_classes', array($this, 'updraftcentral_remotecontrol_command_classes'));
13 add_action('updraftcentral_command_class_wanted', array($this, 'updraftcentral_command_class_wanted'));
14 }
15
16 /**
17 * Register our class
18 *
19 * @param string $command_classes Passing over an array of command classes.
20 */
21 public function updraftcentral_remotecontrol_command_classes($command_classes) {
22 if (is_array($command_classes)) $command_classes['wpoptimize'] = 'UpdraftCentral_WP_Optimize_Commands';
23 return $command_classes;
24 }
25
26 /**
27 * Load the class when required
28 *
29 * @param string $command_php_class Passing over if there are any command classes.
30 */
31 public function updraftcentral_command_class_wanted($command_php_class) {
32 if ('UpdraftCentral_WP_Optimize_Commands' == $command_php_class) {
33 // This fragment is only needed for compatibility with UD < 1.12.30 - thenceforth, the class can be assumed to exist.
34 if (!class_exists('UpdraftCentral_Commands')) {
35 include_once(apply_filters('updraftcentral_command_base_class_at', UPDRAFTPLUS_DIR.'/central/commands.php'));
36 }
37 include_once(WPO_PLUGIN_MAIN_PATH.'includes/class-updraftcentral-wp-optimize-commands.php');
38 }
39 }
40 }
41
42 new WP_Optimize_UpdraftCentral();
43