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 9 replies, has 2 voices.

Last updated by Ahmed Mohammed 1 year, 9 months ago.

Assisted by: Ahmed Mohammed.

Author Posts
March 30, 2023 at 10:30 pm #13370767

peterL-60

Since updating our site from Advanced Custom Fields Multilingual 1.10.4 to 2.0.3 we are seeing a huge drop in our sites overall performance. I've attached a few charts from our performance monitoring through NewRelic showing the drop, and the likely culprit.

Calls to wp_icl_string_translations started becoming our #1 performance issue at the same time as the plugin updates were installed.

Our site makes heavy use of Advanced Custom Fields, and in this new release I see that ACF field labels are added to string translation. On our site there are many thousand of these labels now appearing in string translation. This seems like the likely cause of this issue.

There is nothing in these new strings that we actually want to translate, but just having them appear in string translation seems to be causing some major performance issues for us. Looking through the settings and the codebase I do not see any options or filters to disable this behavior.

I've tried manually deleting the new acf-field-group strings from the string translation plugin, however they automatically get re-added.

Screenshot 2023-03-30 at 5.48.38 PM.png
Screenshot 2023-03-30 at 5.46.30 PM.png
March 31, 2023 at 10:09 pm #13379257

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi there,

Thank you for contacting WPML support!

I'm sorry to hear that the new ACFML update caused performance issues on your website.

Preventing the whole String Translation registration for ACF Group Fields Title and Labels is possible, but we strongly believe there should not be an issue with that because the translation is done with custom WPML MO files.

So, could you please let us know if the site is running on multiple servers? (Check https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#synchronizing-translation-files-for-sites-running-on-multiple-servers).

On the other hand, you can prevent ACFML from registering and reading the fields translations from String Translation for ACFML labels by going to this file: wp-content/plugins/acfml/classes/class-wpml-acf.php and changing this line from

\ACFML\Strings\HooksFactory::class             => true,

to

\ACFML\Strings\HooksFactory::class             => false,

Also, our developers are discussing whether disabling this feature should be possible instead of editing the files with each update.

Looking forward to hearing back from you.

April 1, 2023 at 3:46 pm #13381541

peterL-60

This site runs on a single dedicated high performance server from WPEngine.

I've just now made the change you suggested to class-wpml-acf.php. After some time I will check the monitoring and see if it has any effect on performance.

April 1, 2023 at 11:47 pm #13381875

peterL-60

Making that edit did greatly improve things. It doesn't look 100% back to usual, but very close.

The attached image now shows before the plugin updates. Then the first big spike represents when we did the updates. And then you can see things 'settle down' again after I made the edit you suggested this morning.

I have not manually removed all of the acf-field-group strings from the string translation admin area yet so perhaps doing that would get us completely back to normal. Right now we are still just slightly down from our usual performance range.

Screenshot 2023-04-01 at 7.45.36 PM.png
April 1, 2023 at 11:57 pm #13381899

peterL-60

If this is not going to be made an option, then at the very least it should be made into a filter like so:

\ACFML\Strings\HooksFactory::class             => apply_filters( 'wpml_enable_acfml_string_translation' true ),

Or whatever your developers decide to label to the filter.

April 3, 2023 at 7:41 pm #13394115

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi Peter,

Thank you for trying that and for the insightful feedback!

I have some good news 🙂 Our developers discovered a bug that was originally causing this issue and a fix is being prepared and a new release will be out soon.

Please keep an eye on ACFML updates and let us know if everything goes well.

Thank you again for your understanding.

April 3, 2023 at 8:50 pm #13394327

peterL-60

Okay I will keep my eyes out for this new release and test it to see if it does fix this performance issue. I would like it if you could also communicate to the developers that some users (us for instance) would still like an option to exclude these ACF strings from the String Translation area. Either through an option, or a filter as I suggester earlier.

April 4, 2023 at 8:14 pm #13404029

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi Peter,

I understand your point and have already raised it with our developers.

I want to mention that the new ACFML version will fix the performance issue && it will include a constant to prevent ACFML field group labels from appearing in the translation editors:

define( 'ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS', true );

However, no decision was made regarding ACF strings in the String Translation area.

April 4, 2023 at 9:14 pm #13404335

peterL-60

Thank you for that information about the new constant, I didn't know those field group labels were potentially being sent out for translation. We pay for professional translation services through the Translation Management plugin and we definitely don't want to task them with those labels. So we will be needing that for sure.

April 5, 2023 at 2:39 am #13405239

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hey Peter,

I'm really happy to hear that you found the information helpful!

We're currently testing the new release of ACFML and it should be available soon.

If you have any additional questions about the performance issue, please don't hesitate to reach out. I'm always happy to help!

I'm looking forward to hearing back from you soon.