Version Description
- Improved CSS
- Wpcli V2 code
- account disconnect option
- plugin deactivate bug fix
Download this release
Release Info
Developer | ritesh.soni36 |
Plugin | MalCare WordPress Security Plugin – Malware Scanner, Cleaner, Security Firewall |
Version | 4.27 |
Comparing to | |
See all releases |
Code changes from version 4.23 to 4.27
- admin/account_details.php +55 -0
- admin/top_box.php +0 -8
- callback/wings/info.php +1 -0
- callback/wings/misc.php +29 -3
- css/bvnew.min.css +1 -1
- info.php +4 -4
- malcare.php +2 -2
- protect/wp/lp/lp.php +0 -5
- readme.txt +8 -1
- wp_admin.php +20 -4
- wp_api.php +7 -5
- wp_cli.php +51 -55
- wp_db.php +6 -1
admin/account_details.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="content-wrapper" style="width: 99%;">
|
2 |
+
<!-- Content HTML goes here -->
|
3 |
+
<div class="mui-container-fluid">
|
4 |
+
<div class="mui--appbar-height"></div>
|
5 |
+
<br><br>
|
6 |
+
<div class="mui-row">
|
7 |
+
<div style="background: #4686f5; overflow: hidden;">
|
8 |
+
<a href="https://www.malcare.com/?utm_source=mc_free_plugin_lp_logo&utm_medium=logo_link&utm_campaign=mc_free_plugin_lp_header&utm_term=header_logo&utm_content=image_link"><img src="<?php echo plugins_url($this->getPluginLogo(), __FILE__); ?>" style="padding: 10px;"></a>
|
9 |
+
<div class="top-links" style="width:400px;float: right;margin-top: 15px;">
|
10 |
+
<span class="bv-top-button" style="padding: 5px;margin:5px;border: 1px solid #17252A;display:inline-block;background:ghostwhite;border-radius: 5px;float:right;"><a href="https://wordpress.org/support/plugin/malcare-security/reviews/#new-post">Leave a Review</a></span>
|
11 |
+
<span class="bv-top-button" style="padding: 5px;margin:5px;border: 1px solid #17252A;display:inline-block;background:ghostwhite;border-radius: 5px;float:right;"><a href="https://wordpress.org/support/plugin/malcare-security/">Need Help?</a></span>
|
12 |
+
</div>
|
13 |
+
</div>
|
14 |
+
</div>
|
15 |
+
</div>
|
16 |
+
|
17 |
+
|
18 |
+
</br> </br>
|
19 |
+
<div class="mui-container-fluid">
|
20 |
+
<?php $accounts = MCAccount::accountsByPlugname($this->settings);?>
|
21 |
+
<div class="mui-panel" style="width:800px; margin:0 auto;border:1px solid #CCC;">
|
22 |
+
<div class="mui--text-body1" style="text-align:center;font-size:18px;">Accounts associated with this website.</div><br/>
|
23 |
+
<table cellpadding="10" style="width:700px; margin:0 auto;border:1px solid black;">
|
24 |
+
<tr style="text-align:center;font-size:15px;border: 1px solid black;"> <th> Account Email</th><th>Last Scanned At</th><th></th></tr>
|
25 |
+
<?php
|
26 |
+
$nonce = wp_create_nonce( 'bvnonce' );
|
27 |
+
foreach($accounts as $key => $value){
|
28 |
+
?>
|
29 |
+
<form dummy=">" action="" style="padding:0 2% 2em 1%;" method="post">
|
30 |
+
<input type='hidden' name='bvnonce' value="<?php echo $nonce ?>" />
|
31 |
+
<input type='hidden' name='pubkey' value="<?php echo $key ?>" />
|
32 |
+
<tr style="text-align:center;font-size:15px;border: 1px solid black;">
|
33 |
+
<td >
|
34 |
+
<?php echo $value['email'] ?>
|
35 |
+
</td>
|
36 |
+
<td>
|
37 |
+
<?php echo date('Y-m-d H:i:s', $value['lastbackuptime']); ?>
|
38 |
+
</td>
|
39 |
+
<td >
|
40 |
+
<input type='submit' class="button-primary" value='Disconnect' name='disconnect'>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
</form>
|
44 |
+
<?php } ?>
|
45 |
+
</table>
|
46 |
+
<div class="mui-col-md-12 mui-col-md-offset-3" style="padding-top:2%;">
|
47 |
+
|
48 |
+
<?php if(isset($this->account)) { ?>
|
49 |
+
<a class="mui-btn mui-btn--raised mui-btn--primary" href=<?php echo $this->account->authenticatedUrl('/malcare/access') ?> target="_blank">Visit Dashboard</a>
|
50 |
+
<?php } ?>
|
51 |
+
<a class="mui-btn mui-btn--raised mui-btn--primary" href=<?php echo $this->mainUrl('&add_account=true'); ?> >Connect New Account</a>
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
</div>
|
admin/top_box.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<div style= "width: 800px; margin: 20px auto; overflow: hidden;">
|
2 |
-
<div style="width: 49%; float: left; border-right: 2px solid #333;">
|
3 |
-
<iframe width="380" height="215" src="https://www.youtube.com/embed/rBuYh2dIadk"></iframe>
|
4 |
-
</div>
|
5 |
-
<div style="width: 49%; float: right;">
|
6 |
-
<img src="<?php echo plugins_url("/../img/testimonial_mc.png", __FILE__); ?>"/>
|
7 |
-
</div>
|
8 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
callback/wings/info.php
CHANGED
@@ -135,6 +135,7 @@ class BVInfoCallback extends BVCallbackBase {
|
|
135 |
'charset' => get_bloginfo('charset'),
|
136 |
'wpversion' => $wp_version,
|
137 |
'dbversion' => $wp_db_version,
|
|
|
138 |
'abspath' => ABSPATH,
|
139 |
'bvpluginpath' => defined('MCBASEPATH') ? MCBASEPATH : null,
|
140 |
'uploadpath' => $upload_dir['basedir'],
|
135 |
'charset' => get_bloginfo('charset'),
|
136 |
'wpversion' => $wp_version,
|
137 |
'dbversion' => $wp_db_version,
|
138 |
+
'mysql_version' => $db->getMysqlVersion(),
|
139 |
'abspath' => ABSPATH,
|
140 |
'bvpluginpath' => defined('MCBASEPATH') ? MCBASEPATH : null,
|
141 |
'uploadpath' => $upload_dir['basedir'],
|
callback/wings/misc.php
CHANGED
@@ -16,6 +16,32 @@ class BVMiscCallback extends BVCallbackBase {
|
|
16 |
$this->bvinfo = new MCInfo($callback_handler->settings);
|
17 |
}
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
public function process($request) {
|
20 |
$bvinfo = $this->bvinfo;
|
21 |
$settings = $this->settings;
|
@@ -53,10 +79,10 @@ class BVMiscCallback extends BVCallbackBase {
|
|
53 |
$resp = array("unsetdynplug" => $settings->getOption('bvdynplug'));
|
54 |
break;
|
55 |
case "wpupplgs":
|
56 |
-
$resp =
|
57 |
break;
|
58 |
case "wpupthms":
|
59 |
-
$resp =
|
60 |
break;
|
61 |
case "wpupcre":
|
62 |
$resp = array("wpupdatecore" => wp_version_check());
|
@@ -74,4 +100,4 @@ class BVMiscCallback extends BVCallbackBase {
|
|
74 |
return $resp;
|
75 |
}
|
76 |
}
|
77 |
-
endif;
|
16 |
$this->bvinfo = new MCInfo($callback_handler->settings);
|
17 |
}
|
18 |
|
19 |
+
public function refreshPluginUpdates() {
|
20 |
+
global $wp_current_filter;
|
21 |
+
$wp_current_filter[] = 'load-update-core.php';
|
22 |
+
|
23 |
+
wp_update_plugins();
|
24 |
+
|
25 |
+
array_pop($wp_current_filter);
|
26 |
+
|
27 |
+
wp_update_plugins();
|
28 |
+
|
29 |
+
return array("wpupdateplugins" => true);
|
30 |
+
}
|
31 |
+
|
32 |
+
public function refreshThemeUpdates() {
|
33 |
+
global $wp_current_filter;
|
34 |
+
$wp_current_filter[] = 'load-update-core.php';
|
35 |
+
|
36 |
+
wp_update_themes();
|
37 |
+
|
38 |
+
array_pop($wp_current_filter);
|
39 |
+
|
40 |
+
wp_update_themes();
|
41 |
+
|
42 |
+
return array("wpupdatethemes" => true);
|
43 |
+
}
|
44 |
+
|
45 |
public function process($request) {
|
46 |
$bvinfo = $this->bvinfo;
|
47 |
$settings = $this->settings;
|
79 |
$resp = array("unsetdynplug" => $settings->getOption('bvdynplug'));
|
80 |
break;
|
81 |
case "wpupplgs":
|
82 |
+
$resp = $this->refreshPluginUpdates();
|
83 |
break;
|
84 |
case "wpupthms":
|
85 |
+
$resp = $this->refreshThemeUpdates();
|
86 |
break;
|
87 |
case "wpupcre":
|
88 |
$resp = array("wpupdatecore" => wp_version_check());
|
100 |
return $resp;
|
101 |
}
|
102 |
}
|
103 |
+
endif;
|
css/bvnew.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.text-center{text-align:center}.text-right{text-align:right}.d-flex{display:flex}.testimonial_subtitle{color:#0aaa7a;font-size:12px}.testimonial_btn{background-color:#373d4b!important;color:#fff!important}.seprator{height:2px;width:56px;background-color:#0aaa7a;margin:7px 0 10px 0}.center-align-dflex{align-items:center;display:flex;justify-content:center;flex-direction:column}.card-title img{height:100px;width:125px}.h-100{height:100%}.mb-2{margin-bottom:20px}.mr-1{margin-right:10px}.mt-1{margin-top:10px}.float-right{float:right}.fw-600{font-weight:600}.malcare-logo-img{position:absolute;margin-left:20px;top:10px}.search-container label>a{color:#fff;text-decoration:underline}#malcare-1{padding-top:20px;padding-bottom:100px;background:url(../img/malcare-heading-bg.svg) no-repeat center;height:100%;background-size:cover;background-position:bottom;position:relative}.container-malcare{max-width:1440px;margin:auto}#malcare-1 a:hover{color:red}.text-white{color:#fff!important}a.malcare-top{font-size:14px;line-height:20px;letter-spacing:.25px;font-weight:600;text-decoration-line:underline!important;color:#fff;mix-blend-mode:normal;opacity:.73}#malcare-1 .e-mail-button{background:#50e3c2;border:1px solid #17abff;box-sizing:border-box;padding:30px;max-width:300px;width:17%;border-radius:0 60px 60px 0;font-style:normal;font-weight:600;font-size:17px;line-height:1px;text-align:center;letter-spacing:.333333px;color:#4a4a4a}#malcare-1 .heading{margin-top:50px;padding-bottom:30px}#malcare-1 .e-mail-button:hover,#malcare-5 .premium-subscription a:hover{color:#3a3a3a}#malcare-1 h4{line-height:24px;font-size:24px}#malcare-1 h2{line-height:30px;font-size:26px}#malcare-1 .search-container{margin-top:55px}#malcare-1 form img{margin-left:-20px;position:absolute;bottom:-98px;width:100%;max-width:225px}#malcare-1 input.search{margin-right:-5px;background:#fff;border:1px solid #958afb;box-sizing:border-box;box-shadow:0 17px 40px rgba(217,223,252,.311538);border-radius:60px 0 0 60px;padding:30px;max-width:550px;width:33%;font-style:normal;font-weight:400;font-size:18px;line-height:30px;letter-spacing:.319444px;color:#
|
1 |
+
.text-center{text-align:center}.text-right{text-align:right}.d-flex{display:flex}.testimonial_subtitle{color:#0aaa7a;font-size:12px}.testimonial_btn{background-color:#373d4b!important;color:#fff!important}.seprator{height:2px;width:56px;background-color:#0aaa7a;margin:7px 0 10px 0}.center-align-dflex{align-items:center;display:flex;justify-content:center;flex-direction:column}.card-title img{height:100px;width:125px}.h-100{height:100%}.mb-2{margin-bottom:20px}.mr-1{margin-right:10px}.mt-1{margin-top:10px}.float-right{float:right}.fw-600{font-weight:600}.malcare-logo-img{position:absolute;margin-left:20px;top:10px}.search-container label>a{color:#fff;text-decoration:underline}#malcare-1{padding-top:20px;padding-bottom:100px;background:url(../img/malcare-heading-bg.svg) no-repeat center;height:100%;background-size:cover;background-position:bottom;position:relative}.container-malcare{max-width:1440px;margin:auto}#malcare-1 a:hover{color:red}.text-white{color:#fff!important}a.malcare-top{font-size:14px;line-height:20px;letter-spacing:.25px;font-weight:600;text-decoration-line:underline!important;color:#fff;mix-blend-mode:normal;opacity:.73}#malcare-1 .e-mail-button{background:#50e3c2;border:1px solid #17abff;box-sizing:border-box;padding:30px;max-width:300px;width:17%;border-radius:0 60px 60px 0;font-style:normal;font-weight:600;font-size:17px;line-height:1px;text-align:center;letter-spacing:.333333px;color:#4a4a4a}#malcare-1 .heading{margin-top:50px;padding-bottom:30px}#malcare-1 .e-mail-button:hover,#malcare-5 .premium-subscription a:hover{color:#3a3a3a}#malcare-1 h4{line-height:24px;font-size:24px}#malcare-1 h2{line-height:30px;font-size:26px}#malcare-1 .search-container{margin-top:55px}#malcare-1 form img{margin-left:-20px;position:absolute;bottom:-98px;width:100%;max-width:225px}#malcare-1 input.search{margin-right:-5px;background:#fff;border:1px solid #958afb;box-sizing:border-box;box-shadow:0 17px 40px rgba(217,223,252,.311538);border-radius:60px 0 0 60px;padding:30px;max-width:550px;width:33%;font-style:normal;font-weight:400;font-size:18px;line-height:30px;letter-spacing:.319444px;color:#333;display:inline-block;height:63px}#malcare-1 h5.check-box-text{font-style:normal;font-weight:400;font-size:18px;line-height:40px;text-align:center;letter-spacing:.291667px;color:#fff}#malcare-2 h6.card-subtitle{margin:20px 0 0 0}#malcare-3 .heading-malcare{padding-bottom:20px}.heading-malcare h4{font-size:30px;line-height:38px;text-align:center;letter-spacing:.416667px;color:#7683ad}.heading-malcare h5{font-style:normal;font-weight:400;font-size:19px;line-height:22px;text-align:center;letter-spacing:.277778px;color:#7683ad}input[type=checkbox]:checked::before{width:2.3rem}input[type=checkbox]:focus{outline:unset!important}#malcare-1 h5.check-box-text input.check-box{position:relative;width:20px;height:20px;margin:0 0 5px 0}#malcare-2 h1.number-malcare{margin:0;position:absolute;font-size:50px;color:#7683ad;top:110px;left:25px}#malcare-2,#malcare-3,#malcare-4,#malcare-5{padding:30px 0}#malcare-2{padding-top:30px}#malcare-2 h6{font-style:normal;font-weight:700;font-size:20px;line-height:26px;text-align:center;letter-spacing:.333333px;color:#4a4a4a}#malcare-2 p{font-style:normal;font-weight:400;font-size:18px;line-height:22px;text-align:center;letter-spacing:.25px;color:#7683ad}#malcare-3 .embed-responsive{border-radius:10px}#malcare-3 .malcare-testimonial h4{font-size:22px;line-height:36px;margin-top:50px;text-align:center;color:#4a4a4a}#malcare-3 .malcare-testimonial h5.testimonial_subtitle{font-style:normal;font-weight:400;font-size:18px;line-height:36px;text-align:center;color:#4d50a7}#malcare-3 .malcare-testimonial p.testimonial_para{font-style:normal;font-weight:400;font-size:18px;line-height:27px;text-align:center;letter-spacing:.2px;color:#7683ad}.heading-malcare{margin-bottom:30px}#malcare-3 .malcare-testimonial img{border-radius:50%}#malcare-3 .carousel-inner{border:1px solid #000;padding:18px;border-radius:10px;overflow:inherit}#malcare-3 .carousel-inner img{position:absolute;top:-69px;height:100px;margin-left:-41px}#malcare-4 .brand{justify-content:center}#malcare-4 .brand img{margin:0 30px}#malcare-5 ul li{list-style:none}#malcare-5 ul li{font-style:normal;font-weight:400;font-size:18px;line-height:36px;text-align:initial;color:#4d50a7}#malcare-5 h6{font-size:22px;line-height:36px;text-align:center;font-family:AvenirNextLTPro-Regular,sans-serif;color:#4a4a4a}#malcare-5 ul{padding:0}#malcare-5 .premium-subscription a{background:#50e3c2;border:2px solid #17abff;box-sizing:border-box;border-radius:60px;font-style:normal;text-decoration:none;font-weight:600;font-size:24px;outline:0;line-height:31px;text-align:center;letter-spacing:.333333px;padding:20px;color:#4a4a4a}#malcare-5 .subscription{align-items:center;background:#fff;border:1px solid rgba(97,120,238,.487177);box-sizing:border-box;box-shadow:0 17px 40px rgba(217,223,252,.539883);border-radius:19px;overflow:hidden;height:330px}#malcare-5 .premium-subscription{align-items:center;display:flex}.bg-light-green{background-color:rgba(80,227,194,.18)}body.malcare9 a,body.malcare9 h1,body.malcare9 h2,body.malcare9 h3,body.malcare9 h4{font-family:AvenirNextLTPro-Regular,sans-serif}body.malcare9 button,body.malcare9 h5,body.malcare9 h6,body.malcare9 p,body.malcare9 ul li a{font-family:IBMPlexSans,sans-serif}#malcare-2-1{padding-top:80px;padding-bottom:350px;background:url(../img/malcare-heading-2.svg) no-repeat center;height:100%;background-size:cover;background-position:bottom}#malcare-2-3 .progress.custom-progress .progress-bar{background-color:#777}#malcare-2-3 .progress-heading p{font-size:12px;line-height:41px;text-align:center;color:#4a4a4a}.malcare-3 #malcare-1{padding-top:80px;padding-bottom:130px;background:url('../img/Group\ 5.svg') no-repeat center;height:100%;background-size:cover;background-position:bottom}.color-grey{color:#4a4a4a!important}.color-blue{color:#7683ad!important}#wpcontent{padding:0!important}@media (max-width:624px){#malcare-1 h5.check-box-text{font-size:11px!important}#get-started span{display:none}#get-started:before{font-size:13px;content:'Scan Site'}#malcare-1 h2{font-size:22px}#malcare-1 h4{font-size:20px}.malcare-logo-img img{height:30px;width:121px}#malcare-4 .brand img{margin:10px}#malcare-1 .search-container{margin-top:20px}}@media (max-width:1024px){.man-img{display:none}.d-flex{display:block}.malcare-video{margin:auto;margin-bottom:70px;width:90%}#malcare-1 .e-mail-button{width:36%!important}#malcare-1 input.search{width:44%!important}.malcare-1-container h2{margin-top:70px!important}}@media (min-width:1024px) and (max-width:1367px){#get-started span{display:none}#get-started:before{content:'Scan Site'}}@media (min-width:768px){.justify-content-center{justify-content:center}}@media (max-width:1440px){.row{margin-left:0!important;margin-right:0!important}}@media (min-width:1440px){.malcare-video{width:77%;margin:auto}.malcare-testimonial{width:85%;margin-left:auto;margin-right:auto}}
|
info.php
CHANGED
@@ -9,7 +9,7 @@ if (!class_exists('MCInfo')) :
|
|
9 |
public $badgeinfo = 'mcbadge';
|
10 |
public $ip_header_option = 'mcipheader';
|
11 |
public $brand_option = 'mcbrand';
|
12 |
-
public $version = '4.
|
13 |
public $webpage = 'https://www.malcare.com';
|
14 |
public $appurl = 'https://app.malcare.com';
|
15 |
public $slug = 'malcare-security/malcare.php';
|
@@ -35,8 +35,8 @@ if (!class_exists('MCInfo')) :
|
|
35 |
if ($brand && array_key_exists('menuname', $brand)) {
|
36 |
return $brand['menuname'];
|
37 |
}
|
38 |
-
|
39 |
-
|
40 |
return "Cloudways";
|
41 |
}
|
42 |
|
@@ -103,4 +103,4 @@ if (!class_exists('MCInfo')) :
|
|
103 |
);
|
104 |
}
|
105 |
}
|
106 |
-
endif;
|
9 |
public $badgeinfo = 'mcbadge';
|
10 |
public $ip_header_option = 'mcipheader';
|
11 |
public $brand_option = 'mcbrand';
|
12 |
+
public $version = '4.27';
|
13 |
public $webpage = 'https://www.malcare.com';
|
14 |
public $appurl = 'https://app.malcare.com';
|
15 |
public $slug = 'malcare-security/malcare.php';
|
35 |
if ($brand && array_key_exists('menuname', $brand)) {
|
36 |
return $brand['menuname'];
|
37 |
}
|
38 |
+
$bvinfo = new MCInfo($this->settings);
|
39 |
+
if (MCWPSiteInfo::isCWServer() && !$bvinfo->canOverrideCW()) {
|
40 |
return "Cloudways";
|
41 |
}
|
42 |
|
103 |
);
|
104 |
}
|
105 |
}
|
106 |
+
endif;
|
malcare.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.malcare.com
|
|
5 |
Description: WordPress Security, Firewall and Malware Scanner
|
6 |
Author: MalCare Security
|
7 |
Author URI: https://www.malcare.com
|
8 |
-
Version: 4.
|
9 |
Network: True
|
10 |
*/
|
11 |
|
@@ -142,4 +142,4 @@ if ((array_key_exists('bvplugname', $_REQUEST)) && ($_REQUEST['bvplugname'] == "
|
|
142 |
}
|
143 |
|
144 |
##DYNSYNCMODULE##
|
145 |
-
}
|
5 |
Description: WordPress Security, Firewall and Malware Scanner
|
6 |
Author: MalCare Security
|
7 |
Author URI: https://www.malcare.com
|
8 |
+
Version: 4.27
|
9 |
Network: True
|
10 |
*/
|
11 |
|
142 |
}
|
143 |
|
144 |
##DYNSYNCMODULE##
|
145 |
+
}
|
protect/wp/lp/lp.php
CHANGED
@@ -91,11 +91,6 @@ class BVWPLP {
|
|
91 |
return $this->config->blockAllLimit;
|
92 |
}
|
93 |
|
94 |
-
public function getLoginLogsTable() {
|
95 |
-
global $bvdb;
|
96 |
-
return $bvdb->getBVTable(BVWPLP::$requests_table);
|
97 |
-
}
|
98 |
-
|
99 |
public function getAllowLoginsTransient() {
|
100 |
return $this->settings->getTransient('bvlp_allow_logins');
|
101 |
}
|
91 |
return $this->config->blockAllLimit;
|
92 |
}
|
93 |
|
|
|
|
|
|
|
|
|
|
|
94 |
public function getAllowLoginsTransient() {
|
95 |
return $this->settings->getTransient('bvlp_allow_logins');
|
96 |
}
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Donate link: https://www.malcare.com
|
|
6 |
Requires at least: 4.0
|
7 |
Tested up to: 5.4
|
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 |
|
@@ -339,6 +339,13 @@ FTP details input into MalCare is processed on our servers. We need your FTP cre
|
|
339 |
8. MalCare’s Uptime Monitoring notifies if a website goes down so that you can handle the situation before starting to lose visitors.
|
340 |
|
341 |
== CHANGELOG ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
= 4.23 =
|
343 |
* Override bot protect over protect
|
344 |
|
6 |
Requires at least: 4.0
|
7 |
Tested up to: 5.4
|
8 |
Requires PHP: 5.4.0
|
9 |
+
Stable tag: 4.27
|
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 |
|
339 |
8. MalCare’s Uptime Monitoring notifies if a website goes down so that you can handle the situation before starting to lose visitors.
|
340 |
|
341 |
== CHANGELOG ==
|
342 |
+
|
343 |
+
= 4.27 =
|
344 |
+
* Improved CSS
|
345 |
+
* Wpcli V2 code
|
346 |
+
* account disconnect option
|
347 |
+
* plugin deactivate bug fix
|
348 |
+
|
349 |
= 4.23 =
|
350 |
* Override bot protect over protect
|
351 |
|
wp_admin.php
CHANGED
@@ -75,10 +75,13 @@ class MCWPAdmin {
|
|
75 |
if ($hook === 'toplevel_page_malcare') {
|
76 |
wp_enqueue_style( 'mcsurface', plugins_url('css/bvmui.min.css', __FILE__));
|
77 |
wp_enqueue_style( 'bvnew', plugins_url('css/bvnew.min.css', __FILE__));
|
78 |
-
wp_enqueue_style( 'bootstrap', plugins_url('css/bootstrap.min.css', __FILE__));
|
79 |
}
|
80 |
}
|
81 |
|
|
|
|
|
|
|
|
|
82 |
public function showErrors() {
|
83 |
$error = NULL;
|
84 |
if (isset($_REQUEST['error'])) {
|
@@ -131,7 +134,10 @@ class MCWPAdmin {
|
|
131 |
public function settingsLink($links, $file) {
|
132 |
#XNOTE: Fix this
|
133 |
if ( $file == plugin_basename( dirname(__FILE__).'/malcare.php' ) ) {
|
134 |
-
$
|
|
|
|
|
|
|
135 |
}
|
136 |
return $links;
|
137 |
}
|
@@ -177,13 +183,23 @@ class MCWPAdmin {
|
|
177 |
}
|
178 |
|
179 |
public function adminPage() {
|
180 |
-
if (isset($_REQUEST['
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
$this->settings->updateOption('bvoverridecw', true);
|
|
|
182 |
require_once dirname( __FILE__ ) . "/admin/registration.php";
|
183 |
} else if(MCAccount::isConfigured($this->settings)) {
|
184 |
require_once dirname( __FILE__ ) . "/admin/dashboard.php";
|
185 |
} else {
|
186 |
$this->settings->updateOption('bvoverridecw', true);
|
|
|
187 |
require_once dirname( __FILE__ ) . "/admin/registration.php";
|
188 |
}
|
189 |
}
|
@@ -222,4 +238,4 @@ class MCWPAdmin {
|
|
222 |
return $plugins;
|
223 |
}
|
224 |
}
|
225 |
-
endif;
|
75 |
if ($hook === 'toplevel_page_malcare') {
|
76 |
wp_enqueue_style( 'mcsurface', plugins_url('css/bvmui.min.css', __FILE__));
|
77 |
wp_enqueue_style( 'bvnew', plugins_url('css/bvnew.min.css', __FILE__));
|
|
|
78 |
}
|
79 |
}
|
80 |
|
81 |
+
public function enqueueBootstrapCSS() {
|
82 |
+
wp_enqueue_style( 'bootstrap', plugins_url('css/bootstrap.min.css', __FILE__));
|
83 |
+
}
|
84 |
+
|
85 |
public function showErrors() {
|
86 |
$error = NULL;
|
87 |
if (isset($_REQUEST['error'])) {
|
134 |
public function settingsLink($links, $file) {
|
135 |
#XNOTE: Fix this
|
136 |
if ( $file == plugin_basename( dirname(__FILE__).'/malcare.php' ) ) {
|
137 |
+
$settings_link = '<a href="'.$this->mainUrl().'">'.__( 'Settings' ).'</a>';
|
138 |
+
array_unshift($links, $settings_link);
|
139 |
+
$account_details = '<a href="'.$this->mainUrl('&account_details=true').'">'.__( 'Account Details' ).'</a>';
|
140 |
+
array_unshift($links, $account_details);
|
141 |
}
|
142 |
return $links;
|
143 |
}
|
183 |
}
|
184 |
|
185 |
public function adminPage() {
|
186 |
+
if (isset($_REQUEST['bvnonce']) && wp_verify_nonce( $_REQUEST['bvnonce'], 'bvnonce' )) {
|
187 |
+
$info = array();
|
188 |
+
$this->siteinfo->basic($info);
|
189 |
+
$this->bvapi->pingbv('/bvapi/disconnect', $info, $_REQUEST['pubkey']);
|
190 |
+
MCAccount::remove($this->settings, $_REQUEST['pubkey']);
|
191 |
+
}
|
192 |
+
if (isset($_REQUEST['account_details'])) {
|
193 |
+
require_once dirname( __FILE__ ) . "/admin/account_details.php";
|
194 |
+
} else if (isset($_REQUEST['add_account'])) {
|
195 |
$this->settings->updateOption('bvoverridecw', true);
|
196 |
+
$this->enqueueBootstrapCSS();
|
197 |
require_once dirname( __FILE__ ) . "/admin/registration.php";
|
198 |
} else if(MCAccount::isConfigured($this->settings)) {
|
199 |
require_once dirname( __FILE__ ) . "/admin/dashboard.php";
|
200 |
} else {
|
201 |
$this->settings->updateOption('bvoverridecw', true);
|
202 |
+
$this->enqueueBootstrapCSS();
|
203 |
require_once dirname( __FILE__ ) . "/admin/registration.php";
|
204 |
}
|
205 |
}
|
238 |
return $plugins;
|
239 |
}
|
240 |
}
|
241 |
+
endif;
|
wp_api.php
CHANGED
@@ -11,19 +11,21 @@ if (!class_exists('MCWPAPI')) :
|
|
11 |
|
12 |
public function pingbv($method, $body, $public = false) {
|
13 |
if ($public) {
|
14 |
-
$this->
|
15 |
} else {
|
16 |
$api_public_key = $this->settings->getOption('bvApiPublic');
|
17 |
if (!empty($api_public_key) && (strlen($api_public_key) >= 32)) {
|
18 |
-
$this->
|
19 |
}
|
20 |
}
|
21 |
}
|
22 |
|
23 |
-
public function
|
24 |
$account = MCAccount::find($this->settings, $pubkey);
|
25 |
-
|
26 |
-
|
|
|
|
|
27 |
}
|
28 |
|
29 |
public function http_request($url, $body, $headers = array()) {
|
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 |
}
|
22 |
|
23 |
+
public function do_request($method, $body, $pubkey) {
|
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 |
|
31 |
public function http_request($url, $body, $headers = array()) {
|
wp_cli.php
CHANGED
@@ -10,19 +10,67 @@ class MCWPCli {
|
|
10 |
public $bvinfo;
|
11 |
public $bvapi;
|
12 |
|
13 |
-
public function __construct($settings, $bvinfo, $bvsiteinfo, $bvapi
|
14 |
$this->settings = $settings;
|
15 |
$this->siteinfo = $bvsiteinfo;
|
16 |
$this->bvinfo = $bvinfo;
|
17 |
$this->bvapi = $bvapi;
|
18 |
}
|
19 |
|
20 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
$resp = $this->bvapi->http_request($url, $request_params, $headers);
|
22 |
$this->handle_response($resp);
|
23 |
}
|
24 |
|
25 |
-
|
26 |
if (empty($resp)) {
|
27 |
WP_CLI::error("Error in connecting to MalCare Server. Please retry after some time.");
|
28 |
} else if (is_wp_error($resp)) {
|
@@ -71,57 +119,5 @@ class MCWPCli {
|
|
71 |
}
|
72 |
}
|
73 |
}
|
74 |
-
|
75 |
-
public function execute($args, $params) {
|
76 |
-
switch ($params['action']) {
|
77 |
-
case "setkeys":
|
78 |
-
if (!isset($params['public']) || !isset($params['secret'])) {
|
79 |
-
WP_CLI::error('Please enter valid public and secret keys.');
|
80 |
-
}
|
81 |
-
$secret = $params['secret'];
|
82 |
-
$pubkey = $params['public'];
|
83 |
-
if (strlen($pubkey) < 32 || strlen($secret) < 32) {
|
84 |
-
WP_CLI::error('Public key and secret key should be 32 characters long.');
|
85 |
-
}
|
86 |
-
MCAccount::addAccount($this->settings, $pubkey, $secret);
|
87 |
-
MCAccount::updateApiPublicKey($this->settings, $pubkey);
|
88 |
-
if (MCAccount::exists($this->settings, $pubkey)) {
|
89 |
-
WP_CLI::success('Keys Setup Successfully.');
|
90 |
-
} else {
|
91 |
-
WP_CLI::error('Keys Setup Failed.');
|
92 |
-
}
|
93 |
-
break;
|
94 |
-
case "register":
|
95 |
-
$request_params = array_merge($this->siteinfo->info(), $this->bvinfo->info());
|
96 |
-
$request_params['bvpublic'] = MCAccount::getApiPublicKey($this->settings);
|
97 |
-
$request_params['bvsecret'] = MCRecover::defaultSecret($this->settings);
|
98 |
-
$url = $this->bvinfo->appUrl()."/api/v2/sites/register";
|
99 |
-
foreach (preg_grep('#time|customer_id|host_id|action|sig|site_id|email|password#i', array_keys($params)) as $key ) {
|
100 |
-
$request_params[$key] = $params[$key];
|
101 |
-
}
|
102 |
-
$headers = array(
|
103 |
-
'Authorization' => "BVAPI-{HMAC-SHA512} {$request_params['host_id']}:{$request_params['sig']}:{$request_params['time']}"
|
104 |
-
);
|
105 |
-
$this->request($url, $request_params, $headers);
|
106 |
-
break;
|
107 |
-
case "disable_fw":
|
108 |
-
$account = MCAccount::apiPublicAccount($this->settings);
|
109 |
-
if (!$account) {
|
110 |
-
WP_CLI::error('Account not found');
|
111 |
-
}
|
112 |
-
$this->request($account->authenticatedUrl('/bvapi/disable_fw'));
|
113 |
-
break;
|
114 |
-
case "enable_fw":
|
115 |
-
$account = MCAccount::apiPublicAccount($this->settings);
|
116 |
-
if (!$account) {
|
117 |
-
WP_CLI::error('Account not found.');
|
118 |
-
}
|
119 |
-
$this->request($account->authenticatedUrl('/bvapi/enable_fw'));
|
120 |
-
break;
|
121 |
-
|
122 |
-
default:
|
123 |
-
WP_CLI::error('Please Enter a valid action');
|
124 |
-
}
|
125 |
-
}
|
126 |
}
|
127 |
endif;
|
10 |
public $bvinfo;
|
11 |
public $bvapi;
|
12 |
|
13 |
+
public function __construct($settings, $bvinfo, $bvsiteinfo, $bvapi) {
|
14 |
$this->settings = $settings;
|
15 |
$this->siteinfo = $bvsiteinfo;
|
16 |
$this->bvinfo = $bvinfo;
|
17 |
$this->bvapi = $bvapi;
|
18 |
}
|
19 |
|
20 |
+
public function create($args, $params) {
|
21 |
+
$request_params = array_merge($this->siteinfo->info(), $this->bvinfo->info());
|
22 |
+
$request_params['bvpublic'] = MCAccount::getApiPublicKey($this->settings);
|
23 |
+
$request_params['bvsecret'] = MCRecover::defaultSecret($this->settings);
|
24 |
+
$url = $this->bvinfo->appUrl()."/api/v3/accounts/".$params['account_id']."/sites";
|
25 |
+
foreach (preg_grep('#site_id|email|password|wp_cli_command#i', array_keys($params)) as $key ) {
|
26 |
+
$request_params[$key] = $params[$key];
|
27 |
+
}
|
28 |
+
$headers = array(
|
29 |
+
'Authorization' => "BVAPI-HMAC {$params['account_public']}:{$params['sig']}:{$params['timestamp']}"
|
30 |
+
);
|
31 |
+
$this->request($url, $request_params, $headers);
|
32 |
+
}
|
33 |
+
|
34 |
+
public function setkeys($args, $params) {
|
35 |
+
if (!isset($params['public']) || !isset($params['secret'])) {
|
36 |
+
WP_CLI::error('Please enter valid public and secret keys.');
|
37 |
+
}
|
38 |
+
$secret = $params['secret'];
|
39 |
+
$pubkey = $params['public'];
|
40 |
+
if (strlen($pubkey) < 32 || strlen($secret) < 32) {
|
41 |
+
WP_CLI::error('Public key and secret key should be 32 characters long.');
|
42 |
+
}
|
43 |
+
MCAccount::addAccount($this->settings, $pubkey, $secret);
|
44 |
+
MCAccount::updateApiPublicKey($this->settings, $pubkey);
|
45 |
+
if (MCAccount::exists($this->settings, $pubkey)) {
|
46 |
+
WP_CLI::success('Keys Setup Successfully.');
|
47 |
+
} else {
|
48 |
+
WP_CLI::error('Keys Setup Failed.');
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
public function disable_fw($args, $params) {
|
53 |
+
$account = MCAccount::apiPublicAccount($this->settings);
|
54 |
+
if (!$account) {
|
55 |
+
WP_CLI::error('Account not found');
|
56 |
+
}
|
57 |
+
$this->request($account->authenticatedUrl('/bvapi/disable_fw'));
|
58 |
+
}
|
59 |
+
|
60 |
+
public function enable_fw($args, $params) {
|
61 |
+
$account = MCAccount::apiPublicAccount($this->settings);
|
62 |
+
if (!$account) {
|
63 |
+
WP_CLI::error('Account not found.');
|
64 |
+
}
|
65 |
+
$this->request($account->authenticatedUrl('/bvapi/enable_fw'));
|
66 |
+
}
|
67 |
+
|
68 |
+
private function request($url, $request_params = array(), $headers = array()) {
|
69 |
$resp = $this->bvapi->http_request($url, $request_params, $headers);
|
70 |
$this->handle_response($resp);
|
71 |
}
|
72 |
|
73 |
+
private function handle_response($resp) {
|
74 |
if (empty($resp)) {
|
75 |
WP_CLI::error("Error in connecting to MalCare Server. Please retry after some time.");
|
76 |
} else if (is_wp_error($resp)) {
|
119 |
}
|
120 |
}
|
121 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
}
|
123 |
endif;
|
wp_db.php
CHANGED
@@ -182,5 +182,10 @@ class MCWPDb {
|
|
182 |
|
183 |
return $result;
|
184 |
}
|
|
|
|
|
|
|
|
|
|
|
185 |
}
|
186 |
-
endif;
|
182 |
|
183 |
return $result;
|
184 |
}
|
185 |
+
|
186 |
+
public function getMysqlVersion() {
|
187 |
+
global $wpdb;
|
188 |
+
return $wpdb->db_version();
|
189 |
+
}
|
190 |
}
|
191 |
+
endif;
|