-
Notifications
You must be signed in to change notification settings - Fork 56
Fix misleading success message when version check API fails #303
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
Draft
Copilot
wants to merge
9
commits into
main
Choose a base branch
from
copilot/fix-wp-core-check-update-issue
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+69
−1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
…ify unused params Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix wp core check-update failure with https_proxy
Fix misleading success message when version check API fails
Dec 3, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implementation Complete ✅
Summary
Fixed the misleading "Success: WordPress is at the latest version" message that appears when
wp core check-updatefails to reach the version check API due to network issues (e.g., proxy misconfiguration).Changes Made
$version_check_errorpropertycapture_version_check_error()method usinghttp_api_debughookget_updates()to hook into HTTP API debug with try-finally for cleanupcheck_update()to display warning when HTTP errors occurKey Features
Testing
The implementation includes a Behat test that:
--force-checkflag to bypass transient cacheReady for CI validation and merge.
Original prompt
This section details on the original issue you should resolve
<issue_title>when shell env includes https_proxy, wp core check-update fails without php-curl installed</issue_title>
<issue_description>## Bug Report
Describe the current, buggy behavior
wp-cli seems to honor http_proxy and/or https_proxy shell environment variables properly only when php-curl is installed, but when using the fallback fsockopen transport of Requests,
wp core check-updateandwp core download --forcefail in misleading fashion, leading to the possible mistaken conclusion that the current install is up to date.Here is a shell session on a host that must use a proxy to reach the public internet and that does not have php-curl installed:
Now let's try again after installing php-curl:
Steps to replicate
wp core check-updateandwp core download --forceon internal.example.orgDescribe what you would expect as the correct outcome
I would expect both
check-updateanddownload --forceto correctly identify the existence of a new minor or major version. Failing that, I would expect both to give a cogent error.Multiple possible approaches could be pursued, including tests both for the availability of curl and the presence of proxy environment variables, but the present defaults present an ugly tripping hazard.
Environment where this error occurs
Additional context
Similar error to wp-cli/checksum-command#93
</issue_description>
<agent_instructions>
Core_Command/wp core check-updateuseswp_version_checkto fetch updates fromhttps://api.wordpress.org/core/version-check/1.7/. However, that function will silently fail if a HTTP proxy is incorrectly configured and that API endpoint is unreachable, especial...✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.