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/embedpre.../EmbedPre.../Provider...
File: X.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace EmbedPress\Providers;
[2] Fix | Delete
[3] Fix | Delete
use Embera\Provider\ProviderAdapter;
[4] Fix | Delete
use Embera\Provider\ProviderInterface;
[5] Fix | Delete
use Embera\Url;
[6] Fix | Delete
[7] Fix | Delete
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
[8] Fix | Delete
[9] Fix | Delete
/**
[10] Fix | Delete
* Entity responsible to support Wrapper embeds.
[11] Fix | Delete
*
[12] Fix | Delete
* @package EmbedPress
[13] Fix | Delete
* @subpackage EmbedPress/Providers
[14] Fix | Delete
* @author EmbedPress <help@embedpress.com>
[15] Fix | Delete
* @copyright Copyright (C) 2023 WPDeveloper. All rights reserved.
[16] Fix | Delete
* @license GPLv3 or later
[17] Fix | Delete
* @since 1.0.0
[18] Fix | Delete
*/
[19] Fix | Delete
class X extends ProviderAdapter implements ProviderInterface
[20] Fix | Delete
{
[21] Fix | Delete
/** inline {@inheritdoc} */
[22] Fix | Delete
protected $endpoint = 'https://publish.x.com/oembed?format=json';
[23] Fix | Delete
[24] Fix | Delete
/** inline {@inheritdoc} */
[25] Fix | Delete
protected static $hosts = [
[26] Fix | Delete
'x.com',
[27] Fix | Delete
];
[28] Fix | Delete
[29] Fix | Delete
/** inline {@inheritdoc} */
[30] Fix | Delete
protected $allowedParams = [
[31] Fix | Delete
'maxwidth', 'maxheight', 'hide_media', 'hide_thread', 'omit_script', 'align',
[32] Fix | Delete
'related', 'lang', 'theme', 'link_color', 'widget_type', 'dnt'
[33] Fix | Delete
];
[34] Fix | Delete
[35] Fix | Delete
/** inline {@inheritdoc} */
[36] Fix | Delete
protected $httpsSupport = true;
[37] Fix | Delete
[38] Fix | Delete
/** inline {@inheritdoc} */
[39] Fix | Delete
protected $responsiveSupport = true;
[40] Fix | Delete
[41] Fix | Delete
/** inline {@inheritdoc} */
[42] Fix | Delete
public function validateUrl(Url $url)
[43] Fix | Delete
{
[44] Fix | Delete
return (bool) (preg_match('~x\.com/(?:[^/]+)/(?:status|moments)/(?:[0-9]+)~i', (string) $url));
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
/** inline {@inheritdoc} */
[48] Fix | Delete
public function normalizeUrl(Url $url)
[49] Fix | Delete
{
[50] Fix | Delete
$url->convertToHttps();
[51] Fix | Delete
$url->removeQueryString();
[52] Fix | Delete
$url->removeLastSlash();
[53] Fix | Delete
[54] Fix | Delete
return $url;
[55] Fix | Delete
}
[56] Fix | Delete
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function