<?php
/*
* fix.php
*/
require('wordpress_vulnerabilities.php');
$options = (file_exists('options.php') ? include('options.php') : array());
$fix = new wordpress_vulnerabilities_class;
if(($success = $fix->Initialize($options)))
{
if(($success = $fix->GetSupportedVulnerabilityChecks($checks)))
{
$checked = $total_vulnerable = 0;
foreach($checks as $name)
{
echo 'Checking "', $name, '"...',"\n";
if(!($success = $fix->CheckVulnerability($name, $vulnerable)))
break;
if($vulnerable)
{
++$total_vulnerable;
echo 'Vulnerable to "', $name, '": Yes',"\n";
if(!($success = $fix->FixVulnerability($name, $fixed)))
break;
echo 'Fixing vulnerability "', $name, '": ', ($fixed ? 'Success' : 'Failed'),"\n";
}
++$checked;
}
echo 'Checked ', $checked, ' vulnerabilities, Vulnerable ', $total_vulnerable, ' .', "\n";
}
$success = $fix->Finalize($success);
}
if(!$success)
echo 'Failed with error: ', $fix->error, "\n";
|