Suspicous Images
Here you can see all all images that do have suspicious names in your database.
Note: We flag an image as suspicous if the name of the following vendors appers in it: Stock, Fotolia, corbisimages, gettyimages, dreamstime, sxc!';
echo '
Reload with all images shown: Show all Images
';
} else
echo '
Show only suspicious images: Show suspicious Images
';
?>
Image ID
Image Name
Image Type
Kritische EXIF-Daten
Volle EXIF-Daten
Post ID
Post Name
Suggested Name
show_errors();
$sql = sprintf(
'SELECT a.ID as image_post_id, a.post_name as image_post_name, a.post_mime_type as image_mime_type, b.ID as parent_post_id, b.post_title as parent_post_title, b.post_content as parent_post_content, c.meta_value as image_path, c.meta_id as image_meta_id'.
' FROM %sposts as a ' .
' LEFT JOIN %sposts as b ON a.post_parent = b.ID '.
' LEFT JOIN %spostmeta as c ON a.ID = c.post_id AND c.meta_key = "_wp_attached_file" '.
' WHERE a.post_mime_type LIKE "image%%"'
,$wpdb->prefix
,$wpdb->prefix
,$wpdb->prefix);
if(!isset($_GET['seoir_showall'])) {
$sql = $sql . sprintf(" AND a.post_name REGEXP '%s'", implode('|', $suspicious_imagename_parts));
}
$results = $wpdb->get_results($sql,'ARRAY_A');
$uploaddir = wp_upload_dir();
foreach($results as $result) {
preg_match_all('#<(h2|strong)>(.*)<\/(h2|strong)>#Ui', $result['parent_post_content'], $matches);
$keyword_occurence = array_flip(array_count_values($matches[2]));
array_walk($keyword_occurence, create_function('&$v,$k', '$v = preg_replace(array("#ß#","#ä#","#ü#","#ö#","#Ä#","#Ü#", "#Ö#","#\s#", "#[^\w-]#"), array("ss","ae","ue","oe","Ae","Ue","Oe","-", ""), $v);'));
//$sorted_keyword_occurence = sort($keyword_occurence);
$suggested_name = array_pop($keyword_occurence);
//$img = new Imagick($uploaddir['basedir'].'/'.$result['meta_value']);
$exif = @read_exif_data($uploaddir['basedir'].'/'.$result['image_path']);
$exif_data = empty($exif['COMPUTED']['Copyright']) ? empty($exif['Copyright']) ? $exif['Artist'] : $exif['Copyright'] : $exif['COMPUTED']['Copyright'];
printf(
'
%s
%s
%s
%s
Show
%s
%s
%s %s Take! Manually Rename!
',
$uploaddir['baseurl'].'/'.$result['image_path'],
htmlspecialchars($result['image_meta_id']),
htmlspecialchars($result['image_post_name']),
htmlspecialchars($result['image_mime_type']),
$exif_data,
$result['image_meta_id'],
htmlspecialchars($result['image_post_id']),
substr(htmlspecialchars($result['parent_post_title']), 0, 20).'...',
$suggested_name,
implode('', $keyword_occurence),
htmlspecialchars($result['image_post_id']),
htmlspecialchars($result['image_post_id']),
$result['image_meta_id'],
htmlspecialchars(print_r($exif, true))
);
}
?>