Title: Fatal Error
Last modified: August 30, 2016

---

# Fatal Error

 *  Resolved [Frodde](https://wordpress.org/support/users/frodde/)
 * (@frodde)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-1695/)
 * Hi
 * We had an e-shop crash a moment ago:
 * Fatal error: Cannot use object of type WP_Error as array in /home/u/u7989098/
   www/valid.u7989098.fsdata.se/wp-content/plugins/woocommerce-geolocation-based-
   products/includes/class-wc-geolocation-based-products-frontend.phpon line 464
 * What I did yesterday was to add:
    Some pecific countries for purchase. Specific
   countries for VAT.
 * Boom crash today…
 * Also
    I removed the whole geolocation-based-products folder from the server (
   I have a copy of the folder in local). After this the site works again.
 * Questions are:
    – what could it be? – How should I proceed?
 * Best regards,
    Fredrik
 * [https://wordpress.org/plugins/woocommerce-geolocation-based-products/](https://wordpress.org/plugins/woocommerce-geolocation-based-products/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [royho](https://wordpress.org/support/users/royho/)
 * (@royho)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-1695/#post-6274056)
 * Hello,
 * That means you’re not able to get a response from the API POST api call, it is
   giving an error.
 * What version of the plugin are you using?
 * Try this. Open the file in your error and add just before line 464 this:
 *     ```
       var_dump($response);
       ```
   
 * Load the page and you should see some code. Copy and paste that here so I can
   see what error it is stating.
 *  Thread Starter [Frodde](https://wordpress.org/support/users/frodde/)
 * (@frodde)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-1695/#post-6274082)
 * Hi,
    It’s the 1.3.0 + I have prepared a local copy according to your instructions,
   does it look ok?:
 *  if ( $posts ) {
    foreach ( $posts as $post ) { var_dump($response); $product
   = get_product( $post );
 * And now I put the whole folder back to the remote server, reload the page and
   screendump the message?
    And I just remove the folder again direct after?
 * Best regards,
    Fredrik
 * I wonder if I could have done something wrong when setting up woocommerce for
   international payments. Can that cause this fatal error?
 *  Plugin Author [royho](https://wordpress.org/support/users/royho/)
 * (@royho)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-1695/#post-6274083)
 * That is not the correct file. Check the filename again.
 *  Thread Starter [Frodde](https://wordpress.org/support/users/frodde/)
 * (@frodde)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-1695/#post-6274106)
 * Here it is:
 * $response = wp_remote_get( $url, $args );
 *  $response_body = wp_remote_retrieve_body( $response );
    var_dump($response);
   if ( isset( $response[‘response’][‘message’] ) && $response[‘response’][‘message’]
   == ‘OK’ ) { return json_decode( $response_body );
 *  Plugin Author [royho](https://wordpress.org/support/users/royho/)
 * (@royho)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-1695/#post-6274122)
 * Yes, run that and let me know what you get in the dump.
 *  [DanielOakfield](https://wordpress.org/support/users/carodani/)
 * (@carodani)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-1695/#post-6274170)
 * We also got the same error, it doesn’t happen all the time though. But we cannot
   allow this error to happen on our shop.
 * Are you going to fix that with a release anytime soon or should we look to another
   solution?
 *  Thread Starter [Frodde](https://wordpress.org/support/users/frodde/)
 * (@frodde)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-1695/#post-6274239)
 * Hi Again Rohyo,
 * I’m back again.
 * Should I continue with the dump according to your instruction, or has anything
   changed during the passed 2 months?
 * I’m afraid with experimenting to much since the e-shop has customers in it, except
   from nighttime.
 *  Thread Starter [Frodde](https://wordpress.org/support/users/frodde/)
 * (@frodde)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-1695/#post-6274240)
 * I just replaced the old plugin-folder with the updated version via ftp. But have
   not activated it yet. Will the latest update fix my issue? Do I dare to turn 
   it on?
 *  Plugin Author [royho](https://wordpress.org/support/users/royho/)
 * (@royho)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-1695/#post-6274242)
 * You should not have this issue with the new versions.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Fatal Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woocommerce-geolocation-based-products_041a55.
   svg)
 * [WooCommerce Geolocation Based Products](https://wordpress.org/plugins/woocommerce-geolocation-based-products/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-geolocation-based-products/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-geolocation-based-products/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-geolocation-based-products/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-geolocation-based-products/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-geolocation-based-products/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [royho](https://wordpress.org/support/users/royho/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-1695/#post-6274242)
 * Status: resolved