Skip Navigation

Resolved

Reported for: Advanced Custom Fields Multilingual 1.9.0

Resolved in: 1.9.3

Overview of the issue

After updating to Advanced Custom Fields Multilingual 1.9.0, you may notice an increase in the number of queries and numerous slow queries.

So far, this situation seems to be exclusively related to themes with ACF fields locally stored in /acf-json/ folders.

Workaround

Our developers are working on it. In the meantime, you can apply the following workaround:

  1. Make a full backup of your site before proceeding.
  2. If you are using ACFML 1.9.3 or older, in your functions.php file add this line:
    remove_filter( 'acf/prepare_fields_for_import', [ '\ACFML\Tools\Local', 'syncTranslationPreferences' ] );
    
  3. If you are using ACFML 1.9.4 or later, in wp-config.php define constant:
    define( 'ACFML_SCAN_LOCAL_FIELDS', false );
    

16 Responses to “ACFML 1.9.0 - Performance issues after updating from 1.8.2”

  1. Version 1.9.2 does not totally fix the problem.

    $preference is often set as (int) 0 and will be considere as empty.
    It will update the value at every refresh even if the value is the same.

    file class-wpml-acf-field-settings.php:

    private function maybe_set_new_preference( $setting_index, $field, $preference ) {
    if ( empty( $this->translation_management->settings[ $setting_index ][ $field ] )
    || $this->translation_management->settings[ $setting_index ][ $field ] !== $preference
    ) {

    should be

    private function maybe_set_new_preference( $setting_index, $field, $preference ) {
    if ( !isset( $this->translation_management->settings[ $setting_index ][ $field ] )
    || $this->translation_management->settings[ $setting_index ][ $field ] !== $preference
    ) {

    Regards

  2. We applied the fix mentioned here, including what Jonathan mentions here but it doesn’t seem to improve the situation.

    The issue is very much visible when editing a page with the query monitor plugin enabled.
    The caller WPML_Term_Query_Filter->get_terms triggers still over 11000 selects in our case.

    I have another observation to add here:
    We use Ultimate Addons for Gutenberg (UAG) on our site. When disabling that plugin, the entire issue seems to be solved at the page editing level.
    Not sure how that is related but may that could be helpful for WPML developers.

    With very best regards,
    Henri

    • Thank you very much for your report, Henri.
      I wouldn’t say this other situation is related to ACFML but to an interaction between Gutenberg Blocks – Ultimate Addons for Gutenberg and our core. I checked in our archives and we don’t have other reports so far.
      Could you please continue in the ticket you have already opened? He will escalate it once he has all the needed information.
      Thanks again for your help.

  3. The same issue still persist in 1.9.3. TTFB is around 2s without workaround and 100ms when add_filter line is commented out. Is there any hope for a fix in the next version?

    • Hello there,
      So far we don’t have reports associated to WPML 4.5.0. It would be great if you can open a ticket in our support forum so we can investigate it better.
      Thank you for your help.

    • Thank you for your report, Kristian. I’ve already shared it with our devs but it would be nice if you update your ticket as well.
      Regards

      • Hey @Andrés,

        thank you for reach out your devs with this information. Thats all what I wanted.

        I haven’t (and will not) open a ticket. All information are already here. So I’ll be waiting for the final fix 😉

        • Thanks Kristian. Unfortunately, we need a site’s copy to check why it is not working as it should be fixed after the last update.

          • Hello Andrés,

            it is not possible and not necessary at the moment.
            I know this is your normal way of providing support.

            With this hotfix 👆 the performance is back to normal 👍.

            Thank you for caring, Cheers.