PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
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
← All changes | includes/class-wpo-ajax.php +4 -14 4.5.3 → 4.7.0 View file →
@@ -60,13 +60,13 @@
60 60 */
61 61 public function handle_heartbeat_requests($action) {
62 62 $this->set_heartbeat_subaction($action);
63 63
64 - if (!$this->is_user_capable()) {
64 + if (!WP_Optimize()->current_user_can()) {
65 65 return wp_json_encode($this->send_user_capability_error_response(false));
66 66 }
67 67
68 - if (is_multisite() && !current_user_can('manage_network_options')) {
68 + if (is_multisite() && !WP_Optimize()->current_user_can('manage_network_options')) {
69 69 if (!$this->is_valid_multisite_command()) {
70 70 return wp_json_encode($this->send_invalid_multisite_command_error_response(false));
71 71 }
72 72 }
@@ -105,13 +105,13 @@
105 105 if (!$this->is_valid_request()) {
106 106 $this->send_security_check_failed_error_response();
107 107 }
108 108
109 - if (!$this->is_user_capable()) {
109 + if (!WP_Optimize()->current_user_can()) {
110 110 $this->send_user_capability_error_response();
111 111 }
112 112
113 - if (is_multisite() && !current_user_can('manage_network_options')) {
113 + if (is_multisite() && !WP_Optimize()->current_user_can('manage_network_options')) {
114 114 if (!$this->is_valid_multisite_command()) {
115 115 $this->send_invalid_multisite_command_error_response();
116 116 }
117 117 }
@@ -189,18 +189,8 @@
189 189 'result' => false,
190 190 'error_code' => 'security_check',
191 191 'error_message' => __('The security check failed; try refreshing the page.', 'wp-optimize')
192 192 ));
193 - }
194 -
195 -
196 - /**
197 - * Checks whether current user capable of doing this action or not
198 - *
199 - * @return bool
200 - */
201 - private function is_user_capable() {
202 - return current_user_can(WP_Optimize()->capability_required());
203 193 }
204 194
205 195 /**
206 196 * Send user capability check failed error response to browser and possibly die