I there,
This is due to your server having URL file-acess disabled.
Can you download this https://meocloud.pt/link/566d1786-bf3a-4e57-af45-2e1781128ea8/wonderm00n-open-graph.zip/ override wonderm00n-open-graph.php and get back to me?
I tried that new version but I still see the errors. You can look here to see my web page which uses this new version of the script and shows the errors. It looks like allow_url_fopen is set to 1 on my server. I tried forcing the full path name instead of the url and that fails as well although in that case it fails with the following warning:
Warning: getimagesize(/home2/jeiseman/public_html/wp-content/uploads/2012/07/wilkins-betterw-201×300.jpg): failed to open stream: No such file or directory in /home2/jeiseman/public_html/classical-scene/wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/wonderm00n-open-graph.php on line 465
You can go here to see the image is available.
You need to replace $_SERVER[‘DOCUMENT_ROOT’] with ABSPATH. THe difference is that ABSPATH is the path to the WordPress installation while $_SERVER[‘DOCUMENT_ROOT’] is the path to the root of the website. Here’s the new version that works:
https://dl.dropboxusercontent.com/u/28883337/wonderm00n-open-graph.zip
It always uses the path and not the url.
“You need to replace $_SERVER[‘DOCUMENT_ROOT’] with ABSPATH”
You’re totally right.
Can you try this one? https://meocloud.pt/link/47da787d-21c6-4f45-8cd2-b24c2cb9195e/wonderm00n-open-graph.zip/
I want to make sure I do keep the “allow_url_fopen” check because of possible external images being used
The allow_url_fopen is set to 1 but the getimagesize using the url is still failing. Only convert from a url to a path if it contains the site_url. If it’s a pathname then prepend the ABSPATH.
Disregard my last post. The new version does work. Thanks!
It still fails using the latest version. You can see the error here.
The problem is that allow_url_fopen is set to 1 but the getimagesize using the url is failing.
Try this one: https://meocloud.pt/link/20104182-f6d0-45f9-ad51-97ca220fb7f6/wonderm00n-open-graph.zip/
I’m adding the site_url above if the path does not contain it and then remove it again just when performing get_image_size.
This way I’ll always get the full URL to use in the OG tag and always use local file path to test the image size.
Anyway: if you have allow_url_fopen set to 1 it should work… but this new approach I’m now using should do it.
Please get back to me.
Here’s a new version of the script that works:
https://dl.dropboxusercontent.com/u/28883337/new/wonderm00n-open-graph.zip
It only replaces the url with a path if it’s not an external script.
joneiseman,
You already sent me that version.
You did not, however, told me if the last one I sent is working for you. (it should be)
No the new version didn’t work. It doesn’t convert the internal urls to paths because allow_url_fopen is set to 1.
I don’t think you have the last version.
This is it: https://meocloud.pt/link/20104182-f6d0-45f9-ad51-97ca220fb7f6/wonderm00n-open-graph.zip/
In the last one we add the site_url on line 470 if it doesn’t has it already. So now all images should have the full URL.
Then on line 477 we convert the url to path no matter if allow_url_fopen is set to 1 or not.
It should work for everyone.
I put in the new version and it works!
Thank you.
OK, I’ll push an update then.
Sorry but I’m having the same error even after updating to 1.3.3 and attempting to use your file. We use flickr images on our blog and it’s trying to find them locally. I’ve deactivated the plugin for now. Here is an example warning:
Warning: getimagesize(/home/username/public_html/http://farm6.staticflickr.com/5489/11224964104_df2698c696_z.jpg): failed to open stream: No such file or directory in /home/username/public_html/wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/wonderm00n-open-graph.php on line 477
Note: I made the username of the filepath generic on purpose.