cabrerahector / wordpress-popular-posts

WordPress Popular Posts - A highly customizable WordPress widget that displays your most popular posts.
https://wordpress.org/plugins/wordpress-popular-posts/
GNU General Public License v2.0
280 stars 83 forks source link

When "Data Caching" is enabled, WPP doesn't switch languages #208

Closed cabrerahector closed 5 years ago

cabrerahector commented 5 years ago

The problem -apparently, need to investigate further- is that the cache doesn't take the current language into account. In consequence, the plugin caches the result of the popular posts query in the current language (eg. English).

If, for example, the visitor switches to another language (eg. Spanish) or a visitor loads the website from a different country and a different language kicks in, WPP will return the cached result of the first query (popular posts in English).

cabrerahector commented 5 years ago

There's no issue, actually. WPP's transients store raw query data, not HTML output. WPP retrieves said data and then it's when the translation happens, so we don't really need to do anything :)