Cannot install WP language through WP CLI - CORS issue
Since one of my plugins allows you to switch between different locales in the admin I wanted to simply install them through WP CLI:
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"landingPage": "\/wp-admin\/index.php",
"preferredVersions": {
"php": "8.0",
"wp": "latest"
},
"phpExtensionBundles": ["kitchen-sink"],
"features": {
"networking": true
},
"steps": [
{
"step": "installPlugin",
"pluginZipFile": {
"resource": "wordpress.org/plugins",
"slug": "simple-admin-language-change"
},
"options": {
"activate": true
}
},
{
"step": "wp-cli",
"command": "wp language core install fr_FR"
},
{
"step": "wp-cli",
"command": "wp language core install de_DE"
},
{
"step": "wp-cli",
"command": "wp language core install cs_CZ"
},
{
"step": "wp-cli",
"command": "wp language core install ar"
},
{
"step": "login",
"username": "admin",
"password": "password"
}
]
}
But CORS forbid this:
CC @dd32 – can we relax CORS for translations?
@adamziel Escalated to Systems: https://make.wordpress.org/systems/2024/04/10/enable-cors-for-core-translation-downloads/
This seems to be done on June 5th 2024: https://make.wordpress.org/systems/2024/04/10/enable-cors-for-core-translation-downloads/#comment-2252
But for https://playground.wordpress.net/ I'm still not able to switch locales. The UI is missing completely on Settings -> General and in the profile there is only "English (US)" listed.
Is this hidden because of the former limitation? If yes, could this be showed again now, after the CORS issue is solved?
This seems to work now, but networking does need to be enabled.
This playground demo seems to work for me:
https://playground.wordpress.net/#{%22preferredVersions%22:{%22php%22:%228.0%22,%22wp%22:%226.5%22},%22phpExtensionBundles%22:[%22kitchen-sink%22],%22features%22:{%22networking%22:true},%22landingPage%22:%22/wp-admin/options-general.php%22,%22steps%22:[{%22step%22:%22login%22,%22username%22:%22admin%22,%22password%22:%22password%22}]}
Thank you very much @dd32 - confirmed! It is working for me too with networking enabled.
But there is still one CORS error in my browser console for this link: https://api.wordpress.org/themes/update-check/1.1/ on the Options -> General settings page.
Not sure if this is needed or necessary to fix.
If @vyskoczilova confirms that this is working for CLI way too, we can close the ticket. Correct?
It works like a charm! Thanks guys! BTW, I just found this https://playground.wordpress.net/builder/builder.html and it's just great
But there is still one CORS error in my browser console for this link: https://api.wordpress.org/themes/update-check/1.1/ on the Options -> General settings page.
@Zodiac1978 I'm not seeing any CORS issues on that page, and the cited endpoint should be working, can you verify and/or copy the error?
Marking this as fixed, as the original issue is resolved. If you can reproduce the CORS issues, let me know and I'll get that fixed up.
Everything fine @dd32 - I tried again and couldn't reproduce it. It was there, but maybe caching, or a temporary hiccup 👍