Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install WP language through WP CLI - CORS issue #1206

Closed
vyskoczilova opened this issue Apr 5, 2024 · 9 comments
Closed

Cannot install WP language through WP CLI - CORS issue #1206

vyskoczilova opened this issue Apr 5, 2024 · 9 comments

Comments

 @vyskoczilova
Copy link

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:

 image
 @adamziel
Copy link
Collaborator

CC @dd32 – can we relax CORS for translations?

 @dd32
Copy link
Member

@adamziel Escalated to Systems: https://make.wordpress.org/systems/2024/04/10/enable-cors-for-core-translation-downloads/

 @Zodiac1978
Copy link

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?

 @dd32
Copy link
Member

dd32 commented Jun 17, 2024

 @Zodiac1978
Copy link

Zodiac1978 commented Jun 17, 2024

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?

 @vyskoczilova
Copy link
Author

It works like a charm! Thanks guys!
BTW, I just found this https://playground.wordpress.net/builder/builder.html and it's just great

 @dd32
Copy link
Member

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?

 @dd32
Copy link
Member

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.

 @Zodiac1978
Copy link

Everything fine @dd32 - I tried again and couldn't reproduce it. It was there, but maybe caching, or a temporary hiccup 👍

Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants