WordPress.org

Ready to get started?Download WordPress

Forums

An Unexpected HTTP Error occurred during the API request. ! how to fix it (39 posts)

  1. tanveersultan
    Member
    Posted 2 years ago #

    am using 3.3 wordpress ! when i search any plugin i got the error

    An Unexpected HTTP Error occurred during the API request.
    Try again.

    any solution for that what i got all from searching is to edit http.php or class-http.php and change time limit but there is no text like i.e

    1) Login to your FTP server

    2) Open wp_include/http.php

    3) Look out for the 223rd line inside

    4) This is what you should be looking at: ‘timeout’ => apply_filters( ‘http_request_timeout’, 5),

    5) All you have to do is change the value “5” to “30”, the value is actually is the number of seconds before the server times out.

    6) This should resolve your problem.

    but i cant find these lines in my wordpress any solution please !

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Never edit WordPress core files! This may be a server issue. Try asking your hosts for assistance.

  3. MatthewRuddy
    Member
    Posted 2 years ago #

    I have this issue as well. Never made any changes to the WordPress core files. I have no plugins installed using default theme. This never occurred in 3.2.1.

  4. joecking
    Member
    Posted 2 years ago #

    I also has this problem, I am using the default theme. I am using 3.3 and previously I had no problem until I updated to 3.3

  5. joecking
    Member
    Posted 2 years ago #

    Hi Guys this is what I found and it is working for wordpress 3.3

    Thanks tophertopher it worked with me in wordpress 3.2.1

    Thanks to Member tophertopher:

    Edit file plugin-install.php
    in directory wp-admin/includes
    and find the timeout setting. It is by default set to 15. Increase to 60.
    $request = wp_remote_post('http://api.wordpress.org/plugins/info/1.0/', array( 'timeout' => 60, 'body' => array('action' => $action, 'request' => serialize($args))) );

    NB: you will not find this in http.php file as this is version 3.3
    Hope it works for you guys

  6. In2itioN
    Member
    Posted 2 years ago #

    I am having also this problem, I don't know what to do, I tried to change the timeout but nothing good happened.

    I am using WP 3.3.

  7. medicadiet
    Member
    Posted 2 years ago #

    Hi, i am experiencing this problem.

    I do not find that line in http.php

    I have the spanish version installed.

    I prefer not to change anything but, is there any official solution?

    my isp says it is my problem.

  8. joecking
    Member
    Posted 2 years ago #

    hi In2itioN, did you try what I have given above? This is differen, try and see..

  9. medicadiet
    Member
    Posted 2 years ago #

    I also do not have "plugin-install.php" file in the spanish version.

  10. In2itioN
    Member
    Posted 2 years ago #

    joecking WOW It worked !!!!!!

    Thx a LOT!!!!!!

  11. mohamedali
    Member
    Posted 2 years ago #

    I think everyone is facing this problem. I have 2 different servers where i host my websites, i tried a fresh installation on my second server, on a new domain, and i still faced the error. It just started today, something wrong from wordpress?

  12. medicadiet
    Member
    Posted 2 years ago #

    ok, i am sorry. At last, i found it and it worked.

    thanks a lot

  13. mohamedali
    Member
    Posted 2 years ago #

    mediacadiet - i can't find plugin-install.php where did you find it?

  14. Istie
    Member
    Posted 2 years ago #

    Here the same using WP 3.3. Before update never had problems before.
    After editing the core file as joecking suggested it's still not working good. Finding new plugins is working now but installing them gives me the http api error.

    Also the page: http://api.wordpress.org/plugins/info/1.0/
    is taking too way long to answer or i get an 504 Gateway Time-out...

    Hope WP will fix this soon.

  15. medicadiet
    Member
    Posted 2 years ago #

    mohamedali, i was looking in:

    wp-includes. That is wrong.

    It is in:

    wp-admin/includes This is ok.

  16. mohamedali
    Member
    Posted 2 years ago #

    Just wondering - am i the only one facing the same issue when searching for new themes? P.s this has also only started from today. And for those of you feeling it's due to the update - I had not updated my WordPress from the previous version. I faced this API error this morning and I thought maybe its due to me not updating my wordpress - i updated it to 3.3 and yes it still gives me the error

  17. mohamedali
    Member
    Posted 2 years ago #

    Mediacadiet - Thank you, i was doing the same ^^ found it

  18. mohamedali
    Member
    Posted 2 years ago #

    Ok Joecking's method worked - changed the setting from 15 seconds to 60 seconds, however i still cannot search for any new themes. I'm assuming something needs to be modified at wp-admin/theme-install.php but i am not exactly sure. Please could someone check on it. Thanks

  19. medicadiet
    Member
    Posted 2 years ago #

    When i try to import my old blog, i receive:

    Fatal error: Maximum execution time of 30 seconds exceeded in C:\inetpub\vhosts\medicadiet.com\httpdocs\wp-includes\class-http.php on line 1106

    any ideas?

  20. MatthewRuddy
    Member
    Posted 2 years ago #

    I also noticed that my plugins aren't reporting updated versions. For example, I deliberately installed an old version of my Easing Slider plugin yet WordPress isn't reporting that a new one is available. I also tried using set_site_transient to reset the update_plugins transient.

    Also noticed that the wp_option related to this function ( '_site_transient_update_plugins') only contains information on when it was last checked. No plugin slugs, version, id, or response on updated version. Suggests to me that the set_site_transient function is failing to access the API also.

    Bit of a pain. I think their may be a problem with their API at this current time. Probably just slow to respond to requests. I'd say they will have it sorted soon.

  21. joecking
    Member
    Posted 2 years ago #

    I have a strange feeling that MatthewRuddy is correct... This is because even after increasing the timeout to 60, I can search for plugins but not install them... the server is painfully slow... Let us wait and hear from WordPress!

  22. MatthewRuddy
    Member
    Posted 2 years ago #

    I can't even search for plugins, even with the code change you suggested.

  23. Tamara3
    Member
    Posted 2 years ago #

    Thank you joecking... it worked for me:

    Edit file: (v.3.3)
    httpdocs > wp-admin > includes >plugin-install.php
    Around line 44 you will see:
    'timeout' => 15,
    Increase 15 to 60.

    So far the plugins have installed fine.

  24. mohamedali
    Member
    Posted 2 years ago #

    Ok everything seems to be back to normal, - so it was a problem from WP i suppose.

  25. SteveAx
    Member
    Posted 2 years ago #

    I am having the same issue still... as well as others since the 3.3 update... I auto updated one of my blogs and the created a new one from scratch and both are having this issue (as well as being very slow)

    Please advise

  26. Please don't edit core. You make us cry.

    Try, instead, re-updating WordPress. Failing that, DELETE the wp-admin folder and get a new copy from http://wordpress.org/download/

  27. xanaftp
    Member
    Posted 2 years ago #

    None of all of these suggestions in this post worked. I'm still getting API errors and RSS Error: WP HTTP Error: name lookup timed out errors in every place of my website that connects to wordpress.

  28. SteveAx
    Member
    Posted 2 years ago #

    I installed this plug-in and it seemed to fix it all...
    http://wordpress.org/extend/plugins/hotfix/

    No idea exactly what it does but worked for me

  29. xanaftp
    Member
    Posted 2 years ago #

    Okay I did forget to mention that additionally to the API error I get request.name lookup timed out. Would that help any?

  30. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Sounding more and more like a network issue...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.