Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 0 voices.

Last updated by Waqas Bin Hasan 10 hours, 49 minutes ago.

Assisted by: Waqas Bin Hasan.

Author Posts
March 4, 2025 at 5:28 pm #16775347

T4ng

Background of the issue:
I am trying to upload an SVG in place of another SVG as a Media Translation using WPML. The issue can be seen here: hidden link.

Symptoms:
When using Safe SVG (as we do succesfully for years), after uploading the image, I get, instead of the right image, this image :/wp-includes/images/media/default.png image.
With SVG Support instead of Safe SVG, I get a 'Security check failed' message.
However, I can upload an SVG file from the Media Library, whatever the SVG plugin I use.
This issue occured after updating WPML plugins (amon which) Media Translation to their very latest versions
It's been reproduced on 3 environments, and in a minimal environment with only WPML plugins and Storefront theme.

Questions:
Why can't I upload SVGs through WPML Media Translation anymore?

March 5, 2025 at 11:40 am #16778182

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support.

WordPress does not support SVG by default and the support is added via 3rd party plugins (or custom code). Most of these may not be compatible with WPML, like the "Safe SVG" which I can't find on our compatibility list.

I'll recommend checking with the plugin author, because I see the plugin was updated some months ago (https://wordpress.org/plugins/safe-svg/) and may need a compatibility update.

Theme and plugin authors are welcome to join WPML’s Go Global program, which helps them make their code multilingual ready. Together with WPML’s compatibility team, they can test and confirm that their theme or plugin works with WPML. See https://wpml.org/documentation/support/go-global-program/ for details and you can refer your theme/plugin provider to this as well.

Regards.

March 5, 2025 at 11:51 am #16778273

T4ng

I'll contact them.
However, SVG support is the one you seem the closest to support, while requiring a patch. As mentionned, this patch doesn't seem to work either.

March 5, 2025 at 11:54 am #16778319

T4ng

Coud you create a test environment where we could reproduce the issue?
The only requirements seem to be WPML + WPML Medias + Safe SVG plugin.
That'd probably a good start on the way to an SVG upload plugin compatible with WPML?

Best Regards,

March 5, 2025 at 12:44 pm #16778575

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Sure, I've created hidden link (one-click login). Remember to configure WPML as needed and add your desired SVG plugin, before going to reproduce the problem.

About the SVG Support plugin, that's still not compatible with WPML and our team has tried several times to contact them and even created a report in their support, which was closed without resolution, a long time ago.

You may try the fix provided for the SVG Support plugin, but with only this plugin and its latest version. This fix may not work for Safe SVG plugin.

Again it is better to check with Safe SVG support and get any relevant/technical information and then I can check with our team for any possibility.

March 5, 2025 at 2:35 pm #16779477

T4ng

I configured the environment to perform the same tests as in my local environment.

1. I activated WPML Media Translation
2. I adde both Safe SVG and SVG Support plugins, to have both available to troubleshoot them alternately.
3. I uploaded an SVG image file (with Safe SVG enabled), from the library, and added Title and Alt metadata

Results :
1. With Safe SVG : Translating the image by uploading an alternative image in WPML Media gives the same result as I get in my environment.

hidden link

2. With SVG Support activated instead of Safe SVG, I also get the same results : "Security check failed" (see attached)
3. If applied the suggested patch to function.php (:339) , same results.

In the end both of these plugins allow to upload SVG to the library, but none of them allows to translate SVG to WPML Media *anymore*. While both obviously still used to until very recently.

2025-03-05- svgsuppport-patched.png
March 6, 2025 at 5:57 am #16781069

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates, I've observed the issue in the sandbox site. I'm checking with my team and 'll get back to you accordingly.

March 6, 2025 at 11:55 am #16782992

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I've escalated the matter to our 2nd tier team for some insights, I'll get back to you as soon as I hear back.