Wordpress-Timthumb-alternative icon indicating copy to clipboard operation
Wordpress-Timthumb-alternative copied to clipboard

Script Bails if Subdomain is/isn't Present (www vs non-www)

Open robneu opened this issue 12 years ago • 5 comments

This seems to be expected behavior of the script because WordPress treats this situation as if the images are external.

My situation occurred because the initial WordPress install took place under a non-www domain. After migrating the site, it was changed to the www version which caused the script to fail. In the browser, the images still appeared with the www prepended, but in the database they were not.

I don't think this requires a patch, although I think it could use an extra error handling statement somewhere. At the very least you might want to mention the issue in the documentation.

robneu avatar Feb 07 '13 08:02 robneu

Were you getting an WP_Error when this issue occurred? You can check for WP_Errors using the function 'is_wp_error' and from there (using more functions) you should be able to display the error message being returned.

MatthewRuddy avatar May 10 '13 16:05 MatthewRuddy

I wasn't able to get the script to return any errors in this situation. I tried to get it to throw an error during nearly every stage of the script's execution and even with WP_DEBUG enabled I couldn't pull anything out of it. It might just be my inexperience with debugging, but I tried everything I could think of.

robneu avatar May 10 '13 17:05 robneu

Weird. Were you receiving just the image in its original dimensions/size? I'll look into this when I get a chance, might be able to throw in an extra check or two for www in subdomain.

MatthewRuddy avatar May 10 '13 17:05 MatthewRuddy

Yup, all the images run through the script were returned as full size. I fixed it by replacing all the serialized strings in the database so that everything used the www subdomain.

robneu avatar May 10 '13 17:05 robneu

Yeah, sounds like script was just blacklisting the domain and bailing out by returning the original image. No actual errors as such. I'll see if I can add some extra checks when I get a chance.

MatthewRuddy avatar May 10 '13 18:05 MatthewRuddy