: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
public function setThemes($themes) {
* @throws wfScanKnownFilesException
public function getKnownFiles() {
if (!$this->isLoaded()) {
$this->fetchKnownFiles();
return $this->knownFiles;
* @param array $knownFiles
public function setKnownFiles($knownFiles) {
$this->knownFiles = $knownFiles;
public function getAPI() {
public function setAPI($api) {
class wfScanKnownFilesException extends Exception {
class wfCommonBackupFileTest {
const MATCH_EXACT = 'exact';
const MATCH_REGEX = 'regex';
* @param bool|string $matcher If $mode is MATCH_REGEX, this will be the regex pattern.
* @return wfCommonBackupFileTest
public static function createFromRootPath($path, $mode = self::MATCH_EXACT, $matcher = false) {
return new self(site_url($path), ABSPATH . $path, array(), $mode, $matcher);
* Identical to createFromRootPath except it returns an entry for each file in the index that matches $name
* @param bool|string $matcher
public static function createAllForFile($file, $mode = self::MATCH_EXACT, $matcher = false) {
$escapedFile = esc_sql(preg_quote($file));
$table_wfKnownFileList = wfDB::networkTable('wfKnownFileList');
$files = $wpdb->get_col("SELECT path FROM {$table_wfKnownFileList} WHERE path REGEXP '(^|/){$escapedFile}$'");
$tests[] = new self(site_url($f), ABSPATH . $f, array(), $mode, $matcher);
* @param array $requestArgs
public function __construct($url, $path, $requestArgs = array(), $mode = self::MATCH_EXACT, $matcher = false) {
$this->matcher = $matcher;
$this->requestArgs = $requestArgs;
public function fileExists() {
return file_exists($this->path);
public function isPubliclyAccessible() {
$this->response = wp_remote_get($this->url, $this->requestArgs);
if ((int) floor(((int) wp_remote_retrieve_response_code($this->response) / 100)) === 2) {
$handle = @fopen($this->path, 'r');
$contents = fread($handle, 700);
$remoteContents = substr(wp_remote_retrieve_body($this->response), 0, 700);
if ($this->mode == self::MATCH_REGEX) {
return preg_match($this->matcher, $remoteContents);
return $contents === $remoteContents;
public function getUrl() {
public function setUrl($url) {
public function getPath() {
public function setPath($path) {
public function getRequestArgs() {
return $this->requestArgs;
* @param array $requestArgs
public function setRequestArgs($requestArgs) {
$this->requestArgs = $requestArgs;
public function getResponse() {
class wfPubliclyAccessibleFileTest extends wfCommonBackupFileTest {
class wfScanEngineDurationLimitException extends Exception {
class wfScanEngineCoreVersionChangeException extends Exception {
class wfScanEngineTestCallbackFailedException extends Exception {