From 7ecb00460b9e443e9f5d462c25eca8a2618f4b5a Mon Sep 17 00:00:00 2001 From: Joey Kudish Date: Fri, 12 Jul 2024 11:14:12 -0700 Subject: [PATCH] WordPress plugins: update the polylang cookie solution (#8882) * WordPress plugins: update the polylang cookie solution The previous solution removed the polylang cache key. The new solution makes the cookie a cache-varying cookie which is a better and more reliable solution * Copy edits --------- Co-authored-by: Joey Kudish Co-authored-by: Rachel Whitton --- source/content/plugins-known-issues.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/content/plugins-known-issues.md b/source/content/plugins-known-issues.md index 29500350fc..82cbf99c50 100644 --- a/source/content/plugins-known-issues.md +++ b/source/content/plugins-known-issues.md @@ -11,7 +11,7 @@ cms: [wordpress] audience: [development] product: [--] integration: [--] -reviewed: "2023-01-30" +reviewed: "2024-07-12" --- This page lists WordPress plugins, themes, and functions that may not function as expected or are currently problematic on the Pantheon platform. This is not a comprehensive list (see [other issues](#other-issues)). We continually update it as problems are reported and/or solved. If you are aware of any modules or plugins that do not work as expected, please [contact support](/guides/support/contact-support/). @@ -713,18 +713,18 @@ ___ ## PolyLang - + **Issue:** The [PolyLang](https://wordpress.org/plugins/polylang/) plugin adds a cache-busting cookie (ex. `pll_language=en`) for each request. -**Solution:** Define the constant `PLL_COOKIE` to false in `wp-config.php` to remove the cookie: +**Solution:** Define the constant `PLL_COOKIE` to `STYXKEY_pll_language` in `wp-config.php` to make the cookie a cache-varying cookie. ```php:title=wp-config.php -// Disable Polylang's feature to set a cookie that stores the visitor's selected language. -define('PLL_COOKIE', false); +// Set the polylang cache key to be edge cache compliant +define('PLL_COOKIE', 'STYXKEY_pll_language'); ``` -The value of `PLL_COOKIE` defaults to `pll_polylang`. This defines the name of the cookie used by Polylang to store the visitor's language. When `PLL_COOKIE` is set to false, Polylang does not set any cookie. Be aware that in this case some features of the plugin may not work completely. For example, the login page will not be translated. +The value of `PLL_COOKIE` defaults to `pll_polylang`. This defines the name of the cookie used by Polylang to store the visitor's language. By changing `PLL_COOKIE` to `STYXKEY_pll_language` the cookie will become a [cache-varying cookie](/cookies#cache-varying-cookies). See the [plugin documentation](https://polylang.pro/doc/php-constants/) for more information on its PHP constants.