Anti-Malware Security and Brute-Force Firewall - Version 4.17.28

Version Description

  • Added the Turkish translation thanks to Umut Can Alparslan.
  • Improved the auto update so that old definitions could be phased out and new threat types would be selected by default.
  • Fixed the admin username change feature on multisite installs.
Download this release

Release Info

Developer scheeeli
Plugin Icon 128x128 Anti-Malware Security and Brute-Force Firewall
Version 4.17.28
Comparing to
See all releases

Code changes from version 4.16.53 to 4.17.28

Files changed (4) hide show
  1. images/index.php +222 -42
  2. index.php +20 -68
  3. readme.txt +13 -4
  4. safe-load/wp-settings.php +87 -0
images/index.php CHANGED
@@ -20,7 +20,7 @@ else
20
  GOTMLS_define("GOTMLS_require_version", "3.3");
21
 
22
  if (!function_exists("__")) {
23
- function __($text, $domain) {
24
  return $text;
25
  }}
26
 
@@ -93,28 +93,6 @@ function GOTMLS_decode($encoded_string) {
93
  return "Cannot decode: $encoded_string";
94
  }}
95
 
96
- if (isset($_GET["SESSION"]) && is_numeric($_GET["SESSION"]) && preg_match('|(.*?/gotmls\.js\?SESSION=)|', GOTMLS_script_URI, $match)) {
97
- header("Content-type: text/javascript");
98
- if (is_file(GOTMLS_plugin_path."safe-load/session.php"))
99
- require_once(GOTMLS_plugin_path."safe-load/session.php");
100
- if (isset($_SESSION["GOTMLS_SESSION_TEST"]))
101
- die("/* GOTMLS SESSION PASS */\nif('undefined' != typeof stopCheckingSession && stopCheckingSession)\n\tclearTimeout(stopCheckingSession);\nshowhide('GOTMLS_patch_searching', true);\nif (autoUpdateDownloadGIF = document.getElementById('autoUpdateDownload'))\n\tdonationAmount = autoUpdateDownloadGIF.src.replace(/^.+\?/,'');\nif ((autoUpdateDownloadGIF.src == donationAmount) || donationAmount=='0') {\n\tif (patch_searching_div = document.getElementById('GOTMLS_patch_searching')) {\n\t\tif (autoUpdateDownloadGIF.src == donationAmount)\n\t\t\tpatch_searching_div.innerHTML = '<span style=\"color: #F00;\">".__("You must register and donate to use this feature!",'gotmls')."</span>';\n\t\telse\n\t\t\tpatch_searching_div.innerHTML = '<span style=\"color: #F00;\">".__("This feature is available to those who have donated!",'gotmls')."</span>';\n\t}\n} else {\n\tshowhide('GOTMLS_patch_searching');\n\tshowhide('GOTMLS_patch_button', true);\n}\n");
102
- else {
103
- $_SESSION["GOTMLS_SESSION_TEST"] = $_GET["SESSION"] + 1;
104
- if ($_GET["SESSION"] > 0)
105
- die("/* GOTMLS SESSION FAIL */\nif('undefined' != typeof stopCheckingSession && stopCheckingSession)\n\tclearTimeout(stopCheckingSession);\ndocument.getElementById('GOTMLS_patch_searching').innerHTML = '<div class=\"error\">".__("Your Server could not start a Session!",'gotmls')."</div>';");
106
- else
107
- die("/* GOTMLS SESSION TEST */\nif('undefined' != typeof stopCheckingSession && stopCheckingSession)\n\tclearTimeout(stopCheckingSession);\nstopCheckingSession = checkupdateserver('".$match[0].$_SESSION["GOTMLS_SESSION_TEST"]."', 'GOTMLS_patch_searching');");
108
- }
109
- } elseif ((isset($_SERVER["DOCUMENT_ROOT"]) && ($SCRIPT_FILE = str_replace($_SERVER["DOCUMENT_ROOT"], "", isset($_SERVER["SCRIPT_FILENAME"])?$_SERVER["SCRIPT_FILENAME"]:isset($_SERVER["SCRIPT_NAME"])?$_SERVER["SCRIPT_NAME"]:"")) && strlen($SCRIPT_FILE) > strlen("/".basename(__FILE__)) && substr(__FILE__, -1 * strlen($SCRIPT_FILE)) == substr($SCRIPT_FILE, -1 * strlen(__FILE__))) || !defined("GOTMLS_plugin_path")) {
110
- header("Content-type: image/gif");
111
- $img_src = GOTMLS_local_images_path.'GOTMLS-16x16.gif';
112
- if (!(file_exists($img_src) && $img_bin = @file_get_contents($img_src)))
113
- $img_bin = GOTMLS_decode('R=lGODlhEAAQAIABAAAAAP___yH5BAEAAAEALAAAAAAQABAAAAIshB=Qm-eo2HuJNWdrjlFm3S2hKB7kViKaxZmr98YgSo_jzH6tiU=974MADwUAOw2');
114
- die($img_bin);
115
- } elseif (isset($_GET["no_error_reporting"]))
116
- @error_reporting(0);
117
-
118
  GOTMLS_define("GOTMLS_Failed_to_list_LANGUAGE", __("Failed to list files in directory!",'gotmls'));
119
  GOTMLS_define("GOTMLS_Run_Quick_Scan_LANGUAGE", __("Quick Scan",'gotmls'));
120
  GOTMLS_define("GOTMLS_View_Quarantine_LANGUAGE", __("View Quarantine",'gotmls'));
@@ -124,7 +102,17 @@ GOTMLS_define("GOTMLS_Scan_Settings_LANGUAGE", __("Scan Settings",'gotmls'));
124
  GOTMLS_define("GOTMLS_Loading_LANGUAGE", __("Loading, Please Wait ...",'gotmls'));
125
  GOTMLS_define("GOTMLS_Automatically_Fix_LANGUAGE", __("Automatically Fix SELECTED Files Now",'gotmls'));
126
 
127
- if (function_exists("get_option")) {
 
 
 
 
 
 
 
 
 
 
128
  function GOTMLS_update_option($index, $value = array()) {
129
  return update_option('GOTMLS_'.$index.'_blob', GOTMLS_encode(serialize($value)));
130
  }
@@ -136,20 +124,18 @@ function GOTMLS_get_option($index, $value = array()) {
136
  $tmp = $value;
137
  return unserialize(GOTMLS_decode(get_option('GOTMLS_'.$index.'_blob', GOTMLS_encode(serialize($tmp)))));
138
  }
139
- $GLOBALS["GOTMLS"]["tmp"]["nonce"] = get_option('GOTMLS_nonce_array', array());
140
- $GLOBALS["GOTMLS"]["tmp"]["settings_array"] = get_option('GOTMLS_settings_array', array());
141
- $GLOBALS["GOTMLS"]["tmp"]["definitions_array"] = GOTMLS_get_option('definitions', $GLOBALS["GOTMLS"]["tmp"]["definitions_array"]);
142
- GOTMLS_define("GOTMLS_siteurl", get_option("siteurl"));
143
- $GLOBALS["GOTMLS"]["log"] = get_option('GOTMLS_scan_log/'.(isset($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:"0.0.0.0").'/'.$GLOBALS["GOTMLS"]["tmp"]["mt"], array());
144
- if (!(isset($GLOBALS["GOTMLS"]["log"]["settings"]) && is_array($GLOBALS["GOTMLS"]["log"]["settings"])))
145
- $GLOBALS["GOTMLS"]["log"]["settings"] = $GLOBALS["GOTMLS"]["tmp"]["settings_array"];
146
- } else {
147
- GOTMLS_define("GOTMLS_siteurl", $GLOBALS["GOTMLS"]["tmp"]["protocol"].$SERVER_parts[1].((count($SERVER_parts) > 2 && ($SERVER_parts[2] == '80' || $SERVER_parts[2] == '443'))?"":":".$SERVER_parts[2])."/");
148
- $GLOBALS["GOTMLS"]["log"] = array();
149
- $GLOBALS["GOTMLS"]["tmp"]["settings_array"] = array();
150
- }
151
  GOTMLS_define("GOTMLS_installation_key", md5(GOTMLS_siteurl));
152
- GOTMLS_define("GOTMLS_update_home", "http://updates.gotmls.net/".GOTMLS_installation_key."/");
153
 
154
  if (!function_exists("GOTMLS_Invalid_Nonce")) {
155
  function GOTMLS_Invalid_Nonce($pre = "//Error: ") {
@@ -162,7 +148,7 @@ function GOTMLS_set_nonce($context = "NULL") {
162
  $transient_name = md5(GOTMLS_installation_key.GOTMLS_plugin_path.$hour);
163
  foreach ($GLOBALS["GOTMLS"]["tmp"]["nonce"] as $nonce_key => $nonce_value)
164
  if (($nonce_value + 24) < $hour)
165
- unset($GLOBALS["GOTMLS"]["tmp"]["nonce"][$nonce_value]);
166
  if (!isset($GLOBALS["GOTMLS"]["tmp"]["nonce"][$transient_name])) {
167
  $GLOBALS["GOTMLS"]["tmp"]["nonce"][$transient_name] = $hour;
168
  if (!update_option('GOTMLS_nonce_array', $GLOBALS["GOTMLS"]["tmp"]["nonce"]))
@@ -186,6 +172,194 @@ function GOTMLS_get_nonce() {
186
  } else
187
  return false;
188
  }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
 
190
  if (function_exists("plugins_url"))
191
  GOTMLS_define("GOTMLS_images_path", plugins_url('/', __FILE__));
@@ -198,8 +372,6 @@ elseif (isset($_SERVER["SCRIPT_FILENAME"]) && isset($_SERVER["DOCUMENT_ROOT"]) &
198
  else
199
  GOTMLS_define("GOTMLS_images_path", "/wp-content/plugins/update/images/");
200
 
201
- $GOTMLS_chmod_file = (0644);
202
- $GOTMLS_chmod_dir = (0755);
203
  $GOTMLS_image_alt = array("wait"=>"...", "checked"=>"&#x2714;", "blocked"=>"X", "question"=>"?", "threat"=>"!");
204
  $GOTMLS_dir_at_depth = array();
205
  $GOTMLS_dirs_at_depth = array();
@@ -237,7 +409,7 @@ foreach ($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["firewall"] as $TP => $V
237
  elseif (!preg_match($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["firewall"]["$TP"][$V], $GLOBAL_STRING[$GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["firewall"]["$TP"][$V-1]], $matches))
238
  $GLOBALS["GOTMLS"]["detected_attacks"] = "";
239
  if ($GLOBALS["GOTMLS"]["detected_attacks"])
240
- include(dirname(__FILE__)."/../safe-load/index.php");
241
  }
242
  }
243
  $GLOBALS["GOTMLS"]["detected_attacks"] = "";
@@ -272,6 +444,12 @@ function GOTMLS_array_recurse($array1, $array2) {
272
  return $array1;
273
  }
274
 
 
 
 
 
 
 
275
  function GOTMLS_array_replace_recursive($array1 = array()) {
276
  $args = func_get_args();
277
  $array1 = $args[0];
@@ -918,6 +1096,8 @@ function GOTMLS_reset_settings($item, $key) {
918
 
919
  function GOTMLS_file_put_contents($file, $content) {
920
  global $GOTMLS_chmod_file, $GOTMLS_chmod_dir;
 
 
921
  if ((is_dir(dirname($file)) || @mkdir(dirname($file), $GOTMLS_chmod_dir, true)) && !is_writable(dirname($file)) && ($GOTMLS_chmod_dir = @fileperms(dirname($file))))
922
  $chmoded_dir = @chmod(dirname($file), 0777);
923
  if (is_file($file) && !is_writable($file) && ($GOTMLS_chmod_file = @fileperms($file)))
@@ -1010,4 +1190,4 @@ function GOTMLS_get_URL($URL) {
1010
  if (isset($_GET["GOTMLS_debug"]) && (strlen($response) == 0 || $_GET["GOTMLS_debug"] == "GOTMLS_get_URL"))
1011
  print_r(array("$method:".strlen($response)=>$GLOBALS["GOTMLS"]["get_URL"]));
1012
  return $response;
1013
- }
20
  GOTMLS_define("GOTMLS_require_version", "3.3");
21
 
22
  if (!function_exists("__")) {
23
+ function __($text, $domain = "gotmls") {
24
  return $text;
25
  }}
26
 
93
  return "Cannot decode: $encoded_string";
94
  }}
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  GOTMLS_define("GOTMLS_Failed_to_list_LANGUAGE", __("Failed to list files in directory!",'gotmls'));
97
  GOTMLS_define("GOTMLS_Run_Quick_Scan_LANGUAGE", __("Quick Scan",'gotmls'));
98
  GOTMLS_define("GOTMLS_View_Quarantine_LANGUAGE", __("View Quarantine",'gotmls'));
102
  GOTMLS_define("GOTMLS_Loading_LANGUAGE", __("Loading, Please Wait ...",'gotmls'));
103
  GOTMLS_define("GOTMLS_Automatically_Fix_LANGUAGE", __("Automatically Fix SELECTED Files Now",'gotmls'));
104
 
105
+ if (!defined("ABSPATH")) {
106
+ define("ABSPATH", dirname(dirname(__FILE__)).'/safe-load/');
107
+ $root_path = dirname(ABSPATH);
108
+ while (strlen($root_path) > 1 && !is_file($root_path."/wp-config.php"))
109
+ $root_path = dirname($root_path);
110
+ if (is_file($root_path."/wp-config.php"))
111
+ include_once($root_path."/wp-config.php");
112
+ else
113
+ die("No wp-config!");
114
+ }
115
+
116
  function GOTMLS_update_option($index, $value = array()) {
117
  return update_option('GOTMLS_'.$index.'_blob', GOTMLS_encode(serialize($value)));
118
  }
124
  $tmp = $value;
125
  return unserialize(GOTMLS_decode(get_option('GOTMLS_'.$index.'_blob', GOTMLS_encode(serialize($tmp)))));
126
  }
127
+ $GOTMLS_chmod_file = (0644);
128
+ $GOTMLS_chmod_dir = (0755);
129
+ $GLOBALS["GOTMLS"]["tmp"]["nonce"] = get_option('GOTMLS_nonce_array', array());
130
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"] = get_option('GOTMLS_settings_array', array());
131
+ $GLOBALS["GOTMLS"]["tmp"]["definitions_array"] = GOTMLS_get_option('definitions', $GLOBALS["GOTMLS"]["tmp"]["definitions_array"]);
132
+ GOTMLS_define("GOTMLS_siteurl", get_option("siteurl", $GLOBALS["GOTMLS"]["tmp"]["protocol"].$SERVER_parts[1].((count($SERVER_parts) > 2 && ($SERVER_parts[2] == '80' || $SERVER_parts[2] == '443'))?"":":".$SERVER_parts[2])."/"));
133
+ $GLOBALS["GOTMLS"]["log"] = get_option('GOTMLS_scan_log/'.(isset($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:"0.0.0.0").'/'.$GLOBALS["GOTMLS"]["tmp"]["mt"], array());
134
+ if (!(isset($GLOBALS["GOTMLS"]["log"]["settings"]) && is_array($GLOBALS["GOTMLS"]["log"]["settings"])))
135
+ $GLOBALS["GOTMLS"]["log"]["settings"] = $GLOBALS["GOTMLS"]["tmp"]["settings_array"];
136
+
 
 
137
  GOTMLS_define("GOTMLS_installation_key", md5(GOTMLS_siteurl));
138
+ GOTMLS_define("GOTMLS_update_home", "https://updates.gotmls.net/".GOTMLS_installation_key."/");
139
 
140
  if (!function_exists("GOTMLS_Invalid_Nonce")) {
141
  function GOTMLS_Invalid_Nonce($pre = "//Error: ") {
148
  $transient_name = md5(GOTMLS_installation_key.GOTMLS_plugin_path.$hour);
149
  foreach ($GLOBALS["GOTMLS"]["tmp"]["nonce"] as $nonce_key => $nonce_value)
150
  if (($nonce_value + 24) < $hour)
151
+ unset($GLOBALS["GOTMLS"]["tmp"]["nonce"][$nonce_key]);
152
  if (!isset($GLOBALS["GOTMLS"]["tmp"]["nonce"][$transient_name])) {
153
  $GLOBALS["GOTMLS"]["tmp"]["nonce"][$transient_name] = $hour;
154
  if (!update_option('GOTMLS_nonce_array', $GLOBALS["GOTMLS"]["tmp"]["nonce"]))
172
  } else
173
  return false;
174
  }}
175
+ if (isset($_GET["SESSION"]) && is_numeric($_GET["SESSION"]) && preg_match('|(.*?/gotmls\.js\?SESSION=)|', GOTMLS_script_URI, $match)) {
176
+ header("Content-type: text/javascript");
177
+ if (is_file(GOTMLS_plugin_path."safe-load/session.php"))
178
+ require_once(GOTMLS_plugin_path."safe-load/session.php");
179
+ if (isset($_SESSION["GOTMLS_SESSION_TEST"]))
180
+ die("/* GOTMLS SESSION PASS */\nif('undefined' != typeof stopCheckingSession && stopCheckingSession)\n\tclearTimeout(stopCheckingSession);\nshowhide('GOTMLS_patch_searching', true);\nif (autoUpdateDownloadGIF = document.getElementById('autoUpdateDownload'))\n\tdonationAmount = autoUpdateDownloadGIF.src.replace(/^.+\?/,'');\nif ((autoUpdateDownloadGIF.src == donationAmount) || donationAmount=='0') {\n\tif (patch_searching_div = document.getElementById('GOTMLS_patch_searching')) {\n\t\tif (autoUpdateDownloadGIF.src == donationAmount)\n\t\t\tpatch_searching_div.innerHTML = '<span style=\"color: #F00;\">".__("You must register and donate to use this feature!",'gotmls')."</span>';\n\t\telse\n\t\t\tpatch_searching_div.innerHTML = '<span style=\"color: #F00;\">".__("This feature is available to those who have donated!",'gotmls')."</span>';\n\t}\n} else {\n\tshowhide('GOTMLS_patch_searching');\n\tshowhide('GOTMLS_patch_button', true);\n}\n");
181
+ else {
182
+ $_SESSION["GOTMLS_SESSION_TEST"] = $_GET["SESSION"] + 1;
183
+ if ($_GET["SESSION"] > 0)
184
+ die("/* GOTMLS SESSION FAIL */\nif('undefined' != typeof stopCheckingSession && stopCheckingSession)\n\tclearTimeout(stopCheckingSession);\ndocument.getElementById('GOTMLS_patch_searching').innerHTML = '<div class=\"error\">".__("Your Server could not start a Session!",'gotmls')."</div>';");
185
+ else
186
+ die("/* GOTMLS SESSION TEST */\nif('undefined' != typeof stopCheckingSession && stopCheckingSession)\n\tclearTimeout(stopCheckingSession);\nstopCheckingSession = checkupdateserver('".$match[0].$_SESSION["GOTMLS_SESSION_TEST"]."', 'GOTMLS_patch_searching');");
187
+ }
188
+ } elseif ((isset($_SERVER["DOCUMENT_ROOT"]) && ($SCRIPT_FILE = str_replace($_SERVER["DOCUMENT_ROOT"], "", isset($_SERVER["SCRIPT_FILENAME"])?$_SERVER["SCRIPT_FILENAME"]:isset($_SERVER["SCRIPT_NAME"])?$_SERVER["SCRIPT_NAME"]:"")) && strlen($SCRIPT_FILE) > strlen("/".basename(__FILE__)) && substr(__FILE__, -1 * strlen($SCRIPT_FILE)) == substr($SCRIPT_FILE, -1 * strlen(__FILE__)))) {
189
+ if (isset($_GET["page"]) && $_GET["page"] == "GOTMLS-View-Quarantine" && isset($_REQUEST["GOTMLS_mt"]) && strlen($_REQUEST["GOTMLS_mt"]) == 32 && isset($GLOBALS["GOTMLS"]["tmp"]["nonce"][$_REQUEST["GOTMLS_mt"]])) {
190
+ $return = (print_r( array("nonce"=>$GLOBALS["GOTMLS"]["tmp"]["nonce"][$_REQUEST["GOTMLS_mt"]],"mt"=>($_REQUEST["GOTMLS_mt"])),1));
191
+ try {
192
+ $Q_Paged = '<form method="POST" name="GOTMLS_Form_page"><input type="hidden" id="GOTMLS_paged" name="paged" value="1">';//<div style="float: left;">Page:</div>';
193
+ $Q_Page = '
194
+ <style>
195
+ #found_Quarantine {
196
+ line-height: 1.4em;
197
+ font-size: 13px;
198
+ }
199
+ #GOTMLS-right-sidebar {float: right; margin-right: 0px;}
200
+ span.GOTMLS_date {float: right; width: 135px; white-space: nowrap; font-size: 11px;}
201
+ .GOTMLS_page {float: left; border-radius: 10px; padding: 0 5px;}
202
+ .GOTMLS_quarantine_item {margin: 4px 12px;}
203
+ .rounded-corners {margin: 10px; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border: 1px solid #000;}
204
+ .shadowed-box {box-shadow: -3px 3px 3px #666; -moz-box-shadow: -3px 3px 3px #666; -webkit-box-shadow: -3px 3px 3px #666;}
205
+ .sidebar-box {background-color: #CCC;}
206
+ .GOTMLS-scanlog li a {display: none;}
207
+ .GOTMLS-scanlog li:hover a {display: block;}
208
+ .GOTMLS-sidebar-links {list-style: none;}
209
+ .GOTMLS-sidebar-links li img {margin: 3px; height: 16px; vertical-align: middle;}
210
+ .GOTMLS-sidebar-links li {margin-bottom: 0 !important;}
211
+ .popup-box {background-color: #FFC; display: none; position: absolute; left: 0px; z-index: 10;}
212
+ .shadowed-text {text-shadow: #00F -1px 1px 1px;}
213
+ .sub-option {float: left; margin: 3px 5px;}
214
+ .inside p {margin: 10px;}
215
+ .GOTMLS_li, .GOTMLS_plugin li {list-style: none;}
216
+ .GOTMLS_plugin {margin: 5px; background: #cfc; border: 1px solid #0C0; padding: 0 5px; border-radius: 3px;}
217
+ .GOTMLS_plugin.disabled, .GOTMLS_plugin.read-only {background: #9f9; border: 1px solid #0f0;}
218
+ .GOTMLS_plugin.known, .GOTMLS_plugin.backdoor, .GOTMLS_plugin.htaccess, .GOTMLS_plugin.timthumb, .GOTMLS_plugin.errors {background: #f99; border: 1px solid #f00;}
219
+ .GOTMLS_plugin.potential, .GOTMLS_plugin.wp_core, .GOTMLS_plugin.skipdirs, .GOTMLS_plugin.skipped {background: #ffc; border: 1px solid #fc6;}
220
+ .GOTMLS ul li {margin-left: 12px;}
221
+ .GOTMLS h2 {margin: 0 0 10px;}
222
+ .postbox {margin-right: 10px;}
223
+ #pastDonations li {list-style: none;}
224
+ #quarantine_buttons {float: right;}//position: absolute; right: 0px; top: -54px; margin: 0px; padding: 0px;}
225
+ #quarantine_buttons input.button-primary {margin-right: 20px;}
226
+ #main-page-title {
227
+ background: url("//gravatar.com/avatar/5feb789dd3a292d563fea3b885f786d6?s=64") no-repeat scroll 0 0 transparent;
228
+ height: 64px;
229
+ line-height: 58px;
230
+ margin: 10px 0 0 0;
231
+ max-width: 600px;
232
+ padding: 0 110px 0 84px;
233
+ }
234
+ #main-page-title h1 {
235
+ background: url("//gravatar.com/avatar/8151cac22b3fc543d099241fd573d176?s=64") no-repeat scroll top right transparent;
236
+ height: 64px;
237
+ line-height: 32px;
238
+ margin: 0;
239
+ padding: 0 84px 0 0;
240
+ display: table-cell;
241
+ text-align: center;
242
+ vertical-align: middle;
243
+ }
244
+ </style>
245
+ <script type="text/javascript">
246
+ function showhide(id) {
247
+ divx = document.getElementById(id);
248
+ if (divx) {
249
+ if (divx.style.display == "none" || arguments[1]) {
250
+ divx.style.display = "block";
251
+ divx.parentNode.className = (divx.parentNode.className+"close").replace(/close/gi,"");
252
+ return true;
253
+ } else {
254
+ divx.style.display = "none";
255
+ return false;
256
+ }
257
+ }
258
+ }
259
+ function checkAllFiles(check) {
260
+ var checkboxes = new Array();
261
+ checkboxes = document["GOTMLS_Form_clean"].getElementsByTagName("input");
262
+ for (var i=0; i<checkboxes.length; i++)
263
+ if (checkboxes[i].type == "checkbox")
264
+ checkboxes[i].checked = check;
265
+ }
266
+ </script>
267
+ <form method="POST" action="?'.(isset($_SERVER["QUERY_STRING"])&&strlen($_SERVER["QUERY_STRING"])?$_SERVER["QUERY_STRING"]:"page=GOTMLS-View-Quarantine&".GOTMLS_set_nonce(__FUNCTION__."256")).'" target="GOTMLS_iFrame" name="GOTMLS_Form_clean">';
268
+ if (isset($_REQUEST["id"]) && is_numeric($_REQUEST["id"])) {
269
+ $my_query = $wpdb->get_results("SELECT * FROM `{$table_prefix}posts` WHERE `post_type` = 'GOTMLS_quarantine' AND `post_status` = 'private' AND `ID` = ".$_REQUEST["id"], ARRAY_A);
270
+ if (is_array($my_query) && count($my_query) && ($Q_post = $my_query[0]) && isset($Q_post["post_type"]) && $Q_post["post_type"] == "GOTMLS_quarantine" && isset($Q_post["post_status"]) && $Q_post["post_status"] == "private") {
271
+ $clean_file = $Q_post["post_title"];
272
+ $GLOBALS["GOTMLS"]["tmp"]["file_contents"] = GOTMLS_decode($Q_post["post_content"]);
273
+ $fa = "";
274
+ if (isset($Q_post["post_excerpt"]) && strlen($Q_post["post_excerpt"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["threats_found"] = @unserialize(GOTMLS_decode($Q_post["post_excerpt"])))) {
275
+ $f = 1;
276
+ foreach ($GLOBALS["GOTMLS"]["tmp"]["threats_found"] as $threats_found => $threats_name) {
277
+ list($start, $end, $junk) = explode("-", "$threats_found--", 3);
278
+ if (strlen($end) > 0 && is_numeric($start) && is_numeric($end)) {
279
+ if ($start < $end)
280
+ $fa .= ' <a title="'.htmlspecialchars($threats_name).'" href="javascript:select_text_range(\'ta_file\', '.$start.', '.$end.');">['.$f++.']</a>';
281
+ else
282
+ $fa .= ' <a title="'.htmlspecialchars($threats_name).'" href="javascript:select_text_range(\'ta_file\', '.$end.', '.$start.');">['.$f++.']</a>';
283
+ } else {
284
+ if (is_numeric($threats_found)) {
285
+ $threats_found = $threats_name;
286
+ $threats_name = $f;
287
+ }
288
+ $fpos = 0;
289
+ $flen = 0;
290
+ $potential_threat = str_replace("\r", "", $threats_found);
291
+ while (($fpos = strpos(str_replace("\r", "", $GLOBALS["GOTMLS"]["tmp"]["file_contents"]), ($potential_threat), $flen + $fpos)) !== false) {
292
+ $flen = strlen($potential_threat);
293
+ $fa .= ' <a title="'.htmlspecialchars($threats_name).'" href="javascript:select_text_range(\'ta_file\', '.($fpos).', '.($fpos + $flen).');">['.$f++.']</a>';
294
+ }
295
+ }
296
+ }
297
+ }
298
+ die("\n".'<script type="text/javascript">
299
+ function select_text_range(ta_id, start, end) {
300
+ var textBox = document.getElementById(ta_id);
301
+ var scrolledText = "";
302
+ scrolledText = textBox.value.substring(0, end);
303
+ textBox.focus();
304
+ if (textBox.setSelectionRange) {
305
+ scrolledText = textBox.value.substring(end);
306
+ textBox.value = textBox.value.substring(0, end);
307
+ textBox.scrollTop = textBox.scrollHeight;
308
+ textBox.value = textBox.value + scrolledText;
309
+ textBox.setSelectionRange(start, end);
310
+ } else if (textBox.createTextRange) {
311
+ var range = textBox.createTextRange();
312
+ range.collapse(true);
313
+ range.moveStart("character", start);
314
+ range.moveEnd("character", end);
315
+ range.select();
316
+ } else
317
+ alert("The highlighting function does not work in your browser");
318
+ }
319
+ </script><table style="top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;"><tr><td style="width: 100%"><form style="margin: 0;" method="post" action="?'.GOTMLS_set_nonce(__FUNCTION__."1522").'&page=GOTMLS-View-Quarantine&GOTMLS_mt='.$_REQUEST["GOTMLS_mt"].'" onsubmit="return confirm(\''.__("Are you sure you want to restore this file from the quarantine?",'gotmls').'\');"><input type="hidden" name="id[]" value="'.$Q_post["ID"].'"><input type="submit" value="RESTORE from Quarantine" style="display: none; background-color: #0C0; float: right;"></form><div id="fileperms" class="shadowed-box rounded-corners" style="display: none; position: absolute; left: 8px; top: 29px; background-color: #ccc; border: medium solid #C00; box-shadow: -3px 3px 3px #666; border-radius: 10px; padding: 10px;"><b>File Details</b><br />encoding: '.(function_exists("mb_detect_encoding")?mb_detect_encoding($GLOBALS["GOTMLS"]["tmp"]["file_contents"]):"Unknown").'<br />size: '.strlen($GLOBALS["GOTMLS"]["tmp"]["file_contents"]).' bytes<br />infected:'.$Q_post["post_modified_gmt"].'<br />quarantined:'.$Q_post["post_date_gmt"].'</div><div style="overflow: auto;"><span onmouseover="document.getElementById(\'fileperms\').style.display=\'block\';" onmouseout="document.getElementById(\'fileperms\').style.display=\'none\';">'.__("File Details:",'gotmls').'</span> ('.$fa.' )</div></td></tr><tr><td style="height: 100%"><textarea id="ta_file" style="width: 100%; height: 100%">'.htmlentities(str_replace("\r", "", $GLOBALS["GOTMLS"]["tmp"]["file_contents"])).'</textarea></td></tr></table>');
320
+ } else
321
+ die('<h3>Item NOT Found in Quarantine</h3>');
322
+ } else {
323
+ $my_query = $wpdb->get_results("SELECT * FROM `{$table_prefix}posts` WHERE `post_type` = 'GOTMLS_quarantine' AND `post_status` = 'private' ORDER BY `post_date_gmt` DESC", ARRAY_A);
324
+ if (is_array($my_query) && count($my_query)) {
325
+ $Q_Page .= '<p id="quarantine_buttons" style="display: none;"><input id="repair_button" type="submit" value="Restore selected files" class="button-primary" style="background-color: #0C0;" onclick="return confirm(\'Are you sure you want to overwrite the previously cleaned files with the selected files in the Quarantine?\'));" /></p><p><b>The following items have been found to contain malicious code, they have been cleaned, and the original infected file contents have been saved here in the Quarantine. The code is safe here and you do not need to do anything further with these files.</b></p>
326
+ <ul name="found_Quarantine" id="found_Quarantine" class="GOTMLS_plugin known" style="background-color: #ccc; padding: 0;"><h3 style="margin: 8px 12px;">'.(count($my_query)>1?'<input type="checkbox" onchange="checkAllFiles(this.checked); document.getElementById(\'quarantine_buttons\').style.display = \'block\';"> '.sprintf(__("Check all %d",'gotmls'),count($my_query)):"").__(" Items in Quarantine",'gotmls').'<span class="GOTMLS_date">'.__("Quarantined",'gotmls').'</span><span class="GOTMLS_date">'.__("Date Infected",'gotmls').'</span></h3>';
327
+ $root_path = implode(GOTMLS_slash(), array_slice(GOTMLS_explode_dir(__FILE__), 0, (2 + intval($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_level"])) * -1));
328
+ foreach ($my_query as $post_a) {
329
+ $restored = "";
330
+ $image = "blocked";
331
+ if (isset($_REQUEST["id"]) && is_array($_REQUEST["id"]) && in_array($post_a["ID"], $_REQUEST["id"])) {
332
+ $restored = " read-only disabled";
333
+ if (GOTMLS_file_put_contents($post_a["post_title"], GOTMLS_decode($post_a["post_content"]))) {
334
+ $post_a["post_modified_gmt"] = date("Y-m-d H:i:s");
335
+ $image = "checked";
336
+ $wpdb->query("UPDATE `{$table_prefix}posts` SET `post_status` = 'pending' WHERE `post_type` = 'GOTMLS_quarantine' AND `post_status` = 'private' AND `ID` = ".$post_a["ID"]);
337
+ }
338
+ }
339
+ $Q_Page .= '
340
+ <li id="GOTMLS_quarantine_'.$post_a["ID"].'" class="GOTMLS_quarantine_item"><span class="GOTMLS_date">'.$post_a["post_date_gmt"].'</span><span class="GOTMLS_date">'.$post_a["post_modified_gmt"].'</span><input'.$restored.' type="checkbox" name="id[]" value="'.$post_a["ID"].'" id="check_'.$post_a["ID"].'" onchange="document.getElementById(\'quarantine_buttons\').style.display = \'block\';" /><img src="'.$image.'.gif" height=16 width=16 alt="Q"><a class="GOTMLS_plugin '.$restored.$post_a["ping_status"].'" target="_blank" href="?page=GOTMLS-View-Quarantine&id='.$post_a["ID"].'&'.GOTMLS_set_nonce(__FUNCTION__."191").'" title="View Quarantined File">'.str_replace($root_path, "...", $post_a["post_title"])."</a></li>\n";
341
+ }
342
+ $Q_Page .= "\n</ul>";
343
+ for ($p = 1; $p <= 0; $p++) {
344
+ $Q_Paged .= '<input class="GOTMLS_page" type="submit" value="'.$p.'"'.((isset($_POST["paged"]) && $_POST["paged"] == $p) || (!isset($_POST["paged"]) && 1 == $p)?" DISABLED":"").' onclick="document.getElementById(\'GOTMLS_paged\').value = \''.$p.'\';">';
345
+ }
346
+ } else
347
+ $Q_Page .= '<h3>'.__("No Items in Quarantine",'gotmls').'</h3>';
348
+ $return = "$Q_Paged\n</form><br style=\"clear: left;\" />\n$Q_Page\n</form>\n$Q_Paged\n</form><br style=\"clear: left;\" />\n";
349
+ die("$return");
350
+ }
351
+ } catch (Exception $e) {
352
+ die('Caught exception: '. $e->getMessage(). "\n");
353
+ }
354
+ } else {
355
+ header("Content-type: image/gif");
356
+ $img_src = GOTMLS_local_images_path.'GOTMLS-16x16.gif';
357
+ if (!(file_exists($img_src) && $img_bin = @file_get_contents($img_src)))
358
+ $img_bin = GOTMLS_decode('R=lGODlhEAAQAIABAAAAAP___yH5BAEAAAEALAAAAAAQABAAAAIshB=Qm-eo2HuJNWdrjlFm3S2hKB7kViKaxZmr98YgSo_jzH6tiU=974MADwUAOw2');
359
+ die($img_bin);
360
+ }
361
+ } elseif (isset($_GET["no_error_reporting"]))
362
+ @error_reporting(0);
363
 
364
  if (function_exists("plugins_url"))
365
  GOTMLS_define("GOTMLS_images_path", plugins_url('/', __FILE__));
372
  else
373
  GOTMLS_define("GOTMLS_images_path", "/wp-content/plugins/update/images/");
374
 
 
 
375
  $GOTMLS_image_alt = array("wait"=>"...", "checked"=>"&#x2714;", "blocked"=>"X", "question"=>"?", "threat"=>"!");
376
  $GOTMLS_dir_at_depth = array();
377
  $GOTMLS_dirs_at_depth = array();
409
  elseif (!preg_match($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["firewall"]["$TP"][$V], $GLOBAL_STRING[$GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["firewall"]["$TP"][$V-1]], $matches))
410
  $GLOBALS["GOTMLS"]["detected_attacks"] = "";
411
  if ($GLOBALS["GOTMLS"]["detected_attacks"])
412
+ include(dirname(dirname(__FILE__))."/safe-load/index.php");
413
  }
414
  }
415
  $GLOBALS["GOTMLS"]["detected_attacks"] = "";
444
  return $array1;
445
  }
446
 
447
+ function GOTMLS_array_replace($array1, $array2) {
448
+ foreach ($array2 as $key => $value)
449
+ $array1[$key] = $value;
450
+ return $array1;
451
+ }
452
+
453
  function GOTMLS_array_replace_recursive($array1 = array()) {
454
  $args = func_get_args();
455
  $array1 = $args[0];
1096
 
1097
  function GOTMLS_file_put_contents($file, $content) {
1098
  global $GOTMLS_chmod_file, $GOTMLS_chmod_dir;
1099
+ $chmoded_file = false;
1100
+ $chmoded_dir = false;
1101
  if ((is_dir(dirname($file)) || @mkdir(dirname($file), $GOTMLS_chmod_dir, true)) && !is_writable(dirname($file)) && ($GOTMLS_chmod_dir = @fileperms(dirname($file))))
1102
  $chmoded_dir = @chmod(dirname($file), 0777);
1103
  if (is_file($file) && !is_writable($file) && ($GOTMLS_chmod_file = @fileperms($file)))
1190
  if (isset($_GET["GOTMLS_debug"]) && (strlen($response) == 0 || $_GET["GOTMLS_debug"] == "GOTMLS_get_URL"))
1191
  print_r(array("$method:".strlen($response)=>$GLOBALS["GOTMLS"]["get_URL"]));
1192
  return $response;
1193
+ }
index.php CHANGED
@@ -8,7 +8,7 @@ Author URI: http://wordpress.ieonly.com/category/my-plugins/anti-malware/
8
  Contributors: scheeeli, gotmls
9
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZHD8QHZ2E7PE
10
  Description: This Anti-Virus/Anti-Malware plugin searches for Malware and other Virus like threats and vulnerabilities on your server and helps you remove them. It's always growing and changing to adapt to new threats so let me know if it's not working for you.
11
- Version: 4.16.53
12
  */
13
  if (isset($_SERVER["DOCUMENT_ROOT"]) && ($SCRIPT_FILE = str_replace($_SERVER["DOCUMENT_ROOT"], "", isset($_SERVER["SCRIPT_FILENAME"])?$_SERVER["SCRIPT_FILENAME"]:isset($_SERVER["SCRIPT_NAME"])?$_SERVER["SCRIPT_NAME"]:"")) && strlen($SCRIPT_FILE) > strlen("/".basename(__FILE__)) && substr(__FILE__, -1 * strlen($SCRIPT_FILE)) == substr($SCRIPT_FILE, -1 * strlen(__FILE__)))
14
  include(dirname(__FILE__)."/safe-load/index.php");
@@ -105,7 +105,7 @@ function GOTMLS_display_header($optional_box = "") {
105
  echo '<div id="check_site" style="z-index: 1234567;"><img src="'.GOTMLS_images_path.'checked.gif" height=16 width=16 alt="&#x2714;"> '.__("Tested your site. It appears we didn't break anything",'gotmls').' ;-)</div><script type="text/javascript">window.parent.document.getElementById("check_site_warning").style.backgroundColor=\'#0C0\';</script><li>Please <a target="_blank" href="https://wordpress.org/plugins/gotmls/stats/?compatibility%5Bversion%5D='.$wp_version.'&compatibility%5Btopic_version%5D='.GOTMLS_Version.'&compatibility%5Bcompatible%5D=1#compatibility-works">Vote "Works"</a> or <a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/gotmls#postform">write a "Five-Star" Reviews</a> on WordPress.org if you like this plugin.</li><style>#footer, #GOTMLS-metabox-container, #GOTMLS-right-sidebar, #admin-page-container, #wpadminbar, #adminmenuback, #adminmenuwrap, #adminmenu, .error, .updated, .update-nag {display: none !important;} #wpbody-content {padding-bottom: 0;} #wpbody, html.wp-toolbar {padding-top: 0 !important;} #wpcontent, #footer {margin-left: 5px !important;}';
106
  else
107
  echo '<style>#GOTMLS-right-sidebar {float: right; margin-right: 0px;}';
108
- $Update_Definitions = array(GOTMLS_plugin_home.'definitions.js'.$GLOBALS["GOTMLS"]["tmp"]["Definition"]["Updates"].'&js='.GOTMLS_Version.'&p=GOTMLS&wp='.$wp_version.'&ts='.date("YmdHis").'&key='.GOTMLS_installation_key.'&d='.ur1encode(GOTMLS_siteurl).'&'.GOTMLS_set_nonce(__FUNCTION__."111"));
109
  if (isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["auto_UPDATE_definitions"]) && $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["auto_UPDATE_definitions"])
110
  array_unshift($Update_Definitions, admin_url('admin-ajax.php?action=GOTMLS_auto_update&'.GOTMLS_set_nonce(__FUNCTION__."109").'&UPDATE_definitions_array=1'));
111
  else
@@ -613,62 +613,10 @@ function GOTMLS_get_whitelists() {
613
 
614
  function GOTMLS_get_quarantine($only = false) {
615
  global $wpdb, $post;
616
- $old_files = 0;
617
- if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"]) || $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"]) {
618
- if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"])) {
619
- if (($upload = wp_upload_dir()) && isset($upload['basedir']))
620
- $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"] = str_replace("/", GOTMLS_slash(), GOTMLS_trailingslashit($upload['basedir'])).'quarantine';
621
- else
622
- $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"] = false;
623
- }
624
- if (isset($_GET["page"]) && substr($_GET["page"], 0, 6) == "GOTMLS" && $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"] && is_dir($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"])) {
625
- $entries = GOTMLS_getfiles($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"]);
626
- if (is_array($entries) && count($entries)) {
627
- foreach ($entries as $entry) {
628
- if (is_file($file = GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"]).$entry)) {
629
- if (GOTMLS_get_ext($entry) == "gotmls") {
630
- $old_files++;
631
- if (GOTMLS_get_nonce() && ($GLOBALS["GOTMLS"]["tmp"]["file_contents"] = @file_get_contents($file))) {
632
- $insert = array("post_author"=>GOTMLS_get_current_user_id(), "ping_status"=>"imported", "post_status"=>"private", "post_type"=>"GOTMLS_quarantine", "post_content"=>GOTMLS_encode($GLOBALS["GOTMLS"]["tmp"]["file_contents"]), "post_mime_type"=>md5($GLOBALS["GOTMLS"]["tmp"]["file_contents"]), "guid"=>"Unknown");//! comment_status post_password post_name to_ping post_parent menu_order";
633
- if (!($insert["comment_count"] = @filesize($file)))
634
- $insert["comment_count"] = strlen($GLOBALS["GOTMLS"]["tmp"]["file_contents"]);
635
- $file_date = explode(".", $entry);
636
- $insert["post_date"] = date("Y-m-d H:i:s", filemtime($file));
637
- $insert["post_date_gmt"] = $insert["post_date"];
638
- $insert["post_modified"] = $insert["post_date"];
639
- $match = '/^(20)?([0-5][0-9])[\-: \/]*(0*[1-9]|1[0-2])[\-: \/]*(0*[1-9]|[12][0-9]|3[01])[\-: \/]*([0-5][0-9])[\-: \/]*([0-5][0-9])$/';
640
- if (count($file_date) > 2 && strlen($file_date[0]) == 5 && preg_match($match, GOTMLS_sexagesimal($file_date[0])))
641
- $insert["post_modified"] = GOTMLS_sexagesimal($file_date[0]).":00";
642
- elseif (count($file_date) > 3 && strlen($file_date[1]) == 5 && preg_match($match, GOTMLS_sexagesimal($file_date[1])))
643
- $insert["post_modified"] = GOTMLS_sexagesimal($file_date[1]).":00";
644
- $insert["post_modified_gmt"] = $insert["post_modified"];
645
- $insert["post_title"] = GOTMLS_decode($file_date[count($file_date)-2]);
646
- if (is_file($insert["post_title"]) && ($GLOBALS["GOTMLS"]["tmp"]["new_contents"] = file_get_contents($insert["post_title"])))
647
- $insert["post_content_filtered"] = GOTMLS_encode($GLOBALS["GOTMLS"]["tmp"]["new_contents"]);
648
- //! pinged post_excerpt
649
- if ($wpdb->insert($wpdb->posts, $insert)) {
650
- unlink(trailingslashit($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"]).$entry);
651
- $old_files--;
652
- } else
653
- print_r(array($entry=>$insert, "last_error"=>$wpdb->last_error));
654
- }
655
- } elseif (basename($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"]) == "quarantine")
656
- unlink(trailingslashit($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"]).$entry);
657
- }
658
- }
659
- }
660
- if ($old_files == 0 && basename($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"]) == "quarantine")
661
- rmdir($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"]);
662
- }
663
- if (!($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"] && is_dir($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"]))) {
664
- $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["quarantine_dir"] = false;
665
- update_option("GOTMLS_settings_array", $GLOBALS["GOTMLS"]["tmp"]["settings_array"]);
666
- }
667
- }
668
  if (is_numeric($only))
669
  return get_post($only, ARRAY_A);
670
  elseif ($only)
671
- return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'GOTMLS_quarantine' AND `post_status` = 'private'") + $old_files;
672
  else
673
  $args = array('posts_per_page' => (isset($_GET['posts_per_page'])&&is_numeric($_GET['posts_per_page'])&&$_GET['posts_per_page']>0?$_GET['posts_per_page']:200), 'orderby' => 'date', 'post_type' => 'GOTMLS_quarantine', "post_status" => "private");
674
  if (isset($_POST["paged"]))
@@ -715,7 +663,7 @@ function GOTMLS_View_Quarantine() {
715
  }
716
 
717
  function GOTMLS_Firewall_Options() {
718
- global $current_user, $wpdb;
719
  GOTMLS_update_definitions();
720
  GOTMLS_display_header();
721
  $GOTMLS_nonce_found = GOTMLS_get_nonce();
@@ -843,9 +791,10 @@ function GOTMLS_Firewall_Options() {
843
  if ($current_user->user_login == "admin") {
844
  $admin_notice .= $lt.'hr /'.$gt;
845
  if ($GOTMLS_nonce_found && isset($_POST["GOTMLS_admin_username"]) && ($current_user->user_login != trim($_POST["GOTMLS_admin_username"])) && strlen(trim($_POST["GOTMLS_admin_username"])) && preg_match('/^\s*[a-z_0-9\@\.\-]{3,}\s*$/i', $_POST["GOTMLS_admin_username"])) {
846
- if ($wpdb->update($wpdb->users, array("user_login" => trim($_POST["GOTMLS_admin_username"])), array("user_login" => $current_user->user_login)))
 
847
  $admin_notice .= $lt.'div class="updated"'.$gt.sprintf(__("You username has been change to %s. Don't forget to use your new username when you login again.",'gotmls'), $_POST["GOTMLS_admin_username"]).$lt.'/div'.$gt;
848
- else
849
  $admin_notice .= $lt.'div class="error"'.$gt.sprintf(__("SQL Error changing username: %s. Please try again later.",'gotmls'), $wpdb->last_error).$lt.'/div'.$gt;
850
  } else {
851
  if (isset($_POST["GOTMLS_admin_username"]))
@@ -904,8 +853,6 @@ function GOTMLS_update_definitions() {
904
  if (is_array($GOTnew_definitions))
905
  $GLOBALS["GOTMLS"]["tmp"]["onLoad"] .= "updates_complete('Downloaded Definitions');";
906
  } elseif (($DEF = GOTMLS_get_URL(GOTMLS_update_home.'definitions.php?ver='.GOTMLS_Version.'&wp='.$wp_version.'&'.GOTMLS_set_nonce(__FUNCTION__."870").'&d='.ur1encode(GOTMLS_siteurl))) && is_array($GOTnew_definitions = maybe_unserialize(GOTMLS_decode($DEF))) && count($GOTnew_definitions)) {
907
- if (!(isset($_REQUEST["check"]) && is_array($_REQUEST["check"])))
908
- $_REQUEST["check"] = array();
909
  $user_info = $GOTnew_definitions["you"];
910
  if (isset($user_info["user_email"]) && strlen($user_info["user_email"]) == 32) {
911
  if ($user_info["user_email"] == md5($current_user->user_email))
@@ -941,17 +888,21 @@ function GOTMLS_update_definitions() {
941
  $innerHTML = "<li style=\\\"color: #f00\\\"><a title='report error' href='#' onclick=\\\"stopCheckingDefinitions = checkupdateserver(alt_addr+'&error=".GOTMLS_encode(serialize(array("get_URL"=>$GLOBALS["GOTMLS"]["get_URL"])))."', 'Definition_Updates');\\\">Automatic Update Connection Failed!</a></li>";
942
  }
943
  if (isset($GOTnew_definitions) && is_array($GOTnew_definitions)) {
944
- $GLOBALS["GOTMLS"]["tmp"]["definitions_array"] = GOTMLS_array_replace_recursive($GLOBALS["GOTMLS"]["tmp"]["definitions_array"], $GOTnew_definitions);
945
  if (file_exists(GOTMLS_plugin_path.'definitions_update.txt'))
946
  @unlink(GOTMLS_plugin_path.'definitions_update.txt');
947
- if (isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"]))
948
- unset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"]);
949
  $saved = GOTMLS_update_option('definitions', $GLOBALS["GOTMLS"]["tmp"]["definitions_array"]);
950
- foreach ($GLOBALS["GOTMLS"]["tmp"]["definitions_array"] as $threat_level=>$definition_names)
 
 
 
951
  foreach ($definition_names as $definition_name=>$definition_version)
952
  if (is_array($definition_version) && isset($definition_version[0]) && strlen($definition_version[0]) == 5)
953
  if (!isset($GOTMLS_definitions_versions[$threat_level]) || $definition_version[0] > $GOTMLS_definitions_versions[$threat_level])
954
  $GOTMLS_definitions_versions[$threat_level] = $definition_version[0];
 
 
 
955
  asort($GOTMLS_definitions_versions);
956
  $autoUpJS .= '<span style="color: #0C0;">(Newest Definition Updates Installed.)</span>';
957
  } else {
@@ -991,7 +942,7 @@ if (foundUpdates = document.getElementById("UPDATE_definitions_div"))
991
  }
992
  $GLOBALS["GOTMLS"]["tmp"]["Definition"]["Updates"] = '?div=Definition_Updates';
993
  foreach ($GOTMLS_definitions_versions as $definition_name=>$GLOBALS["GOTMLS"]["tmp"]["Definition"]["Latest"])
994
- $GLOBALS["GOTMLS"]["tmp"]["Definition"]["Updates"] .= "&ver[$definition_name]=".$GLOBALS["GOTMLS"]["tmp"]["Definition"]["Latest"];
995
  }
996
  add_action('wp_ajax_GOTMLS_auto_update', 'GOTMLS_update_definitions');
997
 
@@ -1408,7 +1359,7 @@ var startTime = 0;
1408
  function GOTMLS_login_form($form_id = "loginform") {
1409
  $sess = time();
1410
  $ajaxURL = admin_url("admin-ajax.php?action=GOTMLS_logintime&GOTMLS_sess=");
1411
- echo '<input type="hidden" name="session_id" value="'.substr($sess, 4).'"><input type="hidden" id="offset_id" value="0" name="sess'.substr($sess, 4).'"><script type="text/javascript">'."\nvar GOTMLS_login_offset = new Date();\nvar GOTMLS_login_script = document.createElement('script');\nGOTMLS_login_script.src = '$ajaxURL'+GOTMLS_login_offset.getTime();\n//GOTMLS_login_script.onload = set_offset_id();\ndocument.head.appendChild(GOTMLS_login_script);\n</script>\n";
1412
  }
1413
  add_action("login_form", "GOTMLS_login_form");
1414
 
@@ -1636,7 +1587,8 @@ function GOTMLS_ajax_fix() {
1636
  GOTMLS_update_scan_log(array("scan" => array("finish" => time(), "type" => "Automatic Fix")));
1637
  }
1638
  }
1639
- die('<div id="check_site_warning" style="background-color: #F00;">'.sprintf(__("Because some changes were made we need to check to make sure it did not break your site. If this stays Red and the frame below does not load please <a %s>revert the changes</a> made during this automated fix process.",'gotmls'), 'target="_top" href="admin.php?page=GOTMLS-View-Quarantine"').' <span style="color: #F00;">'.__("Never mind, it worked!",'gotmls').'</span></div><br /><iframe id="test_frame" name="test_frame" src="'.admin_url('admin.php?page=GOTMLS-settings&check_site=1&'.GOTMLS_set_nonce(__FUNCTION__."1451")).'" style="width: 100%; height: 200px"></iframe>'.$li_js."/*-->*"."/\nalert_repaired(0);\n</script>\n$HTML[1]");
 
1640
  } else
1641
  die(GOTMLS_html_tags(array("html" => array("body" => "<script type=\"text/javascript\">\nwindow.parent.showhide('GOTMLS_iFrame', true);\nalert('".__("Nothing Selected to be Changed!",'gotmls')."');\n</script>".__("Done!",'gotmls')))));
1642
  } else
@@ -1796,4 +1748,4 @@ add_action('wp_ajax_nopriv_GOTMLS_auto_update', 'GOTMLS_update_definitions');
1796
  add_action("plugins_loaded", "GOTMLS_loaded");
1797
  add_action("admin_notices", "GOTMLS_admin_notices");
1798
  add_action("admin_menu", "GOTMLS_menu");
1799
- add_action("network_admin_menu", "GOTMLS_menu");
8
  Contributors: scheeeli, gotmls
9
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZHD8QHZ2E7PE
10
  Description: This Anti-Virus/Anti-Malware plugin searches for Malware and other Virus like threats and vulnerabilities on your server and helps you remove them. It's always growing and changing to adapt to new threats so let me know if it's not working for you.
11
+ Version: 4.17.28
12
  */
13
  if (isset($_SERVER["DOCUMENT_ROOT"]) && ($SCRIPT_FILE = str_replace($_SERVER["DOCUMENT_ROOT"], "", isset($_SERVER["SCRIPT_FILENAME"])?$_SERVER["SCRIPT_FILENAME"]:isset($_SERVER["SCRIPT_NAME"])?$_SERVER["SCRIPT_NAME"]:"")) && strlen($SCRIPT_FILE) > strlen("/".basename(__FILE__)) && substr(__FILE__, -1 * strlen($SCRIPT_FILE)) == substr($SCRIPT_FILE, -1 * strlen(__FILE__)))
14
  include(dirname(__FILE__)."/safe-load/index.php");
105
  echo '<div id="check_site" style="z-index: 1234567;"><img src="'.GOTMLS_images_path.'checked.gif" height=16 width=16 alt="&#x2714;"> '.__("Tested your site. It appears we didn't break anything",'gotmls').' ;-)</div><script type="text/javascript">window.parent.document.getElementById("check_site_warning").style.backgroundColor=\'#0C0\';</script><li>Please <a target="_blank" href="https://wordpress.org/plugins/gotmls/stats/?compatibility%5Bversion%5D='.$wp_version.'&compatibility%5Btopic_version%5D='.GOTMLS_Version.'&compatibility%5Bcompatible%5D=1#compatibility-works">Vote "Works"</a> or <a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/gotmls#postform">write a "Five-Star" Reviews</a> on WordPress.org if you like this plugin.</li><style>#footer, #GOTMLS-metabox-container, #GOTMLS-right-sidebar, #admin-page-container, #wpadminbar, #adminmenuback, #adminmenuwrap, #adminmenu, .error, .updated, .update-nag {display: none !important;} #wpbody-content {padding-bottom: 0;} #wpbody, html.wp-toolbar {padding-top: 0 !important;} #wpcontent, #footer {margin-left: 5px !important;}';
106
  else
107
  echo '<style>#GOTMLS-right-sidebar {float: right; margin-right: 0px;}';
108
+ $Update_Definitions = array(GOTMLS_update_home.'definitions.js'.$GLOBALS["GOTMLS"]["tmp"]["Definition"]["Updates"].'&ver='.GOTMLS_Version.'&wp='.$wp_version.'&'.GOTMLS_set_nonce(__FUNCTION__."108").'&d='.ur1encode(GOTMLS_siteurl));
109
  if (isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["auto_UPDATE_definitions"]) && $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["auto_UPDATE_definitions"])
110
  array_unshift($Update_Definitions, admin_url('admin-ajax.php?action=GOTMLS_auto_update&'.GOTMLS_set_nonce(__FUNCTION__."109").'&UPDATE_definitions_array=1'));
111
  else
613
 
614
  function GOTMLS_get_quarantine($only = false) {
615
  global $wpdb, $post;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
616
  if (is_numeric($only))
617
  return get_post($only, ARRAY_A);
618
  elseif ($only)
619
+ return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'GOTMLS_quarantine' AND `post_status` = 'private'");
620
  else
621
  $args = array('posts_per_page' => (isset($_GET['posts_per_page'])&&is_numeric($_GET['posts_per_page'])&&$_GET['posts_per_page']>0?$_GET['posts_per_page']:200), 'orderby' => 'date', 'post_type' => 'GOTMLS_quarantine', "post_status" => "private");
622
  if (isset($_POST["paged"]))
663
  }
664
 
665
  function GOTMLS_Firewall_Options() {
666
+ global $current_user, $wpdb, $table_prefix;
667
  GOTMLS_update_definitions();
668
  GOTMLS_display_header();
669
  $GOTMLS_nonce_found = GOTMLS_get_nonce();
791
  if ($current_user->user_login == "admin") {
792
  $admin_notice .= $lt.'hr /'.$gt;
793
  if ($GOTMLS_nonce_found && isset($_POST["GOTMLS_admin_username"]) && ($current_user->user_login != trim($_POST["GOTMLS_admin_username"])) && strlen(trim($_POST["GOTMLS_admin_username"])) && preg_match('/^\s*[a-z_0-9\@\.\-]{3,}\s*$/i', $_POST["GOTMLS_admin_username"])) {
794
+ if ($wpdb->update($wpdb->users, array("user_login" => trim($_POST["GOTMLS_admin_username"])), array("user_login" => $current_user->user_login))) {
795
+ $wpdb->query("UPDATE `{$table_prefix}sitemeta` SET `meta_value` = REPLACE(`meta_value`, 's:5:\"admin\";', 's:".strlen(trim($_POST["GOTMLS_admin_username"])).":\"".trim($_POST["GOTMLS_admin_username"])."\";') WHERE `meta_key` = 'site_admins' AND `meta_value` like '%s:5:\"admin\";%'");
796
  $admin_notice .= $lt.'div class="updated"'.$gt.sprintf(__("You username has been change to %s. Don't forget to use your new username when you login again.",'gotmls'), $_POST["GOTMLS_admin_username"]).$lt.'/div'.$gt;
797
+ } else
798
  $admin_notice .= $lt.'div class="error"'.$gt.sprintf(__("SQL Error changing username: %s. Please try again later.",'gotmls'), $wpdb->last_error).$lt.'/div'.$gt;
799
  } else {
800
  if (isset($_POST["GOTMLS_admin_username"]))
853
  if (is_array($GOTnew_definitions))
854
  $GLOBALS["GOTMLS"]["tmp"]["onLoad"] .= "updates_complete('Downloaded Definitions');";
855
  } elseif (($DEF = GOTMLS_get_URL(GOTMLS_update_home.'definitions.php?ver='.GOTMLS_Version.'&wp='.$wp_version.'&'.GOTMLS_set_nonce(__FUNCTION__."870").'&d='.ur1encode(GOTMLS_siteurl))) && is_array($GOTnew_definitions = maybe_unserialize(GOTMLS_decode($DEF))) && count($GOTnew_definitions)) {
 
 
856
  $user_info = $GOTnew_definitions["you"];
857
  if (isset($user_info["user_email"]) && strlen($user_info["user_email"]) == 32) {
858
  if ($user_info["user_email"] == md5($current_user->user_email))
888
  $innerHTML = "<li style=\\\"color: #f00\\\"><a title='report error' href='#' onclick=\\\"stopCheckingDefinitions = checkupdateserver(alt_addr+'&error=".GOTMLS_encode(serialize(array("get_URL"=>$GLOBALS["GOTMLS"]["get_URL"])))."', 'Definition_Updates');\\\">Automatic Update Connection Failed!</a></li>";
889
  }
890
  if (isset($GOTnew_definitions) && is_array($GOTnew_definitions)) {
891
+ $GLOBALS["GOTMLS"]["tmp"]["definitions_array"] = GOTMLS_array_replace($GLOBALS["GOTMLS"]["tmp"]["definitions_array"], $GOTnew_definitions);
892
  if (file_exists(GOTMLS_plugin_path.'definitions_update.txt'))
893
  @unlink(GOTMLS_plugin_path.'definitions_update.txt');
 
 
894
  $saved = GOTMLS_update_option('definitions', $GLOBALS["GOTMLS"]["tmp"]["definitions_array"]);
895
+ $_REQUEST["check"] = array();
896
+ foreach ($GLOBALS["GOTMLS"]["tmp"]["definitions_array"] as $threat_level=>$definition_names) {
897
+ if ($threat_level != "potential")
898
+ $_REQUEST["check"][] = $threat_level;
899
  foreach ($definition_names as $definition_name=>$definition_version)
900
  if (is_array($definition_version) && isset($definition_version[0]) && strlen($definition_version[0]) == 5)
901
  if (!isset($GOTMLS_definitions_versions[$threat_level]) || $definition_version[0] > $GOTMLS_definitions_versions[$threat_level])
902
  $GOTMLS_definitions_versions[$threat_level] = $definition_version[0];
903
+ }
904
+ $GLOBALS["GOTMLS"]["log"]["settings"]["check"] = $_REQUEST["check"];
905
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"] = $_REQUEST["check"];
906
  asort($GOTMLS_definitions_versions);
907
  $autoUpJS .= '<span style="color: #0C0;">(Newest Definition Updates Installed.)</span>';
908
  } else {
942
  }
943
  $GLOBALS["GOTMLS"]["tmp"]["Definition"]["Updates"] = '?div=Definition_Updates';
944
  foreach ($GOTMLS_definitions_versions as $definition_name=>$GLOBALS["GOTMLS"]["tmp"]["Definition"]["Latest"])
945
+ $GLOBALS["GOTMLS"]["tmp"]["Definition"]["Updates"] .= "&def[$definition_name]=".$GLOBALS["GOTMLS"]["tmp"]["Definition"]["Latest"];
946
  }
947
  add_action('wp_ajax_GOTMLS_auto_update', 'GOTMLS_update_definitions');
948
 
1359
  function GOTMLS_login_form($form_id = "loginform") {
1360
  $sess = time();
1361
  $ajaxURL = admin_url("admin-ajax.php?action=GOTMLS_logintime&GOTMLS_sess=");
1362
+ echo '<input type="hidden" name="sess_id" value="'.substr($sess, 4).'"><input type="hidden" id="offset_id" value="0" name="sess'.substr($sess, 4).'"><script type="text/javascript">'."\nvar GOTMLS_login_offset = new Date();\nvar GOTMLS_login_script = document.createElement('script');\nGOTMLS_login_script.src = '$ajaxURL'+GOTMLS_login_offset.getTime();\n\ndocument.head.appendChild(GOTMLS_login_script);\n</script>\n";//GOTMLS_login_script.onload = set_offset_id();
1363
  }
1364
  add_action("login_form", "GOTMLS_login_form");
1365
 
1587
  GOTMLS_update_scan_log(array("scan" => array("finish" => time(), "type" => "Automatic Fix")));
1588
  }
1589
  }
1590
+ $nonce = GOTMLS_set_nonce(__FUNCTION__."1593");
1591
+ die('<div id="check_site_warning" style="background-color: #F00;">'.sprintf(__("Because some changes were made we need to check to make sure it did not break your site. If this stays Red and the frame below does not load please <a %s>revert the changes</a> made during this automated fix process.",'gotmls'), 'href="'.GOTMLS_images_path.'?page=GOTMLS-View-Quarantine&'.$nonce.'"').' <span style="color: #F00;">'.__("Never mind, it worked!",'gotmls').'</span></div><br /><iframe id="test_frame" name="test_frame" src="'.admin_url('admin.php?page=GOTMLS-settings&check_site=1&'.$nonce).'" style="width: 100%; height: 200px"></iframe>'.$li_js."/*-->*"."/\nalert_repaired(0);\n</script>\n$HTML[1]");
1592
  } else
1593
  die(GOTMLS_html_tags(array("html" => array("body" => "<script type=\"text/javascript\">\nwindow.parent.showhide('GOTMLS_iFrame', true);\nalert('".__("Nothing Selected to be Changed!",'gotmls')."');\n</script>".__("Done!",'gotmls')))));
1594
  } else
1748
  add_action("plugins_loaded", "GOTMLS_loaded");
1749
  add_action("admin_notices", "GOTMLS_admin_notices");
1750
  add_action("admin_menu", "GOTMLS_menu");
1751
+ add_action("network_admin_menu", "GOTMLS_menu");
readme.txt CHANGED
@@ -5,10 +5,10 @@ Author URI: http://wordpress.ieonly.com/category/my-plugins/anti-malware/
5
  Contributors: scheeeli, gotmls
6
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZHD8QHZ2E7PE
7
  Tags: security, firewall, anti-malware, scanner, automatic, repair, remove, malware, virus, threat, hacked, malicious, infection, timthumb, exploit, block, brute-force, wp-login, patch, antimalware, revslider, Revolution Slider
8
- Version: 4.16.53
9
- Stable tag: 4.16.53
10
  Requires at least: 3.3
11
- Tested up to: 4.7.2
12
 
13
  This Anti-Malware scanner searches for Malware, Viruses, and other security threats and vulnerabilities on your server and it helps you fix them.
14
 
@@ -27,7 +27,7 @@ This Anti-Malware scanner searches for Malware, Viruses, and other security thre
27
  * Check the integrity of your WordPress Core files.
28
  * Automatically download new Definition Updates when running a Complete Scan.
29
 
30
- Updated February 19th
31
 
32
  Register this plugin at [GOTMLS.NET](http://gotmls.net/) and get access to new definitions of "Known Threats" and added features like Automatic Removal, plus patches for specific security vulnerabilities like old versions of timthumb. Updated definition files can be downloaded automatically within the admin once your Key is registered. Otherwise, this plugin just scans for "Potential Threats" and leaves it up to you to identify and remove the malicious ones.
33
 
@@ -38,6 +38,7 @@ NOTICE: This plugin make call to GOTMLS.NET to check for updates not unlike what
38
  * Clarus Dignus for design suggestions and graphic design work on the banner image.
39
  * Jelena Kovacevic and Andrew Kurtis of webhostinghub.com for providing the Spanish translation.
40
  * Marcelo Guernieri for the Brazilian Portuguese translation.
 
41
 
42
  == Installation ==
43
 
@@ -93,6 +94,11 @@ sucuri.net caches their scan results and will not refresh the scan until you cli
93
 
94
  == Changelog ==
95
 
 
 
 
 
 
96
  = 4.16.53 =
97
  * Fixed the details window so that it scrolls to the highlighted code.
98
  * Set defaults to disable the Potential Threat scan if other threats definitions are enabled.
@@ -359,6 +365,9 @@ sucuri.net caches their scan results and will not refresh the scan until you cli
359
 
360
  == Upgrade Notice ==
361
 
 
 
 
362
  = 4.16.53 =
363
  Fixed the details window to scrolls to the highlighted code, set default Potential Threat scan to disabled, and encoded definitions array for DB storage.
364
 
5
  Contributors: scheeeli, gotmls
6
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZHD8QHZ2E7PE
7
  Tags: security, firewall, anti-malware, scanner, automatic, repair, remove, malware, virus, threat, hacked, malicious, infection, timthumb, exploit, block, brute-force, wp-login, patch, antimalware, revslider, Revolution Slider
8
+ Version: 4.17.28
9
+ Stable tag: 4.17.28
10
  Requires at least: 3.3
11
+ Tested up to: 4.8
12
 
13
  This Anti-Malware scanner searches for Malware, Viruses, and other security threats and vulnerabilities on your server and it helps you fix them.
14
 
27
  * Check the integrity of your WordPress Core files.
28
  * Automatically download new Definition Updates when running a Complete Scan.
29
 
30
+ Updated July 24th
31
 
32
  Register this plugin at [GOTMLS.NET](http://gotmls.net/) and get access to new definitions of "Known Threats" and added features like Automatic Removal, plus patches for specific security vulnerabilities like old versions of timthumb. Updated definition files can be downloaded automatically within the admin once your Key is registered. Otherwise, this plugin just scans for "Potential Threats" and leaves it up to you to identify and remove the malicious ones.
33
 
38
  * Clarus Dignus for design suggestions and graphic design work on the banner image.
39
  * Jelena Kovacevic and Andrew Kurtis of webhostinghub.com for providing the Spanish translation.
40
  * Marcelo Guernieri for the Brazilian Portuguese translation.
41
+ * Umut Can Alparslan for the Turkish translation.
42
 
43
  == Installation ==
44
 
94
 
95
  == Changelog ==
96
 
97
+ = 4.17.28 =
98
+ * Added the Turkish translation thanks to Umut Can Alparslan.
99
+ * Improved the auto update so that old definitions could be phased out and new threat types would be selected by default.
100
+ * Fixed the admin username change feature on multisite installs.
101
+
102
  = 4.16.53 =
103
  * Fixed the details window so that it scrolls to the highlighted code.
104
  * Set defaults to disable the Potential Threat scan if other threats definitions are enabled.
365
 
366
  == Upgrade Notice ==
367
 
368
+ = 4.17.28 =
369
+ Added the Turkish translation thanks to Umut Can Alparslan, improved the auto update feature, and fixed the admin username change feature on multisite installs.
370
+
371
  = 4.16.53 =
372
  Fixed the details window to scrolls to the highlighted code, set default Potential Threat scan to disabled, and encoded definitions array for DB storage.
373
 
safe-load/wp-settings.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once("../../../../wp-includes/version.php");
3
+ //home/mauivalu/sites/mauivalue.com/public_html/wp-includes/default-constants.php:
4
+ if ( !defined('WP_DEBUG_DISPLAY') )
5
+ define( 'WP_DEBUG_DISPLAY', true );
6
+
7
+ if (!function_exists("apply_filters")) {
8
+ function apply_filters($filter, $value) {
9
+ return $value;
10
+ }}
11
+ if (!function_exists("wp_load_translations_early")) {
12
+ function wp_load_translations_early() {
13
+ return false;
14
+ }}
15
+ if (!function_exists("wp_debug_backtrace_summary")) {
16
+ function wp_debug_backtrace_summary() {
17
+ return false;
18
+ }}
19
+ if (!function_exists("is_multisite")) {
20
+ function is_multisite() {
21
+ return false;
22
+ }}
23
+
24
+ if (!function_exists("is_wp_error")) {
25
+ function is_wp_error() {
26
+ return false;
27
+ }}
28
+
29
+ if (!function_exists("mbstring_binary_safe_encoding")) {
30
+ function mbstring_binary_safe_encoding( $reset = false ) {
31
+ static $encodings = array();
32
+ static $overloaded = null;
33
+
34
+ if ( is_null( $overloaded ) )
35
+ $overloaded = function_exists( 'mb_internal_encoding' ) && ( ini_get( 'mbstring.func_overload' ) & 2 );
36
+
37
+ if ( false === $overloaded )
38
+ return;
39
+
40
+ if ( ! $reset ) {
41
+ $encoding = mb_internal_encoding();
42
+ array_push( $encodings, $encoding );
43
+ mb_internal_encoding( 'ISO-8859-1' );
44
+ }
45
+
46
+ if ( $reset && $encodings ) {
47
+ $encoding = array_pop( $encodings );
48
+ mb_internal_encoding( $encoding );
49
+ }
50
+ }
51
+ function reset_mbstring_encoding() {
52
+ mbstring_binary_safe_encoding( true );
53
+ }}
54
+
55
+ require_once("../../../../wp-includes/wp-db.php");
56
+
57
+ $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
58
+
59
+ if (!function_exists("delete_option")) {
60
+ function delete_option($index) {
61
+ global $wpdb, $table_prefix;
62
+ $wpdb->delete($table_prefix."options", array( 'option_name' => "'$index'"));
63
+ // echo "<li>del:".$index."<li>qry:".$wpdb->last_query."<li>err:".$wpdb->last_error;
64
+ }}
65
+
66
+ if (!function_exists("update_option")) {
67
+ function update_option($index, $value = "") {
68
+ global $wpdb, $table_prefix;
69
+ if (is_array($value))
70
+ $value = serialize($value);
71
+ // $value = mysqli_real_escape_string($wpdb, $value);
72
+ $return = $wpdb->update($table_prefix."options", array('option_value' => $value), array('option_name' => $index));
73
+ // echo "<li>upd:".$index."<li>qry:".$wpdb->last_query."<li>err:".$wpdb->last_error;
74
+ return $return;
75
+ }}
76
+
77
+ if (!function_exists("get_option")) {
78
+ function get_option($index, $value = array()) {
79
+ global $wpdb, $table_prefix;
80
+ $qry = "SELECT option_value FROM {$table_prefix}options WHERE option_name = '$index'";
81
+ $return = $wpdb->get_var( $qry );
82
+ if (@unserialize($return) && is_array(@unserialize($return)))
83
+ return unserialize($return);
84
+ else
85
+ return $return;
86
+ // echo $wpdb->func_call."<li>get:".$index."<li>qry:$qry;/".$wpdb->last_query."<li>err:".$wpdb->last_error;
87
+ }}