WordPress Trac: Ticket #20605: Be more friendly when API requests failhttps://core.trac.wordpress.org/ticket/20605
<p>
When plugins_api() fails, you see "An unknown error occurred during the API request." if the response was invalid, and "An Unexpected HTTP Error occurred during the API request." if the HTTP request failed.
</p>
<p>
That is not helpful. We should improve this string to let people know that it is likely a temporary issue with WordPress.org, and that if they are still seeing problems, they check the support forums.
</p>
<p>
If the HTTP request fails, it probably is not an issue with WordPress.org, so we should just point them to the support forums.
</p>
<p>
Same goes for themes_api(), I imagine.
</p>
en-usWordPress Trachttps://core.trac.wordpress.org/chrome/site/your_project_logo.pnghttps://core.trac.wordpress.org/ticket/20605
Trac 1.0.1markjaquithWed, 02 May 2012 19:16:44 GMTkeywords sethttps://core.trac.wordpress.org/ticket/20605#comment:1
https://core.trac.wordpress.org/ticket/20605#comment:1
<ul>
<li><strong>keywords</strong>
<em>needs-patch</em> added
</li>
</ul>
<p>
So, "invalid response" =&gt; Temporary issue with WP.org and "HTTP fail" =&gt; local problem, point to support forums?
</p>
TicketmbijonWed, 02 May 2012 19:34:17 GMTkeywords changed; cc sethttps://core.trac.wordpress.org/ticket/20605#comment:2
https://core.trac.wordpress.org/ticket/20605#comment:2
<ul>
<li><strong>cc</strong>
<em>mike@…</em> added
</li>
<li><strong>keywords</strong>
<em>ux-feedback</em> added
</li>
</ul>
<p>
For a system like WordPress that has many non-dev end users, I think it's worth writing longer messages that have a plain-language explanation.
</p>
<p>
Suggestions for both:
"An unknown error occurred during the API request. Something may be wrong with WordPress.org"
</p>
<p>
"An Unexpected HTTP Error occurred during the API request. Something may be wrong with this network connection or server configuration."
</p>
TicketpavelevapWed, 02 May 2012 20:03:02 GMTcc changedhttps://core.trac.wordpress.org/ticket/20605#comment:3
https://core.trac.wordpress.org/ticket/20605#comment:3
<ul>
<li><strong>cc</strong>
<em>pavelevap@…</em> added
</li>
</ul>
<p>
We had some users which reported following error (for plugin install screen) during last several hours, but I am not sure if it is related:
</p>
<pre class="wiki">Warning: number_format() expects parameter 1 to be double, string given in .../wp-includes/functions.php on line 155
</pre><p>
Now, everything is OK.
</p>
TicketnacinThu, 03 May 2012 00:26:53 GMThttps://core.trac.wordpress.org/ticket/20605#comment:4
https://core.trac.wordpress.org/ticket/20605#comment:4
<p>
Replying to <a class="closed" href="https://core.trac.wordpress.org/ticket/20605#comment:1" title="Comment 1 for Ticket #20605">markjaquith</a>:
</p>
<blockquote class="citation">
<p>
So, "invalid response" =&gt; Temporary issue with WP.org and "HTTP fail" =&gt; local problem, point to support forums?
</p>
</blockquote>
<p>
Yeah, pretty much. Invalid response means the HTTP request went through, but when unserialized, the data didn't come back as expected. Note that even a WP.org issue of 500, 404, etc. could cause this. Of course, if api.wordpress.org times out, then it is possible for the HTTP failure to occur.
</p>
<p>
So, "Invalid response" =&gt; Issue with WP.org, but possibly a local problem, point to forums, "HTTP fail" =&gt; Local problem, but possibly an issue with WP.org, point to forums.
</p>
<p>
Either way, the user is actually able to understand what went wrong, and they are pointed to the best forum (heh) to address it.
</p>
TicketryanWed, 09 May 2012 15:15:32 GMTattachment sethttps://core.trac.wordpress.org/ticket/20605
https://core.trac.wordpress.org/ticket/20605
<ul>
<li><strong>attachment</strong>
set to <em>20605.diff</em>
</li>
</ul>
TicketryanWed, 09 May 2012 15:24:48 GMTattachment sethttps://core.trac.wordpress.org/ticket/20605
https://core.trac.wordpress.org/ticket/20605
<ul>
<li><strong>attachment</strong>
set to <em>20605.2.diff</em>
</li>
</ul>
TicketSergeyBiryukovWed, 09 May 2012 15:46:10 GMTattachment sethttps://core.trac.wordpress.org/ticket/20605
https://core.trac.wordpress.org/ticket/20605
<ul>
<li><strong>attachment</strong>
set to <em>20605.2.alt.diff</em>
</li>
</ul>
TicketSergeyBiryukovWed, 09 May 2012 15:51:46 GMTkeywords changedhttps://core.trac.wordpress.org/ticket/20605#comment:5
https://core.trac.wordpress.org/ticket/20605#comment:5
<ul>
<li><strong>keywords</strong>
<em>has-patch</em> added; <em>needs-patch</em> removed
</li>
</ul>
<p>
Was going to tweak the patch so that it would be easier to distinguish the most likely cause on the support forums.
</p>
<p>
On a second thought, <a class="attachment" href="https://core.trac.wordpress.org/attachment/ticket/20605/20605.2.diff" title="Attachment '20605.2.diff' in Ticket #20605">20605.2.diff</a><a class="trac-rawlink" href="https://core.trac.wordpress.org/raw-attachment/ticket/20605/20605.2.diff" title="Download">​</a> looks good. Separate strings are not that necessary.
</p>
TicketryanWed, 09 May 2012 15:56:00 GMTstatus changed; owner, resolution sethttps://core.trac.wordpress.org/ticket/20605#comment:6
https://core.trac.wordpress.org/ticket/20605#comment:6
<ul>
<li><strong>owner</strong>
set to <em>ryan</em>
</li>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
<p>
In <a class="changeset" href="https://core.trac.wordpress.org/changeset/20752" title="Friendlier strings with links to the support forums when experiencing ...">[20752]</a>:
</p>
<div class="message"><p>
Friendlier strings with links to the support forums when experiencing problems talking to api.wordpress.org. fixes <a class="closed ticket" href="https://core.trac.wordpress.org/ticket/20605" title="enhancement: Be more friendly when API requests fail (closed: fixed)">#20605</a><br />
</p>
</div>
Ticket