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.../Ends/Back/Settings/template...
File: custom-logo.php
<?php
[0] Fix | Delete
/*
[1] Fix | Delete
* Custom Logo Settings page
[2] Fix | Delete
* All undefined vars comes from 'render_settings_page' method
[3] Fix | Delete
*
[4] Fix | Delete
* */
[5] Fix | Delete
[6] Fix | Delete
use EmbedPress\Includes\Classes\Helper;
[7] Fix | Delete
[8] Fix | Delete
$option_name = EMBEDPRESS_PLG_NAME . ':youtube';
[9] Fix | Delete
$yt_settings = get_option( $option_name);
[10] Fix | Delete
$gen_settings = get_option( EMBEDPRESS_PLG_NAME);
[11] Fix | Delete
$yt_logo_xpos = isset( $yt_settings['logo_xpos']) ? intval( $yt_settings['logo_xpos']) : 10;
[12] Fix | Delete
$yt_logo_ypos = isset( $yt_settings['logo_ypos']) ? intval( $yt_settings['logo_ypos']) : 10;
[13] Fix | Delete
$yt_logo_opacity = isset( $yt_settings['logo_opacity']) ? intval( $yt_settings['logo_opacity']) : 50;
[14] Fix | Delete
$yt_logo_id = isset( $yt_settings['logo_id']) ? intval( $yt_settings['logo_id']) : 0;
[15] Fix | Delete
$yt_logo_url = isset( $yt_settings['logo_url']) ? esc_url( $yt_settings['logo_url']) : '';
[16] Fix | Delete
$yt_cta_url = isset( $yt_settings['cta_url']) ? esc_url( $yt_settings['cta_url']) : '';
[17] Fix | Delete
$yt_branding = isset( $yt_settings['branding']) ? sanitize_text_field( $yt_settings['branding']) : (!empty( $yt_logo_url) ? 'yes': 'no');
[18] Fix | Delete
[19] Fix | Delete
[20] Fix | Delete
$embedpress_document_powered_by = isset( $gen_settings['embedpress_document_powered_by']) ? sanitize_text_field( $gen_settings['embedpress_document_powered_by']) : 'yes';
[21] Fix | Delete
[22] Fix | Delete
// Vimeo branding
[23] Fix | Delete
$vm_settings = get_option( EMBEDPRESS_PLG_NAME.':vimeo');
[24] Fix | Delete
$vm_branding = isset( $vm_settings['branding']) ? sanitize_text_field( $vm_settings['branding']) : 'no';
[25] Fix | Delete
$vm_logo_xpos = isset( $vm_settings['logo_xpos']) ? intval( $vm_settings['logo_xpos']) : 10;
[26] Fix | Delete
$vm_logo_ypos = isset( $vm_settings['logo_ypos']) ? intval( $vm_settings['logo_ypos']) : 10;
[27] Fix | Delete
$vm_logo_opacity = isset( $vm_settings['logo_opacity']) ? intval( $vm_settings['logo_opacity']) : 50;
[28] Fix | Delete
$vm_logo_id = isset( $vm_settings['logo_id']) ? intval( $vm_settings['logo_id']) : 0;
[29] Fix | Delete
$vm_logo_url = isset( $vm_settings['logo_url']) ? esc_url( $vm_settings['logo_url']) : '';
[30] Fix | Delete
$vm_cta_url = isset( $vm_settings['cta_url']) ? esc_url( $vm_settings['cta_url']) : 'no';
[31] Fix | Delete
[32] Fix | Delete
[33] Fix | Delete
?>
[34] Fix | Delete
[35] Fix | Delete
<div class="embedpress__settings background__white radius-16 p-24">
[36] Fix | Delete
<h3><?php esc_html_e( "Global Branding Settings", "embedpress" ); ?></h3>
[37] Fix | Delete
<div class="embedpress__settings__form">
[38] Fix | Delete
<form action="" method="post" enctype="multipart/form-data" class="embedpress-settings-form">
[39] Fix | Delete
<?php
[40] Fix | Delete
do_action( 'embedpress_before_custom_branding_settings_fields');
[41] Fix | Delete
echo $nonce_field ; ?>
[42] Fix | Delete
<div class="form__group">
[43] Fix | Delete
<p class="form__label">Powered by EmbedPress</p>
[44] Fix | Delete
<div class="form__control__wrap">
[45] Fix | Delete
<label class="input__switch switch__text">
[46] Fix | Delete
<input type="checkbox" data-default="<?php echo esc_attr( $embedpress_document_powered_by ); ?>" data-value="<?php echo esc_attr( $embedpress_document_powered_by ); ?>" value="yes" name="embedpress_document_powered_by" <?php checked( 'yes', $embedpress_document_powered_by );?>>
[47] Fix | Delete
<span></span>
[48] Fix | Delete
</label>
[49] Fix | Delete
</div>
[50] Fix | Delete
</div>
[51] Fix | Delete
<h3><?php esc_html_e( "Custom Logo", "embedpress" ); ?></h3>
[52] Fix | Delete
<?php
[53] Fix | Delete
embedpress_print_branding_controls('youtube', 'yt');
[54] Fix | Delete
embedpress_print_branding_controls('vimeo', 'vm');
[55] Fix | Delete
embedpress_print_branding_controls('wistia', 'wis');
[56] Fix | Delete
embedpress_print_branding_controls('twitch', 'tw');
[57] Fix | Delete
embedpress_print_branding_controls('dailymotion', 'dm');
[58] Fix | Delete
embedpress_print_branding_controls('document', 'doc');
[59] Fix | Delete
do_action( 'embedpress_after_custom_branding_settings_fields');
[60] Fix | Delete
?>
[61] Fix | Delete
<button class="button button__themeColor radius-10 embedpress-submit-btn" name="submit" value="custom_logo"><?php esc_html_e( 'Save Changes', 'embedpress'); ?></button>
[62] Fix | Delete
</form>
[63] Fix | Delete
</div>
[64] Fix | Delete
</div>
[65] Fix | Delete
[66] Fix | Delete
[67] Fix | Delete
<?php
[68] Fix | Delete
/**
[69] Fix | Delete
* @param string $provider this is the provider name eg. youtube and vimeo etc. It should be lowercase generally or the same as the key we use to save data in the database. We save data like eg. EMBEDPRESS_PLG_NAME.':youtube'. Here youtube is the provider.
[70] Fix | Delete
* @param string $prefix It is a prefix for field name eg. yt or vm etc.
[71] Fix | Delete
*/
[72] Fix | Delete
function embedpress_print_branding_controls($provider='', $prefix='') {
[73] Fix | Delete
global $pro_active;
[74] Fix | Delete
$settings = get_option( EMBEDPRESS_PLG_NAME.':'.$provider, []);
[75] Fix | Delete
$branding = isset( $settings['branding']) ? $settings['branding'] : 'no';
[76] Fix | Delete
$logo_xpos = isset( $settings['logo_xpos']) ? intval( $settings['logo_xpos']) : 10;
[77] Fix | Delete
$logo_ypos = isset( $settings['logo_ypos']) ? intval( $settings['logo_ypos']) : 10;
[78] Fix | Delete
$logo_opacity = isset( $settings['logo_opacity']) ? intval( $settings['logo_opacity']) : 50;
[79] Fix | Delete
$logo_id = isset( $settings['logo_id']) ? intval( $settings['logo_id']) : 0;
[80] Fix | Delete
$logo_url = isset( $settings['logo_url']) ? esc_url( $settings['logo_url']) : '';
[81] Fix | Delete
$cta_url = isset( $settings['cta_url']) ? esc_url( $settings['cta_url']) : '';
[82] Fix | Delete
[83] Fix | Delete
// prepare prefixed field name
[84] Fix | Delete
$px_branding = "{$prefix}_branding";
[85] Fix | Delete
$px_logo_xpos = "{$prefix}_logo_xpos";
[86] Fix | Delete
$px_logo_ypos = "{$prefix}_logo_ypos";
[87] Fix | Delete
$px_logo_opacity = "{$prefix}_logo_opacity";
[88] Fix | Delete
$px_logo_id = "{$prefix}_logo_id";
[89] Fix | Delete
$px_logo_url = "{$prefix}_logo_url";
[90] Fix | Delete
$px_cta_url = "{$prefix}_cta_url";
[91] Fix | Delete
switch ($provider){
[92] Fix | Delete
case 'vimeo':
[93] Fix | Delete
$preview_video = '<iframe title="" loading="lazy" src="'.esc_url('https://player.vimeo.com/video/463346733').'" frameborder="0"></iframe>';
[94] Fix | Delete
break;
[95] Fix | Delete
case 'wistia':
[96] Fix | Delete
[97] Fix | Delete
$preview_video=<<<KAMAL
[98] Fix | Delete
<div class="ose-wistia--inc. ose-uid-0869333898f94a99ed20457fc4b79d88 ose-embedpress-responsive" style="width:500px; max-width:100%; height: 300px"><iframe loading="lazy" title="Best Embedding Solution For Elementor, Gutenberg &amp; Classic Editor - EmbedPress Video" src="https://fast.wistia.net/embed/iframe/u7eq83w1cg?dnt=1" allow="autoplay; fullscreen" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen msallowfullscreen width="500" height="300"></iframe><script src="https://fast.wistia.net/assets/external/E-v1.js" async></script></div>
[99] Fix | Delete
KAMAL;
[100] Fix | Delete
[101] Fix | Delete
break;
[102] Fix | Delete
case 'twitch':
[103] Fix | Delete
$parent = wp_parse_url( site_url(), 1);
[104] Fix | Delete
$preview_video = <<<KAMAL
[105] Fix | Delete
<div class="embedpress_wrapper" data-url="https://www.twitch.tv/wpdeveloperdotnet" style="width:90%; height:360px;">
[106] Fix | Delete
<iframe loading="lazy" src="https://embed.twitch.tv?autoplay=true&#038;channel=wpdeveloperdotnet&#038;height=360&#038;layout=video&#038;migration=true&#038;muted=false&#038;theme=dark&#038;time=0h0m0s&#038;video=&#038;width=600&#038;allowfullscreen=true&#038;parent={$parent}" allowfullscreen="" scrolling="no" frameborder="0" allow="autoplay; fullscreen" title="Twitch" sandbox="allow-modals allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox" ></iframe>
[107] Fix | Delete
</div>
[108] Fix | Delete
KAMAL;
[109] Fix | Delete
[110] Fix | Delete
break;
[111] Fix | Delete
case 'dailymotion':
[112] Fix | Delete
$parent = wp_parse_url( site_url(), 1);
[113] Fix | Delete
$preview_video = <<<KAMAL
[114] Fix | Delete
<div class="embedpress_wrapper" style="width:90%; height:360px;">
[115] Fix | Delete
<iframe title="Sample video" frameborder="0" width="640" height="400" src="https://www.dailymotion.com/embed/video/x7qvzya?ui-highlight=dd3333&amp;start=0&amp;mute=0&amp;autoplay=0&amp;controls=1&amp;ui-start-screen-info=1&amp;endscreen-enable=0&amp;ui-logo=1" allowfullscreen="" allow="autoplay" loading="lazy" style="max-width: 100%; max-height: 400px;"></iframe>
[116] Fix | Delete
</div>
[117] Fix | Delete
KAMAL;
[118] Fix | Delete
[119] Fix | Delete
break;
[120] Fix | Delete
case 'document':
[121] Fix | Delete
$pdf_url = EMBEDPRESS_SETTINGS_ASSETS_URL . 'embedpress.pdf';
[122] Fix | Delete
$renderer = Helper::get_pdf_renderer();
[123] Fix | Delete
$src = $renderer . ((strpos($renderer, '?') == false) ? '?' : '&') . 'file=' . urlencode($pdf_url);
[124] Fix | Delete
ob_start(); ?>
[125] Fix | Delete
<iframe class="embedpress-embed-document-pdf ep-pdf-sample" style="width:500px; max-width:100%; height: 300px; display: inline-block" src="<?php echo esc_url( $src); ?>" ></iframe>
[126] Fix | Delete
<?php
[127] Fix | Delete
$preview_video = ob_get_clean();
[128] Fix | Delete
break;
[129] Fix | Delete
default:
[130] Fix | Delete
$preview_video = '<iframe height="300px" src="https://www.youtube.com/embed/2u0HRUdLHxo" frameborder="0"></iframe>';
[131] Fix | Delete
break;
[132] Fix | Delete
}
[133] Fix | Delete
?>
[134] Fix | Delete
<div class="form__group">
[135] Fix | Delete
<p class="form__label"><?php
[136] Fix | Delete
$provider_name = $provider === 'youtube' ? 'YouTube' : ucfirst( $provider);
[137] Fix | Delete
printf( esc_html__( '%s Custom Branding', 'embedpress'), $provider_name);
[138] Fix | Delete
echo $pro_active ? '': ' <span class="isPro">Pro</span>'; ?>
[139] Fix | Delete
</p>
[140] Fix | Delete
<div class="form__control__wrap">
[141] Fix | Delete
<label class="input__switch switch__text <?php echo $pro_active ? '': 'isPro'; ?>">
[142] Fix | Delete
<input type="checkbox" name="<?php echo esc_attr( $px_branding ); ?>" data-default="<?php echo esc_attr( $branding ); ?>" data-value="<?php echo esc_attr( $branding ); ?>" value="yes" <?php checked( 'yes', $branding);?> <?php echo $pro_active ? '': ' disabled'; ?>>
[143] Fix | Delete
<span></span>
[144] Fix | Delete
<a href="#" class="logo__adjust__toggler"><?php esc_html_e( "Settings", "embedpress" ); ?><i class="ep-icon ep-caret-down"></i></a>
[145] Fix | Delete
</label>
[146] Fix | Delete
<div class="logo__adjust__wrap <?php echo $pro_active ? '': 'proOverlay'; ?>" style="<?php if ( ('yes' !== $branding) || !$pro_active ) { echo 'display:none;'; } ?>">
[147] Fix | Delete
<label class="logo__upload" id="yt_logo_upload_wrap" style="<?php if (!empty( $logo_url)) { echo 'display:none;'; } ?>">
[148] Fix | Delete
<input type="hidden" class="preview__logo__input" name="<?php echo esc_attr( $px_logo_url ); ?>" id="<?php echo esc_attr( $px_logo_url ); ?>" data-default="<?php echo esc_url( $logo_url ); ?>" value="<?php echo $logo_url; ?>">
[149] Fix | Delete
<input type="hidden" class="preview__logo__input_id" name="<?php echo esc_attr( $px_logo_id ); ?>" id="<?php echo esc_attr( $px_logo_id ); ?>" data-default="<?php echo esc_attr( $logo_id ); ?>" value="<?php echo $logo_id; ?>">
[150] Fix | Delete
<span class="icon"><i class="ep-icon ep-upload"></i></span>
[151] Fix | Delete
<span class="text"><?php esc_html_e( "Click To Upload", "embedpress" ); ?></span>
[152] Fix | Delete
</label>
[153] Fix | Delete
<div class="logo__upload__preview" id="yt_logo__upload__preview" style="<?php if ( empty( $logo_url) ) { echo 'display:none'; } ?> ">
[154] Fix | Delete
<div class="instant__preview">
[155] Fix | Delete
<a href="#" id="yt_preview__remove" class="preview__remove"><i class="ep-icon ep-cross"></i></a>
[156] Fix | Delete
<img class="instant__preview__img" id="yt_logo_preview" src="<?php echo esc_url($logo_url); ?>" alt="">
[157] Fix | Delete
</div>
[158] Fix | Delete
</div>
[159] Fix | Delete
[160] Fix | Delete
<div class="logo__adjust">
[161] Fix | Delete
<div class="logo__adjust__controller">
[162] Fix | Delete
<div class="logo__adjust__controller__item">
[163] Fix | Delete
<span class="controller__label"><?php esc_html_e( "Logo Opacity (%)", "embedpress" ); ?></span>
[164] Fix | Delete
<div class="logo__adjust__controller__inputs">
[165] Fix | Delete
<input type="range" max="100" data-default="<?php echo esc_attr( $logo_opacity ); ?>" value="<?php echo esc_attr( $logo_opacity ); ?>" class="opacity__range" name="<?php echo esc_attr( $px_logo_opacity )?>">
[166] Fix | Delete
<input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_opacity ); ?>" value="<?php echo esc_attr( $logo_opacity ); ?>">
[167] Fix | Delete
</div>
[168] Fix | Delete
</div>
[169] Fix | Delete
<div class="logo__adjust__controller__item">
[170] Fix | Delete
<span class="controller__label"><?php esc_html_e( "Logo X Position (%)", "embedpress" ); ?></span>
[171] Fix | Delete
<div class="logo__adjust__controller__inputs">
[172] Fix | Delete
<input type="range" max="100" data-default="<?php echo esc_attr( $logo_xpos ); ?>" value="<?php echo $logo_xpos; ?>" class="x__range" name="<?php echo esc_attr( $px_logo_xpos );?>">
[173] Fix | Delete
<input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_xpos ); ?>" value="<?php echo $logo_xpos; ?>">
[174] Fix | Delete
</div>
[175] Fix | Delete
</div>
[176] Fix | Delete
<div class="logo__adjust__controller__item">
[177] Fix | Delete
<span class="controller__label"><?php esc_html_e( "Logo Y Position (%)", "embedpress" ); ?></span>
[178] Fix | Delete
<div class="logo__adjust__controller__inputs">
[179] Fix | Delete
<input type="range" max="100" data-default="<?php echo esc_attr( $logo_ypos ); ?>" value="<?php echo esc_attr( $logo_ypos ); ?>" class="y__range" name="<?php echo esc_attr( $px_logo_ypos ); ?>" >
[180] Fix | Delete
<input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_ypos ); ?>" value="<?php echo esc_attr( $logo_ypos ); ?>">
[181] Fix | Delete
</div>
[182] Fix | Delete
</div>
[183] Fix | Delete
<div class="logo__adjust__controller__item">
[184] Fix | Delete
<label class="controller__label" for="yt_cta_url" ><?php esc_html_e( "Call to Action Link", "embedpress" );?> </label>
[185] Fix | Delete
<div>
[186] Fix | Delete
<input type="url" name="<?php echo esc_attr( $px_cta_url ); ?>" id="<?php echo esc_attr( $px_cta_url ); ?>" class="form__control" data-default="<?php echo esc_url( $cta_url ); ?>" value="<?php echo esc_url( $cta_url); ?>">
[187] Fix | Delete
[188] Fix | Delete
<p><?php esc_html_e( "You may link the logo to any CTA link.", "embedpress" ); ?></p>
[189] Fix | Delete
</div>
[190] Fix | Delete
</div>
[191] Fix | Delete
</div>
[192] Fix | Delete
<div class="logo__adjust__preview">
[193] Fix | Delete
<span class="title"><?php esc_html_e( "Live Preview", "embedpress" ); ?></span>
[194] Fix | Delete
<div class="preview__box">
[195] Fix | Delete
<?php echo $preview_video ;?>
[196] Fix | Delete
<img src="<?php echo esc_url($logo_url); ?>" class="preview__logo" style="bottom:<?php echo esc_attr( $logo_ypos); ?>%; right:<?php echo esc_attr( $logo_xpos); ?>%; opacity:<?php echo ($logo_opacity/100); ?>;" alt="">
[197] Fix | Delete
</div>
[198] Fix | Delete
</div>
[199] Fix | Delete
</div>
[200] Fix | Delete
</div>
[201] Fix | Delete
<?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?>
[202] Fix | Delete
[203] Fix | Delete
</div>
[204] Fix | Delete
</div>
[205] Fix | Delete
[206] Fix | Delete
<?php
[207] Fix | Delete
}
[208] Fix | Delete
?>
[209] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function