Support » Plugin: Geo Redirect » The plugin generates a fatal error

  • Hello,
    some months ago the plugin started to generate a Fatal error: Cannot redeclare geoip_country_code_by_name() in /home/fqxdiyhh/public_html/wp-content/plugins/oldgeographical-redirect/geoip/geoip.inc on line 508

    Since then I haven’t been able to use it, and there are no other alternatives as far as I know, that can redirect the foreign visitor to a single page on my website. A real pity as it worked great…

    https://wordpress.org/plugins/geographical-redirect/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Same problem when try Activate plugin

    eduard_

    (@edwardintoronto)

    Why does it say oldgeographical-redirect instead of just geographical-redirect?

    The error is caused by the fact that some other plugin already loaded the same GeoIP library. The Georedirect plugin does not check if the library is already loaded, it just loads it straight away.

    The fix is “ugly”, but it should be simple:

    1. Go to https://github.com/daigo75/geoip-api-php.
    2. From the repository, download files geoip.inc and geoipcity.inc.
    3. Replace files files geoip.inc and geoipcity.inc that you find the Georedirect plugin folder with the ones you just downloaded.

    The plugin should now work correctly.

    Note
    Above solution is provided as is, without implicit or explicit warranty. We patched the Geoip library to avoid conflicts in our WooCommerce Currency Switcher plugin, and we haven’t tested it in 3rd party plugins.
    I would recommend to take a backup of the original plugin before patching it, to be able to roll back if necessary.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The plugin generates a fatal error’ is closed to new replies.