• Resolved Frodde

    (@frodde)


    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://www.ads-software.com/plugins/woocommerce-geolocation-based-products/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author royho

    (@royho)

    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

    (@frodde)

    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

    (@royho)

    That is not the correct file. Check the filename again.

    Thread Starter Frodde

    (@frodde)

    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

    (@royho)

    Yes, run that and let me know what you get in the dump.

    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

    (@frodde)

    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

    (@frodde)

    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

    (@royho)

    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.