#50584 closed defect (bug) (worksforme)
translation-install.php file creates an issue when opening settings page
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | |
| Focuses: | Cc: |
Description
My installation of wordpress is within a closed network. The server does not have access to the internet.
When installing the default wordpress installation, everything seems to be working correctly but when I try to get to the main settings page on wp-admin (options-general.php) it throws the error below:
"PHP Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in D:\wordpress\wordpress-5.4.2\wordpress\wp-admin\includes\translation-install.php on line 68 PHP Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in D:\wordpress\wordpress-5.4.2\wordpress\wp-admin\includes\translation-install.php on line 68 "
I figured that this was due the server not having the access to the particular wordpress hosted translation API.
doing some troubleshooting, i found this stack overflow that "fixed" the issue:
https://stackoverflow.com/questions/35238058/error-wp-admin-includes-translation-install-php-on-line-59
This solved the issue for now, but when i run an upgrade, it will be broken again.
Suggestion to either have a switch on a config file to use or not this translation feature or to have a error exit on the code if it can't access.
Hi @mariolonghi, welcome to WordPress Trac!
Thanks for the report. The message you're getting there is the same for all WordPress.org requests, like update checks or API requests for plugins and themes. The message is only visible when PHP is set to display warnings/notices.
To override the specific request you can use the translations_api filter.
add_filter( 'translations_api', '__return_empty_array' )should work.