: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<video class="ep-ad" muted>
<source src="<?= esc_url($adFileUrl) ?>">
<span class="ad-running-time"></span>
<span class="ad-duration"> <?php echo esc_html__('• Ad', 'embedpress'); ?></span>
<div class="progress-bar-container">
<div class="progress-bar"></div>
<img class="ep-ad" src="<?= esc_url($adFileUrl) ?>">
<?php if (!empty($adUrl)) : ?>
<?php if (!empty($adSkipButton) && !empty($showSkipButton)) : ?>
<button title="Skip Ad" class="skip-ad-button" style="display: none;">
<?php echo esc_html__('Skip Ad', 'embedpress'); ?>
.ad-mask .ose-embedpress-responsive {
display: inline-block !important;
.ad-mask .ep-embed-content-wraper::after {
.ep-embed-content-wraper {
/* display: none !important; */
[data-sponsored-id="<?php echo esc_attr($client_id) ?>"] .main-ad-template {
width: <?php echo esc_attr($width); ?><?php echo esc_attr($unit); ?>;
height: <?php echo esc_attr($height); ?>px;
display: inline-block !important;
.embedpress-document-embed div[data-sponsored-id],
.embedpress-document-embed .main-ad-template.video {
.ep-percentage-width div[data-sponsored-id] {
.main-ad-template.image.ad-running {
[data-sponsored-id="<?php echo esc_attr($client_id) ?>"] .main-ad-template.image.ad-running {
width: <?php echo esc_attr($adWidth); ?>px !important;
height: <?php echo esc_attr($adHeight); ?>px !important;
bottom: <?php echo esc_attr($adYPosition); ?>%;
left: <?php echo esc_attr($adXPosition); ?>%;
[data-sponsored-id="<?php echo esc_attr($client_id) ?>"] .main-ad-template .ep-ad-content,
[data-sponsored-id="<?php echo esc_attr($client_id) ?>"] .main-ad-template .ep-ad-container,
.main-ad-template div img {
.main-ad-template.image.ad-running img {
.progress-bar-container {
background: #d41556b5 !important;
[data-sponsored-id="<?php echo esc_attr($client_id) ?>"] .hidden {
display: none !important;
public static function is_pro_active()
if (defined('EMBEDPRESS_SL_ITEM_SLUG')) {
public static function getInstagramUserInfo($accessToken, $accountType, $userId, $is_sync = false)
// If $is_sync is true, don't use transient
// If $is_sync is false, use transient
$transient_key = 'instagram_user_info_' . $userId;
if ($use_transient && false !== ($userInfo = get_transient($transient_key))) {
// If transient exists, return cached user info
if (strtolower($accountType) === 'business') {
$api_url = 'https://graph.facebook.com/' . $userId . '?fields=biography,id,username,website,followers_count,media_count,profile_picture_url,name&access_token=' . $accessToken;
$api_url = "https://graph.instagram.com/me?fields=id,username,account_type,media_count,followers_count,biography,website&access_token={$accessToken}";
$connected_account_type = $accountType;
$userInfoResponse = wp_remote_get($api_url);
if (is_wp_error($userInfoResponse)) {
echo 'Error: Unable to retrieve Instagram user information.';
$userInfoBody = wp_remote_retrieve_body($userInfoResponse);
$userInfo = json_decode($userInfoBody, true);
$userInfo['connected_account_type'] = $connected_account_type;
$userInfo['access_token'] = $accessToken;
if (!isset($userInfo['profile_picture_url'])) {
$userInfo['profile_picture_url'] = '';
// If not using transient, cache the user info for an hour
set_transient($transient_key, $userInfo, HOUR_IN_SECONDS);
// Get Instagram posts, videos, reels
public static function getInstagramPosts($access_token, $account_type, $userId, $limit = 100, $is_sync = false)
// If $is_sync is true, don't use transient
// If $is_sync is false, use transient
$transient_key = 'instagram_posts_' . $userId;
if ($use_transient && false !== ($posts = get_transient($transient_key))) {
// If transient exists, return cached posts
if (strtolower($account_type) === 'business') {
$api_url = 'https://graph.facebook.com/v17.0/' . $userId . '/media?fields=media_url,media_product_type,thumbnail_url,caption,id,media_type,timestamp,username,comments_count,like_count,permalink,children%7Bmedia_url,id,media_type,timestamp,permalink,thumbnail_url%7D&limit=' . $limit . '&access_token=' . $access_token;
$api_url = "https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,children{media_url,id,media_type},permalink,timestamp,username,thumbnail_url&limit=$limit&access_token=$access_token";
$postsResponse = wp_remote_get($api_url);
if (is_wp_error($postsResponse)) {
echo 'Error: Unable to retrieve Instagram posts.';
$postsBody = wp_remote_retrieve_body($postsResponse);
$posts = json_decode($postsBody, true);
if (empty($posts['data'])) {
return 'Please add Instagram Access Token';
// If not using transient, cache the posts for an hour
set_transient($transient_key, $posts['data'], HOUR_IN_SECONDS);
public static function get_enable_settings_data_for_scripts($settings)
'enabled_ads' => isset($settings['adManager']) && $settings['adManager'] === 'yes' ? 'yes' : '',
'enabled_custom_player' => isset($settings['emberpress_custom_player']) && $settings['emberpress_custom_player'] === 'yes' ? 'yes' : '',
'enabled_instafeed' => isset($settings['embedpress_pro_embeded_source']) && $settings['embedpress_pro_embeded_source'] === 'instafeed' ? 'yes' : '',
'enabled_docs_custom_viewer' => isset($settings['embedpress_document_viewer']) && $settings['embedpress_document_viewer'] === 'custom' ? 'yes' : '',
update_option('enabled_elementor_scripts', $settings_data);
public static function get_options_value($key)
$g_settings = get_option(EMBEDPRESS_PLG_NAME);
if (isset($g_settings[$key])) {
return $g_settings[$key];