[Resolved] Can't connect to Petfinder after server change
I built a site on my server, installed the plugin, setup the API key and so forth, and everything worked great!
When I moved the site to the live server (full database and site move), I haven’t been able to get the plugin to work, even when I applied for and entered a new API Key. It always gives me a message saying something along the lines of the Petfinder server is unavailable (it’s the same message that is displayed when no API key is defined in the plugin settings).
I have absolutely no idea what to try next, as everything on this server is the exact same as my test server – where the plugin works with either of the 2 API keys I have. I’ve even tried uninstalling and reinstalling the plugin.
Any help would be greatly appreciated!
Could you try uncommenting line 196 in the petfinder-listings.php file on the site that is not working? It should look like this: //echo “http://api.petfinder.com/shelter.getPets?key=” . $petf_options[“apikey”] . “&count=” . intval($count) . “&id=” . $shelter_id . “&output=full”; This file is in your plugins/petfinder-listings folder.
Remove the // before the line and visit the page listing the pets on your site. There should be a URL that starts with “http://api.petfinder…” at the top of the Petfinder unavailable message you are seeing. You can copy this URL and paste it in a browser to see what Petfinder is returning and you can compare the key to your API key and id to your shelter ID in the URL to make sure what you are telling the plugin to save is being saved and returned correctly.
Let me know how it goes.
Thanks for the quick response, Bridget!
The XML results at the produced URL load perfectly fine (I’d post the link but don’t want to overload the api key)
Any other ideas of what it might be?
Can you send me the exact error message you are getting? Then I can tell where in the code it is failing. In the XML, is the status code 100? Should look like below:
I assumed, but just to be sure, are you looking at a page using the shortcode shelter_list?
It is status code 100, yes:
<petfinder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://api.petfinder.com/schemas/0.9/petfinder.xsd"> <header> <version>0.1</version> <timestamp>2012-11-09T01:23:20Z</timestamp> <status> <code>100</code> <message/> </status>
The error message is simply “Petfinder is down for the moment. Please check back shortly.”
And I am looking at a page using the [shelter_list] shortcode 🙂 (which I’ve also tried adding additional queries to – such as defining the shelter id and animal type, in the format provided with your plugin documentation – the changes are reflected in the produced XML link, but again don’t display on the page)
Okay, that is weird. Could you do something else – put the following below the line you uncommented, on a line of its own:
and comment back the line with the URL – add back the // before the line at 196 that starts with “echo”.
Then send me the link to your page so I can look at the XML coming back from Petfinder.
Actually, I wonder if your live site has all php errors turned off and you don’t have something php needs to parse the XML….While you are in there, can you turn on errors in your wp-config.php file? Change the following line: define(‘WP_DEBUG’, false); to true?
Let me know if this is above your level of php knowledge:
Make sure you have allow_url_fopen turned on in your php.ini
Where are you hosting? Usually this is set by default.
I’m thinking it likely is something related to the XML parsing on this server (it’s a different company from the test server, where everything worked splendidly).
I’ve included the debug errors below, which are a little over my head but the first error seems to suggest it is perhaps an issue with a setting on the server.
Warning: simplexml_load_file(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /hermes/bosweb/web047/b476/nf.seanbaker/public_html/wp-content/plugins/petfinder-listings/petfinder-listings.php on line 194 Warning: simplexml_load_file(http://api.petfinder.com/shelter.getPets?key=faeeafa545215334ad623a83e1efc8df&count=50&id=BC73&status=A&output=full): failed to open stream: no suitable wrapper could be found in /hermes/bosweb/web047/b476/nf.seanbaker/public_html/wp-content/plugins/petfinder-listings/petfinder-listings.php on line 194 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://api.petfinder.com/shelter.getPets?key=faeeafa545215334ad623a83e1efc8df&count=50&id=BC73&status=A&output=full" in /hermes/bosweb/web047/b476/nf.seanbaker/public_html/wp-content/plugins/petfinder-listings/petfinder-listings.php on line 194 Notice: Trying to get property of non-object in /hermes/bosweb/web047/b476/nf.seanbaker/public_html/wp-content/plugins/petfinder-listings/petfinder-listings.php on line 198 Notice: Trying to get property of non-object in /hermes/bosweb/web047/b476/nf.seanbaker/public_html/wp-content/plugins/petfinder-listings/petfinder-listings.php on line 198 Notice: Trying to get property of non-object in /hermes/bosweb/web047/b476/nf.seanbaker/public_html/wp-content/plugins/petfinder-listings/petfinder-listings.php on line 198
I’ll be unavailable for the next couple of hours, but will plan to contact the web host to see if it’s simply something prohibiting this interaction on their end.
Thanks for your help – it’s a beautiful plugin 🙂
Yes, it looks like you’ll need to contact your web host to turn that on for you. Good luck!
It turns out the solution was as simple as editing php.ini to enable allow_url_fopen, but I wouldn’t have been able to figure that out without your help, so thanks again Bridget!
The implementation of the plugin is here, if you or anyone else would like to see.
The site looks really nice! Great use of the plugin.
I am having exactly the same problem. wordpress 3.5.1 , hostgator, allow_url_fopen is on. but shows. page constantly shows Petfinder is down for the moment. Please check back shortly. and the xml output is exactly like above:
<petfinder xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”http://api.petfinder.com/schemas/0.9/petfinder.xsd”>
how can i fix this?
The plugin definitely works at Hostgator.
Could you try doing the following on your petfinder account:
“If the list is not working after correctly entering all your Petfinder Listings Settings and the page displays a status of ‘shelter opt-out’, make sure your Petfinder account is set up to share data through Petfinder’s API. To do this, log into your Petfinder account and click on the Organization Info tab. Look for the box labeled ‘Share Pet List’ and make sure all checkboxes within this box are selected: Please share my pet list with all third parties, Partner sites & Petfinder API users.”
If that doesn’t do anything, try uncommenting line 196 in the petfinder-listings.php file – you can see details about how to do this in my first reply to this post. This will tell us if the issue is Petfinder or the plugin.
It has something to do with petfinder account. i think petfinder recently changed something on their site, because i cant find organization info tab and “share pet list” box.
- The topic ‘[Resolved] Can't connect to Petfinder after server change’ is closed to new replies.