Version Description
- Enhanced handling of plugin services
- Added functionality for realtime sync
- Removed deprecated hook
- Improvements in identifying plugin updates.
Download this release
Release Info
Developer | ritesh.soni36 |
Plugin | MalCare WordPress Security Plugin – Malware Scanner, Cleaner, Security Firewall |
Version | 4.74 |
Comparing to | |
See all releases |
Code changes from version 4.72 to 4.74
- account.php +8 -2
- callback/base.php +5 -4
- callback/wings/db.php +17 -1
- callback/wings/dynsync.php +92 -0
- callback/wings/fs.php +32 -12
- callback/wings/info.php +40 -1
- callback/wings/misc.php +14 -1
- info.php +1 -1
- malcare.php +11 -2
- readme.txt +58 -58
- wp_actions.php +6 -1
- wp_api.php +3 -3
- wp_db.php +32 -0
- wp_dynsync.php +693 -0
account.php
CHANGED
@@ -191,7 +191,6 @@ if (!class_exists('MCAccount')) :
|
|
191 |
|
192 |
public function updateInfo($info) {
|
193 |
$accounts = self::allAccounts($this->settings);
|
194 |
-
$plugname = $info["plugname"];
|
195 |
$account_type = $info["account_type"];
|
196 |
$pubkey = $info['pubkey'];
|
197 |
if (!array_key_exists($pubkey, $accounts)) {
|
@@ -202,7 +201,14 @@ if (!class_exists('MCAccount')) :
|
|
202 |
}
|
203 |
$accounts[$pubkey]['account_gid'] = $info['account_gid'];
|
204 |
$accounts[$pubkey]['lastbackuptime'] = time();
|
205 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
$accounts[$pubkey]['account_type'] = $account_type;
|
207 |
$accounts[$pubkey]['url'] = $info['url'];
|
208 |
$accounts[$pubkey]['email'] = $info['email'];
|
191 |
|
192 |
public function updateInfo($info) {
|
193 |
$accounts = self::allAccounts($this->settings);
|
|
|
194 |
$account_type = $info["account_type"];
|
195 |
$pubkey = $info['pubkey'];
|
196 |
if (!array_key_exists($pubkey, $accounts)) {
|
201 |
}
|
202 |
$accounts[$pubkey]['account_gid'] = $info['account_gid'];
|
203 |
$accounts[$pubkey]['lastbackuptime'] = time();
|
204 |
+
if (isset($info["speed_plugname"])) {
|
205 |
+
$speed_plugname = $info["speed_plugname"];
|
206 |
+
$accounts[$pubkey][$speed_plugname] = true;
|
207 |
+
}
|
208 |
+
if (isset($info["plugname"])) {
|
209 |
+
$plugname = $info["plugname"];
|
210 |
+
$accounts[$pubkey][$plugname] = true;
|
211 |
+
}
|
212 |
$accounts[$pubkey]['account_type'] = $account_type;
|
213 |
$accounts[$pubkey]['url'] = $info['url'];
|
214 |
$accounts[$pubkey]['email'] = $info['email'];
|
callback/base.php
CHANGED
@@ -7,13 +7,14 @@ class BVCallbackBase {
|
|
7 |
|
8 |
public static $wing_infos = array("MANAGE_WING_VERSION" => '1.0',
|
9 |
"ACTLOG_WING_VERSION" => '1.0',
|
|
|
10 |
"UPGRADER_WING_VERSION" => '1.0',
|
11 |
"BRAND_WING_VERSION" => '1.0',
|
12 |
-
"DB_WING_VERSION" => '1.
|
13 |
"ACCOUNT_WING_VERSION" => '1.1',
|
14 |
-
"MISC_WING_VERSION" => '1.
|
15 |
-
"FS_WING_VERSION" => '1.
|
16 |
-
"INFO_WING_VERSION" => '1.
|
17 |
"WATCH_WING_VERSION" => '1.0',
|
18 |
"FS_WRITE_WING_VERSION" => '1.0',
|
19 |
"IPSTORE_WING_VERSION" => '1.0',
|
7 |
|
8 |
public static $wing_infos = array("MANAGE_WING_VERSION" => '1.0',
|
9 |
"ACTLOG_WING_VERSION" => '1.0',
|
10 |
+
"DYNSYNC_WING_VERSION" => '1.0',
|
11 |
"UPGRADER_WING_VERSION" => '1.0',
|
12 |
"BRAND_WING_VERSION" => '1.0',
|
13 |
+
"DB_WING_VERSION" => '1.1',
|
14 |
"ACCOUNT_WING_VERSION" => '1.1',
|
15 |
+
"MISC_WING_VERSION" => '1.2',
|
16 |
+
"FS_WING_VERSION" => '1.1',
|
17 |
+
"INFO_WING_VERSION" => '1.4',
|
18 |
"WATCH_WING_VERSION" => '1.0',
|
19 |
"FS_WRITE_WING_VERSION" => '1.0',
|
20 |
"IPSTORE_WING_VERSION" => '1.0',
|
callback/wings/db.php
CHANGED
@@ -11,7 +11,7 @@ class BVDBCallback extends BVCallbackBase {
|
|
11 |
|
12 |
public static $bvTables = array("fw_requests", "lp_requests", "ip_store");
|
13 |
|
14 |
-
const DB_WING_VERSION = 1.
|
15 |
|
16 |
public function __construct($callback_handler) {
|
17 |
$this->db = $callback_handler->db;
|
@@ -284,6 +284,22 @@ class BVDBCallback extends BVCallbackBase {
|
|
284 |
break;
|
285 |
case "altrtbl":
|
286 |
$resp = array("altrtbl" => $db->alterBVTable($params['query'], $params['query']));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
break;
|
288 |
default:
|
289 |
$resp = false;
|
11 |
|
12 |
public static $bvTables = array("fw_requests", "lp_requests", "ip_store");
|
13 |
|
14 |
+
const DB_WING_VERSION = 1.1;
|
15 |
|
16 |
public function __construct($callback_handler) {
|
17 |
$this->db = $callback_handler->db;
|
284 |
break;
|
285 |
case "altrtbl":
|
286 |
$resp = array("altrtbl" => $db->alterBVTable($params['query'], $params['query']));
|
287 |
+
break;
|
288 |
+
case "tbls":
|
289 |
+
$resp = array();
|
290 |
+
|
291 |
+
if (array_key_exists('truncate', $params))
|
292 |
+
$resp['truncate'] = $db->truncateTables($params['truncate']);
|
293 |
+
|
294 |
+
if (array_key_exists('drop', $params))
|
295 |
+
$resp['drop'] = $db->dropTables($params['drop']);
|
296 |
+
|
297 |
+
if (array_key_exists('create', $params))
|
298 |
+
$resp['create'] = $db->createTables($params['create']);
|
299 |
+
|
300 |
+
if (array_key_exists('alter', $params))
|
301 |
+
$resp['alter'] = $db->alterTables($params['alter']);
|
302 |
+
|
303 |
break;
|
304 |
default:
|
305 |
$resp = false;
|
callback/wings/dynsync.php
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH')) exit;
|
4 |
+
if (!class_exists('BVDynSyncCallback')) :
|
5 |
+
|
6 |
+
require_once dirname( __FILE__ ) . '/../../wp_dynsync.php';
|
7 |
+
|
8 |
+
class BVDynSyncCallback extends BVCallbackBase {
|
9 |
+
public $db;
|
10 |
+
public $settings;
|
11 |
+
|
12 |
+
const DYNSYNC_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 dropDynSyncTable() {
|
20 |
+
return $this->db->dropBVTable(BVWPDynSync::$dynsync_table);
|
21 |
+
}
|
22 |
+
|
23 |
+
public function createDynSyncTable($usedbdelta = false) {
|
24 |
+
$db = $this->db;
|
25 |
+
$charset_collate = $db->getCharsetCollate();
|
26 |
+
$table = $this->db->getBVTable(BVWPDynSync::$dynsync_table);
|
27 |
+
$query = "CREATE TABLE $table (
|
28 |
+
id bigint(20) NOT NULL AUTO_INCREMENT,
|
29 |
+
site_id int NOT NULL,
|
30 |
+
event_type varchar(40) NOT NULL DEFAULT '',
|
31 |
+
event_tag varchar(40) NOT NULL DEFAULT '',
|
32 |
+
event_data text NOT NULL DEFAULT '',
|
33 |
+
PRIMARY KEY (id)
|
34 |
+
) $charset_collate;";
|
35 |
+
return $db->createTable($query, BVWPDynSync::$dynsync_table, $usedbdelta);
|
36 |
+
}
|
37 |
+
|
38 |
+
public function process($request) {
|
39 |
+
$settings = $this->settings;
|
40 |
+
$params = $request->params;
|
41 |
+
switch ($request->method) {
|
42 |
+
case "truncdynsynctable":
|
43 |
+
$resp = array("status" => $this->db->truncateBVTable(BVWPDynSync::$dynsync_table));
|
44 |
+
break;
|
45 |
+
case "dropdynsynctable":
|
46 |
+
$resp = array("status" => $this->dropDynSyncTable());
|
47 |
+
break;
|
48 |
+
case "createdynsynctable":
|
49 |
+
$usedbdelta = array_key_exists('usedbdelta', $params);
|
50 |
+
$resp = array("status" => $this->createDynSyncTable($usedbdelta));
|
51 |
+
break;
|
52 |
+
case "setdynsync":
|
53 |
+
if (array_key_exists('dynplug', $params)) {
|
54 |
+
$settings->updateOption('bvdynplug', $params['dynplug']);
|
55 |
+
} else {
|
56 |
+
$settings->deleteOption('bvdynplug');
|
57 |
+
}
|
58 |
+
$settings->updateOption('bvDynSyncActive', $params['dynsync']);
|
59 |
+
$resp = array("status" => "done");
|
60 |
+
break;
|
61 |
+
case "setwoodyn":
|
62 |
+
$resp = array("status" => $settings->updateOption('bvWooDynSync', $params['woodyn']));
|
63 |
+
break;
|
64 |
+
case "setignorednames":
|
65 |
+
switch ($params['table']) {
|
66 |
+
case "options":
|
67 |
+
$settings->updateOption('bvIgnoredOptions', $params['names']);
|
68 |
+
break;
|
69 |
+
case "postmeta":
|
70 |
+
$settings->updateOption('bvIgnoredPostmeta', $params['names']);
|
71 |
+
break;
|
72 |
+
}
|
73 |
+
$resp = array("status" => "done");
|
74 |
+
break;
|
75 |
+
case "getignorednames":
|
76 |
+
switch ($params['table']) {
|
77 |
+
case "options":
|
78 |
+
$names = $settings->getOption('bvIgnoredOptions');
|
79 |
+
break;
|
80 |
+
case "postmeta":
|
81 |
+
$names = $settings->getOption('bvIgnoredPostmeta');
|
82 |
+
break;
|
83 |
+
}
|
84 |
+
$resp = array("names", $names);
|
85 |
+
break;
|
86 |
+
default:
|
87 |
+
$resp = false;
|
88 |
+
}
|
89 |
+
return $resp;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
endif;
|
callback/wings/fs.php
CHANGED
@@ -9,7 +9,7 @@ class BVFSCallback extends BVCallbackBase {
|
|
9 |
public $account;
|
10 |
|
11 |
public static $cwAllowedFiles = array(".htaccess", ".user.ini", "malcare-waf.php");
|
12 |
-
const FS_WING_VERSION = 1.
|
13 |
|
14 |
public function __construct($callback_handler) {
|
15 |
$this->account = $callback_handler->account;
|
@@ -200,7 +200,7 @@ class BVFSCallback extends BVCallbackBase {
|
|
200 |
if ($md5 === true && !is_dir($absfile)) {
|
201 |
$fdata["md5"] = $this->calculateMd5($absfile, $fdata, $offset, $limit, $bsize);
|
202 |
}
|
203 |
-
$result[
|
204 |
}
|
205 |
return $result;
|
206 |
}
|
@@ -288,15 +288,11 @@ class BVFSCallback extends BVCallbackBase {
|
|
288 |
$resp = array("status" => "done", "links" => $links);
|
289 |
break;
|
290 |
case "getfilesstats":
|
291 |
-
$
|
292 |
-
$
|
293 |
-
|
294 |
-
|
295 |
-
$
|
296 |
-
if (array_key_exists('md5', $params)) {
|
297 |
-
$md5 = true;
|
298 |
-
}
|
299 |
-
$resp = $this->getFilesStats($files, $offset, $limit, $bsize, $md5);
|
300 |
break;
|
301 |
case "sendmanyfiles":
|
302 |
$files = $params['files'];
|
@@ -335,7 +331,7 @@ class BVFSCallback extends BVCallbackBase {
|
|
335 |
foreach($regexes as $regex) {
|
336 |
$directoryList = array_merge($directoryList, glob($options['dir'].$regex, $glob_option));
|
337 |
}
|
338 |
-
$resp[$options['dir']] = $this->getFilesStats($directoryList, 0, 0, 0, $md5);
|
339 |
}
|
340 |
break;
|
341 |
case "dirsexists":
|
@@ -357,6 +353,30 @@ class BVFSCallback extends BVCallbackBase {
|
|
357 |
$files = $params['files'];
|
358 |
$withContent = array_key_exists('withcontent', $params) ? $params['withcontent'] : true;
|
359 |
$resp = array("files_content" => $this->getFilesContent($files, $withContent));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
break;
|
361 |
default:
|
362 |
$resp = false;
|
9 |
public $account;
|
10 |
|
11 |
public static $cwAllowedFiles = array(".htaccess", ".user.ini", "malcare-waf.php");
|
12 |
+
const FS_WING_VERSION = 1.1;
|
13 |
|
14 |
public function __construct($callback_handler) {
|
15 |
$this->account = $callback_handler->account;
|
200 |
if ($md5 === true && !is_dir($absfile)) {
|
201 |
$fdata["md5"] = $this->calculateMd5($absfile, $fdata, $offset, $limit, $bsize);
|
202 |
}
|
203 |
+
$result[] = $fdata;
|
204 |
}
|
205 |
return $result;
|
206 |
}
|
288 |
$resp = array("status" => "done", "links" => $links);
|
289 |
break;
|
290 |
case "getfilesstats":
|
291 |
+
$md5 = array_key_exists('md5', $params) ? $params['md5'] : false;
|
292 |
+
$stats = $this->getFilesStats(
|
293 |
+
$params['files'], $params['offset'], $params['limit'], $params['bsize'], $md5
|
294 |
+
);
|
295 |
+
$resp = array('stats' => $stats);
|
|
|
|
|
|
|
|
|
296 |
break;
|
297 |
case "sendmanyfiles":
|
298 |
$files = $params['files'];
|
331 |
foreach($regexes as $regex) {
|
332 |
$directoryList = array_merge($directoryList, glob($options['dir'].$regex, $glob_option));
|
333 |
}
|
334 |
+
$resp[$options['dir']] = array('stats' => $this->getFilesStats($directoryList, 0, 0, 0, $md5));
|
335 |
}
|
336 |
break;
|
337 |
case "dirsexists":
|
353 |
$files = $params['files'];
|
354 |
$withContent = array_key_exists('withcontent', $params) ? $params['withcontent'] : true;
|
355 |
$resp = array("files_content" => $this->getFilesContent($files, $withContent));
|
356 |
+
break;
|
357 |
+
case "gtfls":
|
358 |
+
$resp = array();
|
359 |
+
|
360 |
+
if (array_key_exists('get_files_content', $params)) {
|
361 |
+
$args = $params['get_files_content'];
|
362 |
+
$with_content = array_key_exists('withcontent', $args) ? $args['withcontent'] : true;
|
363 |
+
$resp['get_files_content'] = $this->getFilesContent($args['files'], $with_content);
|
364 |
+
}
|
365 |
+
|
366 |
+
if (array_key_exists('get_files_stats', $params)) {
|
367 |
+
$args = $params['get_files_stats'];
|
368 |
+
$md5 = array_key_exists('md5', $args) ? $args['md5'] : false;
|
369 |
+
$stats = $this->getFilesStats(
|
370 |
+
$args['files'], $args['offset'], $args['limit'], $args['bsize'], $md5
|
371 |
+
);
|
372 |
+
|
373 |
+
$result = array();
|
374 |
+
foreach ($stats as $stat) {
|
375 |
+
$result[$stat['filename']] = $stat;
|
376 |
+
}
|
377 |
+
$resp['get_files_stats'] = $result;
|
378 |
+
}
|
379 |
+
|
380 |
break;
|
381 |
default:
|
382 |
$resp = false;
|
callback/wings/info.php
CHANGED
@@ -10,7 +10,7 @@ class BVInfoCallback extends BVCallbackBase {
|
|
10 |
public $bvinfo;
|
11 |
public $bvapi;
|
12 |
|
13 |
-
const INFO_WING_VERSION = 1.
|
14 |
|
15 |
public function __construct($callback_handler) {
|
16 |
$this->db = $callback_handler->db;
|
@@ -260,6 +260,18 @@ class BVInfoCallback extends BVCallbackBase {
|
|
260 |
return $host_info;
|
261 |
}
|
262 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
function refreshUpdatesInfo() {
|
264 |
global $wp_current_filter;
|
265 |
$wp_current_filter[] = 'load-update-core.php';
|
@@ -333,6 +345,12 @@ class BVInfoCallback extends BVCallbackBase {
|
|
333 |
function getSiteInfo($args) {
|
334 |
$result = array();
|
335 |
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
if (array_key_exists('refresh', $args))
|
337 |
$result['refreshed'] = $this->refreshUpdatesInfo();
|
338 |
|
@@ -351,6 +369,9 @@ class BVInfoCallback extends BVCallbackBase {
|
|
351 |
if (array_key_exists('sys', $args))
|
352 |
$result['sys'] = $this->getSystemInfo();
|
353 |
|
|
|
|
|
|
|
354 |
return $result;
|
355 |
}
|
356 |
|
@@ -390,6 +411,21 @@ class BVInfoCallback extends BVCallbackBase {
|
|
390 |
return $result;
|
391 |
}
|
392 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
public function process($request) {
|
394 |
$db = $this->db;
|
395 |
$params = $request->params;
|
@@ -459,6 +495,9 @@ class BVInfoCallback extends BVCallbackBase {
|
|
459 |
case "gtsteinfo":
|
460 |
$resp = $this->getSiteInfo($params);
|
461 |
break;
|
|
|
|
|
|
|
462 |
default:
|
463 |
$resp = false;
|
464 |
}
|
10 |
public $bvinfo;
|
11 |
public $bvapi;
|
12 |
|
13 |
+
const INFO_WING_VERSION = 1.4;
|
14 |
|
15 |
public function __construct($callback_handler) {
|
16 |
$this->db = $callback_handler->db;
|
260 |
return $host_info;
|
261 |
}
|
262 |
|
263 |
+
public function serverConfig() {
|
264 |
+
return array(
|
265 |
+
'software' => $_SERVER['SERVER_SOFTWARE'],
|
266 |
+
'sapi' => (function_exists('php_sapi_name')) ? php_sapi_name() : false,
|
267 |
+
'has_apache_get_modules' => function_exists('apache_get_modules'),
|
268 |
+
'posix_getuid' => (function_exists('posix_getuid')) ? posix_getuid() : null,
|
269 |
+
'uid' => (function_exists('getmyuid')) ? getmyuid() : null,
|
270 |
+
'user_ini' => ini_get('user_ini.filename'),
|
271 |
+
'php_major_version' => PHP_MAJOR_VERSION
|
272 |
+
);
|
273 |
+
}
|
274 |
+
|
275 |
function refreshUpdatesInfo() {
|
276 |
global $wp_current_filter;
|
277 |
$wp_current_filter[] = 'load-update-core.php';
|
345 |
function getSiteInfo($args) {
|
346 |
$result = array();
|
347 |
|
348 |
+
if (array_key_exists('pre_refresh_get_options', $args)) {
|
349 |
+
$result['pre_refresh_get_options'] = $this->settings->getOptions(
|
350 |
+
$args['pre_refresh_get_options']
|
351 |
+
);
|
352 |
+
}
|
353 |
+
|
354 |
if (array_key_exists('refresh', $args))
|
355 |
$result['refreshed'] = $this->refreshUpdatesInfo();
|
356 |
|
369 |
if (array_key_exists('sys', $args))
|
370 |
$result['sys'] = $this->getSystemInfo();
|
371 |
|
372 |
+
if (array_key_exists('get_options', $args))
|
373 |
+
$result['get_options'] = $this->settings->getOptions($args['get_options']);
|
374 |
+
|
375 |
return $result;
|
376 |
}
|
377 |
|
411 |
return $result;
|
412 |
}
|
413 |
|
414 |
+
function getPluginServicesInfo($args) {
|
415 |
+
$result = array();
|
416 |
+
|
417 |
+
if (array_key_exists('get_options', $args))
|
418 |
+
$result['get_options'] = $this->settings->getOptions($args['get_options']);
|
419 |
+
|
420 |
+
if (array_key_exists('pingbv', $args))
|
421 |
+
$result['pingbv'] = array('status' => $this->pingBV());
|
422 |
+
|
423 |
+
if (array_key_exists('server_config', $args))
|
424 |
+
$result['server_config'] = $this->serverConfig();
|
425 |
+
|
426 |
+
return $result;
|
427 |
+
}
|
428 |
+
|
429 |
public function process($request) {
|
430 |
$db = $this->db;
|
431 |
$params = $request->params;
|
495 |
case "gtsteinfo":
|
496 |
$resp = $this->getSiteInfo($params);
|
497 |
break;
|
498 |
+
case "psinfo":
|
499 |
+
$resp = $this->getPluginServicesInfo($params);
|
500 |
+
break;
|
501 |
default:
|
502 |
$resp = false;
|
503 |
}
|
callback/wings/misc.php
CHANGED
@@ -11,7 +11,7 @@ class BVMiscCallback extends BVCallbackBase {
|
|
11 |
public $bvapi;
|
12 |
public $db;
|
13 |
|
14 |
-
const MISC_WING_VERSION = 1.
|
15 |
|
16 |
public function __construct($callback_handler) {
|
17 |
$this->settings = $callback_handler->settings;
|
@@ -154,6 +154,19 @@ class BVMiscCallback extends BVCallbackBase {
|
|
154 |
break;
|
155 |
case "dlttrsnt":
|
156 |
$resp = array("dlttrsnt" => $settings->deleteTransient($params['key']));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
break;
|
158 |
case "setbvss":
|
159 |
$resp = array("status" => $settings->updateOption('bv_site_settings', $params['bv_site_settings']));
|
11 |
public $bvapi;
|
12 |
public $db;
|
13 |
|
14 |
+
const MISC_WING_VERSION = 1.2;
|
15 |
|
16 |
public function __construct($callback_handler) {
|
17 |
$this->settings = $callback_handler->settings;
|
154 |
break;
|
155 |
case "dlttrsnt":
|
156 |
$resp = array("dlttrsnt" => $settings->deleteTransient($params['key']));
|
157 |
+
break;
|
158 |
+
case "optns":
|
159 |
+
$resp = array();
|
160 |
+
|
161 |
+
if (array_key_exists("get_options", $params))
|
162 |
+
$resp["get_options"] = $settings->getOptions($params["get_options"]);
|
163 |
+
|
164 |
+
if (array_key_exists("update_options", $params))
|
165 |
+
$resp["update_options"] = $settings->updateOptions($params["update_options"]);
|
166 |
+
|
167 |
+
if (array_key_exists("delete_options", $params))
|
168 |
+
$resp["delete_options"] = $settings->deleteOptions($params["delete_options"]);
|
169 |
+
|
170 |
break;
|
171 |
case "setbvss":
|
172 |
$resp = array("status" => $settings->updateOption('bv_site_settings', $params['bv_site_settings']));
|
info.php
CHANGED
@@ -10,7 +10,7 @@ if (!class_exists('MCInfo')) :
|
|
10 |
public $badgeinfo = 'mcbadge';
|
11 |
public $ip_header_option = 'mcipheader';
|
12 |
public $brand_option = 'mcbrand';
|
13 |
-
public $version = '4.
|
14 |
public $webpage = 'https://www.malcare.com';
|
15 |
public $appurl = 'https://app.malcare.com';
|
16 |
public $slug = 'malcare-security/malcare.php';
|
10 |
public $badgeinfo = 'mcbadge';
|
11 |
public $ip_header_option = 'mcipheader';
|
12 |
public $brand_option = 'mcbrand';
|
13 |
+
public $version = '4.74';
|
14 |
public $webpage = 'https://www.malcare.com';
|
15 |
public $appurl = 'https://app.malcare.com';
|
16 |
public $slug = 'malcare-security/malcare.php';
|
malcare.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.malcare.com
|
|
5 |
Description: MalCare Security - Free Malware Scanner, Protection & Security for WordPress
|
6 |
Author: MalCare Security
|
7 |
Author URI: https://www.malcare.com
|
8 |
-
Version: 4.
|
9 |
Network: True
|
10 |
*/
|
11 |
|
@@ -37,6 +37,7 @@ require_once dirname( __FILE__ ) . '/wp_api.php';
|
|
37 |
require_once dirname( __FILE__ ) . '/wp_actions.php';
|
38 |
require_once dirname( __FILE__ ) . '/info.php';
|
39 |
require_once dirname( __FILE__ ) . '/account.php';
|
|
|
40 |
|
41 |
|
42 |
$bvsettings = new MCWPSettings();
|
@@ -54,6 +55,7 @@ register_deactivation_hook(__FILE__, array($wp_action, 'deactivate'));
|
|
54 |
|
55 |
add_action('wp_footer', array($wp_action, 'footerHandler'), 100);
|
56 |
add_action('clear_bv_services_config', array($wp_action, 'clear_bv_services_config'));
|
|
|
57 |
|
58 |
if (defined('WP_CLI') && WP_CLI) {
|
59 |
require_once dirname( __FILE__ ) . '/wp_cli.php';
|
@@ -76,6 +78,7 @@ if (is_admin()) {
|
|
76 |
add_action('admin_head', array($wpadmin, 'removeAdminNotices'), 3);
|
77 |
add_action('admin_notices', array($wpadmin, 'activateWarning'));
|
78 |
add_action('admin_enqueue_scripts', array($wpadmin, 'mcsecAdminMenu'));
|
|
|
79 |
}
|
80 |
|
81 |
|
@@ -148,7 +151,13 @@ if ((array_key_exists('bvplugname', $_REQUEST)) && ($_REQUEST['bvplugname'] == "
|
|
148 |
}
|
149 |
}
|
150 |
|
151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
if ($bvinfo->isServiceActive('activity_log')) {
|
153 |
require_once dirname( __FILE__ ) . '/wp_actlog.php';
|
154 |
$bvconfig = $bvinfo->config;
|
5 |
Description: MalCare Security - Free Malware Scanner, Protection & Security for WordPress
|
6 |
Author: MalCare Security
|
7 |
Author URI: https://www.malcare.com
|
8 |
+
Version: 4.74
|
9 |
Network: True
|
10 |
*/
|
11 |
|
37 |
require_once dirname( __FILE__ ) . '/wp_actions.php';
|
38 |
require_once dirname( __FILE__ ) . '/info.php';
|
39 |
require_once dirname( __FILE__ ) . '/account.php';
|
40 |
+
##WPCACHEMODULE##
|
41 |
|
42 |
|
43 |
$bvsettings = new MCWPSettings();
|
55 |
|
56 |
add_action('wp_footer', array($wp_action, 'footerHandler'), 100);
|
57 |
add_action('clear_bv_services_config', array($wp_action, 'clear_bv_services_config'));
|
58 |
+
##SOADDUNINSTALLACTION##
|
59 |
|
60 |
if (defined('WP_CLI') && WP_CLI) {
|
61 |
require_once dirname( __FILE__ ) . '/wp_cli.php';
|
78 |
add_action('admin_head', array($wpadmin, 'removeAdminNotices'), 3);
|
79 |
add_action('admin_notices', array($wpadmin, 'activateWarning'));
|
80 |
add_action('admin_enqueue_scripts', array($wpadmin, 'mcsecAdminMenu'));
|
81 |
+
##SOADMINMENU##
|
82 |
}
|
83 |
|
84 |
|
151 |
}
|
152 |
}
|
153 |
|
154 |
+
if ($bvinfo->isDynSyncModuleEnabled()) {
|
155 |
+
require_once dirname( __FILE__ ) . '/wp_dynsync.php';
|
156 |
+
$bvconfig = $bvinfo->config;
|
157 |
+
$dynsync = new BVWPDynSync($bvdb, $bvsettings, $bvconfig['dynsync']);
|
158 |
+
$dynsync->init();
|
159 |
+
}
|
160 |
+
|
161 |
if ($bvinfo->isServiceActive('activity_log')) {
|
162 |
require_once dirname( __FILE__ ) . '/wp_actlog.php';
|
163 |
$bvconfig = $bvinfo->config;
|
readme.txt
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
=== MalCare Security -
|
2 |
Contributors: malcare security, akshatc
|
3 |
-
Tags: security, wordpress security, security plugin, firewall, malware scanner, login security,
|
4 |
Plugin URI: https://www.malcare.com
|
5 |
Donate link: https://www.malcare.com
|
6 |
Requires at least: 4.0
|
7 |
Tested up to: 5.9
|
8 |
Requires PHP: 5.4.0
|
9 |
-
Stable tag: 4.
|
10 |
License: GPLv2 or later
|
11 |
License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
|
12 |
|
13 |
-
Get Bulletproof Security for your site.
|
14 |
|
15 |
== DESCRIPTION ==
|
16 |
|
17 |
### MALCARE SECURITY SERVICES
|
18 |
|
19 |
-
|
20 |
★★★★★
|
21 |
|
22 |
A WordPress security plugin ensures that your website remains completely safe and secure, always. We created [MalCare Security Plugin](https://www.malcare.com/) to help website owners worry less about their site security, achieve peace of mind and focus all their energies on growing their business or website.
|
@@ -30,28 +30,29 @@ A WordPress security plugin ensures that your website remains completely safe an
|
|
30 |
[youtube https://www.youtube.com/watch?v=rBuYh2dIadk]
|
31 |
<br/>
|
32 |
|
33 |
-
**Important Links: [Features](https://www.malcare.com/features/) | [Why Choose MalCare?](https://www.malcare.com/) | [Comparisons](https://www.malcare.com/top-wordpress-security-plugins-compared/) | [Free vs Paid](https://www.malcare.com/malcare-free-premium/)**
|
34 |
|
35 |
-
MalCare is the **fastest** malware detection and removal plugin loved by thousands of developers and agencies. With an industry-first **automatic one-click malware removal**, your website is clean before Google blacklists it or your web host takes it down. MalCare has been developed from the ground up after **analyzing over 240,000 websites over 2.5+ years**.
|
36 |
|
37 |
-
Its **intelligent scanning methodology** will **never slow down your
|
38 |
|
39 |
-
The **one-click malware cleaner** offers unlimited automated cleanups while the inbuilt **powerful cloud-based firewall** ensures round-the-clock website protection. Moreover, you can **block countries** to mitigate hack attacks.
|
40 |
|
41 |
-
MalCare comes integrated with a **complete website management** module that ensures better security and site management to your websites from a single dashboard.
|
42 |
|
43 |
-
The plugin **notifies you if the
|
44 |
|
45 |
-
MalCare offers a premium **White-Label** solution that lets agencies provide better security to their clients without risking their business. And enables users to **generate beautiful reports** for their clients.
|
46 |
|
47 |
-
== Why Choose MalCare? ==
|
48 |
|
49 |
* #### WordPress Malware Scanner
|
50 |
* Cloud Based Deep malware scanner
|
51 |
-
* Doesn’t Slow down your
|
52 |
* Detects malware BEFORE it’s too late
|
53 |
* NO impact on your website
|
54 |
* Finds ALL types of malware, even new & complex ones
|
|
|
55 |
|
56 |
* #### WordPress Malware Removal
|
57 |
* View hacked file details
|
@@ -62,7 +63,7 @@ MalCare offers a premium **White-Label** solution that lets agencies provide bet
|
|
62 |
* #### WordPress Website Protection
|
63 |
* Blocks hacker BOTS from attacking login page
|
64 |
* Identifies & blocks MALICIOUS traffic
|
65 |
-
* Enables users to HARDEN their sites
|
66 |
* Enables users to block ENTIRE countries
|
67 |
|
68 |
* #### Easy to Use
|
@@ -79,13 +80,13 @@ MalCare offers unparalleled security services. Some services are free and others
|
|
79 |
#### MalCare’s FREE Services -
|
80 |
|
81 |
1. #### Cloud-Based Malware Scanning (Free)
|
82 |
-
MalCare’s Cloud-based Scanning ensures no impact on your website ever. Moreover, it detects Complex Malware missed by other popular plugins
|
83 |
|
84 |
2. #### Web-Application WordPress Firewall (Free)
|
85 |
-
Get Real-Time Protection for your WordPress website against the latest threats with MalCare's Smart Firewall. Block hackers & bots before they harm your site.
|
86 |
|
87 |
-
3. #### CAPTCHA-Based Login Protection (Free)
|
88 |
-
Automatically prevent brute force attacks with MalCare’s Smart Captcha-Based Login Protection. Round-the-clock protection against malicious traffic.
|
89 |
|
90 |
#### MalCare’s PAID Services -
|
91 |
|
@@ -102,7 +103,7 @@ MalCare offers unparalleled security services. Some services are free and others
|
|
102 |
Restrict access to users based on their geographical location. Easily block all visitors from certain countries to mitigate the risk of being hacked.
|
103 |
|
104 |
5. #### Uptime Monitoring (Paid)
|
105 |
-
With MalCare's Uptime Monitoring keep a steady eye on your
|
106 |
|
107 |
|
108 |
== Common Hack Attacks Prevented By MalCare ==
|
@@ -143,7 +144,7 @@ MalCare protects websites against all common hack attacks which includes:
|
|
143 |
* Web Application Firewall **(Free)**
|
144 |
* Plugin Based Firewall **(Free)**
|
145 |
* Rules update every 7 days **(Free)**
|
146 |
-
* Login Protection **(Free)**
|
147 |
* Bot Protection **(Free)**
|
148 |
* Rules update every 5 mins **(Paid)**
|
149 |
* Geo-Blocking **(Paid)**
|
@@ -180,14 +181,14 @@ MalCare is perfect for:
|
|
180 |
|
181 |
== Detailed Setup Step-by-Step Tutorials ==
|
182 |
|
183 |
-
This plugin works in tandem with the [MalCare](https://www.malcare.com) servers. MalCare servers do all the heavy processing and will alert you if your site has any issues.
|
184 |
|
185 |
Hence a MalCare account is needed to use the plugin. This account can also be used by our other products including [BlogVault](https://blogvault.net).
|
186 |
|
187 |
* [How to Set Up a MalCare Account?](https://malcare.freshdesk.com/support/solutions/articles/35000055512-how-do-i-set-up-a-malcare-account-) (Help Doc)
|
188 |
* [How to Set Up a MalCare Account?](https://www.youtube.com/watch?v=v8L_DZllk7k&list=) (Video)
|
189 |
|
190 |
-
== MalCare Full Features List ==
|
191 |
|
192 |
* #### Cloud Based Malware Scanner
|
193 |
* Daily Scan Frequency
|
@@ -204,7 +205,7 @@ Hence a MalCare account is needed to use the plugin. This account can also be us
|
|
204 |
* #### Intelligent Malware Protection
|
205 |
* Web Application Firewall
|
206 |
* IP Whitelisting
|
207 |
-
* CAPTCHA-based Login Protection
|
208 |
* Traffic Logs
|
209 |
* Login Logs
|
210 |
* Geo-Blocking
|
@@ -259,12 +260,6 @@ Hence a MalCare account is needed to use the plugin. This account can also be us
|
|
259 |
|
260 |
== MalCare vs. Others ==
|
261 |
|
262 |
-
* [MalCare vs Sucuri](https://www.malcare.com/sucuri-comparison/)
|
263 |
-
* [MalCare vs Wordfence](https://www.malcare.com/wordfence-comparison/)
|
264 |
-
* [MalCare vs iThemes](https://www.malcare.com/ithemes-comparison/)
|
265 |
-
* [MalCare vs SiteLock](https://www.malcare.com/sitelock-comparison/)
|
266 |
-
* [MalCare vs SecuPress](https://www.malcare.com/secupress-comparison/)
|
267 |
-
* [MalCare Compared With Top WordPress Security Plugins](https://www.malcare.com/top-wordpress-security-plugins-compared/)
|
268 |
* [MalCare vs Sucuri vs Wordfence by CodeinWP](https://www.codeinwp.com/blog/sucuri-vs-wordfence-vs-malcare/)
|
269 |
* [MalCare vs Sucuri vs Wordfence vs SiteLock vs iThemes Security by WPMayor](https://wpmayor.com/malcare-sucuri-wordfence-sitelock-ithemes-security-comparison/)
|
270 |
|
@@ -274,7 +269,7 @@ Hence a MalCare account is needed to use the plugin. This account can also be us
|
|
274 |
Yes. Take the help of this **[step-by-step guide](http://bit.ly/2RKSVCb)**.
|
275 |
|
276 |
=I am unable to reach the security plugin. What can I do?=
|
277 |
-
You can send an email to the support team
|
278 |
|
279 |
=Do you have a free version? How does it work?=
|
280 |
MalCare Security Service has a free version and a premium version. We’ll scan and protect your website with a Firewall in the **[free MalCare version](https://wordpress.org/plugins/malcare-security/)**. You can download the security plugin from the WordPress repository.
|
@@ -283,8 +278,8 @@ The **[paid version](http://bit.ly/2ROFL7y)** includes Cleaning a Hacked Site, W
|
|
283 |
|
284 |
To learn more, please take a look at **[MalCare free vs premium page](http://bit.ly/2RMzUPY)**.
|
285 |
|
286 |
-
=How do I upgrade from free to a premium account?=
|
287 |
-
To upgrade from free trial version to a premium account, please take the help of **[this guide](http://bit.ly/2RMSBTP)**.
|
288 |
|
289 |
=How do I upgrade to a bigger Plan?=
|
290 |
To upgrade to a bigger Plan, take the help of **[this guide](http://bit.ly/2RMSBTP)**.
|
@@ -296,7 +291,7 @@ Never! We will be with you for any queries at any time. **[Click here](https://w
|
|
296 |
MalCare automatic security scans a website once every 24 hours.
|
297 |
|
298 |
=How does MalCare detect complex malware?=
|
299 |
-
MalCare Security Service scans all your website WordPress files beyond just signatures and evaluates
|
300 |
|
301 |
=Does MalCare affect my site performance?=
|
302 |
No, not at all. MalCare Security Service performs all the heavy lifting of scanning your entire site WordPress files on its own. It does not use your site resources. MalCare Security Service runs its security operations on MalCare servers, thereby ensuring zero loads from its side on your website.
|
@@ -309,33 +304,33 @@ But if the situation persists, then cleaning up the site, again and again, will
|
|
309 |
=What do I need to clean my website?=
|
310 |
In order to begin the cleanup process, we need access to your server and its associated files. (Don’t worry, this will not compromise your site’s security).
|
311 |
|
312 |
-
We get this access in the form of FTP, SFTP, or SSH access to your server. FTP stands for File Transfer Protocol, sFTP for Secure File Transfer Protocol, and SSH for Secure Shell. These are connection protocol mechanisms that allow us to log into servers to edit/add/remove files. These connection protocols allow us to log into your websites, specifically the server, and perform the remediation process. If you for some reason are unfamiliar with these protocols, don’t worry, our team of security analysts
|
313 |
|
314 |
We covered how to clean a website **[here](http://bit.ly/2RHzkD2)**. Here’s a guide on **[how to find FTP credentials](http://bit.ly/2RFPeOl)** and another guide on **[how to locate a folder where WordPress is installed](http://bit.ly/2RFPf4R)**.
|
315 |
|
316 |
=How long does it take to clean a site?=
|
317 |
It really depends on the size of the website. In average, **[cleaning up with MalCare Security](http://bit.ly/2RHzkD2)** usually takes 5-10 mins.
|
318 |
|
319 |
-
=How does the Login Protection work?=
|
320 |
-
**[MalCare’s Login Protection](http://bit.ly/2RKbDKn)** feature prevents bots from entering your website stealing your data, spamming and other malicious activities that threaten the security of your site.
|
321 |
|
322 |
=How does the Site Hardening work?=
|
323 |
-
WordPress has recommended few extra security measures which will harden the security of your website. We have incorporated those recommendations in our Site Hardening feature. Kindly have a look at our guide on **[how to implement Site Hardening](http://bit.ly/2RGnSYt)**.
|
324 |
|
325 |
=How does the Firewall work?=
|
326 |
-
MalCare Security Service was created after analyzing over 240,000 sites from scratch. The Firewall constantly monitors traffic from all places and automatically blocks
|
327 |
|
328 |
**[MalCare Firewall Security](http://bit.ly/2RKIuyu)** ensures that attacks on your site by even bots are mitigated, without affecting your WordPress site. It monitors bots across a global level without ever overloading your server.
|
329 |
|
330 |
-
=Can I update WordPress core, plugins and themes directly?=
|
331 |
Yes. Updating WordPress add-ons tightens the security of your website. Take a look at this **[Manage Site help doc](http://bit.ly/2RKhMGr)** to learn how to update WordPress add-ons.
|
332 |
|
333 |
=Can I manage my site users and their password directly?=
|
334 |
Yes. With MalCare managing WordPress, users have become easier. Take the help of this **[Manage Site help doc](http://bit.ly/2RKhMGr)**. Remember to delete the passive user account and encourage users to use a strong password for better security.
|
335 |
|
336 |
-
=Can I add Clients and Team Members
|
337 |
Yes, you can.
|
338 |
-
Our client feature is for your reference alone. You can assign a client to their site. If you want to give a user,
|
339 |
|
340 |
=Will MalCare Security work if my site is down?=
|
341 |
We understand the pains of a website going down. If a site goes down after you have **[added the website](http://bit.ly/2ROE7CU)** and **[installed the security plugin](http://bit.ly/2RI7eHW)** from the dashboard, **[MalCare will clean up your site](http://bit.ly/2RHzkD2)**.
|
@@ -345,16 +340,16 @@ But if you add a website that was down beforehand, i.e. before adding the securi
|
|
345 |
=What information does MalCare Security Service store?=
|
346 |
We only store data related to your site structure such as plugins/themes with their respective versions. This helps us identify vulnerabilities that may be present on the site. We track the IPs of visitors to your site, to identify malicious actors who might attack your site.
|
347 |
|
348 |
-
=What makes MalCare Security Service better than other security plugins?=
|
349 |
MalCare Security Service was developed after analyzing 240,000+ websites.
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
|
355 |
We feel these features set us apart from most other WordPress security plugins. For further information take a look at how MalCare Security Service stands when compared with **[Top Security Plugins](http://bit.ly/2RKFdPG)**.
|
356 |
|
357 |
-
=I already have a backup solution. Something happens to my site, I can simply restore. Why do I need a security plugin?=
|
358 |
Backups play a very important role in WordPress security, but it has some limitations. We have noticed that in many cases, it is weeks before a site owner realizes that his/her website has been hacked.
|
359 |
|
360 |
During this period multiple backups will be taken, and there will be a high chance that the files that contain the hack or the Malware are also backed up.
|
@@ -362,22 +357,22 @@ During this period multiple backups will be taken, and there will be a high chan
|
|
362 |
In such a case restoring from backup is not sufficient as it will not clean your website. Here is where a Malware solution like MalCare Security Service comes in. It does regular automated security scans of your website and notifies you if there is any sort of Malicious content on your website.
|
363 |
|
364 |
=Isn’t WordPress secure enough?=
|
365 |
-
WordPress core is safe, but the CMS does not work in isolation. Security plugins and themes are part of its ecosystem. Several studies on hacked sites show that plugins and themes are responsible for a majority of such
|
366 |
|
367 |
=Why will an SSL certificate not suffice?=
|
368 |
-
An SSL certificate is used only to encrypt a connection between the browser and server to safely transmit sensitive information. However, MalCare Security Service goes beyond and actually protects the database where this information is stored, scans your website files using 100+ intelligent signals automatically, and applications protect from data breaches and spreading of viruses/malware. These functionalities are not provided by an SSL certificate.
|
369 |
|
370 |
=How is MalCare Security Service the best for agencies or developers?=
|
371 |
We’re the best because of three features:
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
|
376 |
=How does MalCare Security handle WordPress Multisite installs?=
|
377 |
We completely understand the concern and complexities surrounding WordPress Multisite installs. We treat each WordPress install as a license. It means that if you have a network of websites on a single WordPress installation, we treat that as a single license.
|
378 |
|
379 |
=Will MalCare Security Service slow down my website?=
|
380 |
-
MalCare runs on its own servers. We take great care to ensure that we do not add load to your site. We do all the hard work of security scanning, cleaning and protecting, on our servers and this is our USP.
|
381 |
|
382 |
=Where are my FTP details processed?=
|
383 |
FTP details input into MalCare is processed on our servers. We need your FTP credentials to access your website’s files and folders. We feel that FTP transfer is the safest way to transfer data to and from a site. However, they are treated like payment details (i.e. they’re not stored on our servers). Once we’ve processed them, they’re deleted from our servers.
|
@@ -390,16 +385,21 @@ These are available on our website: [Terms of Service](https://www.malcare.com/t
|
|
390 |
1. It’s extremely easy to add a website to MalCare’s dashboard. All you need to do is add a URL and install the plugin on your website.
|
391 |
2. MalCare's Early Detecting Technology uses 100+ intelligent signals to detect even the most complex malware that other WordPress security plugins cannot detect.
|
392 |
3. No more waiting for days or hours to clean your website. Clean your website of malicious code with surgical precision in One-Click.
|
393 |
-
4. MalCare offers
|
394 |
5. MalCare's Firewall automatically blocks malicious traffic with its intelligent visitor pattern detection technology.
|
395 |
-
6. MalCare helps implement Advanced Website Hardening measures to make your site more secure against hackers and bots.
|
396 |
7. MalCare's Geoblocking effectively blocks countries from visiting your site with just a click of a button.
|
397 |
8. MalCare’s Uptime Monitoring notifies if a website goes down so that you can handle the situation before starting to lose visitors.
|
398 |
|
399 |
== CHANGELOG ==
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
= 4.72 =
|
401 |
* Sync Improvements
|
402 |
-
* Adding Manage wing
|
403 |
|
404 |
= 4.69 =
|
405 |
* Improved network call efficiency for site info callbacks.
|
@@ -541,7 +541,7 @@ These are available on our website: [Terms of Service](https://www.malcare.com/t
|
|
541 |
* Request profling and logging
|
542 |
|
543 |
= 1.89 =
|
544 |
-
*Firewall improvements
|
545 |
|
546 |
= 1.88 =
|
547 |
* Callback improvements
|
1 |
+
=== MalCare WordPress Security Plugin - Malware Scanner, Cleaner, Security Firewall ===
|
2 |
Contributors: malcare security, akshatc
|
3 |
+
Tags: security, wordpress security, security plugin, firewall, malware scanner, login security, malware removal, improve security
|
4 |
Plugin URI: https://www.malcare.com
|
5 |
Donate link: https://www.malcare.com
|
6 |
Requires at least: 4.0
|
7 |
Tested up to: 5.9
|
8 |
Requires PHP: 5.4.0
|
9 |
+
Stable tag: 4.74
|
10 |
License: GPLv2 or later
|
11 |
License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
|
12 |
|
13 |
+
Get Bulletproof Security for your WordPress site. WordPress security plugin packed with comprehensive Firewall, malware scanner, cleaner & more.
|
14 |
|
15 |
== DESCRIPTION ==
|
16 |
|
17 |
### MALCARE SECURITY SERVICES
|
18 |
|
19 |
+
Security Plugin For WordPress Websites
|
20 |
★★★★★
|
21 |
|
22 |
A WordPress security plugin ensures that your website remains completely safe and secure, always. We created [MalCare Security Plugin](https://www.malcare.com/) to help website owners worry less about their site security, achieve peace of mind and focus all their energies on growing their business or website.
|
30 |
[youtube https://www.youtube.com/watch?v=rBuYh2dIadk]
|
31 |
<br/>
|
32 |
|
33 |
+
**Important Links: [Security Features](https://www.malcare.com/features/) | [Why Choose MalCare?](https://www.malcare.com/) | [Comparisons](https://www.malcare.com/top-wordpress-security-plugins-compared/) | [Free vs Paid](https://www.malcare.com/malcare-free-premium/)**
|
34 |
|
35 |
+
MalCare is the **fastest** malware detection and removal plugin loved by thousands of developers and agencies. With an industry-first **automatic one-click malware removal**, your WordPress website is clean before Google blacklists it or your web host takes it down. MalCare has been developed from the ground up after **analyzing over 240,000 websites over 2.5+ years**.
|
36 |
|
37 |
+
Its **intelligent scanning methodology** will **never slow down your WordPress site** and **accurately identifies** the most complex malware that typically goes undetected in other popular WordPress security plugins.
|
38 |
|
39 |
+
The **one-click malware cleaner** offers unlimited automated cleanups while the inbuilt **powerful cloud-based firewall** ensures round-the-clock website protection against spam attacks. Moreover, you can **block countries** to mitigate hack attacks.
|
40 |
|
41 |
+
MalCare comes integrated with a **complete website management** module that ensures better WP security and site management to your websites from a single dashboard.
|
42 |
|
43 |
+
The WP security plugin **notifies you if the WordPress site goes down** so that you can handle the situation before you start losing visitors. Performance Check enables WordPress users to keep an eye on their **loading speed**.
|
44 |
|
45 |
+
MalCare offers a premium **White-Label** solution that lets agencies provide better website security to their clients without risking their business. And enables users to **generate beautiful reports** for their clients.
|
46 |
|
47 |
+
== Why Choose MalCare WordPress Security Plugin? ==
|
48 |
|
49 |
* #### WordPress Malware Scanner
|
50 |
* Cloud Based Deep malware scanner
|
51 |
+
* Doesn’t Slow down your WordPress site
|
52 |
* Detects malware BEFORE it’s too late
|
53 |
* NO impact on your website
|
54 |
* Finds ALL types of malware, even new & complex ones
|
55 |
+
* Get Alerts about Security Risks with our WordPress Vulnerability Scanner
|
56 |
|
57 |
* #### WordPress Malware Removal
|
58 |
* View hacked file details
|
63 |
* #### WordPress Website Protection
|
64 |
* Blocks hacker BOTS from attacking login page
|
65 |
* Identifies & blocks MALICIOUS traffic
|
66 |
+
* Enables users to HARDEN their WordPress sites
|
67 |
* Enables users to block ENTIRE countries
|
68 |
|
69 |
* #### Easy to Use
|
80 |
#### MalCare’s FREE Services -
|
81 |
|
82 |
1. #### Cloud-Based Malware Scanning (Free)
|
83 |
+
MalCare’s Cloud-based Scanning ensures no impact on your website ever. Moreover, it detects Complex Malware missed by other popular security plugins for WordPress.
|
84 |
|
85 |
2. #### Web-Application WordPress Firewall (Free)
|
86 |
+
Get Real-Time Protection for your WordPress website against the latest security threats with MalCare's Smart Firewall. Block hackers & bots before they harm your site.
|
87 |
|
88 |
+
3. #### CAPTCHA-Based Login Page Protection (Free)
|
89 |
+
Automatically prevent brute force attacks with MalCare’s Smart Captcha-Based Login Page Protection. Round-the-clock protection against malicious traffic.
|
90 |
|
91 |
#### MalCare’s PAID Services -
|
92 |
|
103 |
Restrict access to users based on their geographical location. Easily block all visitors from certain countries to mitigate the risk of being hacked.
|
104 |
|
105 |
5. #### Uptime Monitoring (Paid)
|
106 |
+
With MalCare's Uptime Monitoring keep a steady eye on your WordPress site. It ensures that you are not oblivious to website downtime.
|
107 |
|
108 |
|
109 |
== Common Hack Attacks Prevented By MalCare ==
|
144 |
* Web Application Firewall **(Free)**
|
145 |
* Plugin Based Firewall **(Free)**
|
146 |
* Rules update every 7 days **(Free)**
|
147 |
+
* Login Page Protection **(Free)**
|
148 |
* Bot Protection **(Free)**
|
149 |
* Rules update every 5 mins **(Paid)**
|
150 |
* Geo-Blocking **(Paid)**
|
181 |
|
182 |
== Detailed Setup Step-by-Step Tutorials ==
|
183 |
|
184 |
+
This WordPress security plugin works in tandem with the [MalCare](https://www.malcare.com) servers. MalCare servers do all the heavy processing and will alert you if your site has any security issues.
|
185 |
|
186 |
Hence a MalCare account is needed to use the plugin. This account can also be used by our other products including [BlogVault](https://blogvault.net).
|
187 |
|
188 |
* [How to Set Up a MalCare Account?](https://malcare.freshdesk.com/support/solutions/articles/35000055512-how-do-i-set-up-a-malcare-account-) (Help Doc)
|
189 |
* [How to Set Up a MalCare Account?](https://www.youtube.com/watch?v=v8L_DZllk7k&list=) (Video)
|
190 |
|
191 |
+
== MalCare Full Security Features List ==
|
192 |
|
193 |
* #### Cloud Based Malware Scanner
|
194 |
* Daily Scan Frequency
|
205 |
* #### Intelligent Malware Protection
|
206 |
* Web Application Firewall
|
207 |
* IP Whitelisting
|
208 |
+
* CAPTCHA-based Login Page Protection
|
209 |
* Traffic Logs
|
210 |
* Login Logs
|
211 |
* Geo-Blocking
|
260 |
|
261 |
== MalCare vs. Others ==
|
262 |
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
* [MalCare vs Sucuri vs Wordfence by CodeinWP](https://www.codeinwp.com/blog/sucuri-vs-wordfence-vs-malcare/)
|
264 |
* [MalCare vs Sucuri vs Wordfence vs SiteLock vs iThemes Security by WPMayor](https://wpmayor.com/malcare-sucuri-wordfence-sitelock-ithemes-security-comparison/)
|
265 |
|
269 |
Yes. Take the help of this **[step-by-step guide](http://bit.ly/2RKSVCb)**.
|
270 |
|
271 |
=I am unable to reach the security plugin. What can I do?=
|
272 |
+
You can send an email to the support team at support@malcare.com and notify our team regarding this.
|
273 |
|
274 |
=Do you have a free version? How does it work?=
|
275 |
MalCare Security Service has a free version and a premium version. We’ll scan and protect your website with a Firewall in the **[free MalCare version](https://wordpress.org/plugins/malcare-security/)**. You can download the security plugin from the WordPress repository.
|
278 |
|
279 |
To learn more, please take a look at **[MalCare free vs premium page](http://bit.ly/2RMzUPY)**.
|
280 |
|
281 |
+
=How do I upgrade from a free to a premium account?=
|
282 |
+
To upgrade from a free trial version to a premium account, please take the help of **[this guide](http://bit.ly/2RMSBTP)**.
|
283 |
|
284 |
=How do I upgrade to a bigger Plan?=
|
285 |
To upgrade to a bigger Plan, take the help of **[this guide](http://bit.ly/2RMSBTP)**.
|
291 |
MalCare automatic security scans a website once every 24 hours.
|
292 |
|
293 |
=How does MalCare detect complex malware?=
|
294 |
+
MalCare Security Service scans all your website WordPress files beyond just signatures and evaluates them automatically using powerful technology with the collective knowledge of 240,000+ sites. It uses 100 + intelligent signals automatically for deep security scanning and combing through all the files. That is how it detects even the most complex and well-hidden malware on your site.
|
295 |
|
296 |
=Does MalCare affect my site performance?=
|
297 |
No, not at all. MalCare Security Service performs all the heavy lifting of scanning your entire site WordPress files on its own. It does not use your site resources. MalCare Security Service runs its security operations on MalCare servers, thereby ensuring zero loads from its side on your website.
|
304 |
=What do I need to clean my website?=
|
305 |
In order to begin the cleanup process, we need access to your server and its associated files. (Don’t worry, this will not compromise your site’s security).
|
306 |
|
307 |
+
We get this access in the form of FTP, SFTP, or SSH access to your server. FTP stands for File Transfer Protocol, sFTP for Secure File Transfer Protocol, and SSH for Secure Shell. These are connection protocol mechanisms that allow us to log into servers to edit/add/remove files. These connection protocols allow us to log into your websites, specifically the server, and perform the remediation process. If you for some reason are unfamiliar with these protocols, don’t worry, our team of security analysts is prepared to assist you in the process. To do so, you’ll need to be willing to share access information to your hosting account.
|
308 |
|
309 |
We covered how to clean a website **[here](http://bit.ly/2RHzkD2)**. Here’s a guide on **[how to find FTP credentials](http://bit.ly/2RFPeOl)** and another guide on **[how to locate a folder where WordPress is installed](http://bit.ly/2RFPf4R)**.
|
310 |
|
311 |
=How long does it take to clean a site?=
|
312 |
It really depends on the size of the website. In average, **[cleaning up with MalCare Security](http://bit.ly/2RHzkD2)** usually takes 5-10 mins.
|
313 |
|
314 |
+
=How does the Login Page Protection work?=
|
315 |
+
**[MalCare’s Login Protection](http://bit.ly/2RKbDKn)** feature prevents bots from entering your website stealing your data, spamming, and other malicious activities that threaten the security of your site.
|
316 |
|
317 |
=How does the Site Hardening work?=
|
318 |
+
WordPress has recommended a few extra security measures which will harden the security of your website. We have incorporated those recommendations in our Site Hardening feature. Kindly have a look at our guide on **[how to implement Site Hardening](http://bit.ly/2RGnSYt)**.
|
319 |
|
320 |
=How does the Firewall work?=
|
321 |
+
MalCare Security Service was created after analyzing over 240,000 sites from scratch. The Firewall constantly monitors traffic from all places and automatically blocks IPs that seem malicious in nature. As such, it is **[automatically enabled](http://bit.ly/2RKbZAH)** and needs minimal overseeing.
|
322 |
|
323 |
**[MalCare Firewall Security](http://bit.ly/2RKIuyu)** ensures that attacks on your site by even bots are mitigated, without affecting your WordPress site. It monitors bots across a global level without ever overloading your server.
|
324 |
|
325 |
+
=Can I update WordPress core, plugins, and themes directly?=
|
326 |
Yes. Updating WordPress add-ons tightens the security of your website. Take a look at this **[Manage Site help doc](http://bit.ly/2RKhMGr)** to learn how to update WordPress add-ons.
|
327 |
|
328 |
=Can I manage my site users and their password directly?=
|
329 |
Yes. With MalCare managing WordPress, users have become easier. Take the help of this **[Manage Site help doc](http://bit.ly/2RKhMGr)**. Remember to delete the passive user account and encourage users to use a strong password for better security.
|
330 |
|
331 |
+
=Can I add Clients and Team Members to my account?=
|
332 |
Yes, you can.
|
333 |
+
Our client feature is for your reference alone. You can assign a client to their site. If you want to give a user, dashboard access, please add them as your team members under the team section. Please see **[How do I add clients and team members](http://bit.ly/2RKcKtx)**? For the sake of security, give dashboard access to only people you can trust.
|
334 |
|
335 |
=Will MalCare Security work if my site is down?=
|
336 |
We understand the pains of a website going down. If a site goes down after you have **[added the website](http://bit.ly/2ROE7CU)** and **[installed the security plugin](http://bit.ly/2RI7eHW)** from the dashboard, **[MalCare will clean up your site](http://bit.ly/2RHzkD2)**.
|
340 |
=What information does MalCare Security Service store?=
|
341 |
We only store data related to your site structure such as plugins/themes with their respective versions. This helps us identify vulnerabilities that may be present on the site. We track the IPs of visitors to your site, to identify malicious actors who might attack your site.
|
342 |
|
343 |
+
=What makes MalCare Security Service better than other WordPress security plugins?=
|
344 |
MalCare Security Service was developed after analyzing 240,000+ websites.
|
345 |
+
1. It uses 100+ internal signals to Scan and identify the most complex malware.
|
346 |
+
2. It pinpoints the malware’s exact location on your site. It does remote security scanning, to ensure there are Zero loads on your server.
|
347 |
+
3. MalCare comes with an industry-first One-Click Malware removal service that eliminates any malware in a jiffy.
|
348 |
+
4. We alert you only when there is a legitimate malicious discovery rather than 'possible hacks'.
|
349 |
|
350 |
We feel these features set us apart from most other WordPress security plugins. For further information take a look at how MalCare Security Service stands when compared with **[Top Security Plugins](http://bit.ly/2RKFdPG)**.
|
351 |
|
352 |
+
=I already have a backup solution. Something happens to my site, I can simply restore it. Why do I need a security plugin?=
|
353 |
Backups play a very important role in WordPress security, but it has some limitations. We have noticed that in many cases, it is weeks before a site owner realizes that his/her website has been hacked.
|
354 |
|
355 |
During this period multiple backups will be taken, and there will be a high chance that the files that contain the hack or the Malware are also backed up.
|
357 |
In such a case restoring from backup is not sufficient as it will not clean your website. Here is where a Malware solution like MalCare Security Service comes in. It does regular automated security scans of your website and notifies you if there is any sort of Malicious content on your website.
|
358 |
|
359 |
=Isn’t WordPress secure enough?=
|
360 |
+
WordPress core is safe, but the CMS does not work in isolation. Security plugins and themes are part of its ecosystem. Several studies on hacked sites show that plugins and themes are responsible for a majority of such compromises. MalCare Security Service is an easy and effective way of securing websites and keeping them safe from hack attempts. Look at this **[full feature list](http://bit.ly/2RJyRjV)**.
|
361 |
|
362 |
=Why will an SSL certificate not suffice?=
|
363 |
+
An SSL certificate is used only to encrypt a connection between the browser and server to safely transmit sensitive information. However, MalCare Security Service goes beyond and actually protects the database where this information is stored, scans your website files using 100+ intelligent signals automatically, and applications protect from data breaches and the spreading of viruses/malware. These functionalities are not provided by an SSL certificate.
|
364 |
|
365 |
=How is MalCare Security Service the best for agencies or developers?=
|
366 |
We’re the best because of three features:
|
367 |
+
1. We have developer-friendly plans that are easy on the wallet. If you’re a developer or an agency that hosts about 10 websites, the chances are that enterprise-level security packages would be too expensive for you. If you’ve got anything more than seven sites, take a look at our unlimited plans.
|
368 |
+
2. Our auto-clean feature makes sure that you can scan, and clean your sites by yourself, so you don’t waste precious time.
|
369 |
+
3. MalCare’s regular security scans alert you whenever it identifies hacks, so your sites are always secure.
|
370 |
|
371 |
=How does MalCare Security handle WordPress Multisite installs?=
|
372 |
We completely understand the concern and complexities surrounding WordPress Multisite installs. We treat each WordPress install as a license. It means that if you have a network of websites on a single WordPress installation, we treat that as a single license.
|
373 |
|
374 |
=Will MalCare Security Service slow down my website?=
|
375 |
+
MalCare runs on its own servers. We take great care to ensure that we do not add load to your site. We do all the hard work of security scanning, cleaning, and protecting, on our servers and this is our USP.
|
376 |
|
377 |
=Where are my FTP details processed?=
|
378 |
FTP details input into MalCare is processed on our servers. We need your FTP credentials to access your website’s files and folders. We feel that FTP transfer is the safest way to transfer data to and from a site. However, they are treated like payment details (i.e. they’re not stored on our servers). Once we’ve processed them, they’re deleted from our servers.
|
385 |
1. It’s extremely easy to add a website to MalCare’s dashboard. All you need to do is add a URL and install the plugin on your website.
|
386 |
2. MalCare's Early Detecting Technology uses 100+ intelligent signals to detect even the most complex malware that other WordPress security plugins cannot detect.
|
387 |
3. No more waiting for days or hours to clean your website. Clean your website of malicious code with surgical precision in One-Click.
|
388 |
+
4. MalCare offers Login Page Protection which limits the number of failed login attempts made by hackers and bots via Captcha protection.
|
389 |
5. MalCare's Firewall automatically blocks malicious traffic with its intelligent visitor pattern detection technology.
|
390 |
+
6. MalCare helps implement Advanced Website Security Hardening measures to make your site more secure against hackers and bots.
|
391 |
7. MalCare's Geoblocking effectively blocks countries from visiting your site with just a click of a button.
|
392 |
8. MalCare’s Uptime Monitoring notifies if a website goes down so that you can handle the situation before starting to lose visitors.
|
393 |
|
394 |
== CHANGELOG ==
|
395 |
+
= 4.74 =
|
396 |
+
* Enhanced handling of plugin services
|
397 |
+
* Added functionality for realtime sync
|
398 |
+
* Removed deprecated hook
|
399 |
+
* Improvements in identifying plugin updates.
|
400 |
+
|
401 |
= 4.72 =
|
402 |
* Sync Improvements
|
|
|
403 |
|
404 |
= 4.69 =
|
405 |
* Improved network call efficiency for site info callbacks.
|
541 |
* Request profling and logging
|
542 |
|
543 |
= 1.89 =
|
544 |
+
* Firewall improvements
|
545 |
|
546 |
= 1.88 =
|
547 |
* Callback improvements
|
wp_actions.php
CHANGED
@@ -27,18 +27,21 @@ if (!class_exists('MCWPAction')) :
|
|
27 |
} else {
|
28 |
MCAccount::setup($this->settings);
|
29 |
}
|
|
|
30 |
}
|
31 |
|
32 |
public function deactivate() {
|
33 |
$info = array();
|
34 |
$this->siteinfo->basic($info);
|
|
|
35 |
$this->bvapi->pingbv('/bvapi/deactivate', $info);
|
36 |
}
|
37 |
|
38 |
public static function uninstall() {
|
39 |
do_action('clear_pt_config');
|
40 |
do_action('clear_ip_store');
|
41 |
-
|
|
|
42 |
do_action('clear_bv_services_config');
|
43 |
}
|
44 |
|
@@ -46,6 +49,8 @@ if (!class_exists('MCWPAction')) :
|
|
46 |
$this->settings->deleteOption($this->bvinfo->services_option_name);
|
47 |
}
|
48 |
|
|
|
|
|
49 |
public function footerHandler() {
|
50 |
$bvfooter = $this->settings->getOption($this->bvinfo->badgeinfo);
|
51 |
if ($bvfooter) {
|
27 |
} else {
|
28 |
MCAccount::setup($this->settings);
|
29 |
}
|
30 |
+
##ENABLECACHE##
|
31 |
}
|
32 |
|
33 |
public function deactivate() {
|
34 |
$info = array();
|
35 |
$this->siteinfo->basic($info);
|
36 |
+
##DISABLECACHE##
|
37 |
$this->bvapi->pingbv('/bvapi/deactivate', $info);
|
38 |
}
|
39 |
|
40 |
public static function uninstall() {
|
41 |
do_action('clear_pt_config');
|
42 |
do_action('clear_ip_store');
|
43 |
+
do_action('clear_dynsync_config');
|
44 |
+
##CLEARCACHECONFIG##
|
45 |
do_action('clear_bv_services_config');
|
46 |
}
|
47 |
|
49 |
$this->settings->deleteOption($this->bvinfo->services_option_name);
|
50 |
}
|
51 |
|
52 |
+
##SOUNINSTALLFUNCTION##
|
53 |
+
|
54 |
public function footerHandler() {
|
55 |
$bvfooter = $this->settings->getOption($this->bvinfo->badgeinfo);
|
56 |
if ($bvfooter) {
|
wp_api.php
CHANGED
@@ -11,11 +11,11 @@ if (!class_exists('MCWPAPI')) :
|
|
11 |
|
12 |
public function pingbv($method, $body, $public = false) {
|
13 |
if ($public) {
|
14 |
-
$this->do_request($method, $body, $public);
|
15 |
} else {
|
16 |
$api_public_key = $this->settings->getOption('bvApiPublic');
|
17 |
if (!empty($api_public_key) && (strlen($api_public_key) >= 32)) {
|
18 |
-
$this->do_request($method, $body, $api_public_key);
|
19 |
}
|
20 |
}
|
21 |
}
|
@@ -24,7 +24,7 @@ if (!class_exists('MCWPAPI')) :
|
|
24 |
$account = MCAccount::find($this->settings, $pubkey);
|
25 |
if (isset($account)) {
|
26 |
$url = $account->authenticatedUrl($method);
|
27 |
-
$this->http_request($url, $body);
|
28 |
}
|
29 |
}
|
30 |
|
11 |
|
12 |
public function pingbv($method, $body, $public = false) {
|
13 |
if ($public) {
|
14 |
+
return $this->do_request($method, $body, $public);
|
15 |
} else {
|
16 |
$api_public_key = $this->settings->getOption('bvApiPublic');
|
17 |
if (!empty($api_public_key) && (strlen($api_public_key) >= 32)) {
|
18 |
+
return $this->do_request($method, $body, $api_public_key);
|
19 |
}
|
20 |
}
|
21 |
}
|
24 |
$account = MCAccount::find($this->settings, $pubkey);
|
25 |
if (isset($account)) {
|
26 |
$url = $account->authenticatedUrl($method);
|
27 |
+
return $this->http_request($url, $body);
|
28 |
}
|
29 |
}
|
30 |
|
wp_db.php
CHANGED
@@ -92,6 +92,14 @@ class MCWPDb {
|
|
92 |
return $this->isTablePresent($table);
|
93 |
}
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
public function alterBVTable($query, $name) {
|
96 |
$resp = false;
|
97 |
$table = $this->getBVTable($name);
|
@@ -101,6 +109,14 @@ class MCWPDb {
|
|
101 |
return $resp;
|
102 |
}
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
public function getTableContent($table, $fields = '*', $filter = '', $limit = 0, $offset = 0) {
|
105 |
$query = "SELECT $fields from $table $filter";
|
106 |
if ($limit > 0)
|
@@ -154,6 +170,22 @@ class MCWPDb {
|
|
154 |
return !$this->isTablePresent($table);
|
155 |
}
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
public function deleteRowsFromtable($name, $count = 1) {
|
158 |
$table = $this->getBVTable($name);
|
159 |
if ($this->isTablePresent($table)) {
|
92 |
return $this->isTablePresent($table);
|
93 |
}
|
94 |
|
95 |
+
public function createTables($tables, $usedbdelta = false) {
|
96 |
+
$result = array();
|
97 |
+
foreach ($tables as $table => $query) {
|
98 |
+
$result[$table] = $this->createTable($query, $table, $usedbdelta);
|
99 |
+
}
|
100 |
+
return $result;
|
101 |
+
}
|
102 |
+
|
103 |
public function alterBVTable($query, $name) {
|
104 |
$resp = false;
|
105 |
$table = $this->getBVTable($name);
|
109 |
return $resp;
|
110 |
}
|
111 |
|
112 |
+
public function alterTables($tables) {
|
113 |
+
$result = array();
|
114 |
+
foreach ($tables as $table => $query) {
|
115 |
+
$result[$table] = $this->alterBVTable($query, $table);
|
116 |
+
}
|
117 |
+
return $result;
|
118 |
+
}
|
119 |
+
|
120 |
public function getTableContent($table, $fields = '*', $filter = '', $limit = 0, $offset = 0) {
|
121 |
$query = "SELECT $fields from $table $filter";
|
122 |
if ($limit > 0)
|
170 |
return !$this->isTablePresent($table);
|
171 |
}
|
172 |
|
173 |
+
public function dropTables($tables) {
|
174 |
+
$result = array();
|
175 |
+
foreach ($tables as $table) {
|
176 |
+
$result[$table] = $this->dropBVTable($table);
|
177 |
+
}
|
178 |
+
return $result;
|
179 |
+
}
|
180 |
+
|
181 |
+
public function truncateTables($tables) {
|
182 |
+
$result = array();
|
183 |
+
foreach ($tables as $table) {
|
184 |
+
$result[$table] = $this->truncateBVTable($table);
|
185 |
+
}
|
186 |
+
return $result;
|
187 |
+
}
|
188 |
+
|
189 |
public function deleteRowsFromtable($name, $count = 1) {
|
190 |
$table = $this->getBVTable($name);
|
191 |
if ($this->isTablePresent($table)) {
|
wp_dynsync.php
ADDED
@@ -0,0 +1,693 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH')) exit;
|
4 |
+
if (!class_exists('BVWPDynSync')) :
|
5 |
+
|
6 |
+
class BVWPDynSync {
|
7 |
+
|
8 |
+
public static $dynsync_table = 'dynamic_sync';
|
9 |
+
public $db;
|
10 |
+
public $settings;
|
11 |
+
|
12 |
+
public function __construct($db, $settings, $config) {
|
13 |
+
$this->db = $db;
|
14 |
+
$this->settings = $settings;
|
15 |
+
$this->config = $config;
|
16 |
+
$this->ignored_events = array_key_exists('ignored_events', $config) ? $config['ignored_events'] : array();
|
17 |
+
}
|
18 |
+
|
19 |
+
function init() {
|
20 |
+
$this->add_actions_and_listeners();
|
21 |
+
add_action('clear_dynsync_config', array($this, 'clearConfig'));
|
22 |
+
}
|
23 |
+
|
24 |
+
public function clearConfig() {
|
25 |
+
$this->db->dropBVTable(BVWPDynSync::$dynsync_table);
|
26 |
+
}
|
27 |
+
|
28 |
+
function add_event($event_type, $event_data) {
|
29 |
+
global $wp_current_filter;
|
30 |
+
$site_id = get_current_blog_id();
|
31 |
+
$values = array ( "event_type" => $event_type, "event_tag" => end($wp_current_filter), "event_data" => maybe_serialize($event_data), "site_id" => $site_id);
|
32 |
+
$this->db->replaceIntoBVTable(BVWPDynSync::$dynsync_table, $values);
|
33 |
+
}
|
34 |
+
|
35 |
+
function add_db_event($table, $message) {
|
36 |
+
$_msg = array();
|
37 |
+
$_msg['table'] = $table;
|
38 |
+
$_msg['data'] = $message;
|
39 |
+
$this->add_event('db', $_msg);
|
40 |
+
}
|
41 |
+
|
42 |
+
function post_action_handler($post_id) {
|
43 |
+
if (current_filter() == 'delete_post')
|
44 |
+
$msg_type = 'delete';
|
45 |
+
else
|
46 |
+
$msg_type = 'edit';
|
47 |
+
$this->add_db_event('posts', array('ID' => $post_id, 'msg_type' => $msg_type));
|
48 |
+
}
|
49 |
+
|
50 |
+
function get_ignored_postmeta() {
|
51 |
+
$defaults = array(
|
52 |
+
'_excluded_links'
|
53 |
+
);
|
54 |
+
$ignored_postmeta = $this->ignored_events['postmeta'];
|
55 |
+
if (empty($ignored_postmeta)) {
|
56 |
+
$ignored_postmeta = array();
|
57 |
+
}
|
58 |
+
return array_unique(array_merge($defaults, $ignored_postmeta));
|
59 |
+
}
|
60 |
+
|
61 |
+
function postmeta_insert_handler($meta_id, $post_id, $meta_key, $meta_value='') {
|
62 |
+
if (in_array($meta_key, $this->get_ignored_postmeta(), true))
|
63 |
+
return;
|
64 |
+
$this->add_db_event('postmeta', array('meta_id' => $meta_id));
|
65 |
+
}
|
66 |
+
|
67 |
+
function postmeta_modification_handler($meta_id, $object_id, $meta_key, $meta_value) {
|
68 |
+
if (in_array($meta_key, $this->get_ignored_postmeta(), true))
|
69 |
+
return;
|
70 |
+
if (!is_array($meta_id))
|
71 |
+
return $this->add_db_event('postmeta', array('meta_id' => $meta_id));
|
72 |
+
foreach ($meta_id as $id) {
|
73 |
+
$this->add_db_event('postmeta', array('meta_id' => $id));
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
function postmeta_action_handler($meta_id, $post_id = null, $meta_key = null) {
|
78 |
+
if (in_array($meta_key, $this->get_ignored_postmeta(), true))
|
79 |
+
return;
|
80 |
+
if ( !is_array($meta_id) )
|
81 |
+
return $this->add_db_event('postmeta', array('meta_id' => $meta_id));
|
82 |
+
foreach ( $meta_id as $id )
|
83 |
+
$this->add_db_event('postmeta', array('meta_id' => $id));
|
84 |
+
}
|
85 |
+
|
86 |
+
function comment_action_handler($comment_id) {
|
87 |
+
if (current_filter() == 'delete_comment')
|
88 |
+
$msg_type = 'delete';
|
89 |
+
else
|
90 |
+
$msg_type = 'edit';
|
91 |
+
if (!is_array($comment_id)) {
|
92 |
+
if (wp_get_comment_status($comment_id) != 'spam')
|
93 |
+
$this->add_db_event('comments', array('comment_ID' => $comment_id, 'msg_type' => $msg_type));
|
94 |
+
} else {
|
95 |
+
foreach ($comment_id as $id) {
|
96 |
+
if (wp_get_comment_status($comment_id) != 'spam')
|
97 |
+
$this->add_db_event('comments', array('comment_ID' => $id, 'msg_type' => $msg_type));
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
function commentmeta_insert_handler($meta_id, $comment_id = null) {
|
103 |
+
if (empty($comment_id) || wp_get_comment_status($comment_id) != 'spam')
|
104 |
+
$this->add_db_event('commentmeta', array('meta_id' => $meta_id));
|
105 |
+
}
|
106 |
+
|
107 |
+
function commentmeta_modification_handler($meta_id, $object_id, $meta_key, $meta_value) {
|
108 |
+
if (current_filter() == 'deleted_comment_meta')
|
109 |
+
$msg_type = 'delete';
|
110 |
+
else
|
111 |
+
$msg_type = 'edit';
|
112 |
+
if (!is_array($meta_id))
|
113 |
+
return $this->add_db_event('commentmeta', array('meta_id' => $meta_id, 'msg_type' => $msg_type));
|
114 |
+
foreach ($meta_id as $id) {
|
115 |
+
$this->add_db_event('commentmeta', array('meta_id' => $id, 'msg_type' => $msg_type));
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
function userid_action_handler($user_or_id) {
|
120 |
+
if (is_object($user_or_id))
|
121 |
+
$userid = intval( $user_or_id->ID );
|
122 |
+
else
|
123 |
+
$userid = intval( $user_or_id );
|
124 |
+
if ( !$userid )
|
125 |
+
return;
|
126 |
+
if (current_filter() == 'deleted_user')
|
127 |
+
$msg_type = 'delete';
|
128 |
+
else
|
129 |
+
$msg_type = 'edit';
|
130 |
+
|
131 |
+
$this->add_db_event('users', array('ID' => $userid));
|
132 |
+
}
|
133 |
+
|
134 |
+
function usermeta_insert_handler($umeta_id, $user_id = null) {
|
135 |
+
$this->add_db_event('usermeta', array('umeta_id' => $umeta_id));
|
136 |
+
}
|
137 |
+
|
138 |
+
function usermeta_modification_handler($umeta_id, $object_id, $meta_key, $meta_value = '') {
|
139 |
+
if (current_filter() == 'delete_usermeta')
|
140 |
+
$msg_type = 'delete';
|
141 |
+
else
|
142 |
+
$msg_type = 'edit';
|
143 |
+
if (!is_array($umeta_id))
|
144 |
+
return $this->add_db_event('usermeta', array('umeta_id' => $umeta_id, 'msg_type' => $msg_type));
|
145 |
+
foreach ($umeta_id as $id) {
|
146 |
+
$this->add_db_event('usermeta', array('umeta_id' => $id, 'msg_type' => $msg_type));
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
function link_action_handler($link_id) {
|
151 |
+
$this->add_db_event('links', array('link_id' => $link_id));
|
152 |
+
}
|
153 |
+
|
154 |
+
function edited_terms_handler($term_id, $taxonomy = null) {
|
155 |
+
$this->add_db_event('terms', array('term_id' => $term_id));
|
156 |
+
}
|
157 |
+
|
158 |
+
function term_handler($term_id, $tt_id, $taxonomy) {
|
159 |
+
$this->add_db_event('terms', array('term_id' => $term_id));
|
160 |
+
$this->term_taxonomy_handler($tt_id, $taxonomy);
|
161 |
+
}
|
162 |
+
|
163 |
+
function delete_term_handler($term, $tt_id, $taxonomy, $deleted_term ) {
|
164 |
+
$this->add_db_event('terms', array('term_id' => $term, 'msg_type' => 'delete'));
|
165 |
+
}
|
166 |
+
|
167 |
+
function term_taxonomy_handler($tt_id, $taxonomy = null) {
|
168 |
+
$this->add_db_event('term_taxonomy', array('term_taxonomy_id' => $tt_id));
|
169 |
+
}
|
170 |
+
|
171 |
+
function term_taxonomies_handler($tt_ids) {
|
172 |
+
foreach((array)$tt_ids as $tt_id) {
|
173 |
+
$this->term_taxonomy_handler($tt_id);
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
function term_relationship_handler($object_id, $term_id) {
|
178 |
+
$this->add_db_event('term_relationships', array('term_taxonomy_id' => $term_id, 'object_id' => $object_id));
|
179 |
+
}
|
180 |
+
|
181 |
+
function term_relationships_handler($object_id, $term_ids) {
|
182 |
+
foreach ((array)$term_ids as $term_id) {
|
183 |
+
$this->term_relationship_handler($object_id, $term_id);
|
184 |
+
}
|
185 |
+
}
|
186 |
+
|
187 |
+
function set_object_terms_handler( $object_id, $terms, $tt_ids ) {
|
188 |
+
$this->term_relationships_handler( $object_id, $tt_ids );
|
189 |
+
}
|
190 |
+
|
191 |
+
function get_ignored_options() {
|
192 |
+
$defaults = array(
|
193 |
+
'cron',
|
194 |
+
'wpsupercache_gc_time',
|
195 |
+
'rewrite_rules',
|
196 |
+
'akismet_spam_count',
|
197 |
+
'iwp_client_user_hit_count',
|
198 |
+
'_disqus_sync_lock',
|
199 |
+
'stats_cache'
|
200 |
+
);
|
201 |
+
$ignored_options = $this->ignored_events['options'];
|
202 |
+
if (empty($ignored_options)) {
|
203 |
+
$ignored_options = array();
|
204 |
+
}
|
205 |
+
return array_unique(array_merge($defaults, $ignored_options));
|
206 |
+
}
|
207 |
+
|
208 |
+
function get_ping_permission($option_name) {
|
209 |
+
$ping_permitted = true;
|
210 |
+
$ignored_options = $this->get_ignored_options();
|
211 |
+
foreach($ignored_options as $val) {
|
212 |
+
if ($val[0] == '/') {
|
213 |
+
if (preg_match($val, $option_name))
|
214 |
+
$ping_permitted = false;
|
215 |
+
} else {
|
216 |
+
if ($val == $option_name)
|
217 |
+
$ping_permitted = false;
|
218 |
+
}
|
219 |
+
if (!$ping_permitted)
|
220 |
+
break;
|
221 |
+
}
|
222 |
+
return $ping_permitted;
|
223 |
+
}
|
224 |
+
|
225 |
+
function option_handler($option_name) {
|
226 |
+
if (current_filter() == 'deleted_option')
|
227 |
+
$msg_type = 'delete';
|
228 |
+
else
|
229 |
+
$msg_type = 'edit';
|
230 |
+
$ping_permitted = $this->get_ping_permission($option_name);
|
231 |
+
if ($ping_permitted)
|
232 |
+
$this->add_db_event('options', array('option_name' => $option_name, 'msg_type' => $msg_type));
|
233 |
+
return $option_name;
|
234 |
+
}
|
235 |
+
|
236 |
+
function theme_action_handler($theme) {
|
237 |
+
$this->add_event('themes', array('theme' => $this->settings->getOption('stylesheet')));
|
238 |
+
}
|
239 |
+
|
240 |
+
function plugin_action_handler($plugin='') {
|
241 |
+
$this->add_event('plugins', array('name' => $plugin));
|
242 |
+
}
|
243 |
+
|
244 |
+
function upload_handler($file) {
|
245 |
+
$this->add_event('uploads', array('file' => $file['file']));
|
246 |
+
return $file;
|
247 |
+
}
|
248 |
+
|
249 |
+
function attachment_metadata_handler($data = null, $post_id = null) {
|
250 |
+
if(!empty($data) && !empty($data['file'])) {
|
251 |
+
$this->add_event('uploads', array('file' => $data['file'], 'sizes' => $data['sizes']));
|
252 |
+
}
|
253 |
+
return $data;
|
254 |
+
}
|
255 |
+
|
256 |
+
function wpmu_new_blog_create_handler($site_id) {
|
257 |
+
$this->add_db_event('blogs', array('site_id' => $site_id));
|
258 |
+
}
|
259 |
+
|
260 |
+
function sitemeta_handler($option) {
|
261 |
+
$ping_permitted = $this->get_ping_permission($option);
|
262 |
+
if ($ping_permitted && is_multisite()) {
|
263 |
+
$this->add_db_event('sitemeta', array('site_id' => $this->db->getSiteId(), 'meta_key' => $option));
|
264 |
+
}
|
265 |
+
return $ping_permitted;
|
266 |
+
}
|
267 |
+
|
268 |
+
/* WOOCOMMERCE SUPPORT FUNCTIONS BEGINS FROM HERE*/
|
269 |
+
|
270 |
+
function woocommerce_resume_order_handler($order_id) {
|
271 |
+
$this->add_db_event('woocommerce_order_items', array('order_id' => $order_id, 'msg_type' => 'delete'));
|
272 |
+
$meta_ids = array();
|
273 |
+
$itemmeta_table = $this->db->getWPTable('woocommerce_order_itemmeta');
|
274 |
+
$items_table = $this->db->getWPTable('woocommerce_order_items');
|
275 |
+
foreach( $this->db->getResult($this->db->prepare("SELECT {$itemmeta_table}.meta_id FROM {$itemmeta_table} INNER JOIN {$items_table} WHERE {$items_table}.order_item_id = {$itemmeta_table}.order_item_id AND {$items_table}.order_id = %d", $order_id)) as $key => $row) {
|
276 |
+
if (!in_array($row->meta_id, $meta_ids, true)) {
|
277 |
+
$meta_ids[] = $row->meta_id;
|
278 |
+
$this->add_db_event('woocommerce_order_itemmeta', array('meta_id' => $row->meta_id, 'msg_type' => 'delete'));
|
279 |
+
}
|
280 |
+
}
|
281 |
+
}
|
282 |
+
|
283 |
+
function woocommerce_new_order_item_handler($item_id, $item, $order_id) {
|
284 |
+
$this->add_db_event('woocommerce_order_items', array('order_item_id' => $item_id));
|
285 |
+
$this->add_db_event('woocommerce_order_itemmeta', array('order_item_id' => $item_id));
|
286 |
+
}
|
287 |
+
|
288 |
+
function woocommerce_update_order_item_handler($item_id, $args){
|
289 |
+
$this->add_db_event('woocommerce_order_items', array('order_item_id' => $item_id));
|
290 |
+
}
|
291 |
+
|
292 |
+
function woocommerce_delete_order_item_handler($item_id) {
|
293 |
+
$this->add_db_event('woocommerce_order_itemmeta', array('order_item_id' => $item_id, 'msg_type' => 'delete'));
|
294 |
+
$this->add_db_event('woocommerce_order_items', array('order_item_id' => $item_id, 'msg_type' => 'delete'));
|
295 |
+
}
|
296 |
+
|
297 |
+
function woocommerce_attribute_added_handler($attribute_id, $attribute) {
|
298 |
+
$this->add_db_event('woocommerce_attribute_taxonomies', array('attribute_id' => $attribute_id));
|
299 |
+
}
|
300 |
+
|
301 |
+
function woocommerce_attribute_updated_handler($attribute_id, $attribute, $old_attribute_name) {
|
302 |
+
$this->add_db_event('woocommerce_attribute_taxonomies', array('attribute_id' => $attribute_id));
|
303 |
+
# $woocommerce->attribute_taxonomy_name( $attribute_name )
|
304 |
+
$this->add_db_event('term_taxonomy', array('taxonomy' => wc_attribute_taxonomy_name($attribute['attribute_name'])));
|
305 |
+
# sanitize_title( $attribute_name )
|
306 |
+
$this->add_db_event('woocommerce_termmeta', array('meta_key' => 'order_pa_' . $attribute['attribute_name']));#deprecated
|
307 |
+
$this->add_db_event('termmeta', array('meta_key' => 'order_pa_' . $attribute['attribute_name']));
|
308 |
+
$this->add_db_event('postmeta', array('meta_key' => '_product_attributes'));
|
309 |
+
# sanitize_title( $attribute_name )
|
310 |
+
$this->add_db_event('postmeta', array('meta_key' => 'attribute_pa_' . $attribute['attribute_name']));
|
311 |
+
}
|
312 |
+
|
313 |
+
function woocommerce_attribute_deleted_handler($attribute_id, $attribute_name, $taxonomy) {
|
314 |
+
return $this->add_db_event('woocommerce_attribute_taxonomies', array('attribute_id' => $attribute_id, 'msg_type' => 'delete'));
|
315 |
+
}
|
316 |
+
|
317 |
+
function woocommerce_revoke_access_to_product_download_handler($download_id, $product_id, $order_id, $permission_id ) {
|
318 |
+
$this->add_db_event('woocommerce_downloadable_product_permissions', array('permission_id' => $permission_id, 'msg_type' => 'delete'));
|
319 |
+
}
|
320 |
+
|
321 |
+
function woocommerce_tax_rate_handler($tax_rate_id, $_tax_rate) {
|
322 |
+
$this->add_db_event('woocommerce_tax_rates', array('tax_rate_id' => $tax_rate_id));
|
323 |
+
$this->add_db_event('woocommerce_tax_rate_locations', array('tax_rate_id' => $tax_rate_id));
|
324 |
+
}
|
325 |
+
|
326 |
+
function woocommerce_tax_rate_deleted_handler($tax_rate_id) {
|
327 |
+
$this->add_db_event('woocommerce_tax_rates', array('tax_rate_id' => $tax_rate_id, 'msg_type' => 'delete'));
|
328 |
+
$this->add_db_event('woocommerce_tax_rate_locations', array('tax_rate_id' => $tax_rate_id, 'msg_type' => 'delete'));
|
329 |
+
}
|
330 |
+
|
331 |
+
function woocommerce_grant_product_download_access_handler($data) {
|
332 |
+
$this->add_db_event('woocommerce_downloadable_product_permissions', array('download_id' => $data['download_id'], 'user_id' => $data['user_id'], 'order_id' => $data['order_id'], 'product_id' => $data['product_id']));
|
333 |
+
}
|
334 |
+
|
335 |
+
function woocommerce_download_product_handler($user_email, $order_key, $product_id, $user_id, $download_id, $order_id) {
|
336 |
+
$this->add_db_event('woocommerce_downloadable_product_permissions', array('order_id' => $order_id, 'user_id' => $user_id, 'order_key' => $order_key, 'product_id' => $product_id));
|
337 |
+
}
|
338 |
+
|
339 |
+
function woocommerce_delete_order_items_handler($postid) {
|
340 |
+
$meta_ids = array();
|
341 |
+
$order_item_ids = array();
|
342 |
+
foreach( $this->db->getResult("SELECT {$this->db->dbprefix()}woocommerce_order_itemmeta.meta_id, {$this->db->dbprefix()}woocommerce_order_items.order_item_id FROM {$this->db->dbprefix()}woocommerce_order_items JOIN {$this->db->dbprefix()}woocommerce_order_itemmeta ON {$this->db->dbprefix()}woocommerce_order_items.order_item_id = {$this->db->dbprefix()}woocommerce_order_itemmeta.order_item_id WHERE {$this->db->dbprefix()}woocommerce_order_items.order_id = '{$postid}'") as $key => $row) {
|
343 |
+
if (!in_array($row['meta_id'], $meta_ids, true)) {
|
344 |
+
$meta_ids[] = $row['meta_id'];
|
345 |
+
$this->add_db_event('woocommerce_order_itemmeta', array('meta_id' => $row['meta_id'], 'msg_type' => 'delete'));
|
346 |
+
}
|
347 |
+
if (!in_array($row['order_item_id'], $order_item_ids, true)) {
|
348 |
+
$order_item_ids[] = $row['order_item_id'];
|
349 |
+
$this->add_db_event('woocommerce_order_items', array('order_item_id' => $row['order_item_id'], 'msg_type' => 'delete'));
|
350 |
+
}
|
351 |
+
}
|
352 |
+
}
|
353 |
+
|
354 |
+
function woocommerce_payment_token_handler($token_id) {
|
355 |
+
$this->add_db_event('woocommerce_payment_tokens', array('token_id' => $token_id));
|
356 |
+
}
|
357 |
+
|
358 |
+
function woocommerce_payment_token_deleted_handler($token_id, $object) {
|
359 |
+
$this->add_db_event('woocommerce_payment_tokens', array('token_id' => $token_id, 'msg_type' => 'delete'));
|
360 |
+
$this->add_db_event('woocommerce_payment_tokenmeta', array('payment_token_id' => $token_id, 'msg_type' => 'delete'));
|
361 |
+
}
|
362 |
+
|
363 |
+
function woocommerce_shipping_zone_method_added_handler($instance_id, $method_id, $zone_id) {
|
364 |
+
$this->add_db_event('woocommerce_shipping_zone_methods', array('instance_id' => $instance_id));
|
365 |
+
$this->add_db_event('woocommerce_shipping_zones', array('zone_id' => $zone_id));
|
366 |
+
$this->add_db_event('woocommerce_shipping_zone_locations', array('zone_id' => $zone_id));
|
367 |
+
}
|
368 |
+
|
369 |
+
function woocommerce_shipping_zone_method_deleted_handler($instance_id, $method_id, $zone_id) {
|
370 |
+
$this->add_db_event('woocommerce_shipping_zone_methods', array('instance_id' => $instance_id, 'msg_type' => 'delete'));
|
371 |
+
}
|
372 |
+
|
373 |
+
function woocommerce_shipping_zone_method_status_toggled_handler($instance_id, $method_id, $zone_id, $is_enabled) {
|
374 |
+
$this->add_db_event('woocommerce_shipping_zone_methods', array('instance_id' => absint( $instance_id )));
|
375 |
+
}
|
376 |
+
|
377 |
+
function woocommerce_deleted_order_downloadable_permissions_handler($post_id) {
|
378 |
+
$this->add_db_event('woocommerce_downloadable_product_permissions', array('order_id' => $post_id, 'msg_type' => 'delete'));
|
379 |
+
}
|
380 |
+
|
381 |
+
function woocommerce_delete_shipping_zone_handler($zone_id) {
|
382 |
+
$this->add_db_event('woocommerce_shipping_zone_methods', array('zone_id' => $zone_id, 'msg_type' => 'delete'));
|
383 |
+
$this->add_db_event('woocommerce_shipping_zone_locations', array('zone_id' => $zone_id, 'msg_type' => 'delete'));
|
384 |
+
$this->add_db_event('woocommerce_shipping_zones', array('zone_id' => $zone_id, 'msg_type' => 'delete'));
|
385 |
+
}
|
386 |
+
|
387 |
+
function woocommerce_webhook_handler($webhook_id) {
|
388 |
+
$this->add_db_event('wc_webhooks', array('webhook_id' => $webhook_id));
|
389 |
+
}
|
390 |
+
|
391 |
+
function woocommerce_webhook_delete_handler($webhook_id, $webhook) {
|
392 |
+
$this->add_db_event('wc_webhooks', array('webhook_id' => $webhook_id, 'msg_type' => 'delete'));
|
393 |
+
}
|
394 |
+
|
395 |
+
function woocommerce_delete_shipping_zone_method_handler($instance_id) {
|
396 |
+
$this->add_db_event('woocommerce_shipping_zone_methods', array('instance_id' => $instance_id, 'msg_type' => 'delete'));
|
397 |
+
}
|
398 |
+
|
399 |
+
function woocommerce_order_term_meta_handler($meta_id, $object_id, $meta_key, $meta_value) {
|
400 |
+
if (current_filter() == 'deleted_order_item_meta')
|
401 |
+
$msg_type = 'delete';
|
402 |
+
else
|
403 |
+
$msg_type = 'edit';
|
404 |
+
if (!is_array($meta_id)) {
|
405 |
+
$this->add_db_event('woocommerce_order_itemmeta', array('meta_id' => $meta_id, 'msg_type' => $msg_type));
|
406 |
+
} else {
|
407 |
+
foreach ($meta_id as $id) {
|
408 |
+
$this->add_db_event('woocommerce_order_itemmeta', array('meta_id' => $id, 'msg_type' => $msg_type));
|
409 |
+
}
|
410 |
+
}
|
411 |
+
}
|
412 |
+
|
413 |
+
function woocommerce_payment_token_meta_handler($meta_id, $object_id, $meta_key, $meta_value) {
|
414 |
+
if (current_filter() == 'deleted_payment_token_meta')
|
415 |
+
$msg_type = 'delete';
|
416 |
+
else
|
417 |
+
$msg_type = 'edit';
|
418 |
+
if (!is_array($meta_id)) {
|
419 |
+
$this->add_db_event('woocommerce_payment_tokenmeta', array('meta_id' => $meta_id, 'msg_type' => $msg_type));
|
420 |
+
} else {
|
421 |
+
foreach ($meta_id as $id) {
|
422 |
+
$this->add_db_event('woocommerce_payment_tokenmeta', array('meta_id' => $id, 'msg_type' => $msg_type));
|
423 |
+
}
|
424 |
+
}
|
425 |
+
}
|
426 |
+
|
427 |
+
function woocommerce_api_product_attribute_handler($id, $data) {
|
428 |
+
$this->add_db_event('woocommerce_attribute_taxonomies', array('attribute_id' => $id));
|
429 |
+
}
|
430 |
+
|
431 |
+
function woocommerce_note_created_handler($note_id) {
|
432 |
+
$this->add_db_event('wc_admin_notes', array('note_id' => $note_id));
|
433 |
+
$this->add_db_event('wc_admin_note_actions', array('note_id' => $note_id));
|
434 |
+
}
|
435 |
+
|
436 |
+
function woocommerce_note_modification_handler($note_id) {
|
437 |
+
if (current_filter() == 'wooocommerce_note_deleted')
|
438 |
+
$msg_type = 'delete';
|
439 |
+
else
|
440 |
+
$msg_type = 'edit';
|
441 |
+
$this->add_db_event('wc_admin_notes', array('note_id' => $note_id, 'msg_type' => $msg_type));
|
442 |
+
$this->add_db_event('wc_admin_note_actions', array('note_id' => $note_id, 'msg_type' => $msg_type));
|
443 |
+
}
|
444 |
+
|
445 |
+
function woocommerce_analytics_order_stats_modification_handler($order_id) {
|
446 |
+
if (current_filter() == 'woocommerce_analytics_delete_order_stats')
|
447 |
+
$msg_type = 'delete';
|
448 |
+
else
|
449 |
+
$msg_type = 'edit';
|
450 |
+
$this->add_db_event('wc_order_stats', array('order_id' => $order_id, 'msg_type' => $msg_type));
|
451 |
+
}
|
452 |
+
|
453 |
+
function woocommerce_analytics_product_update_handler($order_item_id, $order_id) {
|
454 |
+
$this->add_db_event('wc_order_product_lookup', array('order_item_id' => $order_item_id, 'msg_type' => 'edit'));
|
455 |
+
}
|
456 |
+
|
457 |
+
function woocommerce_analytics_product_delete_handler($order_item_id, $order_id) {
|
458 |
+
$this->add_db_event('wc_order_product_lookup', array('order_id' => $order_id, 'msg_type' => 'delete'));
|
459 |
+
}
|
460 |
+
|
461 |
+
function woocommerce_analytics_new_customer_handler($customer_id) {
|
462 |
+
$this->add_db_event('wc_customer_lookup', array('customer_id' => $customer_id));
|
463 |
+
}
|
464 |
+
|
465 |
+
function woocommerce_analytics_customer_modification_handler($customer_id) {
|
466 |
+
if (current_filter() == 'woocommerce_analytics_delete_customer')
|
467 |
+
$msg_type = 'delete';
|
468 |
+
else
|
469 |
+
$msg_type = 'edit';
|
470 |
+
$this->add_db_event('wc_customer_lookup', array('customer_id' => $customer_id, 'msg_type' => $msg_type));
|
471 |
+
}
|
472 |
+
|
473 |
+
function woocommerce_analytics_coupon_update_handler($coupon_id, $order_id) {
|
474 |
+
$this->add_db_event('wc_order_coupon_lookup', array('coupon_id' => $coupon_id, 'order_id' => $order_id, 'msg_type' => 'edit'));
|
475 |
+
}
|
476 |
+
|
477 |
+
function woocommerce_analytics_coupon_delete_handler($coupon_id, $order_id) {
|
478 |
+
$this->add_db_event('wc_order_coupon_lookup', array('order_id' => $order_id, 'msg_type' => 'delete'));
|
479 |
+
}
|
480 |
+
|
481 |
+
function woocommerce_analytics_tax_update_handler($tax_rate_id, $order_id) {
|
482 |
+
$this->add_db_event('wc_order_tax_lookup', array('tax_rate_id' => $tax_rate_id, 'order_id' => $order_id, 'msg_type' => 'edit'));
|
483 |
+
}
|
484 |
+
|
485 |
+
function woocommerce_analytics_tax_delete_handler($tax_rate_id, $order_id) {
|
486 |
+
$this->add_db_event('wc_order_tax_lookup', array('order_id' => $order_id, 'msg_type' => 'delete'));
|
487 |
+
}
|
488 |
+
|
489 |
+
function woocommerce_product_update_handler($product_id) {
|
490 |
+
$this->add_db_event('wc_product_meta_lookup', array('product_id' => $product_id, 'msg_type' => 'edit'));
|
491 |
+
}
|
492 |
+
|
493 |
+
function woocommerce_trash_untrash_post_handler($post_id) {
|
494 |
+
if (!$post_id) {
|
495 |
+
return;
|
496 |
+
}
|
497 |
+
$results = $this->db->getResult($this->db->prepare("SELECT ID FROM {$this->db->dbprefix()}posts WHERE post_type = 'shop_order_refund' AND post_parent = %d", $post_id));
|
498 |
+
foreach ( $results as $post ) {
|
499 |
+
$this->add_db_event('posts', array('ID' => $post['ID']));
|
500 |
+
}
|
501 |
+
}
|
502 |
+
|
503 |
+
function woocommerce_product_and_order_actions_handler($post_id, $arg = null) {
|
504 |
+
$this->add_db_event('posts', array('ID' => $post_id));
|
505 |
+
}
|
506 |
+
|
507 |
+
function woocommerce_payment_token_set_default_handler($token_id, $token) {
|
508 |
+
$results = $this->db->getResult($this->db->prepare("SELECT user_id FROM {$this->db->dbprefix()}woocommerce_payment_tokens WHERE token_id = %d", $token_id));
|
509 |
+
$user_ids = array();
|
510 |
+
foreach ( $results as $tok ){
|
511 |
+
if (!in_array($tok['user_id'], $user_ids, true)) {
|
512 |
+
$user_ids[] = $tok['user_id'];
|
513 |
+
$this->add_db_event('woocommerce_payment_tokens', array('user_id' => $tok['user_id']));
|
514 |
+
}
|
515 |
+
}
|
516 |
+
}
|
517 |
+
|
518 |
+
function woocommerce_grant_product_download_permissions_handler($order_id) {
|
519 |
+
$this->add_db_event('woocommerce_downloadable_product_permissions', array('order_id' => $order_id));
|
520 |
+
}
|
521 |
+
|
522 |
+
/* ADDING ACTION AND LISTENERS FOR CAPTURING EVENTS. */
|
523 |
+
public function add_actions_and_listeners() {
|
524 |
+
/* CAPTURING EVENTS FOR WP_COMMENTS TABLE */
|
525 |
+
add_action('delete_comment', array($this, 'comment_action_handler'));
|
526 |
+
add_action('wp_set_comment_status', array($this, 'comment_action_handler'));
|
527 |
+
add_action('trashed_comment', array($this, 'comment_action_handler'));
|
528 |
+
add_action('untrashed_comment', array($this, 'comment_action_handler'));
|
529 |
+
add_action('wp_insert_comment', array($this, 'comment_action_handler'));
|
530 |
+
add_action('comment_post', array($this, 'comment_action_handler'));
|
531 |
+
add_action('edit_comment', array($this, 'comment_action_handler'));
|
532 |
+
|
533 |
+
/* CAPTURING EVENTS FOR WP_COMMENTMETA TABLE */
|
534 |
+
add_action('added_comment_meta', array($this, 'commentmeta_insert_handler' ), 10, 2);
|
535 |
+
add_action('updated_comment_meta', array($this, 'commentmeta_modification_handler'), 10, 4);
|
536 |
+
add_action('deleted_comment_meta', array($this, 'commentmeta_modification_handler'), 10, 4);
|
537 |
+
|
538 |
+
/* CAPTURING EVENTS FOR WP_USERMETA TABLE */
|
539 |
+
add_action('added_user_meta', array($this, 'usermeta_insert_handler' ), 10, 2);
|
540 |
+
add_action('updated_user_meta', array($this, 'usermeta_modification_handler' ), 10, 4);
|
541 |
+
add_action('deleted_user_meta', array($this, 'usermeta_modification_handler' ), 10, 4);
|
542 |
+
add_action('added_usermeta', array( $this, 'usermeta_modification_handler'), 10, 4);
|
543 |
+
add_action('update_usermeta', array( $this, 'usermeta_modification_handler'), 10, 4);
|
544 |
+
add_action('delete_usermeta', array( $this, 'usermeta_modification_handler'), 10, 4);
|
545 |
+
|
546 |
+
/* CAPTURING EVENTS FOR WP_USERS TABLE */
|
547 |
+
add_action('user_register', array($this, 'userid_action_handler'));
|
548 |
+
add_action('password_reset', array($this, 'userid_action_handler'));
|
549 |
+
add_action('profile_update', array($this, 'userid_action_handler'));
|
550 |
+
add_action('deleted_user', array($this, 'userid_action_handler'));
|
551 |
+
|
552 |
+
/* CAPTURING EVENTS FOR WP_POSTS TABLE */
|
553 |
+
add_action('delete_post', array($this, 'post_action_handler'));
|
554 |
+
add_action('trash_post', array($this, 'post_action_handler'));
|
555 |
+
add_action('untrash_post', array($this, 'post_action_handler'));
|
556 |
+
add_action('edit_post', array($this, 'post_action_handler'));
|
557 |
+
add_action('save_post', array($this, 'post_action_handler'));
|
558 |
+
add_action('wp_insert_post', array($this, 'post_action_handler'));
|
559 |
+
add_action('edit_attachment', array($this, 'post_action_handler'));
|
560 |
+
add_action('add_attachment', array($this, 'post_action_handler'));
|
561 |
+
add_action('delete_attachment', array($this, 'post_action_handler'));
|
562 |
+
add_action('private_to_published', array($this, 'post_action_handler'));
|
563 |
+
add_action('wp_restore_post_revision', array($this, 'post_action_handler'));
|
564 |
+
|
565 |
+
/* CAPTURING EVENTS FOR WP_POSTMETA TABLE */
|
566 |
+
// Why events for both delete and deleted
|
567 |
+
add_action('added_post_meta', array($this, 'postmeta_insert_handler'), 10, 4);
|
568 |
+
add_action('update_post_meta', array($this, 'postmeta_modification_handler'), 10, 4);
|
569 |
+
add_action('updated_post_meta', array($this, 'postmeta_modification_handler'), 10, 4);
|
570 |
+
add_action('delete_post_meta', array($this, 'postmeta_modification_handler'), 10, 4);
|
571 |
+
add_action('deleted_post_meta', array($this, 'postmeta_modification_handler'), 10, 4);
|
572 |
+
add_action('added_postmeta', array($this, 'postmeta_action_handler'), 10, 3);
|
573 |
+
add_action('update_postmeta', array($this, 'postmeta_action_handler'), 10, 3);
|
574 |
+
add_action('delete_postmeta', array($this, 'postmeta_action_handler'), 10, 3);
|
575 |
+
|
576 |
+
/* CAPTURING EVENTS FOR WP_LINKS TABLE */
|
577 |
+
add_action('edit_link', array($this, 'link_action_handler'));
|
578 |
+
add_action('add_link', array($this, 'link_action_handler'));
|
579 |
+
add_action('delete_link', array($this, 'link_action_handler'));
|
580 |
+
|
581 |
+
/* CAPTURING EVENTS FOR WP_TERM AND WP_TERM_TAXONOMY TABLE */
|
582 |
+
add_action('created_term', array($this, 'term_handler'), 10, 3);
|
583 |
+
add_action('edited_term', array( $this, 'term_handler' ), 10, 3);
|
584 |
+
add_action('edited_terms', array($this, 'edited_terms_handler'), 10, 2);
|
585 |
+
add_action('delete_term', array($this, 'delete_term_handler'), 10, 4);
|
586 |
+
add_action('edit_term_taxonomy', array($this, 'term_taxonomy_handler'), 10, 2);
|
587 |
+
add_action('delete_term_taxonomy', array($this, 'term_taxonomy_handler'));
|
588 |
+
add_action('edit_term_taxonomies', array($this, 'term_taxonomies_handler'));
|
589 |
+
add_action('add_term_relationship', array($this, 'term_relationship_handler'), 10, 2);
|
590 |
+
add_action('delete_term_relationships', array($this, 'term_relationships_handler'), 10, 2);
|
591 |
+
add_action('set_object_terms', array($this, 'set_object_terms_handler'), 10, 3);
|
592 |
+
|
593 |
+
add_action('switch_theme', array($this, 'theme_action_handler'));
|
594 |
+
add_action('activate_plugin', array($this, 'plugin_action_handler'));
|
595 |
+
add_action('deactivate_plugin', array($this, 'plugin_action_handler'));
|
596 |
+
|
597 |
+
/* CAPTURING EVENTS FOR WP_OPTIONS */
|
598 |
+
add_action('deleted_option', array($this, 'option_handler'));
|
599 |
+
add_action('updated_option', array($this, 'option_handler'));
|
600 |
+
add_action('added_option', array($this, 'option_handler'));
|
601 |
+
|
602 |
+
/* CAPTURING EVENTS FOR FILES UPLOAD */
|
603 |
+
add_action('wp_handle_upload', array($this, 'upload_handler'));
|
604 |
+
add_action('wp_update_attachment_metadata', array($this, 'attachment_metadata_handler'), 10, 2);
|
605 |
+
|
606 |
+
/* These are applicable only in case of WPMU */
|
607 |
+
/* XNOTE: Handle registration_log_handler from within the server */
|
608 |
+
add_action('wpmu_new_blog', array($this, 'wpmu_new_blog_create_handler'), 10, 1);
|
609 |
+
add_action('delete_site_option',array($this, 'sitemeta_handler'), 10, 1);
|
610 |
+
add_action('add_site_option', array($this, 'sitemeta_handler'), 10, 1);
|
611 |
+
add_action('update_site_option', array($this, 'sitemeta_handler'), 10, 1);
|
612 |
+
|
613 |
+
/* CAPTURING EVENTS FOR WOOCOMMERCE */
|
614 |
+
add_action('woocommerce_resume_order', array($this, 'woocommerce_resume_order_handler'), 10, 1);
|
615 |
+
add_action('woocommerce_new_order_item', array($this, 'woocommerce_new_order_item_handler'), 10, 3);
|
616 |
+
add_action('woocommerce_update_order_item', array($this, 'woocommerce_update_order_item_handler'), 10, 2);
|
617 |
+
add_action('woocommerce_delete_order_item', array($this, 'woocommerce_delete_order_item_handler'), 10, 1);
|
618 |
+
add_action('woocommerce_delete_order_items', array($this, 'woocommerce_delete_order_items_handler'), 10, 1);
|
619 |
+
add_action('added_order_item_meta', array($this, 'woocommerce_order_term_meta_handler' ), 10, 4);
|
620 |
+
add_action('updated_order_item_meta', array($this, 'woocommerce_order_term_meta_handler'), 10, 4);
|
621 |
+
add_action('deleted_order_item_meta', array($this, 'woocommerce_order_term_meta_handler'), 10, 4);
|
622 |
+
|
623 |
+
add_action('woocommerce_attribute_added', array($this, 'woocommerce_attribute_added_handler' ), 10, 2 );
|
624 |
+
add_action('woocommerce_attribute_updated', array($this, 'woocommerce_attribute_updated_handler'), 10, 3 );
|
625 |
+
add_action('woocommerce_attribute_deleted', array($this, 'woocommerce_attribute_deleted_handler'), 10, 3 );
|
626 |
+
|
627 |
+
add_action('woocommerce_tax_rate_added', array($this, 'woocommerce_tax_rate_handler'), 10, 2);
|
628 |
+
add_action('woocommerce_tax_rate_deleted', array($this, 'woocommerce_tax_rate_deleted_handler'), 10, 1);
|
629 |
+
add_action('woocommerce_tax_rate_updated', array($this, 'woocommerce_tax_rate_handler'), 10, 2);
|
630 |
+
|
631 |
+
add_action('woocommerce_new_webhook', array($this, 'woocommerce_webhook_handler'), 10, 1);
|
632 |
+
add_action('woocommerce_webhook_updated', array($this, 'woocommerce_webhook_handler'), 10, 1);
|
633 |
+
add_action('woocommerce_webhook_deleted', array($this, 'woocommerce_webhook_delete_handler'), 10, 2);
|
634 |
+
|
635 |
+
add_action('woocommerce_download_product', array($this, 'woocommerce_download_product_handler'), 10, 6);
|
636 |
+
add_action('woocommerce_grant_product_download_access', array($this, 'woocommerce_grant_product_download_access_handler'), 10, 1);
|
637 |
+
add_action('woocommerce_ajax_revoke_access_to_product_download', array($this, 'woocommerce_revoke_access_to_product_download_handler'), 10, 4);
|
638 |
+
add_action('woocommerce_deleted_order_downloadable_permissions', array($this, 'woocommerce_deleted_order_downloadable_permissions_handler'), 10, 1);
|
639 |
+
|
640 |
+
add_action('woocommerce_new_payment_token', array($this, 'woocommerce_payment_token_handler'), 10, 1);
|
641 |
+
add_action('woocommerce_payment_token_created', array($this, 'woocommerce_payment_token_handler'), 10, 1);
|
642 |
+
add_action('woocommerce_payment_token_updated', array($this, 'woocommerce_payment_token_handler'), 10, 1);
|
643 |
+
add_action('woocommerce_payment_token_deleted', array($this, 'woocommerce_payment_token_deleted_handler'), 10, 2);
|
644 |
+
add_action('added_payment_token_meta', array($this, 'woocommerce_payment_token_meta_handler' ), 10, 4);
|
645 |
+
add_action('updated_payment_token_meta', array($this, 'woocommerce_payment_token_meta_handler'), 10, 4);
|
646 |
+
add_action('deleted_payment_token_meta', array($this, 'woocommerce_payment_token_meta_handler'), 10, 4);
|
647 |
+
|
648 |
+
add_action('woocommerce_shipping_zone_method_added', array($this, 'woocommerce_shipping_zone_method_added_handler'), 10, 3);
|
649 |
+
add_action('woocommerce_shipping_zone_method_status_toggled', array($this, 'woocommerce_shipping_zone_method_status_toggled_handler'), 10, 4);
|
650 |
+
add_action('woocommerce_shipping_zone_method_deleted', array($this, 'woocommerce_shipping_zone_method_deleted_handler'), 10, 3);
|
651 |
+
|
652 |
+
add_action('woocommerce_delete_shipping_zone', array($this, 'woocommerce_delete_shipping_zone_handler'), 10, 1);
|
653 |
+
add_action('woocommerce_delete_shipping_zone_method', array($this, 'woocommerce_delete_shipping_zone_method_handler'), 10, 1);
|
654 |
+
|
655 |
+
add_action('woocommerce_api_create_product_attribute', array($this, 'woocommerce_api_product_attribute_handler'), 10, 2);
|
656 |
+
add_action('woocommerce_api_edit_product_attribute', array($this, 'woocommerce_api_product_attribute_handler'), 10, 2);
|
657 |
+
|
658 |
+
add_action('woocommerce_note_created', array($this, 'woocommerce_note_created_handler'), 10, 1);
|
659 |
+
add_action('woocommerce_note_updated', array($this, 'woocommerce_note_modification_handler'), 10, 1);
|
660 |
+
add_action('woocommerce_note_deleted', array($this, 'woocommerce_note_modification_handler'), 10, 1);
|
661 |
+
|
662 |
+
add_action('woocommerce_analytics_update_order_stats', array($this, 'woocommerce_analytics_order_stats_modification_handler'), 10, 1);
|
663 |
+
add_action('woocommerce_analytics_delete_order_stats', array($this, 'woocommerce_analytics_order_stats_modification_handler'), 10, 1);
|
664 |
+
|
665 |
+
add_action('woocommerce_analytics_update_product', array($this, 'woocommerce_analytics_product_update_handler'), 10, 2);
|
666 |
+
add_action('woocommerce_analytics_delete_product', array($this, 'woocommerce_analytics_product_delete_handler'), 10, 2);
|
667 |
+
|
668 |
+
add_action('woocommerce_analytics_new_customer', array($this, 'woocommerce_analytics_new_customer_handler'), 10, 1);
|
669 |
+
add_action('woocommerce_analytics_update_customer', array($this, 'woocommerce_analytics_customer_modification_handler'), 10, 1);
|
670 |
+
add_action('woocommerce_analytics_delete_customer', array($this, 'woocommerce_analytics_customer_modification_handler'), 10, 1);
|
671 |
+
|
672 |
+
add_action('woocommerce_analytics_update_coupon', array($this, 'woocommerce_analytics_coupon_update_handler'), 10, 2);
|
673 |
+
add_action('woocommerce_analytics_delete_coupon', array($this, 'woocommerce_analytics_coupon_delete_handler'), 10, 2);
|
674 |
+
|
675 |
+
add_action('woocommerce_analytics_update_tax', array($this, 'woocommerce_analytics_tax_update_handler'), 10, 2);
|
676 |
+
add_action('woocommerce_analytics_delete_tax', array($this, 'woocommerce_analytics_tax_delete_handler'), 10, 2);
|
677 |
+
|
678 |
+
add_action('woocommerce_updated_product_stock', array($this, 'woocommerce_product_update_handler'), 10, 1);
|
679 |
+
add_action('woocommerce_updated_product_sales', array($this, 'woocommerce_product_update_handler'), 10, 1);
|
680 |
+
add_action('woocommerce_updated_product_price', array($this, 'woocommerce_product_update_handler'), 10, 1);
|
681 |
+
|
682 |
+
add_action('wp_trash_post', array($this, 'woocommerce_trash_untrash_post_handler'), 10, 1);
|
683 |
+
add_action('untrashed_post', array($this, 'woocommerce_trash_untrash_post_handler'), 10, 1);
|
684 |
+
|
685 |
+
add_action('woocommerce_after_single_product_ordering', array($this, 'woocommerce_product_and_order_actions_handler'), 10, 2);
|
686 |
+
add_action('woocommerce_update_product', array($this, 'woocommerce_product_and_order_actions_handler'), 10, 2);
|
687 |
+
add_action('woocommerce_update_product_variation', array($this, 'woocommerce_product_and_order_actions_handler'), 10, 2);
|
688 |
+
|
689 |
+
add_action('woocommerce_payment_token_set_default', array($this, 'woocommerce_payment_token_set_default_handler'), 10, 2);
|
690 |
+
add_action('woocommerce_grant_product_download_permissions', array($this, 'woocommerce_grant_product_download_permissions_handler'), 10, 1);
|
691 |
+
}
|
692 |
+
}
|
693 |
+
endif;
|