JS kodunun içinde PHP kodu kullanmışsınız, bu şekilde olmaması lazım.
jQuery(document).ready(function ($) {
$image = 'https://www.hurpaz.com/wp-content/uploads/2021/01/BG1419301-1-300x300.jpg';
$type = pathinfo($image, PATHINFO_EXTENSION);
$data = file_get_contents($image);
$imgData = base64_encode($data);
$src = 'data:image/' . $type . ';base64,' . $imgData;
kısmını
jQuery(document).ready(function ($) {
<?php
$image = 'https://www.hurpaz.com/wp-content/uploads/2021/01/BG1419301-1-300x300.jpg';
$type = pathinfo($image, PATHINFO_EXTENSION);
$data = file_get_contents($image);
$imgData = base64_encode($data);
$src = 'data:image/' . $type . ';base64,' . $imgData;
?>
olarak değiştirip deneyin.