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/wp-conte.../plugins/smart-sl.../Nextend/Framewor.../Filesyst.../WordPres...
File: WordPressFilesystem.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Nextend\Framework\Filesystem\WordPress;
[2] Fix | Delete
[3] Fix | Delete
use Nextend\Framework\Filesystem\AbstractPlatformFilesystem;
[4] Fix | Delete
use Nextend\Framework\Platform\Platform;
[5] Fix | Delete
use Nextend\Framework\Url\Url;
[6] Fix | Delete
use function get_current_blog_id;
[7] Fix | Delete
[8] Fix | Delete
class WordPressFilesystem extends AbstractPlatformFilesystem {
[9] Fix | Delete
[10] Fix | Delete
public function init() {
[11] Fix | Delete
[12] Fix | Delete
$this->paths[] = realpath(ABSPATH);
[13] Fix | Delete
[14] Fix | Delete
$this->_basepath = realpath(WP_CONTENT_DIR);
[15] Fix | Delete
[16] Fix | Delete
$this->paths[] = $this->_basepath;
[17] Fix | Delete
[18] Fix | Delete
$this->paths[] = realpath(WP_PLUGIN_DIR);
[19] Fix | Delete
[20] Fix | Delete
$wp_upload_dir = wp_upload_dir();
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* Amazon S3 storage has s3://my-bucket/uploads upload path. If we found a scheme in the path we will
[24] Fix | Delete
* skip the realpath check so it won't fail in the future.
[25] Fix | Delete
* @url https://github.com/humanmade/S3-Uploads
[26] Fix | Delete
*/
[27] Fix | Delete
if (!stream_is_local($wp_upload_dir['basedir'])) {
[28] Fix | Delete
$uploadPath = $wp_upload_dir['basedir'];
[29] Fix | Delete
} else {
[30] Fix | Delete
$uploadPath = rtrim(realpath($wp_upload_dir['basedir']), "/\\");
[31] Fix | Delete
if (empty($uploadPath)) {
[32] Fix | Delete
echo 'Error: Your upload path is not valid or does not exist: ' . esc_html($wp_upload_dir['basedir']);
[33] Fix | Delete
$uploadPath = rtrim($wp_upload_dir['basedir'], "/\\");
[34] Fix | Delete
} else {
[35] Fix | Delete
$this->measurePermission($uploadPath);
[36] Fix | Delete
}
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
if (strpos($this->_basepath, $uploadPath) !== 0) {
[40] Fix | Delete
$this->paths[] = $uploadPath;
[41] Fix | Delete
}
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
public function getImagesFolder() {
[45] Fix | Delete
return Platform::getPublicDirectory();
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
public function getWebCachePath() {
[49] Fix | Delete
if (is_multisite()) {
[50] Fix | Delete
return $this->getBasePath() . NEXTEND_RELATIVE_CACHE_WEB . get_current_blog_id();
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
return $this->getBasePath() . NEXTEND_RELATIVE_CACHE_WEB;
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
public function getNotWebCachePath() {
[57] Fix | Delete
if (is_multisite()) {
[58] Fix | Delete
return $this->getBasePath() . NEXTEND_RELATIVE_CACHE_NOTWEB . get_current_blog_id();
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
return $this->getBasePath() . NEXTEND_RELATIVE_CACHE_NOTWEB;
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
public function absoluteURLToPath($url) {
[65] Fix | Delete
$uris = Url::getUris();
[66] Fix | Delete
[67] Fix | Delete
for ($i = count($uris) - 1; $i >= 0; $i--) {
[68] Fix | Delete
$uri = $uris[$i];
[69] Fix | Delete
if (substr($url, 0, strlen($uri)) == $uri) {
[70] Fix | Delete
[71] Fix | Delete
return str_replace($uri, $this->paths[$i], $url);
[72] Fix | Delete
}
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
return $url;
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
public function tempnam($filename = '', $dir = '') {
[79] Fix | Delete
return wp_tempnam($filename, $dir);
[80] Fix | Delete
}
[81] Fix | Delete
}
[82] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function