Skip to content

Commit 61d7938

Browse files
committed
Temporary bug fix for adapted file
This is a temporary fix. Only the latest version vulnerabilty is now in the adapted file.
1 parent fafca52 commit 61d7938

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

hhdev-mwp-check-plugins-vulnerability.php

100644100755
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Check Plugins Vulnerability
44
* Plugin URI: https://haha.nl
55
* Description: Check the installed website plugins for vulnerability use the wordfence vulnerability data feed api.
6-
* Version: 1.0.4
6+
* Version: 1.0.5
77
* Author: herbert hoekstra - haha!
88
* Author URI: https://haha.nl
99
* Documentation URI: https://haha.nl/wordpress-plug-in-op-maat/
@@ -228,21 +228,22 @@ public function hhdev_make_adapted_file() {
228228
if($plugin->updated > $date) {
229229
// write to new array
230230
// check if type is plugin
231-
if($plugin->software[0]->type === 'plugin') $file[$plugin->software[0]->slug] = array(
231+
if($plugin->software[0]->type === 'plugin' && !array_key_exists($plugin->software[0]->slug, $file)) $file[$plugin->software[0]->slug] = array(
232232
'title' => $plugin->title,
233233
'name' => $plugin->software[0]->name,
234234
'affected_versions' => json_decode(json_encode($plugin->software[0]->affected_versions),true),
235235
'patched' => $plugin->software[0]->patched,
236236
'references' => $plugin->references,
237237
'updated' => $plugin->updated,
238238
);
239-
240239
//echo '<p>Progress: ' . intval($data->getPosition() / $fileSize * 100) . ' %</p>';
241240
}
242241

243242
}
244243

245-
echo wp_sprintf( '<p>', __('Records saved: %s','hhdev-mwpcpv'), count($file),'</p>');
244+
//print_r($file['litespeed-cache']);
245+
246+
//echo wp_sprintf( '<p>', __('Records saved: %s','hhdev-mwpcpv'), count($file),'</p>');
246247

247248
$result = file_put_contents($this->dir_path_file_vuln, json_encode($file,JSON_UNESCAPED_UNICODE));
248249

@@ -357,8 +358,9 @@ public function hhdev_make_adapted_file() {
357358

358359
/*
359360
change log:
360-
- 1.0.1 initial set up
361-
- 1.0.2 split the file up into 2 files, plugin and dashboard
362-
- 1.0.3 changed adapted file to hold only plugin data
361+
- 1.0.5 fixed missing entries in cleaned data file
363362
- 1.0.4 removed gitignore from /vendor/
363+
- 1.0.3 changed adapted file to hold only plugin data
364+
- 1.0.2 split the file up into 2 files, plugin and dashboard
365+
- 1.0.1 initial set up
364366
*/

0 commit comments

Comments
 (0)