PluginProbe
The WP Remote WordPress Plugin / 4.86
The WP Remote WordPress Plugin v4.86
6.72 6.69 6.65 6.62 6.48 6.47 4.87 4.97 5.05 5.09 5.16 5.22 5.24 5.25 5.38 5.41 5.42 5.45 5.47 5.53 5.56 5.65 5.68 5.72 5.73 All 53 releases
← All changes | wp_actlog.php +17 -34 6.624.86 View file →
@@ -8,11 +8,8 @@
8 8 public static $actlog_table = 'activities_store';
9 9 public $db;
10 10 public $settings;
11 11 public $bvinfo;
12 - public $request_id;
13 - public $ip_header;
14 - public $ignored_events;
15 12
16 13 public function __construct($db, $settings, $info, $config) {
17 14 $this->db = $db;
18 15 $this->settings = $settings;
@@ -109,21 +106,21 @@
109 106 function get_ip($ipHeader) {
110 107 $ip = '127.0.0.1';
111 108 if ($ipHeader && is_array($ipHeader)) {
112 109 if (array_key_exists($ipHeader['hdr'], $_SERVER)) {
113 - $_ips = preg_split("/(,| |\t)/", WPRHelper::getRawParam('SERVER', $ipHeader['hdr']));
110 + $_ips = preg_split("/(,| |\t)/", $_SERVER[$ipHeader['hdr']]);
114 111 if (array_key_exists(intval($ipHeader['pos']), $_ips)) {
115 112 $ip = $_ips[intval($ipHeader['pos'])];
116 113 }
117 114 }
118 115 } else if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
119 - $ip = WPRHelper::getRawParam('SERVER', 'REMOTE_ADDR');
116 + $ip = $_SERVER['REMOTE_ADDR'];
120 117 }
121 118
122 119 $ip = trim($ip);
123 - if (WPRHelper::safePregMatch('/^\[([0-9a-fA-F:]+)\](:[0-9]+)$/', $ip, $matches)) {
120 + if (preg_match('/^\[([0-9a-fA-F:]+)\](:[0-9]+)$/', $ip, $matches)) {
124 121 $ip = $matches[1];
125 - } elseif (WPRHelper::safePregMatch('/^([0-9.]+)(:[0-9]+)$/', $ip, $matches)) {
122 + } elseif (preg_match('/^([0-9.]+)(:[0-9]+)$/', $ip, $matches)) {
126 123 $ip = $matches[1];
127 124 }
128 125
129 126 return $ip;
@@ -152,9 +149,9 @@
152 149 function is_key_ignored($ignored_keys, $value) {
153 150 $is_ignored = false;
154 151 if (array_key_exists("post_types_regex", $ignored_keys)) {
155 152 foreach ($ignored_keys['post_types_regex'] as $val) {
156 - if (WPRHelper::safePregMatch($val, $value)) {
153 + if (preg_match($val, $value)) {
157 154 return true;
158 155 }
159 156 }
160 157 }
@@ -211,11 +208,9 @@
211 208 $post = $this->get_post($post_id);
212 209 if ($this->is_key_ignored($this->ignored_events, $post["type"]))
213 210 return;
214 211 $event_data = array();
215 - if (!isset($post["type"])) {
216 - $event_data["post"] = $post;
217 - } elseif ($post["type"] === "product") {
212 + if ($post["type"] === "product") {
218 213 $event_data["product"] = $post;
219 214 } elseif ($post["type"] === "shop_order") {
220 215 $event_data["order"] = $post;
221 216 } else {
@@ -228,11 +223,9 @@
228 223 $post = $this->get_post($post_id);
229 224 if ($this->is_key_ignored($this->ignored_events, $post["type"]))
230 225 return;
231 226 $event_data = array();
232 - if (!isset($post["type"])) {
233 - $event_data["post"] = $post;
234 - } elseif ($post["type"] === "product") {
227 + if ($post["type"] === "product") {
235 228 $event_data["product"] = $post;
236 229 } elseif ($post["type"] === "shop_order") {
237 230 $event_data["order"] = $post;
238 231 } else {
@@ -369,11 +362,9 @@
369 362 $data = array();
370 363 if (!empty($plugins) && defined('WP_PLUGIN_DIR')) {
371 364 foreach ($plugins as $plugin) {
372 365 $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
373 - $title = isset($plugin_data['Name']) ? $plugin_data['Name'] : '';
374 - $version = isset($plugin_data['Version']) ? $plugin_data['Version'] : '';
375 - $install_data = array('title' => $title, 'version' => $version);
366 + $install_data = array('title' => $plugin_data['Name'], 'version' => $plugin_data['Version']);
376 367 array_push($data, $install_data);
377 368 }
378 369 }
379 370 return $data;
@@ -383,11 +374,9 @@
383 374 $data = array();
384 375 if (!empty($themes)) {
385 376 foreach ($themes as $theme) {
386 377 $theme_data = wp_get_theme($theme);
387 - $title = isset($theme_data['Name']) ? $theme_data['Name'] : '';
388 - $version = isset($theme_data['Version']) ? $theme_data['Version'] : '';
389 - $install_data = array('title' => $title, 'version' => $version);
378 + $install_data = array('title' => $theme_data['Name'], 'version' => $theme_data['Version']);
390 379 array_push($data, $install_data);
391 380 }
392 381 }
393 382 return $data;
@@ -396,11 +385,9 @@
396 385 function get_plugin_install_data($upgrader) {
397 386 $data = array();
398 387 if ($upgrader->bulk != "1") {
399 388 $plugin_data = $upgrader->new_plugin_data;
400 - $title = isset($plugin_data['Name']) ? $plugin_data['Name'] : '';
401 - $version = isset($plugin_data['Version']) ? $plugin_data['Version'] : '';
402 - $install_data = array('title' => $title, 'version' => $version);
389 + $install_data = array('title' => $plugin_data['Name'], 'version' => $plugin_data['Version']);
403 390 array_push($data, $install_data);
404 391 }
405 392 return $data;
406 393 }
@@ -407,11 +394,9 @@
407 394
408 395 function get_theme_install_data($upgrader) {
409 396 $data = array();
410 397 $theme_data = $upgrader->new_theme_data;
411 - $title = isset($theme_data['Name']) ? $theme_data['Name'] : '';
412 - $version = isset($theme_data['Version']) ? $theme_data['Version'] : '';
413 - $install_data = array('title' => $title, 'version' => $version);
398 + $install_data = array('title' => $theme_data['Name'], 'version' => $theme_data['Version']);
414 399 array_push($data, $install_data);
415 400 return $data;
416 401 }
417 402
@@ -450,17 +435,15 @@
450 435 }
451 436
452 437 function upgrade_handler($upgrader, $data) {
453 438 $event_data = array();
454 - if (isset($data['action'])) {
455 - if ($data['action'] === 'update') {
456 - if ('core' === $data['type']) {
457 - return;
458 - }
459 - $event_data = $this->get_update_data($data);
460 - } else if ($data['action'] === 'install') {
461 - $event_data = $this->get_install_data($upgrader, $data);
439 + if ($data['action'] === 'update') {
440 + if ('core' === $data['type']) {
441 + return;
462 442 }
443 + $event_data = $this->get_update_data($data);
444 + } else if ($data['action'] === 'install') {
445 + $event_data = $this->get_install_data($upgrader, $data);
463 446 }
464 447 $this->add_activity($event_data);
465 448 }
466 449