Title: Fatal error on Cache.php
Last modified: December 9, 2025

---

# Fatal error on Cache.php

 *  Resolved [audpxi](https://wordpress.org/support/users/audpxi/)
 * (@audpxi)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-error-on-cache-php/)
 * Hi! Unfortunately our sites crash when using this plugin with our custom theme,
   error:
 * Fatal error: Declaration of Detection\Cache\Cache::get(string $key, mixed $default
   = null): mixed must be compatible with Psr\SimpleCache\CacheInterface::get($key,
   $default = null) in /app/public/wp-content/plugins/adv-geoip-redirect/vendor/
   mobiledetect/mobiledetectlib/src/Cache/Cache.php on line 26
 * I think it happens because the plugin’s Cache class uses simple-cache with type
   hints and our sites theme loads an older simple-cache v1.0.1 that has no type
   hints.
 * I tested the plugin by removing type hints and declare(strict_types=1) from Cache.
   php and after that it worked flawlessly.
 * Is there anything that can be done to support older themes as well?
 * Also one feature recommendation: it would be nice to be able to disable redirection
   for admins, because on our sites we use Beaver Builder which is a front end site
   builder. That means we have to disable redirection manually every time to be 
   able edit the page where user is being redirected from.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Sajjad Hossain Sagor](https://wordpress.org/support/users/sajjad67/)
 * (@sajjad67)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-error-on-cache-php/#post-18749446)
 * Hi [@audpxi](https://wordpress.org/support/users/audpxi/) Can you please let 
   us know how to reproduce the issue? Thanks
 *  Thread Starter [audpxi](https://wordpress.org/support/users/audpxi/)
 * (@audpxi)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-error-on-cache-php/#post-18750170)
 * Hi! Our theme uses Sage Roots 9 starter theme as base, which uses psr/simple-
   cache ~1.0 installed by Composer. So I suppose using a theme based on Sage Roots
   9, or any theme that loads older psr/simple-cache, with the plugin for any WordPress
   site would trigger the error when redirecting user.
   I think that theme loads 
   dependencies before plugins and when one version of simple-cache is already loaded,
   newer one is not loaded at all.
 *  Plugin Author [Sajjad Hossain Sagor](https://wordpress.org/support/users/sajjad67/)
 * (@sajjad67)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-error-on-cache-php/#post-18750909)
 * A new version is published with your requested feature disable redirection for
   admins. Please update to the latest version. As per the test, `composer create-
   project roots/sage my-theme` it does load the `themes\my-theme\vendor\psr\simple-
   cache\src\CacheInterface.php` with type hints, maybe you are using a old version.
   It is recommended to update to the latest version.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-on-cache-php%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/adv-geoip-redirect/assets/icon-128x128.png?rev=2294633)
 * [Advanced GeoIP Redirect](https://wordpress.org/plugins/adv-geoip-redirect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/adv-geoip-redirect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/adv-geoip-redirect/)
 * [Active Topics](https://wordpress.org/support/plugin/adv-geoip-redirect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/adv-geoip-redirect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/adv-geoip-redirect/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Sajjad Hossain Sagor](https://wordpress.org/support/users/sajjad67/)
 * Last activity: [5 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-error-on-cache-php/#post-18750909)
 * Status: resolved