WPML Multilingual Integration
ZiziCache integrates with WPML to keep cache and preloading language-aware. The integration is automatic; there is no dedicated UI switch.
Activation requirements
- WPML (SitePress) is active and
ICL_SITEPRESS_VERSIONis defined (version 4.0+). wpml_active_languagesreturns a valid language list.
What it does
- Expands ZiziCache preload and auto‑purge URL lists with translated URLs using
wpml_permalinkfor each active language. - Adds language variation to file cache names via the WPML cookie
wp-wpml_current_language(cache files include a-{lang}suffix). - Validates query parameters
lang,wpml_lang, andlanguage; invalid values are removed.
What it does not do
- No WP‑CLI commands specific to WPML.
- No dedicated admin UI or settings inside ZiziCache.
- No direct cache purge triggered by WPML events; it only augments existing purge/preload URL lists.
Configuration tips
- Ensure WPML sets the
wp-wpml_current_languagecookie (default behavior). This is what ZiziCache uses for language variants. - If you use query‑parameter language switching, add your parameter to Cache → Exclusions → Include query params (the default include list already contains
lang).
How to verify
- Open a page in two languages and confirm different cache files are created with language suffixes under
/wp-content/cache/zizi-cache/. - Run a purge (Admin bar → Clear All Cache or
wp zizi-cache purge-everything) and confirm preloading includes translated URLs when preloading is enabled. - Check response header
x-zizi-cache-cachefor HIT/MISS/BYPASS to confirm caching behavior.
Disable the integration (optional)
add_filter('zizi_cache_disabled_integrations', function($integrations) {
$integrations[] = ZiziCachePluginsIntegrationsWPML::class;
return $integrations;
});