Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordfenc.../lib
File: wfWebsite.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class wfWebsiteEphemeralPayloadRetrievalException extends RuntimeException {
[2] Fix | Delete
}
[3] Fix | Delete
[4] Fix | Delete
class wfWebsiteEphemeralPayloadExpiredException extends wfWebsiteEphemeralPayloadRetrievalException {
[5] Fix | Delete
[6] Fix | Delete
const STATUS = 404;
[7] Fix | Delete
[8] Fix | Delete
public function __construct() {
[9] Fix | Delete
parent::__construct('Ephemeral payload expired', self::STATUS);
[10] Fix | Delete
}
[11] Fix | Delete
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
class wfWebsiteEphemeralPayloadRateLimitedException extends wfWebsiteEphemeralPayloadRetrievalException {
[15] Fix | Delete
[16] Fix | Delete
const STATUS = 429;
[17] Fix | Delete
[18] Fix | Delete
public function __construct() {
[19] Fix | Delete
parent::__construct('Request limit reached', self::STATUS);
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* Utilities related to the Wordfence website (wordfence.com)
[26] Fix | Delete
*/
[27] Fix | Delete
class wfWebsite {
[28] Fix | Delete
[29] Fix | Delete
private static $INSTANCE = null;
[30] Fix | Delete
[31] Fix | Delete
private $url;
[32] Fix | Delete
[33] Fix | Delete
private function __construct($url) {
[34] Fix | Delete
$this->url = trailingslashit($url);
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
public function getUrl($relative) {
[38] Fix | Delete
return $this->url . $relative;
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
public function retrievePayload($token, &$expired) {
[42] Fix | Delete
$url = $this->getUrl("api/ephemeral-payload/$token");
[43] Fix | Delete
$response = wp_remote_get($url);
[44] Fix | Delete
$status = wp_remote_retrieve_response_code($response);
[45] Fix | Delete
if (!is_wp_error($response) && $status === 200) {
[46] Fix | Delete
return wp_remote_retrieve_body($response);
[47] Fix | Delete
}
[48] Fix | Delete
switch ($status) {
[49] Fix | Delete
case wfWebsiteEphemeralPayloadExpiredException::STATUS:
[50] Fix | Delete
throw new wfWebsiteEphemeralPayloadExpiredException();
[51] Fix | Delete
case wfWebsiteEphemeralPayloadRateLimitedException::STATUS:
[52] Fix | Delete
throw new wfWebsiteEphemeralPayloadRateLimitedException();
[53] Fix | Delete
default:
[54] Fix | Delete
throw new wfWebsiteEphemeralPayloadRetrievalException('Failed to retrieve ephemeral payload', (int) $status);
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
public static function getInstance() {
[59] Fix | Delete
if (self::$INSTANCE === null)
[60] Fix | Delete
self::$INSTANCE = new self(WORDFENCE_WWW_BASE_URL);
[61] Fix | Delete
return self::$INSTANCE;
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
public static function url($relative) {
[65] Fix | Delete
return self::getInstance()->getUrl($relative);
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
}
[69] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function