-
Notifications
You must be signed in to change notification settings - Fork 16
Description
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\GeolocationServiceSlimStat\Services\Geolocation\GeolocationFactorySlimStat\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
- Activate wp-slimstat + wp-slimstat-pro
- View SlimStat reports
- Click on an IP address to view Whois/geolocation details
- Expected: IP details popup with geolocation info
- 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 viaGeolocationFactoryor thegeolocation_providersetting - Replace
GeoIP::loader($ip)withGeolocationService::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.