Last active
January 31, 2021 18:04
-
-
Save westonruter/e5032d805625f0f743237708c43d3783 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* AMP Mobile Server-Side Redirection plugin bootstrap. | |
* | |
* @package Google\AMP_Mobile_Server_Side_Redirection | |
* @author Weston Ruter, Google | |
* @license GPL-2.0-or-later | |
* @copyright 2021 Google Inc. | |
* | |
* @wordpress-plugin | |
* Plugin Name: AMP Mobile Server-Side Redirection | |
* Plugin URI: https://gist.github.com/westonruter/e5032d805625f0f743237708c43d3783 | |
* Description: Disable the default client-side JS-based mobile redirection in lieu of opt-in in to server-side HTTP redirects. The AMP plugin does client-side redirection by default since it is most compatible across various caching plugins, but if possible you should use server-side redirection because it is always faster. | |
* Version: 0.1 | |
* Author: Weston Ruter, Google | |
* Author URI: https://weston.ruter.net/ | |
* License: GNU General Public License v2 (or later) | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
* Gist Plugin URI: https://gist.github.com/westonruter/e5032d805625f0f743237708c43d3783 | |
*/ | |
add_filter( 'amp_mobile_client_side_redirection', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installation instructions: https://gist.github.com/westonruter/6110fbc4bef0c4b8c021a112012f7e9c