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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/embedpre.../EmbedPre.../Includes/Classes
File: Helper.php
$social_icons .= '</div></div>';
[500] Fix | Delete
[501] Fix | Delete
return $social_icons;
[502] Fix | Delete
}
[503] Fix | Delete
[504] Fix | Delete
public static function ep_get_elementor_widget_settings($page_settings = '', $id = '', $widgetType = '')
[505] Fix | Delete
{
[506] Fix | Delete
[507] Fix | Delete
$data = json_decode($page_settings, true);
[508] Fix | Delete
[509] Fix | Delete
// Search for the element with the given ID
[510] Fix | Delete
$element = null;
[511] Fix | Delete
foreach ($data as $section) {
[512] Fix | Delete
foreach ($section['elements'] as $column) {
[513] Fix | Delete
foreach ($column['elements'] as $el) {
[514] Fix | Delete
if ($el['id'] == $id && $el['elType'] == 'widget' && $el['widgetType'] == $widgetType) {
[515] Fix | Delete
$element = $el;
[516] Fix | Delete
break 3;
[517] Fix | Delete
}
[518] Fix | Delete
}
[519] Fix | Delete
}
[520] Fix | Delete
}
[521] Fix | Delete
[522] Fix | Delete
// Output the element code
[523] Fix | Delete
if ($element) {
[524] Fix | Delete
return $element;;
[525] Fix | Delete
}
[526] Fix | Delete
}
[527] Fix | Delete
[528] Fix | Delete
public static function ep_get_popup_icon()
[529] Fix | Delete
{
[530] Fix | Delete
$svg = '<div class="ep-doc-popup-icon" ><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" xml:space="preserve"><path fill="#fff" d="M5 3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6l-2-2v8H5V5h8l-2-2H5zm9 0 2.7 2.7-7.5 7.5 1.7 1.7 7.5-7.5L21 10V3h-7z"/><path style="fill:none" d="M0 0h24v24H0z"/></svg></div>';
[531] Fix | Delete
[532] Fix | Delete
return $svg;
[533] Fix | Delete
}
[534] Fix | Delete
public static function ep_get_download_icon()
[535] Fix | Delete
{
[536] Fix | Delete
$svg = '<div class="ep-doc-download-icon" ><svg width="25" height="25" viewBox="0 0 0.6 0.6" xmlns="http://www.w3.org/2000/svg"><path fill="#fff" fill-rule="evenodd" d="M.525.4A.025.025 0 0 1 .55.422v.053A.075.075 0 0 1 .479.55H.125A.075.075 0 0 1 .05.479V.425A.025.025 0 0 1 .1.422v.053A.025.025 0 0 0 .122.5h.353A.025.025 0 0 0 .5.478V.425A.025.025 0 0 1 .525.4ZM.3.05a.025.025 0 0 1 .025.025v.24L.357.283A.025.025 0 0 1 .39.281l.002.002a.025.025 0 0 1 .002.033L.392.318.317.393.316.394.314.395.311.397.308.398.305.399.301.4H.295L.292.399.289.398.287.397.285.395A.025.025 0 0 1 .283.393L.208.318A.025.025 0 0 1 .241.281l.002.002.032.032v-.24A.025.025 0 0 1 .3.05Z"/></svg></div>';
[537] Fix | Delete
[538] Fix | Delete
return $svg;
[539] Fix | Delete
}
[540] Fix | Delete
[541] Fix | Delete
public static function ep_get_print_icon()
[542] Fix | Delete
{
[543] Fix | Delete
$svg = '<div class="ep-doc-print-icon" ><svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24">
[544] Fix | Delete
<path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z" fill="#fff"/>
[545] Fix | Delete
</svg></div>';
[546] Fix | Delete
[547] Fix | Delete
return $svg;
[548] Fix | Delete
}
[549] Fix | Delete
[550] Fix | Delete
public static function ep_get_fullscreen_icon()
[551] Fix | Delete
{
[552] Fix | Delete
$svg = '<div class="ep-doc-fullscreen-icon"><svg width="25" height="25" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
[553] Fix | Delete
<path d="m3 15 .117.007a1 1 0 0 1 .876.876L4 16v4h4l.117.007a1 1 0 0 1 0 1.986L8 22H3l-.117-.007a1 1 0 0 1-.876-.876L2 21v-5l.007-.117a1 1 0 0 1 .876-.876L3 15Zm18 0a1 1 0 0 1 .993.883L22 16v5a1 1 0 0 1-.883.993L21 22h-5a1 1 0 0 1-.117-1.993L16 20h4v-4a1 1 0 0 1 .883-.993L21 15ZM8 2a1 1 0 0 1 .117 1.993L8 4H4v4a1 1 0 0 1-.883.993L3 9a1 1 0 0 1-.993-.883L2 8V3a1 1 0 0 1 .883-.993L3 2h5Zm13 0 .117.007a1 1 0 0 1 .876.876L22 3v5l-.007.117a1 1 0 0 1-.876.876L21 9l-.117-.007a1 1 0 0 1-.876-.876L20 8V4h-4l-.117-.007a1 1 0 0 1 0-1.986L16 2h5Z" fill="#fff"/>
[554] Fix | Delete
</svg></div>';
[555] Fix | Delete
[556] Fix | Delete
return $svg;
[557] Fix | Delete
}
[558] Fix | Delete
public static function ep_get_minimize_icon()
[559] Fix | Delete
{
[560] Fix | Delete
$svg = '<div class="ep-doc-minimize-icon" style="display:none"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" style="enable-background:new 0 0 385.331 385.331" xml:space="preserve" width="20" height="20"><path fill="#fff" d="M13.751 8.131h5.62c0.355 0 0.619 -0.28 0.619 -0.634 0 -0.355 -0.265 -0.615 -0.619 -0.614h-4.995V1.878c0 -0.355 -0.27 -0.624 -0.624 -0.624s-0.624 0.27 -0.624 0.624v5.62c0 0.002 0.001 0.003 0.001 0.004 0 0.002 -0.001 0.003 -0.001 0.005 0 0.348 0.276 0.625 0.624 0.624zM6.244 1.259c-0.354 0 -0.614 0.265 -0.614 0.619v4.995H0.624c-0.355 0 -0.624 0.27 -0.624 0.624 0 0.355 0.27 0.624 0.624 0.624h5.62c0.002 0 0.003 -0.001 0.004 -0.001 0.002 0 0.003 0.001 0.005 0.001 0.348 0 0.624 -0.276 0.624 -0.624V1.878c0 -0.354 -0.28 -0.619 -0.634 -0.619zm0.005 10.61H0.629c-0.355 0.001 -0.619 0.28 -0.619 0.634 0 0.355 0.265 0.615 0.619 0.614h4.995v5.005c0 0.355 0.27 0.624 0.624 0.624 0.355 0 0.624 -0.27 0.624 -0.624V12.502c0 -0.002 -0.001 -0.003 -0.001 -0.004 0 -0.002 0.001 -0.003 0.001 -0.005 0 -0.348 -0.276 -0.624 -0.624 -0.624zm13.127 0H13.756c-0.002 0 -0.003 0.001 -0.004 0.001 -0.002 0 -0.003 -0.001 -0.005 -0.001 -0.348 0 -0.624 0.276 -0.624 0.624v5.62c0 0.355 0.28 0.619 0.634 0.619 0.354 0.001 0.614 -0.265 0.614 -0.619v-4.995H19.376c0.355 0 0.624 -0.27 0.624 -0.624s-0.27 -0.624 -0.624 -0.625z"/><g/><g/><g/><g/><g/><g/></svg></div>';
[561] Fix | Delete
[562] Fix | Delete
return $svg;
[563] Fix | Delete
}
[564] Fix | Delete
public static function ep_get_draw_icon()
[565] Fix | Delete
{
[566] Fix | Delete
$svg = '<div class="ep-doc-draw-icon"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m15 7.5 2.5 2.5m-10 10L19.25 8.25c0.69 -0.69 0.69 -1.81 0 -2.5v0c-0.69 -0.69 -1.81 -0.69 -2.5 0L5 17.5V20h2.5Zm0 0h8.379C17.05 20 18 19.05 18 17.879v0c0 -0.563 -0.224 -1.103 -0.621 -1.5L17 16M4.5 5c2 -2 5.5 -1 5.5 1 0 2.5 -6 2.5 -6 5 0 0.876 0.533 1.526 1.226 2" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></div>';
[567] Fix | Delete
[568] Fix | Delete
return $svg;
[569] Fix | Delete
}
[570] Fix | Delete
[571] Fix | Delete
public static function get_insta_video_icon()
[572] Fix | Delete
{
[573] Fix | Delete
$svg = '<svg class="insta-video-icon" aria-label="Clip" class="x1lliihq x1n2onr6" color="#FFF" fill="#FFF" height="20" viewBox="1.111 1.111 24.444 24.447" width="20">
[574] Fix | Delete
<path d="m14.248 1.111 3.304 5.558h-6.2L8.408 1.146c.229-.014.466-.024.713-.03l.379-.005Zm2.586 0h.331c3.4 0 4.964.838 6.267 2.097a6.674 6.674 0 0 1 1.773 3.133l.078.328H20.14l-3.307-5.558ZM6.093 1.53l2.74 5.139H1.382a6.678 6.678 0 0 1 4.38-5.033ZM16.91 15.79l-5.05-2.916a1.01 1.01 0 0 0-1.507.742l-.009.133v5.831a1.011 1.011 0 0 0 1.394.933l.121-.059 5.05-2.916a1.01 1.01 0 0 0 .111-1.674l-.111-.076-5.05-2.916ZM1.132 8.891h24.404l.017.4.003.21v7.666c0 3.401-.839 4.966-2.098 6.267-1.279 1.238-2.778 2.062-5.922 2.121l-.371.003H9.501c-3.4 0-4.963-.839-6.267-2.099-1.238-1.278-2.06-2.776-2.12-5.922l-.003-.37V9.501l.003-.21Z" fill-rule="evenodd" /></svg>';
[575] Fix | Delete
[576] Fix | Delete
return $svg;
[577] Fix | Delete
}
[578] Fix | Delete
[579] Fix | Delete
public static function get_insta_image_carousel_icon()
[580] Fix | Delete
{
[581] Fix | Delete
$svg = '<svg aria-label="Carousel" class="x1lliihq x1n2onr6" color="#FFF" fill="#FFF" height="25" viewBox="0 0 43.636 43.636" width="25">
[582] Fix | Delete
<path d="M31.636 27V10a4.695 4.695 0 0 0-4.727-4.727H10A4.695 4.695 0 0 0 5.273 10v17A4.695 4.695 0 0 0 10 31.727h17c2.545-.091 4.636-2.182 4.636-4.727zm4-13.364v14.636c0 4.091-3.364 7.455-7.455 7.455H13.545c-.545 0-.818.636-.455 1 .909 1 2.182 1.636 3.727 1.636h12.182a9.35 9.35 0 0 0 9.364-9.364V16.818a5.076 5.076 0 0 0-1.636-3.727c-.455-.364-1.091 0-1.091.545z" /></svg>';
[583] Fix | Delete
[584] Fix | Delete
return $svg;
[585] Fix | Delete
}
[586] Fix | Delete
[587] Fix | Delete
public static function get_insta_image_icon()
[588] Fix | Delete
{
[589] Fix | Delete
$svg = '<svg width="22" height="22" viewBox="0 0 0.6 0.6" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M.175.05A.125.125 0 0 0 .05.175v.25A.125.125 0 0 0 .175.55h.25A.125.125 0 0 0 .55.425v-.25A.125.125 0 0 0 .425.05h-.25ZM.2.225a.025.025 0 1 1 .05 0 .025.025 0 0 1-.05 0ZM.225.15a.075.075 0 1 0 0 .15.075.075 0 0 0 0-.15Zm.138.205A.025.025 0 0 1 .398.351l.048.042A.025.025 0 1 0 .479.355L.43.312a.075.075 0 0 0-.107.011l-.04.05a.024.024 0 0 1-.032.005.074.074 0 0 0-.099.015L.118.432a.025.025 0 0 0 .038.033l.035-.04A.024.024 0 0 1 .223.42.074.074 0 0 0 .322.405l.04-.05Z" fill="#fff"/></svg>';
[590] Fix | Delete
[591] Fix | Delete
return $svg;
[592] Fix | Delete
}
[593] Fix | Delete
[594] Fix | Delete
public static function get_insta_like_icon()
[595] Fix | Delete
{
[596] Fix | Delete
$svg = '<svg version="1.1" id="Uploaded to svgrepo.com" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 0.8 0.8" xml:space="preserve"><path d="M.225.25C.225.264.214.275.2.275S.175.264.175.25.186.225.2.225.225.236.225.25zM.75.3C.75.453.589.582.485.65a1.06 1.06 0 0 1-.073.044.025.025 0 0 1-.024 0A1.049 1.049 0 0 1 .315.65C.211.582.05.453.05.3a.2.2 0 0 1 .2-.2.199.199 0 0 1 .15.068A.199.199 0 0 1 .55.1a.2.2 0 0 1 .2.2zM.25.25a.05.05 0 1 0-.1 0 .05.05 0 0 0 .1 0z" style="fill:#fff"/></svg>';
[597] Fix | Delete
[598] Fix | Delete
return $svg;
[599] Fix | Delete
}
[600] Fix | Delete
public static function get_insta_comment_icon()
[601] Fix | Delete
{
[602] Fix | Delete
$svg = '<svg fill="#fff" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 2.5 2.5" xml:space="preserve"><path d="M2.374.446a.063.063 0 0 0-.061-.057H.991a.063.063 0 0 0-.063.057H.927v.328h.559c.029 0 .053.022.056.051h.001v.731h.275l.162.162a.063.063 0 0 0 .116-.035v-.127h.217a.063.063 0 0 0 .06-.051h.002V.446h-.001z"/><path d="M1.361.899H.18A.056.056 0 0 0 .125.95v.946h.001a.057.057 0 0 0 .054.045h.194v.113a.057.057 0 0 0 .104.032l.145-.145h.738c.027 0 .05-.02.056-.045h.001V.95h-.001a.056.056 0 0 0-.056-.051z"/></svg>';
[603] Fix | Delete
[604] Fix | Delete
return $svg;
[605] Fix | Delete
}
[606] Fix | Delete
public static function get_instagram_icon()
[607] Fix | Delete
{
[608] Fix | Delete
$svg = '<svg version="1.1" id="Icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" xml:space="preserve" width="1285" height="400"><style>.st0{fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10}</style><path class="st0" d="M14.375 19.375h-8.75c-2.75 0-5-2.25-5-5v-8.75c0-2.75 2.25-5 5-5h8.75c2.75 0 5 2.25 5 5v8.75c0 2.75-2.25 5-5 5z"/><path class="st0" d="M14.375 10A4.375 4.375 0 0 1 10 14.375 4.375 4.375 0 0 1 5.625 10a4.375 4.375 0 0 1 8.75 0zm1.25-5.625A.625.625 0 0 1 15 5a.625.625 0 0 1-.625-.625.625.625 0 0 1 1.25 0z"/></svg>';
[609] Fix | Delete
[610] Fix | Delete
return $svg;
[611] Fix | Delete
}
[612] Fix | Delete
[613] Fix | Delete
public static function get_google_presentation_url($embedded_url)
[614] Fix | Delete
{
[615] Fix | Delete
$parsed_url = parse_url($embedded_url);
[616] Fix | Delete
$base_url = $parsed_url['scheme'] . '://' . $parsed_url['host'] . $parsed_url['path'];
[617] Fix | Delete
$base_url = strtok($base_url, '?');
[618] Fix | Delete
$base_url = rtrim($base_url, '/');
[619] Fix | Delete
return $base_url;
[620] Fix | Delete
}
[621] Fix | Delete
[622] Fix | Delete
public static function check_media_format($url)
[623] Fix | Delete
{
[624] Fix | Delete
$pattern1 = '/\.(mp4|mov|avi|wmv|flv|mkv|webm|mpeg|mpg)$/i';
[625] Fix | Delete
$pattern2 = '/\.(mp3|wav|ogg|aac)$/i';
[626] Fix | Delete
[627] Fix | Delete
$isVideo = preg_match($pattern1, $url);
[628] Fix | Delete
$isAudio = preg_match($pattern2, $url);
[629] Fix | Delete
[630] Fix | Delete
$is_self_hosted = false;
[631] Fix | Delete
$format = '';
[632] Fix | Delete
[633] Fix | Delete
if (!empty($isVideo) || !empty($isAudio)) {
[634] Fix | Delete
$is_self_hosted = true;
[635] Fix | Delete
if (!empty($isVideo)) {
[636] Fix | Delete
$format = 'video';
[637] Fix | Delete
} else if (!empty($isAudio)) {
[638] Fix | Delete
$format = 'audio';
[639] Fix | Delete
}
[640] Fix | Delete
}
[641] Fix | Delete
[642] Fix | Delete
if (!$is_self_hosted) {
[643] Fix | Delete
return [
[644] Fix | Delete
'selhosted' => false,
[645] Fix | Delete
];
[646] Fix | Delete
}
[647] Fix | Delete
[648] Fix | Delete
return [
[649] Fix | Delete
'selhosted' => true,
[650] Fix | Delete
'format' => $format,
[651] Fix | Delete
];
[652] Fix | Delete
}
[653] Fix | Delete
[654] Fix | Delete
// Ajax Methods get instagram feed data
[655] Fix | Delete
public function loadmore_data_handler()
[656] Fix | Delete
{
[657] Fix | Delete
$connected_account_type = isset($_POST['connected_account_type']) ? sanitize_text_field($_POST['connected_account_type']) : 'personal';
[658] Fix | Delete
$hashtag_id = isset($_POST['hashtag_id']) ? sanitize_text_field($_POST['hashtag_id']) : '';
[659] Fix | Delete
$feed_type = isset($_POST['feed_type']) ? sanitize_text_field($_POST['feed_type']) : 'user_aacount_type';
[660] Fix | Delete
$user_id = isset($_POST['user_id']) ? sanitize_text_field($_POST['user_id']) : '';
[661] Fix | Delete
$loadmore_key = isset($_POST['loadmore_key']) ? sanitize_text_field($_POST['loadmore_key']) : '';
[662] Fix | Delete
$nonce = isset($_POST['_nonce']) ? sanitize_text_field($_POST['_nonce']) : '';
[663] Fix | Delete
$params = isset($_POST['params']) ? sanitize_text_field($_POST['params']) : '';
[664] Fix | Delete
// $params = json_decode($params, true);
[665] Fix | Delete
$params = stripslashes($params); // Remove extra backslashes
[666] Fix | Delete
$params = json_decode($params, true);
[667] Fix | Delete
[668] Fix | Delete
// Verify nonce
[669] Fix | Delete
if (!wp_verify_nonce($nonce, 'ep_nonce')) {
[670] Fix | Delete
wp_send_json_error('Invalid nonce');
[671] Fix | Delete
wp_die(); // Terminate script execution if nonce is invalid
[672] Fix | Delete
}
[673] Fix | Delete
[674] Fix | Delete
$feeds_data = get_option('ep_instagram_feed_data');
[675] Fix | Delete
$user_data = $feeds_data[$user_id]['feed_userinfo'];
[676] Fix | Delete
[677] Fix | Delete
if ($feed_type == 'hashtag_type') {
[678] Fix | Delete
$feeds_data = get_option('ep_instagram_hashtag_feed');
[679] Fix | Delete
}
[680] Fix | Delete
[681] Fix | Delete
[682] Fix | Delete
$profile_picture_url = isset($user_data['profile_picture_url']) ? $user_data['profile_picture_url'] : '';
[683] Fix | Delete
[684] Fix | Delete
if ($feed_type === 'user_account_type' && isset($feeds_data[$loadmore_key]['feed_posts'])) {
[685] Fix | Delete
$feed_posts = $feeds_data[$loadmore_key]['feed_posts'];
[686] Fix | Delete
} else if ($feed_type === 'hashtag_type' && isset($feeds_data[$loadmore_key])) {
[687] Fix | Delete
$feed_posts = $feeds_data[$loadmore_key];
[688] Fix | Delete
} else {
[689] Fix | Delete
$feed_posts = ['error'];
[690] Fix | Delete
}
[691] Fix | Delete
[692] Fix | Delete
[693] Fix | Delete
if (is_array($feed_posts) && count($feed_posts) > 0) {
[694] Fix | Delete
$loaded_posts = isset($_POST['loaded_posts']) ? intval($_POST['loaded_posts']) : 0;
[695] Fix | Delete
$posts_per_page = isset($_POST['posts_per_page']) ? intval($_POST['posts_per_page']) : 0;
[696] Fix | Delete
[697] Fix | Delete
$post_index = $loaded_posts + 1;
[698] Fix | Delete
$start_index = $loaded_posts;
[699] Fix | Delete
[700] Fix | Delete
$next_posts = array_slice($feed_posts, $start_index, $posts_per_page);
[701] Fix | Delete
[702] Fix | Delete
ob_start();
[703] Fix | Delete
[704] Fix | Delete
if (is_array($next_posts) && count($next_posts) > 0) :
[705] Fix | Delete
foreach ($next_posts as $post) :
[706] Fix | Delete
$caption = !empty($post['caption']) ? $post['caption'] : '';
[707] Fix | Delete
$media_type = !empty($post['media_type']) ? $post['media_type'] : '';
[708] Fix | Delete
$media_url = !empty($post['media_url']) ? $post['media_url'] : '';
[709] Fix | Delete
$permalink = !empty($post['permalink']) ? $post['permalink'] : '';
[710] Fix | Delete
$timestamp = !empty($post['timestamp']) ? $post['timestamp'] : '';
[711] Fix | Delete
$username = !empty($post['username']) ? $post['username'] : '';
[712] Fix | Delete
$like_count = !empty($post['like_count']) ? $post['like_count'] : 0;
[713] Fix | Delete
$comments_count = !empty($post['comments_count']) ? $post['comments_count'] : 0;
[714] Fix | Delete
[715] Fix | Delete
$post['profile_picture_url'] = $profile_picture_url;
[716] Fix | Delete
$post['show_likes_count'] = isset($params['show_likes_count']) ? $params['show_likes_count'] : false;
[717] Fix | Delete
$post['show_comments_count'] = isset($params['show_comments_count']) ? $params['show_comments_count'] : false;
[718] Fix | Delete
$post['popup_follow_button'] = isset($params['popup_follow_button']) ? $params['popup_follow_button'] : true;
[719] Fix | Delete
$post['popup_follow_button_text'] = isset($params['popup_follow_button_text']) ? $params['popup_follow_button_text'] : 'Follow';
[720] Fix | Delete
?>
[721] Fix | Delete
[722] Fix | Delete
<div class="insta-gallery-item cg-carousel__slide js-carousel__slide" data-insta-postid="<?php echo esc_attr($post['id']) ?>" data-postindex="<?php echo esc_attr($post_index); ?>" data-postdata="<?php echo htmlspecialchars(json_encode($post), ENT_QUOTES, 'UTF-8'); ?>" data-media-type="<?php echo esc_attr($media_type); ?>">
[723] Fix | Delete
<?php
[724] Fix | Delete
[725] Fix | Delete
if (!empty($hashtag_id) && $media_type == 'CAROUSEL_ALBUM') {
[726] Fix | Delete
if (isset($post['children']['data'][0]['media_url'])) {
[727] Fix | Delete
$hashtag_media_url = $post['children']['data'][0]['media_url'];
[728] Fix | Delete
$hashtag_media_type = $post['children']['data'][0]['media_type'];
[729] Fix | Delete
[730] Fix | Delete
if ($hashtag_media_type == 'VIDEO') {
[731] Fix | Delete
echo '<video class="insta-gallery-image" src="' . esc_url($hashtag_media_url) . '"></video>';
[732] Fix | Delete
} else {
[733] Fix | Delete
echo ' <img class="insta-gallery-image" src="' . esc_url($hashtag_media_url) . '" alt="' . esc_attr('image') . '">';
[734] Fix | Delete
}
[735] Fix | Delete
}
[736] Fix | Delete
} else {
[737] Fix | Delete
if ($media_type == 'VIDEO') {
[738] Fix | Delete
echo '<video class="insta-gallery-image" src="' . esc_url($media_url) . '"></video>';
[739] Fix | Delete
} else {
[740] Fix | Delete
echo ' <img class="insta-gallery-image" src="' . esc_url($media_url) . '" alt="' . esc_attr('image') . '">';
[741] Fix | Delete
}
[742] Fix | Delete
}
[743] Fix | Delete
?>
[744] Fix | Delete
[745] Fix | Delete
<div class="insta-gallery-item-type">
[746] Fix | Delete
<div class="insta-gallery-item-type-icon">
[747] Fix | Delete
<?php
[748] Fix | Delete
if ($media_type == 'VIDEO') {
[749] Fix | Delete
echo Helper::get_insta_video_icon();
[750] Fix | Delete
} else if ($media_type == 'CAROUSEL_ALBUM') {
[751] Fix | Delete
echo Helper::get_insta_image_carousel_icon();
[752] Fix | Delete
} else {
[753] Fix | Delete
echo Helper::get_insta_image_icon();
[754] Fix | Delete
}
[755] Fix | Delete
?>
[756] Fix | Delete
</div>
[757] Fix | Delete
</div>
[758] Fix | Delete
<div class="insta-gallery-item-info">
[759] Fix | Delete
<?php if (strtolower($connected_account_type) === 'business') : ?>
[760] Fix | Delete
<div class="insta-item-reaction-count">
[761] Fix | Delete
<div class="insta-gallery-item-likes">
[762] Fix | Delete
<?php echo Helper::get_insta_like_icon();
[763] Fix | Delete
echo esc_html($like_count); ?>
[764] Fix | Delete
</div>
[765] Fix | Delete
<div class="insta-gallery-item-comments">
[766] Fix | Delete
<?php echo Helper::get_insta_comment_icon();
[767] Fix | Delete
echo esc_html($comments_count); ?>
[768] Fix | Delete
</div>
[769] Fix | Delete
</div>
[770] Fix | Delete
<?php else : ?>
[771] Fix | Delete
<div class="insta-gallery-item-permalink">
[772] Fix | Delete
<?php echo Helper::get_instagram_icon(); ?>
[773] Fix | Delete
</div>
[774] Fix | Delete
<?php endif; ?>
[775] Fix | Delete
</div>
[776] Fix | Delete
</div>
[777] Fix | Delete
[778] Fix | Delete
<?php $post_index++;
[779] Fix | Delete
endforeach;
[780] Fix | Delete
endif;
[781] Fix | Delete
[782] Fix | Delete
$feed_item = ob_get_clean();
[783] Fix | Delete
[784] Fix | Delete
$next_start_index = $start_index + count($next_posts);
[785] Fix | Delete
[786] Fix | Delete
wp_send_json(array(
[787] Fix | Delete
'html' => $feed_item,
[788] Fix | Delete
'next_post_index' => $next_start_index,
[789] Fix | Delete
'total_feed_posts' => count($feed_posts)
[790] Fix | Delete
));
[791] Fix | Delete
} else {
[792] Fix | Delete
wp_send_json('');
[793] Fix | Delete
}
[794] Fix | Delete
}
[795] Fix | Delete
[796] Fix | Delete
public static function getCalendlyUuid($url)
[797] Fix | Delete
{
[798] Fix | Delete
$pattern = '/\/([0-9a-fA-F-]+)$/';
[799] Fix | Delete
if (preg_match($pattern, $url, $matches)) {
[800] Fix | Delete
$uuid = $matches[1];
[801] Fix | Delete
return $uuid;
[802] Fix | Delete
}
[803] Fix | Delete
return '';
[804] Fix | Delete
}
[805] Fix | Delete
[806] Fix | Delete
public static function getCalendlyUserInfo($access_token)
[807] Fix | Delete
{
[808] Fix | Delete
$transient_name = 'calendly_user_info_' . $access_token;
[809] Fix | Delete
$user_info = get_transient($transient_name);
[810] Fix | Delete
if (false === $user_info) {
[811] Fix | Delete
$user_endpoint = 'https://api.calendly.com/users/me';
[812] Fix | Delete
$headers = array(
[813] Fix | Delete
'Authorization' => "Bearer $access_token",
[814] Fix | Delete
'Content-Type' => 'application/json',
[815] Fix | Delete
);
[816] Fix | Delete
$args = array(
[817] Fix | Delete
'headers' => $headers,
[818] Fix | Delete
);
[819] Fix | Delete
$response = wp_remote_get($user_endpoint, $args);
[820] Fix | Delete
if (!is_wp_error($response) && 200 === wp_remote_retrieve_response_code($response)) {
[821] Fix | Delete
$user_info = wp_remote_retrieve_body($response);
[822] Fix | Delete
set_transient($transient_name, $user_info, 3600);
[823] Fix | Delete
} else {
[824] Fix | Delete
return false;
[825] Fix | Delete
}
[826] Fix | Delete
}
[827] Fix | Delete
[828] Fix | Delete
return $user_info;
[829] Fix | Delete
}
[830] Fix | Delete
[831] Fix | Delete
[832] Fix | Delete
[833] Fix | Delete
public static function getCalaendlyEventTypes($user_uri, $access_token)
[834] Fix | Delete
{
[835] Fix | Delete
// Attempt to retrieve the data from the transient
[836] Fix | Delete
$events_list = get_transient('calendly_events_list_' . md5($access_token));
[837] Fix | Delete
[838] Fix | Delete
if (false === $events_list) {
[839] Fix | Delete
// If the data is not in the transient, fetch it from the API
[840] Fix | Delete
$events_endpoint = "https://api.calendly.com/event_types?user=$user_uri";
[841] Fix | Delete
[842] Fix | Delete
$headers = array(
[843] Fix | Delete
'Authorization' => "Bearer $access_token",
[844] Fix | Delete
'Content-Type' => 'application/json',
[845] Fix | Delete
);
[846] Fix | Delete
[847] Fix | Delete
$args = array(
[848] Fix | Delete
'headers' => $headers,
[849] Fix | Delete
);
[850] Fix | Delete
[851] Fix | Delete
$response = wp_remote_get($events_endpoint, $args);
[852] Fix | Delete
[853] Fix | Delete
if (!is_wp_error($response)) {
[854] Fix | Delete
$body = wp_remote_retrieve_body($response);
[855] Fix | Delete
$events_list = json_decode($body, true);
[856] Fix | Delete
[857] Fix | Delete
// Store the data in a transient for a specified time (e.g., 1 hour)
[858] Fix | Delete
set_transient('calendly_events_list', $events_list, HOUR_IN_SECONDS);
[859] Fix | Delete
[860] Fix | Delete
return $events_list;
[861] Fix | Delete
}
[862] Fix | Delete
}
[863] Fix | Delete
[864] Fix | Delete
return $events_list;
[865] Fix | Delete
}
[866] Fix | Delete
[867] Fix | Delete
public static function getListEventInvitee($uuid, $access_token)
[868] Fix | Delete
{
[869] Fix | Delete
// Attempt to retrieve the data from the transient
[870] Fix | Delete
$invitee_list = get_transient('calendly_invitee_list_' . md5($access_token));
[871] Fix | Delete
[872] Fix | Delete
if (false === $invitee_list) {
[873] Fix | Delete
// If the data is not in the transient, fetch it from the API
[874] Fix | Delete
$events_endpoint = "https://api.calendly.com/scheduled_events/$uuid/invitees";
[875] Fix | Delete
[876] Fix | Delete
$headers = array(
[877] Fix | Delete
'Authorization' => "Bearer $access_token",
[878] Fix | Delete
'Content-Type' => 'application/json',
[879] Fix | Delete
);
[880] Fix | Delete
[881] Fix | Delete
$args = array(
[882] Fix | Delete
'headers' => $headers,
[883] Fix | Delete
);
[884] Fix | Delete
[885] Fix | Delete
$response = wp_remote_get($events_endpoint, $args);
[886] Fix | Delete
[887] Fix | Delete
if (!is_wp_error($response)) {
[888] Fix | Delete
$body = wp_remote_retrieve_body($response);
[889] Fix | Delete
$invitee_list = json_decode($body, true);
[890] Fix | Delete
[891] Fix | Delete
// Store the data in a transient for a specified time (e.g., 1 hour)
[892] Fix | Delete
set_transient('calendly_invitee_list', $invitee_list, HOUR_IN_SECONDS);
[893] Fix | Delete
[894] Fix | Delete
return $invitee_list;
[895] Fix | Delete
}
[896] Fix | Delete
}
[897] Fix | Delete
[898] Fix | Delete
return $invitee_list;
[899] Fix | Delete
}
[900] Fix | Delete
[901] Fix | Delete
public static function getCalaendlyScheduledEvents($user_uri, $access_token)
[902] Fix | Delete
{
[903] Fix | Delete
// Attempt to retrieve the data from the transient
[904] Fix | Delete
$events_list = get_transient('calendly_events_list_' . md5($access_token));
[905] Fix | Delete
[906] Fix | Delete
if (false === $events_list) {
[907] Fix | Delete
// If the data is not in the transient, fetch it from the API
[908] Fix | Delete
$events_endpoint = "https://api.calendly.com/scheduled_events?user=$user_uri";
[909] Fix | Delete
[910] Fix | Delete
$headers = array(
[911] Fix | Delete
'Authorization' => "Bearer $access_token",
[912] Fix | Delete
'Content-Type' => 'application/json',
[913] Fix | Delete
);
[914] Fix | Delete
[915] Fix | Delete
$args = array(
[916] Fix | Delete
'headers' => $headers,
[917] Fix | Delete
);
[918] Fix | Delete
[919] Fix | Delete
$response = wp_remote_get($events_endpoint, $args);
[920] Fix | Delete
[921] Fix | Delete
if (!is_wp_error($response)) {
[922] Fix | Delete
$body = wp_remote_retrieve_body($response);
[923] Fix | Delete
$events_list = json_decode($body, true);
[924] Fix | Delete
[925] Fix | Delete
// Store the data in a transient for a specified time (e.g., 1 hour)
[926] Fix | Delete
set_transient('calendly_events_list', $events_list, HOUR_IN_SECONDS);
[927] Fix | Delete
[928] Fix | Delete
return $events_list;
[929] Fix | Delete
}
[930] Fix | Delete
}
[931] Fix | Delete
[932] Fix | Delete
return $events_list;
[933] Fix | Delete
}
[934] Fix | Delete
[935] Fix | Delete
[936] Fix | Delete
public static function parseDuration($durationString)
[937] Fix | Delete
{
[938] Fix | Delete
list($minutes, $seconds) = explode(':', $durationString);
[939] Fix | Delete
return intval($minutes) * 60 + intval($seconds);
[940] Fix | Delete
}
[941] Fix | Delete
[942] Fix | Delete
public static function generateAdTemplate($client_id, $attributes, $editor = 'elementor')
[943] Fix | Delete
{
[944] Fix | Delete
[945] Fix | Delete
// Example usage
[946] Fix | Delete
[947] Fix | Delete
[948] Fix | Delete
$adSource = isset($attributes['adSource']) ? $attributes['adSource'] : '';
[949] Fix | Delete
$adContent = isset($attributes['adContent']) ? $attributes['adContent'] : '';
[950] Fix | Delete
$unit = isset($attributes['unitoption']) ? $attributes['unitoption'] : 'px';
[951] Fix | Delete
[952] Fix | Delete
if ($editor === 'elementor') {
[953] Fix | Delete
if ($attributes['adSource'] === 'video') {
[954] Fix | Delete
$adFileUrl = isset($attributes['adFileUrl']['url']) ? $attributes['adFileUrl']['url'] : '';
[955] Fix | Delete
} else if ($attributes['adSource'] === 'image') {
[956] Fix | Delete
$adFileUrl = isset($attributes['adFileUrl1']['url']) ? $attributes['adFileUrl1']['url'] : '';
[957] Fix | Delete
} else {
[958] Fix | Delete
$adFileUrl = isset($attributes['adFileUrl2']['url']) ? $attributes['adFileUrl2']['url'] : '';
[959] Fix | Delete
}
[960] Fix | Delete
[961] Fix | Delete
$width = isset($attributes['width']) ? $attributes['width']['size'] : '600';
[962] Fix | Delete
$height = isset($attributes['height']) ? $attributes['height']['size'] : '550';
[963] Fix | Delete
} else {
[964] Fix | Delete
$adFileUrl = isset($attributes['adFileUrl']) ? $attributes['adFileUrl'] : '';
[965] Fix | Delete
$width = isset($attributes['width']) ? $attributes['width'] : '600';
[966] Fix | Delete
$height = isset($attributes['height']) ? $attributes['height'] : '550';
[967] Fix | Delete
}
[968] Fix | Delete
$adStart = isset($attributes['adStart']) ? intval($attributes['adStart']) : 0;
[969] Fix | Delete
$adUrl = isset($attributes['adUrl']) ? $attributes['adUrl'] : '';
[970] Fix | Delete
$adXPosition = isset($attributes['adXPosition']) ? $attributes['adXPosition'] : '';
[971] Fix | Delete
$adYPosition = isset($attributes['adYPosition']) ? $attributes['adYPosition'] : '';
[972] Fix | Delete
$adWidth = isset($attributes['adWidth']) ? $attributes['adWidth'] : '';
[973] Fix | Delete
$adHeight = isset($attributes['adHeight']) ? $attributes['adHeight'] : '';
[974] Fix | Delete
$adSkipButton = isset($attributes['adSkipButton']) ? $attributes['adSkipButton'] : false;
[975] Fix | Delete
$adSkipButtonAfter = isset($attributes['adSkipButtonAfter']) ? intval($attributes['adSkipButtonAfter']) : 5;
[976] Fix | Delete
[977] Fix | Delete
$currentTime = 0;
[978] Fix | Delete
$showSkipButton = false;
[979] Fix | Delete
$videoDuration = 0;
[980] Fix | Delete
[981] Fix | Delete
if ($adContent && isset($adContent['fileLength'])) {
[982] Fix | Delete
$videoDuration = self::parseDuration($adContent['fileLength']);
[983] Fix | Delete
}
[984] Fix | Delete
[985] Fix | Delete
$showSkipButton = true;
[986] Fix | Delete
[987] Fix | Delete
$isYTChannelClass = '';
[988] Fix | Delete
if (!empty($attributes['url']) && self::is_youtube_channel($attributes['url'])) {
[989] Fix | Delete
$isYTChannelClass = ' ep-youtube-channel';
[990] Fix | Delete
}
[991] Fix | Delete
[992] Fix | Delete
?>
[993] Fix | Delete
<div class="main-ad-template <?php echo esc_attr($adSource);
[994] Fix | Delete
echo esc_attr($isYTChannelClass); ?>" id="<?php echo esc_attr('ad-' . $client_id); ?>" style="display:none">
[995] Fix | Delete
<div class="ep-ad-container">
[996] Fix | Delete
<div class="ep-ad-content" style="position: relative;">
[997] Fix | Delete
<?php if (!empty($adUrl)) : ?> <a target="_blank" href="<?php echo esc_url($adUrl); ?>"> <?php endif; ?>
[998] Fix | Delete
<?php if ($adSource === 'video') : ?>
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function