-
Notifications
You must be signed in to change notification settings - Fork 268
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
Networking access: Fix wp_http_supports() to work without the kitchen-sink extension bundle. #1504
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Let's just check in with @adamziel to make sure this won't have any unwanted consequences.
These filters are tricky! Lovely fix, thank you @dd32! Would you mind also adding an E2E test around here to make sure this regression won't come back in the future?
(The existing one is a duplicate of the one above it and the label is confusing. Kitchen sink is the default now so that test can be rewritten to use |
…-sink extension bundle loaded.
794b03e
to
761f594
Compare
I've tried to e2e it, and the test change looks correct to me, but I wasn't able to get the tests to run locally, I've only guessed what I'm supposed to do for that ( |
@dd32 Why were you expecting it to fail?
I struggled with this too and ended up running the following CI e2e testing commands locally: wordpress-playground/.github/workflows/ci.yml Lines 38 to 39 in cd34e50
(probably shouldn't prefix with sudo locally though :)
Then I discovered local e2e instructions in the website README: wordpress-playground/packages/playground/website/README.md Lines 7 to 11 in cd34e50
|
Good question; and that might have been the misunderstanding :) What this means, is that the test is likely working as expected, even though it's now without OpenSSL, it probably still passes just fine (Just requests via HTTP rather than HTTPS, both of which are totally acceptable). |
Ah! Thank you! Developer instructions being in nested readme's gets me all the time when I have no idea which things are distinct components :) |
Same here. :) I logged an issue to add better instructions here since documenting e2e isn't as quick as mentioning a couple of commands at the top level. |
…-sink extension bundle. (#1504) Fixes #1494 In #1048 I introduced a regression of #819, in that `wp_http_supports( [ 'ssl' ] )` no longer returned truthful without the kitchen-sink extension bundle loaded. This partially reverts #1048 by keeping the filters for Requests, but reinstating the deprecated WP_HTTP filters. It's worth noting, that this is not a direct revert, as it forces the Fetch/Dummy handlers instead of simply adding them as an option. This is to match the Requests filter behaviour. To test this, the following blueprint should land you on a plugin install page without any errors visible: https://playground.wordpress.net/#{%22phpExtensionBundles%22:[%22light%22],%22features%22:{%22networking%22:true},%22landingPage%22:%22/wp-admin/plugin-install.php%22,%22steps%22:[{%22step%22:%22login%22,%22username%22:%22admin%22,%22password%22:%22password%22}]} ``` { "phpExtensionBundles": [ "light" ], "features": { "networking": true }, "landingPage": "/wp-admin/plugin-install.php", "steps": [ { "step": "login", "username": "admin", "password": "password" } ] } ```
Suppresses the following deprecation warning: > PHP Deprecated: Hook http_api_transports is deprecated since version 6.4.0 with no alternative available. in /wordpress/wp-includes/functions.php on line 135 We're forced to use this deprecated hook to ensure SSL operations work without the kitchen-sink bundled. See #1504 for more context. ## Testing instructions Open devtools. Then open Playground: * With and without this PR * With and without networking enabled Then go to wp-admin. Confirm that with this PR the above deprecation notice is not logged. cc @dd32 @bgrgicak
Fixes #1494
In #1048 I introduced a regression of #819, in that
wp_http_supports( [ 'ssl' ] )
no longer returned truthful without the kitchen-sink extension bundle loaded.This partially reverts #1048 by keeping the filters for Requests, but reinstating the deprecated WP_HTTP filters.
It's worth noting, that this is not a direct revert, as it forces the Fetch/Dummy handlers instead of simply adding them as an option. This is to match the Requests filter behaviour.
To test this, the following blueprint should land you on a plugin install page without any errors visible:
https://playground.wordpress.net/#{%22phpExtensionBundles%22:[%22light%22],%22features%22:{%22networking%22:true},%22landingPage%22:%22/wp-admin/plugin-install.php%22,%22steps%22:[{%22step%22:%22login%22,%22username%22:%22admin%22,%22password%22:%22password%22}]}