Skip to content

Instantly share code, notes, and snippets.

Avatar

Weston Ruter westonruter

View GitHub Profile
View amp-debug-bar-compat.php
<?php
/**
* AMP Debug Bar Compat
*
* @package AMP_Debug_Bar_Compat
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2020 Google LLC
*
* @wordpress-plugin
View try-node-no-longer-exists-warning.php
<?php
/**
* Plugin Name: Try Node No Longer Exists
* Description: To test, ensure that all templates as served as AMP and then access what would be an AMP page with "?try_node_no_longer_exists_warning=1".
*/
add_action( 'template_redirect', function () {
if ( ! isset( $_GET['try_node_no_longer_exists_warning'] ) ) {
return;
}
@westonruter
westonruter / slow-content-images.php
Created Jun 12, 2020
Development plugin to test slow-loading images in content
View slow-content-images.php
<?php
/**
* Slow Content Images plugin bootstrap.
*
* @package Google\Mini_Plugin_Template
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2020 Google Inc.
*
* @wordpress-plugin
View amp-disable-default-gallery-shortcode-carousel.php
View amp-wordfence-compat.php
<?php
/**
* AMP Wordfence Compat plugin bootstrap.
*
* @package Google\AMP_Wordfence_Compat
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2020 Google Inc.
*
* @wordpress-plugin
@westonruter
westonruter / offline.css
Last active May 19, 2020
WordPress PWA compatibility plugin for the Lovecraft theme by Anders Norén. For use with the PWA feature plugin: https://wordpress.org/plugins/pwa/
View offline.css
body.offline .toggles {
display: none;
}
@westonruter
westonruter / amp-lovecraft-theme-compat.php
Last active May 27, 2020
WordPress plugin to add AMP compatibility to the Lovecraft theme by Anders Norén. For use with the official AMP plugin in Standard or Transitional template modes: https://wordpress.org/plugins/amp/
View amp-lovecraft-theme-compat.php
<?php
/**
* AMP Lovecraft Theme Compat plugin bootstrap.
*
* @package Google\AMP_Lovecraft_Theme_Compat
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2020 Google Inc.
*
* @wordpress-plugin
View bad-hooks.php
<?php
/**
* Plugin Name: Bad Hooks
* Description: Action and filter which add bad markup.
* Version: 0.1
* Plugin URI: https://gist.github.com/westonruter/f451337351e803044413d942f307229b
* Author: Weston Ruter
*/
namespace Bad\Hooks;
View bad-shortcode.php
<?php
/**
* Plugin Name: Bad Shortcode
* Description: Shortcode which outputs a script.
* Version: 0.7
* Plugin URI: https://gist.github.com/westonruter/6880918d45deb39c89e17f3b76583521
* Author: Weston Ruter
*/
namespace Bad\Shortcode;
You can’t perform that action at this time.