PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.7
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.7
4.7.0 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 All 111 releases
wp-optimize / includes / class-updraftcentral-wp-optimize-commands.php

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

42 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('WPO_PLUGIN_MAIN_PATH')) die('No direct access allowed');
3
4 /**
5 * This is a small glue class, which makes available all the commands in WP_Optimize_Commands, and translates the response from WP_Optimize_Commands (which is either data to return, or a WP_Error) into the format used by UpdraftCentral.
6 */
7 class UpdraftCentral_WP_Optimize_Commands extends UpdraftCentral_Commands {
8
9 private $commands;
10
11 /**
12 * Class constructor
13 */
14 public function __construct() {
15 $this->commands = new WP_Optimize_Commands();
16
17 }
18
19 /**
20 * Magic method to pass on the command to WP_Optimize_Commands
21 *
22 * @param String $name - command name
23 * @param Array $arguments - command parameters
24 *
25 * @return Array - response
26 */
27 public function __call($name, $arguments) {
28
29 if (!is_callable(array($this->commands, $name))) {
30 return $this->_generic_error_response('wp_optimize_no_such_command', $name);
31 }
32
33 $result = call_user_func_array(array($this->commands, $name), $arguments);
34
35 if (is_wp_error($result)) {
36 return $this->_generic_error_response($result->get_error_code(), $result->get_error_data());
37 } else {
38 return $this->_response($result);
39 }
40 }
41 }
42