• Resolved dccharron

    (@dccharron)


    I’ve just updated to 2.4.3

    The update caused my website to stop working completely. The error it generated was related to the call I had in my child function.php. The faulty code was:

    $htbrGeoInfo = geoip_detect2_get_info_from_current_ip();

    This now generates a fatal error as an undefined function.

    I have commented out the call to restore access to admin on my website. Of course this means I no longer have IP detection working but at least my website is accessible again.

    Now what? How do I fix this? The function I am using still appears as a valid function name in the API documentation but I can’t see an example of how I should be making the call.

    https://wordpress.org/plugins/geoip-detect/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter dccharron

    (@dccharron)

    I managed to get the plugin to work again. Here’s what I did:

    0- I had commented out the faulty line of code in my (child) functions.php to get back into my WP admin page.

    1- I found that the GeoIP plugin was updated but was not Activated. So I Activated it.

    2- I went into the “Options” page for this plugin and clicked on “Update Now”.

    3- I uncommented the code in my (child) functions.php and everything worked.

    So all good now.

    Plugin Author Benjamin Pick

    (@benjamin4)

    Sorry to hear that …

    So the real problem was that the update disactivated the plugin? Weird. You updated via the wordpress backend?

    Maybe I should start recommending using function_exist before every plugin call … hm. You could add a check for is_admin() because in the backend you’ll probably not need geo-dectection, right?

    Thread Starter dccharron

    (@dccharron)

    I thought all plugin’s were deactivated during their update process and reactivated after the update? So isn’t the problem that the “reactivation” didn’t work? If it had, then the functions.php would not have detected a missing api function.

    Yes I updated using the WP backend (admin page). I do each plugin separately so that I can tell which one has caused a problem. It makes it easier to fix.

    In a way, I’m glad I haven’t put the function_exist test because that way I got alerted that there was a problem. If I had the function_exist test I might not have noticed that Geo IP detection was not working properly. This way I took action to fix the problem.

    I had not realised you could test is_admin. I’ll consider that.

    Plugin Author Benjamin Pick

    (@benjamin4)

    Hm, I’ve checked the wordpress code: you’re right, upgrading actually deactivates it. Still puzzled why this problem doesn’t happen more often/why it fails to activate it.

    You’re right, seeing the error message at least tells you something has gone wrong …

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Version 2.4.3 broke my website in child function.php’ is closed to new replies.