Vai al contenuto Vai alla barra laterale

Etichettato: 

Questo ticket contiene 0 risposta, ha 0 voci.

Ultimo aggiornamento da Anonimo 1 giorno, 1 ora fa.

Assistito da: Carlos Rojas.

Autore Post
Gennaio 20, 2026 alle 11:38 am

Anonimo

Hello,
I’m having a serious issue with WPML related to REST API URL generation and language routing.
Current setup:
WordPress + WooCommerce
WPML Multilingual CMS, WPML String Translation, WooCommerce Multilingual & Multicurrency
PHP 8.2, LiteSpeed server
Languages in directories
Default frontend language: English
Polish available under /pl/
Admin panel language set to Polish (user profile language)

What works:
The REST API itself works correctly.
Calling this endpoint directly in an incognito window:
link nascosto
returns:
{"success":true,"data":{"status":"valid","get_parameters":"valid"}}

The problem:
WPML reports that the site does not meet minimum requirements because the REST API test endpoint “does not respond correctly”.
However, the URL that WPML tries to test is clearly malformed and contains duplicated language segments, for example:
…/pl/pl/shop.steel-containers.com/pl/wp-json/pl/wpml/pl/v1/pl/rest/pl/status/pl?test_get_parameter=1

This suggests that WPML is building the REST API test URL incorrectly by appending the language slug multiple times.

Symptoms caused by this:
WPML shows a REST API error even though REST API works
Incorrect language routing
/en/ and /pl/ URLs behaving inconsistently

Important notes:
Default frontend language is intentionally English
Admin panel language is Polish (via user profile)
“Languages in directories” is enabled
Default language is NOT supposed to have a directory
Polish should be under /pl/

Conclusion:
REST API is functional, but WPML appears to miscalculate the base URL and language directories when building internal REST API test URLs, leading to duplicated language segments and subsequent routing and canonical errors.

I would appreciate guidance on:
How to fix WPML’s internal URL construction for REST API tests
Whether this is a known issue with this WPML version and PHP 8.2
Whether any specific setting or patch is required for the setup: default language on root, secondary languages in directories

Best regards