Hi guys,
I have noticed a problem with generation of PDF thumbnails. It seems to be caused by plugin Clean Filenames because thubnails are generated with forced lowercase name but original files is not lowercase. I think that lowercase should be enforced only when uploading files, but the same is valid for all file naming operations. What if I am generating the thumbnail of the file which was not sanitized before? It can be, but the file name link in database should be corrected in the same way. This behavior caused my problem with generating some PDF thumbnails using standard WordPress function and ImageMagick PHP module. After deactivation of the plugin was the problem solved. Check this out, please and thank you very much.
Jiri
]]>I have checked code and couldn’t see Turkish characters.
]]>I see this has not been updated in over 6 months. Do you plan any update soon that support WordPress version 6.0/6.1?
]]>Hello
Thanks for the useful plugin.
Thinking about one detail. Often the @ symbol is used in filenames for HDPI images, [email protected] for instance. That’s why I think the @ symbol should be preserved during the sanitizing process. But there can be other reasons to remove it, that I’m not aware about. Otherwise I request to preserve @ in future updates.
Thanks
]]>Hello. Didn’t see any reference to spaces being replaced, and dashes are usually preferable to underscores. Have you thought about replacing them by default, too?
This is a little old, but it makes a clear case against underscores: https://www.webmasterworld.com/google/4533254.htm
Best.
]]>I’m doing this with filter, but maybe that should go into plugin:
$friendly_filename = str_replace('-.', '.', $friendly_filename); // Remove - at the end (before dot)
$friendly_filename = str_replace('_.', '.', $friendly_filename); // Remove _ at the end (before dot)
$friendly_filename = preg_replace('/-+/', '-', $friendly_filename); // Remove multiple -
$friendly_filename = preg_replace('/_+/', '_', $friendly_filename); // Remove multiple _
]]>
Great plugin!
Let me suggest couple of small tweaks to it…
Please add Serbian Cyrillic chars, as it is mostly quite similar to Russian, with some exceptions:
?? = dj
Жж = dz (well, russian 'zh' would do somehow, only 'z' is better)
?? = lj
?? = nj
?? = dj
?? - dz
Шш - s (but 'sh' is ok)
Чч - c (but 'ch' is ok)
?? - c
I can’t use scf_friendly_filename
filter as it is invoked only after special characters are already removed.
NOTE: Consider adding one more filter before processing, then I could use that filter.
Thanks in advance.
]]>Image dimensions in the uploaded filename clashes with many other plugins such as thumbnail creation. The following code snippet added to sanitize-spanish-filenames.php replaces any dimension (examples: 123×123. , 1x1_, 2×2- with . _ – respectively).
// First step of cleanup using WP core function
$friendly_filename = remove_accents( $filename );
// begin Alex remove dimensions (ex. 1200x630.png)
$dimension_pattern = '/([0-9][0-9]*[xX][0-9][0-9]*)([\._-])/';
$dimension_replace = '${2}';
$friendly_filename = preg_replace( $dimension_pattern,
$dimension_replace, $friendly_filename );
// end Alex remove dimensions
// Replacing additional characters
$friendly_filename = preg_replace( $original_chars,
$sanitized_chars, $friendly_filename );
See comment https://www.ads-software.com/support/topic/remove-numbers-on-end-of-file-name/ by @bkjproductions
]]>Hey
It would be great if you could also add rename existing file name. Similar to https://www.ads-software.com/plugins/phoenix-media-rename/
Thanks!
]]>Thank you for this “must have” plugin ??
Small thing. The Danish letters ??? are sanitized, but not quite correctly. The correct way is this
? and ? : ae
? and ? : oe
? and ? : aa
Using the built in plugin editor, I was able to fix the letters in the following strings
'a','a','a','a','aa','ae','c','e','e','e','e','i','i','i','i','d','n','o','o','o','x','oe','u','u','u','y','p', // extra all
'a','a','a','a','aa','ae','c','e','e','e','e','i','i','i','i','d','n','o','o','o','x','oe','u','u','u','y','p','y','y',
Now ??? is sanitized correctly.
FYI:This edit, was done in WordPress 5.0 beta 4, and Clean Filenames seems to behave just fine under WP5
Kind regards
Bjarne
Just wondering if this plugin is being maintained? While it seems to work fine, it looks like it hasn’t been updated for a year or so…
Kind regards
Bjarne
Some of my users are uploading files that have dimensions in the file name, which gets confusing when you know that WordPress is also creating files that have dimensions in the file name.
For example, myfile.jpg when uploaded gets at least two, maybe three versions created by WordPress: myfile_200x200.jpg, myfile_800x600.jpg, etc.
That’s fine and dandy.
But if my user uploads a file
myfile_3000x3000.jpg
then WordPress creates
myfile_3000x3000_200x200.jpg
myfile_3000x3000_800x600.jpg
which is sort of horrible. The “intent” of the original filename is not appropriate in the generated images.
Can you add an option to strip the number X number before .extension?
That is, if I upload
myfile_3000x3000.jpg
you rename it to
myfile.jpg
Hola. Gracias por tu trabajo.
Si algo pudiera pedir sería que todo pasara a minúscula; evitaría algunos problemas más.
Saludos.
https://www.ads-software.com/plugins/sanitize-spanish-filenames/
]]>Genial plugin!
Sera posible “sanitizar” con el mismo codigo los slug de URL?
No estoy muy seguro, pero cambiando:
add_filter('sanitize_file_name', 'sa_sanitize_spanish_chars', 10);
por
add_filter('sanitize_title', 'sa_sanitize_spanish_chars', 10);
Podria resultar ? Actualmente wordpress toma un titulo como este:
Un título con emoción
Y lo publica con este permalink/slug:
…/un-ttulo-con-emocin
Resulta malo para el SEO, seguramente.
https://www.ads-software.com/plugins/sanitize-spanish-filenames/
]]>Hola Samuel,
Muchas gracias por la publicación del plugin.
He mirado el código y creo que la substitución de estos caracteres es erróneo:
“a” se substituye por una “o”
y “o” se substituye por una “a”
De todos modos, muchas gracias por tu trabajo.
Saludos
]]>Algo que noté de inmediato al ver el código fuente fue que no consideraste la diéresis sobre la u, la cual aparece en palabras como: antigüedad, pingüino, desagüe, etc.
Ojalá y lo agregues en futuras versiones. ??
https://www.ads-software.com/extend/plugins/sanitize-spanish-filenames/
]]>