Skip to content

[Bug] Pro MaxMindDetailsAddon references removed GeoIP class — fatal on Advanced Whois AJAX #182

@parhumm

Description

@parhumm

Description

The Pro plugin's MaxMindDetailsAddon (Advanced Whois feature) references SlimStat\Services\GeoIP class and suppress-loads /wp-slimstat/src/Services/GeoIP.php, but the free plugin no longer ships that file or class.

The geolocation stack was refactored to:

  • SlimStat\Services\Geolocation\GeolocationService
  • SlimStat\Services\Geolocation\GeolocationFactory
  • SlimStat\Services\Geolocation\Provider\* (DbIpProvider, MaxmindGeoIPProvider, CloudflareGeolocationProvider)
  • SlimStat\Services\Geolocation\AbstractGeoIPProvider

Affected Code

wp-slimstat-pro/src/Addon/Addons/MaxMindDetailsAddon.php:

  • Line 86: !\SlimStat\Services\GeoIP::database_exists() — class does not exist
  • Line 91: @include_once(WP_PLUGIN_DIR . '/wp-slimstat/src/Services/GeoIP.php') — file does not exist
  • Line 92: GeoIP::loader($ip) — class does not exist

Impact

When a user clicks the Advanced Whois/IP Details link in the SlimStat admin reports, the AJAX handler will fatal error because the included file and class no longer exist. The @include_once suppresses the include warning but GeoIP::loader() on line 92 will cause a fatal "Class not found" error.

Steps to Reproduce

  1. Activate wp-slimstat + wp-slimstat-pro
  2. View SlimStat reports
  3. Click on an IP address to view Whois/geolocation details
  4. Expected: IP details popup with geolocation info
  5. Actual: Fatal error (Class 'GeoIP' not found)

Suggested Fix

Update MaxMindDetailsAddon.php to use the new geolocation API:

  • Replace GeoIP::database_exists() with a check via GeolocationFactory or the geolocation_provider setting
  • Replace GeoIP::loader($ip) with GeolocationService::locate($ip) using the configured provider

Discovery Context

Found during PR #152 (Cloudflare IP geolocation fix) QA verification. This is a pre-existing issue not introduced by that PR.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions