You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppress PHP warnings when pre-fetching WordPress updates (#2458)
#2295 added
pre-fetching of all the api.wp.org/update-check requests in Playground
Web. Unfortunately, it also generates some noise in the output:
```
[04-Aug-2025 17:10:25 UTC] PHP Warning: wp_update_plugins(): 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 <a href="https://wordpress.org/support/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /wordpress/wp-includes/functions.php on line 135
[04-Aug-2025 17:10:25 UTC] PHP Warning: wp_update_themes(): 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 <a href="https://wordpress.org/support/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /wordpress/wp-includes/functions.php on line 135
[04-Aug-2025 17:10:25 UTC] PHP Warning: wp_version_check(): 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 <a href="https://wordpress.org/support/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /wordpress/wp-includes/functions.php on line 135
```
This PR suppresses those warnings without suppressing other errors.
cc @draganescu
## Testing instructions
1. Go to http://127.0.0.1:5400/website-server/?php=8.0
2. Confirm the warnings mentioned above are not present in the browser
devtools
Copy file name to clipboardExpand all lines: packages/playground/remote/src/lib/wordpress-fetch-network-transport.ts
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -217,6 +217,25 @@ export class WordPressFetchNetworkTransport {
217
217
delete_site_transient($php_transient_key);
218
218
}
219
219
220
+
// Set up custom error handler to suppress specific WordPress.org connection warnings:
221
+
// * wp_update_plugins(): 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 <a href="https://wordpress.org/support/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /wordpress/wp-includes/functions.php on line 135
222
+
// * wp_update_themes(): 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 <a href="https://wordpress.org/support/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /wordpress/wp-includes/functions.php on line 135
223
+
// * wp_version_check(): 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 <a href="https://wordpress.org/support/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /wordpress/wp-includes/functions.php on line 135
0 commit comments