PluginProbe
The WP Remote WordPress Plugin / 5.72
The WP Remote WordPress Plugin v5.72
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
wpremote / callback / wings / actlog.php

actlog.php in The WP Remote WordPress Plugin 5.72, at callback/wings/actlog.php

62 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH')) exit;
4 if (!class_exists('BVActLogCallback')) :
5
6 require_once dirname( __FILE__ ) . '/../../wp_actlog.php';
7
8 class BVActLogCallback extends BVCallbackBase {
9 public $db;
10 public $settings;
11
12 const ACTLOG_WING_VERSION = 1.0;
13
14 public function __construct($callback_handler) {
15 $this->db = $callback_handler->db;
16 $this->settings = $callback_handler->settings;
17 }
18
19 public function dropActLogTable() {
20 return $this->db->dropBVTable(BVWPActLog::$actlog_table);
21 }
22
23 public function createActLogTable($usedbdelta = false) {
24 $db = $this->db;
25 $charset_collate = $db->getCharsetCollate();
26 $table = $this->db->getBVTable(BVWPActLog::$actlog_table);
27 $query = "CREATE TABLE $table (
28 id bigint(20) NOT NULL AUTO_INCREMENT,
29 site_id int NOT NULL,
30 user_id int DEFAULT 0,
31 username text DEFAULT '',
32 request_id text DEFAULT '',
33 ip varchar(20) DEFAULT '',
34 event_type varchar(40) NOT NULL DEFAULT '',
35 event_data mediumtext NOT NULL,
36 time int,
37 PRIMARY KEY (id)
38 ) $charset_collate;";
39 return $db->createTable($query, BVWPActLog::$actlog_table, $usedbdelta);
40 }
41
42 public function process($request) {
43 $settings = $this->settings;
44 $params = $request->params;
45 switch ($request->method) {
46 case "truncactlogtable":
47 $resp = array("status" => $this->db->truncateBVTable(BVWPActLog::$actlog_table));
48 break;
49 case "dropactlogtable":
50 $resp = array("status" => $this->dropActLogTable());
51 break;
52 case "createactlogtable":
53 $usedbdelta = array_key_exists('usedbdelta', $params);
54 $resp = array("status" => $this->createActLogTable($usedbdelta));
55 break;
56 default:
57 $resp = false;
58 }
59 return $resp;
60 }
61 }
62 endif;