Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#9861 closed defect (bug) (invalid)

Use cURL for RSS

Reported by: darrens's profile DarrenS Owned by: dd32's profile dd32
Milestone: Priority: normal
Severity: major Version: 2.8
Component: HTTP API Keywords: reporter-feedback
Focuses: Cc:

Description

Since most hosts I have tried have allow_url_fopen disabled why not use cURL to handle all RSS feeds, that or at least give an option to switch between 2 methods in the dashboard.

Currently every RSS feed in my dashboard results in an fopen error which makes the page look rather ugly, plus any plugin which depends on RSS (Twitter for example) automatically fails.

Change History (19)

#1 @ryan
16 years ago

2.8 should use curl, if it's available.

#2 @DarrenS
16 years ago

Well I'm ok 2.8, sometimes RSS works and then other times it gives me an fsock error on every single RSS feed.

#3 @DarrenS
16 years ago

I'm on 2.8* sorry, but heres my options with the host I'm on http://paste2.org/p/214424

I can't figure out why sometimes its working fine and then it randomly just stops. If its Wordpress trying to detect if to use cURL its doing something wrong to still be getting the fsock errors right?

I know I can't even install any plugins from within Wordpress -- sometimes I get a list of available plugins and can search and then other times I get nothing but this message "An Unexpected HTTP Error occurred during the API request."

#4 follow-up: @ryan
16 years ago

Are the functions curl_init() and curl_exec() defined by your host? Those must be available for WP to attempt to use curl.

#5 @Denis-de-Bernardy
16 years ago

  • Component changed from General to HTTP
  • Milestone changed from Unassigned to 2.8
  • Owner set to dd32
  • Type changed from feature request to defect (bug)

#6 in reply to: ↑ 4 @DarrenS
16 years ago

Replying to ryan:

Are the functions curl_init() and curl_exec() defined by your host? Those must be available for WP to attempt to use curl.

Since most hosts I have tried have allow_url_fopen disabled why not use cURL to handle all RSS feeds, that or at least give an option to switch between 2 methods in the dashboard.

Currently every RSS feed in my dashboard results in an fopen error which makes the page look rather ugly, plus any plugin which depends on RSS (Twitter for example) automatically fails

#7 @DarrenS
16 years ago

Argh! damn thing, wrong paste.

cURL support enabled
cURL Information libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8 libssh2/0.18

<?php
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, "http://www.google.com/");
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);
curl_close ($ch);
?>

This directs me to google just fine so again I don't know why I'm getting these error's via Wordpress.

#8 @dd32
16 years ago

  • Status changed from new to accepted

Could you install my plugin 'Core Control'(http://wordpress.org/extend/plugins/core-control/), Activate it, Then switch over to the Core Control page (Under settings i believe)

Activate the HTTP module, Save changes, Then switch to the HTTP tab along the top of the page.

Could you copy everything off that page and paste it here? or email it to me: wordpress @ dd32.id.au

Once you've done that, You can try disabling the current transport in use, to force it to switch to the next transport in the list.

This is the reason the HTTP API was written, Since every host ends up having a different support forexternal requests, yours likes Curl, MANY others do not, Many work with fsockopen(), many do not, some work with the HTTP Extension, most do not have it.. etc.

#9 @DarrenS
16 years ago

Manage Transports:
PHP HTTP Extension Not Available
cURL Available (Successfully retrieved & verified document)
PHP Streams Available (Could not open handle for fopen)
PHP fopen() Available (Could not open handle for fopen)
PHP fsockopen() Available (Successfully retrieved & verified document)

Manage Transports:
Direct - Not Available
SSH2 - Not Available
PHP FTP Extension - Available (Current Transport)
PHP FTP Sockets - Available (via Sockets Library)

Filesystem Paths:
ABSPATH /home/vol3/byethost33.com/b33_3300002/htdocs/
WP_CONTENT_DIR /home/vol3/byethost33.com/b33_3300002/htdocs/wp-content
WP_PLUGIN_DIR /home/vol3/byethost33.com/b33_3300002/htdocs/wp-content/plugins

Plugin check forced update:
"Checking for updates...

An Error occured during the update check"

When installing a plugin in the dashboard:
"Unable to locate WordPress Content directory (wp-content)."

#10 @dd32
16 years ago

Hm.. Byethost.. I've had huge problems with them in the past.

According to that, All your requests should be going via cURL at present on your setup.

The plugin updates component of that plugin doesnt work with 2.8 at present.

You're not using any non-WP-core RSS plugins are you? As of 2.8, MagPie RSS has been deprecated (but still included) which uses Snoopy, which might use fopen(), Core uses SimplePie with the new HTTP Api, which should use the cURL transport.

Does the fopen() errrors mention a filename/line number?

(Side note: fopen() should've been disabled in that plugin, however, it seems that byethost may be disabling ini_get() which prevents WP from being able to check if any settings are disabled, such as allow_url_fopen)

#11 @DarrenS
16 years ago

Nope, all my plugins are pretty standard and don't use any RSS -- well that was until I come to try a Twitter plugin and then notice nothings working exactly as it should. Sometimes RSS will work, but most of the time it wont...

fopen gives no filename or line number by the way.

If you was to sign up for Byethost under a free account you could run Wordpress yourself from their for a few days and you should see the RSS socket errors I keep getting.

I'm not sure if its the host to blame or a Wordpress issue, its just odd to me that one minute it works and then the next it doesn't and that Wordpress is unable to locate the content directory even though it clearly is on the correct path.

#12 @dd32
16 years ago

If you was to sign up for Byethost under a free account you could run Wordpress yourself from their for a few days and you should see the RSS socket errors I keep getting.

I might sign up and do some testing.. However from memory (and nothing seems to have changed from that phpinfo you posted) they're pretty strict about what goes.. and because of that, it may be a bit tricky.

#13 @westi
16 years ago

  • Cc westi added

#14 follow-up: @eddieringle
16 years ago

I do not think I fully understand the situation, but WordPress 2.8 uses SimplePie for RSS now, correct? If this is the case I am guessing that WordPress fetches the feed beforehand and stores it somewhere, then calls on SimplePie.

#15 in reply to: ↑ 14 @westi
16 years ago

  • Keywords reporter-feedback added

Replying to eddieringle:

I do not think I fully understand the situation, but WordPress 2.8 uses SimplePie for RSS now, correct? If this is the case I am guessing that WordPress fetches the feed beforehand and stores it somewhere, then calls on SimplePie.

We use SimplePie to parse the feed.

The fetching is done by SimplePie but using the WordPress HTTP API andSimplePie uses the WordPress transients to cache the feed data.

Both of these bits of WordPress are plugged into SimplePie by extending it's classes and configuring it so.

Please can you test again with the current beta release?

#16 @dd32
16 years ago

Just a quick note:
I've signed on on byethost.. Not much has changed.. cURL is still unrelaible.. 50/50 in my testings..

Just upgrading to 2.8 now (...&has been for over an hour via FTP..) and i'll see how that runs..

#17 @dd32
16 years ago

When installing a plugin in the dashboard: "Unable to locate WordPress Content directory (wp-content)."

The Filesystem-related errors are unavoidable, the FTP extension just doesnt work, (directory listing fails every time), and the Sockets extension isnt available.

Other than cURL failing 50/50 still.. Which seems to be it timing out after 10 seconds of no data recieved.. Hardly something WordPress should have to deal with (waiting incredibly long for a response)..

#18 @DarrenS
16 years ago

For me since reporting this and keeping up to date RSS has been ok (touch wood) but it would be neat if someone could add a timeout option that can be set by the user within Wordpress.

Thanks.

#19 @Denis-de-Bernardy
16 years ago

  • Milestone 2.8 deleted
  • Resolution set to invalid
  • Status changed from accepted to closed

this has been added in a recent changeset.

Note: See TracTickets for help on using tickets.