Title: Mobile redirection error
Last modified: November 1, 2020

---

# Mobile redirection error

 *  [ablachman](https://wordpress.org/support/users/ablachman/)
 * (@ablachman)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/mobile-redirection-error/)
 * I recently upgraded my plugin to 2.0.5, but unfortunately had to downgrade back
   as I was seeing mobile redirection errors that were breaking advertisements on
   my site.
 * This is the error I got:
 *     ```
       PHP message: PHP Fatal error:  Uncaught Error: Undefined class constant 'MOBILE_REDIRECT' in /www/../public/wp-content/plugins/amp/src/MobileRedirection.php:50
       Stack trace:
       #0 /www/../public/wp-content/plugins/amp/src/Infrastructure/ServiceBasedPlugin.php(296): AmpProject\AmpWP\MobileRedirection->register()
       #1 /www/../public/wp-content/plugins/amp/src/Infrastructure/ServiceBasedPlugin.php(213): AmpProject\AmpWP\Infrastructure\ServiceBasedPlugin->register_service('mobile_redirect...', 'AmpProject\\AmpW...')
       #2 /www/../public/wp-content/plugins/amp/src/Infrastructure/ServiceBasedPlugin.php(144): AmpProject\AmpWP\Infrastructure\ServiceBasedPlugin->register_services()
       #3 /www/../public/wp-content/plugins/amp/includes/amp-helper-functions.php(73): AmpProject\AmpWP\Infrastructure\ServiceBasedPlugin->register()
       #4 /www/../public/wp-includes/class-wp-hook.php(287): amp_bootstrap_plugin('')
       ```
   
 * Is there any reason for this?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/mobile-redirection-error/#post-13607990)
 * What version did you upgrade from? This class constant has been in place since
   2.0.0.
 * The error you’re reporting is coming from this line: [https://github.com/ampproject/amp-wp/blob/2.0.5/src/MobileRedirection.php#L50](https://github.com/ampproject/amp-wp/blob/2.0.5/src/MobileRedirection.php#L50)
 * Nevertheless, the the class constant `Option::MOBILE_REDIRECT` does indeed exist:
   [https://github.com/ampproject/amp-wp/blob/2.0.5/src/Option.php#L53](https://github.com/ampproject/amp-wp/blob/2.0.5/src/Option.php#L53)
 * My guess is that the upgrade did not fully complete or you have some PHP OPcache
   that was not flushed. Have you upgraded to WordPress 5.5 yet? If so, then the
   OPcache should be automatically flushed.

Viewing 1 replies (of 1 total)

The topic ‘Mobile redirection error’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/mobile-redirection-error/#post-13607990)
 * Status: not resolved