 kristianP-7
|
I tried adding all of the object cache keys to the list like this in function.php:
add_action( 'wpml_st_before_remove_strings', 'wp_cache_flush' );
wp_cache_add_non_persistent_groups( [
'*',
'posts*',
'posts',
'*posts',
'global-posts',
'blog-details',
'blog-id-cache',
'blog-lookup',
'global-posts',
'networks',
'rss',
'sites',
'site-details',
'site-lookup',
'site-options',
'site-transient',
'users',
'useremail',
'userlogins',
'usermeta',
'user_meta',
'userslugs',
'redis-cache',
'blog_meta',
'network-queries',
'site-queries',
'user-queries',
'convert_url',
'element_translations',
'get_pages_adjust_ids',
'get_user_admin_language',
'translation_priority_relationships',
'translationmanagement--get_translation_job_id',
'wpml_cache_terms_per_lang',
'wpml_endpoints_support',
'wpml_pre_option_page',
'wpml_register_string_filter',
'wpml_register_string_filter--facetwp',
'wpml_slug_translation_records--post',
'wpml_slug_translation_records--taxonomy',
'wpml_st_cache',
'wpml_term_translation',
'wpml_tm_blog_translators--has_translators',
'wpml_wp_cache__group_keys',
] );
And even tried adding these directly to wp-config.php like shown in object cache documentation. hidden link
define('WP_REDIS_CONFIG', [
'non_persistent_groups' => [
'*',
'posts',
'global-posts',
'blog-details',
'blog-id-cache',
'blog-lookup',
'global-posts',
'networks',
'rss',
'sites',
'site-details',
'site-lookup',
'site-options',
'site-transient',
'users',
'useremail',
'userlogins',
'usermeta',
'user_meta',
'userslugs',
'redis-cache',
'blog_meta',
'network-queries',
'site-queries',
'user-queries',
'convert_url',
'element_translations',
'get_pages_adjust_ids',
'get_user_admin_language',
'translation_priority_relationships',
'translationmanagement--get_translation_job_id',
'wpml_cache_terms_per_lang',
'wpml_endpoints_support',
'wpml_pre_option_page',
'wpml_register_string_filter',
'wpml_register_string_filter--facetwp',
'wpml_slug_translation_records--post',
'wpml_slug_translation_records--taxonomy',
'wpml_st_cache',
'wpml_term_translation',
'wpml_tm_blog_translators--has_translators',
'wpml_wp_cache__group_keys',
],
]);
But still not working correctly
|
 Kor
WPML Supporter since 08/2022
Languages:
English (English )
Timezone:
Asia/Singapore (GMT+08:00)
|
Thanks for your reply.
Glad to know that it works on your staging site. As for the on-going issue on your production site, we will have to check on it. Does it have a different setup? If possible, please share your Website WP admin access here using the private reply option and we'll check on it.
Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.
Your upcoming reply will be treated with confidentiality and will only be visible to you and me.
✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.
|
 kristianP-7
|
I installed the same theme on staging site and it has the same issue so you can check the staging site.
|
 Kor
WPML Supporter since 08/2022
Languages:
English (English )
Timezone:
Asia/Singapore (GMT+08:00)
|
Thanks for your reply.
I've shared your feedback with our 2nd Tier Support for a second look.
|
 kristianP-7
|
Hello, happy new year! Any update on the issue?
|
 Kor
WPML Supporter since 08/2022
Languages:
English (English )
Timezone:
Asia/Singapore (GMT+08:00)
|
Thank you for your response.
I regret the oversight on my part. I will review the matter with our 2nd Tier support and will get back to you with an update.
|
 Kor
WPML Supporter since 08/2022
Languages:
English (English )
Timezone:
Asia/Singapore (GMT+08:00)
|
Thanks for your patience.
I have feedback and we have a workaround. Kindly insert the custom PHP code below into your themes functions.php file. Let me know if this works for you.
/**
* WPML fix for Redis cache.
*
* @link wpmlsupp-11341
*/
add_filter('woocommerce_get_product_terms', function($terms, $product_id, $taxonomy, $args){
global $sitepress;
if (method_exists($sitepress, 'is_display_as_translated_post_type') && $sitepress->is_display_as_translated_post_type('product')) {
$args['wpml_lang'] = apply_filters( 'wpml_current_language', null );
return _wc_get_cached_product_terms( $product_id, $taxonomy, $args );
}
return $terms;
}, 10, 4);
|
 kristianP-7
|
It finally works correctly, thank you! I hope to see the fix included in a future update aswell for other website owners.
|