/**
* Harici resimleri özgünleştirme fonksiyonu (indirme yapmadan)
*/
function harici_resimleri_ozgunlestir($content) {
// Yönetici panelinde veya boş içerikte çalışma
if (empty($content) || is_admin()) {
return $content;
}
// DOMDocument için hata ayıklamayı devre dışı bırak
libxml_use_internal_errors(true);
// DOMDocument ile içeriği parse etme
$dom = new DOMDocument();
@$dom->loadHTML('
' . $content . '
');
$images = $dom->getElementsByTagName('img');
if ($images->length === 0) {
return $content;
}
foreach ($images as $img) {
$src = $img->getAttribute('src');
// Yerel resimleri atla
if (strpos($src, site_url()) !== false) {
continue;
}
// Geçerli bir URL mi kontrol et
if (filter_var($src, FILTER_VALIDATE_URL)) {
// Özgünleştirilmiş yeni URL oluştur
$new_src = ozgun_resim_url_olustur($src);
// Resim özelliklerini güncelle
$img->setAttribute('src', $new_src);
$img->setAttribute('data-original-src', $src); // Orijinal URL'yi sakla
$img->setAttribute('loading', 'lazy'); // Lazy loading ekle
// İsteğe bağlı: Referrer policy ekle
$img->setAttribute('referrerpolicy', 'no-referrer');
}
}
// HTML'i temiz bir şekilde çıkar
$body = $dom->getElementsByTagName('div')->item(0);
$new_content = '';
foreach ($body->childNodes as $node) {
$new_content .= $dom->saveHTML($node);
}
return $new_content;
}
/**
* Özgün resim URL'si oluşturma
*/
function ozgun_resim_url_olustur($original_url) {
// URL'ye özgün parametreler ekleme
$params = array(
'ref' => parse_url(site_url(), PHP_URL_HOST),
'utm_source' => 'internal_mirror',
'v' => substr(time(), -6) // Daha kısa cache buster
);
// URL'yi parçala
$parsed = parse_url($original_url);
// Mevcut query parametrelerini al
$query = array();
if (isset($parsed['query'])) {
parse_str($parsed['query'], $query);
}
// Yeni parametreleri ekle
$query = array_merge($query, $params);
$parsed['query'] = http_build_query($query);
// Yeni URL'yi oluştur
return http_build_url($parsed);
}
// HTTP URL oluşturma yardımcı fonksiyonu
if (!function_exists('http_build_url')) {
function http_build_url(array $parts) {
$scheme = isset($parts['scheme']) ? $parts['scheme'] . ':' : '';
$host = isset($parts['host']) ? $parts['host'] : '';
$port = isset($parts['port']) ? ':' . $parts['port'] : '';
$user = isset($parts['user']) ? $parts['user'] : '';
$pass = isset($parts['pass']) ? ':' . $parts['pass'] : '';
$pass = ($user || $pass) ? $pass . '@' : '';
$path = isset($parts['path']) ? $parts['path'] : '';
$query = isset($parts['query']) ? '?' . $parts['query'] : '';
$fragment = isset($parts['fragment']) ? '#' . $parts['fragment'] : '';
return "$scheme//$user$pass$host$port$path$query$fragment";
}
}
// Filtreleri ekle (daha düşük öncelikle)
add_filter('the_content', 'harici_resimleri_ozgunlestir', 20);
add_filter('content_save_pre', 'harici_resimleri_ozgunlestir', 20);
juliejess / juliejessofficial Personal Collection | Hot Leak 2025 – Full Leak Content – belleak
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok