[wp-hackers] Slow loading WordPress (Hack solution)

Jacob Santos wordpress at santosj.name
Sat Dec 6 23:14:23 GMT 2008


I was referring to development that went into WordPress 2.7. There was a 
report that the wp-cron wasn't working and the fix was to use IP, 
therefore I created a patch that used IP, however more reports came in 
that doing so broke other servers that were using IP. Some servers have 
firewall rules which prevent IP from being used for security purposes 
and the problem, I think, is that one IP can serve multiple domains and 
if you use the IP, then the server has no idea which domain (even if you 
add the host HTTP header).

With the HTTP API in WordPress 2.7, the part where you specify where you 
connect and then send the relevant information such as host header and 
domain was lost. It might work well with fsockopen(), but it won't work 
with the HTTP extension, or cURL and you can have no idea which one will 
be used. Care was taken to ensure that each so called, "transport" was 
developed so that they performed the same. fsockopen is used last. You 
can create the Wp_HTTP_Fsockopen object separately and use it or any one 
of the classes. The request method in the Wp_Http class does create the 
proper environment for the classes. Although the classes themselves will 
also sort of help you out if you use them individually.

Not sure about the missing quotes, I didn't even notice it.

Jacob Santos


Peter van der Does wrote:
> On Sat, 06 Dec 2008 00:14:26 -0600
> Jacob Santos <wordpress at santosj.name> wrote:
>
>   
>> As for the IP solution. It was already tried, but it broke too many
>> wp-crons on other servers. The decision was made that those who
>> require IP are just SOL. There was going to be a filter or something,
>> but no matter. Your code also doesn't use the HTTP API.
>>
>>     
>
> Jacob,
>
> Do you know what the problem was on other servers that an IP
> address couldn't be used?
>
> What should I have used to get the IP address of the server if it's not
> by $_SERVER['SERVER_ADDR'] or are you referring to the fact I forgot
> quotes in my original posting?
>
>   



More information about the wp-hackers mailing list