Instantly share code, notes, and snippets.

Weston Ruter westonruter

View GitHub Profile
View amp-infinite-endpoint-blocker.php
<?php
/**
* Plugin Name: AMP Infinite Endpoint Blocker
*
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
* Plugin Name: AMP Infinite Endpoint Blocker
View amp-to-amp.php
<?php
/**
* AMP-To-AMP plugin initialization file.
*
* @package AMP_To_AMP
* @author Weston Ruter, Google
* @link https://gist.github.com/westonruter/f9ee9ea717d52471bae092879e3d52b0
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
View amp-schemaorg-meta-image-content-fallback.php
<?php
/**
* Plugin Name: AMP Schema.org Meta Image Content Fallback
* Description: Promote content image as Schema.org image when no featured image is supplied.
* Plugin URI: https://gist.github.com/westonruter/7358d6669e09cfa15a99021204208a67
* Author: Weston Ruter
* Author URI: https://weston.ruter.net/
*/
add_filter(
View amp-remove-powered-by-wordpress-footer-credit.php
View amp-nextgen-gallery-compat.php
View shutdown-handler.php
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
/*
* Plugin Name: Non-Handling Shutdown Handler
* Description: Disable WSOD protection so that plugins will not auto-suspend during development while errors often occur.
* Plugin URI: https://gist.github.com/westonruter/583a42392a0b8684dc268b40d44eb7f1
* Plugin Author: Weston Ruter
*/
/**
View amp-html-fragment-test.php
<?php
/*
* Plugin Name: AMP HTML Fragment Test
* Plugin URI: https://github.com/ampproject/amp-wp/issues/1778
*/
add_action(
'template_redirect',
function() {
if ( ! isset( $_GET['test_fragment'] ) ) {
View amp-img-loading-issue.html
<!doctype html>
<html amp lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<title>How To Send Emails Via MAMP for Mac OS Localhost - Tech Tutorials</title>
View is-amp-endpoint-shortcode.php
<?php
/**
* Plugin Name: AMP is_amp_endpoint shortcode
* Description: Add a shortcode for conditionally showing content based on whether or not it is an AMP response.
* Plugin URI: https://gist.github.com/westonruter/95da1a34dd4a758e6622c6319c54a60b
* Author Name: Weston Ruter
* Author URI: https://weston.ruter.net/
*/
// Allow shortcodes to run in Custom HTML widgets.
View example-amp-auto-ads.php
<?php
/**
* Plugin Name: AMP Auto Ads
*
* @package AMP_Auto_Ads
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin