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: Feature_Enhancer.php
}
[1500] Fix | Delete
[1501] Fix | Delete
[1502] Fix | Delete
return $embed;
[1503] Fix | Delete
}
[1504] Fix | Delete
[1505] Fix | Delete
[1506] Fix | Delete
public function embedpress_generate_social_share_meta()
[1507] Fix | Delete
{
[1508] Fix | Delete
$post_id = get_the_ID();
[1509] Fix | Delete
$post = get_post($post_id);
[1510] Fix | Delete
$tags = '';
[1511] Fix | Delete
[1512] Fix | Delete
$thumbnail_url = get_the_post_thumbnail_url($post_id);
[1513] Fix | Delete
[1514] Fix | Delete
if (!empty($_GET['hash'])) {
[1515] Fix | Delete
[1516] Fix | Delete
$id_value = sanitize_text_field($_GET['hash']);
[1517] Fix | Delete
[1518] Fix | Delete
$url = get_the_permalink($post_id);
[1519] Fix | Delete
[1520] Fix | Delete
if (class_exists('Elementor\Plugin') && \Elementor\Plugin::$instance->db->is_built_with_elementor(get_the_ID())) {
[1521] Fix | Delete
$page_settings = get_post_meta($post_id, '_elementor_data', true);
[1522] Fix | Delete
[1523] Fix | Delete
$ep_settings = Helper::ep_get_elementor_widget_settings($page_settings, $id_value, 'embedpres_elementor');
[1524] Fix | Delete
$pdf_settings = Helper::ep_get_elementor_widget_settings($page_settings, $id_value, 'embedpress_pdf');
[1525] Fix | Delete
$doc_settings = Helper::ep_get_elementor_widget_settings($page_settings, $id_value, 'embedpres_document');
[1526] Fix | Delete
[1527] Fix | Delete
[1528] Fix | Delete
[1529] Fix | Delete
if (is_array($ep_settings) && !empty($ep_settings)) {
[1530] Fix | Delete
$title = !empty($ep_settings['settings']['embedpress_content_title']) ? $ep_settings['settings']['embedpress_content_title'] : '';
[1531] Fix | Delete
[1532] Fix | Delete
$description = !empty($ep_settings['settings']['embedpress_content_descripiton']) ? $ep_settings['settings']['embedpress_content_descripiton'] : '';
[1533] Fix | Delete
[1534] Fix | Delete
$image_url = !empty($ep_settings['settings']['embedpress_content_share_custom_thumbnail']['url']) ? $ep_settings['settings']['embedpress_content_share_custom_thumbnail']['url'] : '';
[1535] Fix | Delete
} else if (is_array($pdf_settings) && !empty($pdf_settings)) {
[1536] Fix | Delete
$title = !empty($pdf_settings['settings']['embedpress_pdf_content_title']) ? $pdf_settings['settings']['embedpress_pdf_content_title'] : '';
[1537] Fix | Delete
[1538] Fix | Delete
$description = !empty($pdf_settings['settings']['embedpress_pdf_content_descripiton']) ? $pdf_settings['settings']['embedpress_pdf_content_descripiton'] : '';
[1539] Fix | Delete
[1540] Fix | Delete
$image_url = !empty($pdf_settings['settings']['embedpress_pdf_content_share_custom_thumbnail']['url']) ? $pdf_settings['settings']['embedpress_pdf_content_share_custom_thumbnail']['url'] : '';
[1541] Fix | Delete
} else if (is_array($doc_settings) && !empty($doc_settings)) {
[1542] Fix | Delete
$title = !empty($doc_settings['settings']['embedpress_doc_content_title']) ? $doc_settings['settings']['embedpress_doc_content_title'] : '';
[1543] Fix | Delete
[1544] Fix | Delete
$description = !empty($doc_settings['settings']['embedpress_doc_content_descripiton']) ? $doc_settings['settings']['embedpress_doc_content_descripiton'] : '';
[1545] Fix | Delete
[1546] Fix | Delete
$image_url = !empty($doc_settings['settings']['embedpress_doc_content_share_custom_thumbnail']['url']) ? $doc_settings['settings']['embedpress_doc_content_share_custom_thumbnail']['url'] : '';
[1547] Fix | Delete
}
[1548] Fix | Delete
[1549] Fix | Delete
if (!empty($image_url)) {
[1550] Fix | Delete
$tags .= "<meta name='twitter:image' content='" . esc_url($image_url) . "'/>\n";
[1551] Fix | Delete
$tags .= "<meta property='og:image' content='" . esc_url($image_url) . "'/>\n";
[1552] Fix | Delete
$tags .= "<meta property='og:url' content='" . esc_url("$url?hash=$id_value") . "'/>\n";
[1553] Fix | Delete
} else if (!empty($thumbnail_url)) {
[1554] Fix | Delete
$tags .= "<meta name='twitter:image' content='" . esc_url($thumbnail_url) . "'/>\n";
[1555] Fix | Delete
$tags .= "<meta property='og:image' content='" . esc_url($thumbnail_url) . "'/>\n";
[1556] Fix | Delete
}
[1557] Fix | Delete
[1558] Fix | Delete
if (!empty($title)) {
[1559] Fix | Delete
$title = json_decode('"' . $title . '"', JSON_UNESCAPED_UNICODE);
[1560] Fix | Delete
$tags .= "<meta property='og:title' content='" . esc_attr($title) . "'/>\n";
[1561] Fix | Delete
$tags .= "<meta name='title' property='og:title' content='" . esc_attr($title) . "'>\n";
[1562] Fix | Delete
$tags .= "<meta name='twitter:title' content='" . esc_attr($title) . "'/>\n";
[1563] Fix | Delete
}
[1564] Fix | Delete
[1565] Fix | Delete
if (!empty($description)) {
[1566] Fix | Delete
$description = json_decode('"' . $description . '"', JSON_UNESCAPED_UNICODE);
[1567] Fix | Delete
$tags .= "<meta property='og:description' content='" . esc_attr($description) . "'/>\n";
[1568] Fix | Delete
$tags .= "<meta name='twitter:description' content='" . esc_attr($description) . "'/>\n";
[1569] Fix | Delete
}
[1570] Fix | Delete
} else {
[1571] Fix | Delete
[1572] Fix | Delete
$block_content = $post->post_content;
[1573] Fix | Delete
[1574] Fix | Delete
// Regular expression to match the id and href keys and their values
[1575] Fix | Delete
$thumb = '/(?:"id":"' . $id_value . '"|"clientId":"' . $id_value . '").*?"customThumbnail":"(.*?)"/';
[1576] Fix | Delete
$title = '/(?:"id":"' . $id_value . '"|"clientId":"' . $id_value . '").*?"customTitle":"(.*?)"/';
[1577] Fix | Delete
$description = '/(?:"id":"' . $id_value . '"|"clientId":"' . $id_value . '").*?"customDescription":"(.*?)"/';
[1578] Fix | Delete
[1579] Fix | Delete
// Search for the regex pattern in the string and extract the href value
[1580] Fix | Delete
// Search for the regex pattern in the string and extract the href value
[1581] Fix | Delete
if (preg_match($thumb, $block_content, $matches1)) {
[1582] Fix | Delete
$image_url = esc_url($matches1[1]);
[1583] Fix | Delete
echo "\n<meta name='twitter:image' content='" . esc_attr($image_url) . "'/>\n";
[1584] Fix | Delete
echo "<meta property='og:image' content='" . esc_attr($image_url) . "'/>\n";
[1585] Fix | Delete
echo "<meta property='og:url' content='" . esc_url("$url?hash=$id_value") . "'/>\n";
[1586] Fix | Delete
} else if (!empty($thumbnail_url)) {
[1587] Fix | Delete
echo "\n<meta name='twitter:image' content='" . esc_attr($thumbnail_url) . "'/>\n";
[1588] Fix | Delete
echo "<meta property='og:image' content='" . esc_attr($thumbnail_url) . "'/>\n";
[1589] Fix | Delete
}
[1590] Fix | Delete
[1591] Fix | Delete
if (preg_match($title, $block_content, $matches2)) {
[1592] Fix | Delete
$title = json_decode('"' . $matches2[1] . '"', JSON_UNESCAPED_UNICODE);
[1593] Fix | Delete
echo "<meta property='og:title' content='" . esc_attr($title) . "'/>\n";
[1594] Fix | Delete
echo "<meta name='title' property='og:title' content='" . esc_attr($title) . "'>\n";
[1595] Fix | Delete
echo "<meta name='twitter:title' content='" . esc_attr($title) . "'/>\n";
[1596] Fix | Delete
}
[1597] Fix | Delete
[1598] Fix | Delete
if (preg_match($description, $block_content, $matches3)) {
[1599] Fix | Delete
$description = json_decode('"' . $matches3[1] . '"', JSON_UNESCAPED_UNICODE);
[1600] Fix | Delete
echo "<meta property='og:description' content='" . esc_attr($description) . "'/>\n";
[1601] Fix | Delete
echo "<meta name='twitter:description' content='" . esc_attr($description) . "'/>\n";
[1602] Fix | Delete
}
[1603] Fix | Delete
}
[1604] Fix | Delete
[1605] Fix | Delete
$tags .= "<meta name='twitter:card' content='summary_large_image'/>\n";
[1606] Fix | Delete
[1607] Fix | Delete
remove_action('wp_head', 'rel_canonical');
[1608] Fix | Delete
[1609] Fix | Delete
echo $tags;
[1610] Fix | Delete
}
[1611] Fix | Delete
}
[1612] Fix | Delete
}
[1613] Fix | Delete
[1614] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function