Viewing 14 replies - 1 through 14 (of 14 total)
  • Are there any updates on this problem? I’ve been experiencing the same thing and would love to know if there were any (relatively) easy fixes since the filtering functionality in this plugin is really important for my site… Thanks!

    amandakempf,

    What is your ShelterId and WordPress version?

    NY786 and WP 4.4

    The Petfinder Listing plugin works just fine so I know my key is good, etc. Thank you!

    Hello,

    Please replace your petfinder-search-rescue.php with:

    https://pastebin.com/vSCuHsb4

    I copied that over, but am still getting the ‘petfinder is down’ message. Is the shortcode the same or is there anything else that needs to get updated? Thanks so much!

    Interesting. That fixed the issue for me…

    Can you find:
    $request_url = preg_replace(‘/<[^>]*>/’, ”, $request_url);

    and add the following right above it?
    print_r($request_url);

    Then post the link?

    I’m sorry. I meant link to your page.

    Haha, oh. https://www.hubbardshounds.com/wordpress/index.php/available-dogs/

    I deactivated the Listings plugin below it, fyi, just while I was troubleshooting so it didn’t load every time.

    You can revert the changes. Also, remove the link you posted earlier that contains your api key.

    I cannot reproduce the error on a fresh 4.4 installation.

    My only thought would be to put

    print_r($petfinder_data);
    under
    $petfinder_data = simplexml_load_file( $request_url );

    So you can see the raw data.

    $petfinder_data is empty (which I suppose makes sense, given the issue…) Thank you very much for your time–I appreciate it! If I magically figure anything out, I’ll let you know. Thanks again!

    So, I have an update…the problem appears to be with the use of simplexml_load_file (my guess is it’s related to the sucky hosting of the site.) Anyway, I chopped some code out of the Listings plugin that WAS getting the XML info back from the Petfinder API and now seem to have things working! The fix was to use wp_remote_get in conjunction with simplexml_load_string instead of the simplexml_load_file…

    Whew. Definitely a bit of luck on this one for me–thanks so much for getting me started!!

    No problem,

    Please share you code here so others who are running into this issue may give it a go.

    Here’s the code I commented out, plus the replacement code, in petfinder-search-rescue.php. I also hardcoded my key and shelter ID in there so those would need to be updated appropriately depending on the user. This is definitely not an elegant solution, but it seems to be working for now anyway… Thanks!

    /*
    ORIGINAL CODE
    // Request data from Petfinder
    $petfinder_data = @simplexml_load_file( $request_url );
    END ORIGINAL CODE
    */

    //SUBSTITUTE CODE
    //get the xml
    $response = wp_remote_get( “https://api.petfinder.com/shelter.getPets?key=FILL_IN_YOUR KEY&count=50&id=FILL_IN_YOUR_SHELTER_ID&status=A&output=full”, array(“timeout” => 120) );
    $xml = simplexml_load_string(wp_remote_retrieve_body($response));
    //print_r($xml);
    $petfinder_data = $xml;
    //END SUBSTITUTE CODE

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘No information showing’ is closed to new replies.