: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace EmbedPress\Providers;
use Embera\Provider\ProviderAdapter;
use Embera\Provider\ProviderInterface;
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
* Entity responsible to support Wrapper embeds.
* @subpackage EmbedPress/Providers
* @author EmbedPress <help@embedpress.com>
* @copyright Copyright (C) 2023 WPDeveloper. All rights reserved.
* @license GPLv3 or later
class Wrapper extends ProviderAdapter implements ProviderInterface
public function __construct($url, $config = []){
parent::__construct($url, $config);
$hosts_url = parse_url($url);
$this->addHost($hosts_url['host']);
/** inline {@inheritdoc} */
* Method that verifies if the embed URL belongs to Wrapper.
public function validateUrl(Url $url)
return (bool) preg_match(
'/^(https?:\/\/)?(www\.)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/i',
* This method fakes an Oembed response.
public function fakeResponse()
'provider_name' => 'Wrapper',
'provider_url' => site_url(),
'title' => 'Unknown title',
/** inline @inheritDoc */
public function modifyResponse(array $response = [])
return $this->fakeResponse();