Contesto del problema:
We are trying to copy content into a translation from it's original content.
The request goes in 500 error so we decided to understand why.
We found that the AJAX call used to copy the content is "copy_from_original".
Inside this call is being called the following functions (in order):
1) WPML_Post_Edit_Ajax::copy_from_original_fields
2) self::copy_meta_values_from_original
3) self::$post_custom_field_settings->get_post_meta_keys() (from WPML_Custom_Field_Setting_Factory)
4) WPML_Custom_Field_Setting_Factory::get_post_meta_keys()
5) $this->tm_instance->initial_custom_field_translate_states()
Inside the function initial_custom_field_translate_states we can see that you SELECT distinct from ALL the meta fields. As a result, in a website with many post meta the request goes in error.
Such we don't need to pull ALL the meta fields here but just the once related to the post, we suggest to improve your code by adding a filter by post_id in that function.
Thank you
Sintomi:
Domande:
The topic ‘[Fechado] Function copy_from_original bad performance’ is closed to new replies.
Gerenciar o consentimento de cookies
Usamos cookies para otimizar nosso site e nossos serviços. Seu consentimento nos permite processar dados como o comportamento de navegação. O não consentimento pode afetar alguns recursos.
Funcional
Sempre ativo
Necessário para que nosso site funcione e se comunique corretamente.
Preferências
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Estatísticas
Nós os usamos para analisar as estatísticas do nosso site. As informações coletadas são totalmente anônimas. O armazenamento ou acesso técnico que é utilizado exclusivamente para fins estatísticos anônimos. Sem uma intimação, o cumprimento voluntário por parte do seu Provedor de Serviços de Internet, ou outros registros de terceiros, as informações armazenadas ou recuperadas para este propósito geralmente não podem ser usadas para identificá-lo.
Marketing
Esses cookies rastreiam sua navegação para fornecer anúncios relevantes para você.