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.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Bigul 1 year, 11 months ago.

Assisted by: Bigul.

Author Posts
May 23, 2023 at 1:05 pm #13699585

romainB-10

I have noted that if I insert my WPML Language switcher into my header using "do_action('wpml_add_language_selector');", then Pagespeed Insights records an issue with the language flags image sizes under the Best Practices section of the Pagespeed Insights report.

If I remove "do_action('wpml_add_language_selector');" and insert the Language switcher by adding a language switcher in the WordPress dashboard > WPML > Languages > Menu Language switcher, and run another test on Pagespeed Insights, then the problem with the language flag image sizes is no longer recorded under the Best Practices section.

Why is this?
Are there any options or parameters within the wpml_add_language_selector function which can be used to configure it better in order to resolve the issue from being recorded in my Pagespeed Insights report?

May 23, 2023 at 2:14 pm #13700389

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue.

As we discussed in the chat, this may be happening because of the older version of the plugins and WordPress.

So please upgrade to the latest versions of the plugins & WordPress after a full site backup{mandatory} and make sure the issue is existing or not.

The wpml_add_language_selector hook has no parameters. Please refer to the following articles for more details.

https://wpml.org/wpml-hook/wpml_add_language_selector/

https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/

--
Thanks!

Bigul

May 23, 2023 at 2:35 pm #13700511

romainB-10

I have reproduced the problem on my sandbox site and ran a test on Pagespeed Insights and get the same report for the language switcher flags. I have updated the website and plugins and the problem persists.

May 23, 2023 at 4:16 pm #13701685

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the updates. Please upgrade the following configurations for a better performance of the site and check if is there any difference in the result.

1) Increase *WP Memory Limit* to *256*(the minimum required memory limit for WPML is *128*). Please check the following links for more details

https://wpml.org/home/minimum-requirements/

https://developer.wordpress.org/apis/wp-config-php/#increasing-memory-allocated-to-php

2) Increase the *MaxInputVars* of PHP settings to *10000*. Please check the following article for more details and contact your system admin/hosting provider for upgrading this configuration.

hidden link

If the issue exists, I have a couple of requests for tracking the issue.

1) Please fill the private details fields after a full site backup{mandatory}. I would like to access the admin area of your site for further checking. Refer to the following links for more details about our private information sharing policies.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

2) Please let us know the exact steps to reproduce the issue on your site. It will be great if you can share a couple of screenshots for a better understanding.

--
Thanks!

Bigul

2023-05-23_21-48-38.png
May 26, 2023 at 8:55 am #13721327

romainB-10

Hi Bigul

Are you able to contact a WPML developer to find out how the two methods of displaying a Language Switcher each handles the way that the Flag PNGs are displayed, please?

do_action('wpml_add_language_selector');
versus
WPML > Languages > Menu Language Switcher

Currently the Pagespeed report does not mention the Flag images being a problem if I retain do_action('wpml_add_language_selector');, but change the Default flag format from PNG to SVG.

But this does not explain why it is not a problem when the WPML > Languages > Menu Language Switcher method is used instead of "do_action".

May 29, 2023 at 2:39 pm #13733329

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the updates. I have checked about this with our developers. Normally we can configure the Custom language switcher in WPML>>Languages>>Custom language switcher. So please check if you can adjust the images there.

If the problem remains, I have a couple of requests for tracking the issue.

1) Please fill in the private details fields after a full site backup{mandatory}. I would like to access the admin area of your site for further checking. Refer to the following links for more details about our private information sharing policies.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

2) Please let us know the exact steps to reproduce the issue on your site. It will be great if you can share a screencast of the problems for a better understanding. Because it will help a lot in our internal discussions.

--
Thanks!

Bigul