Skip to content

Instantly share code, notes, and snippets.

@pierlon
pierlon / custom-amp-endpoint.php
Created February 18, 2020 12:57
Replaces amp query with /amp/ endpoint slug
<?php
/**
* Plugin Name: Custom AMP endpoint
* Description: Replaces ?amp=1 with /amp/ for posts and pages
* Author: Pierre Gordon
* Version: 0.1.0
* License: GPLv2 or later
*/
namespace Custom_AMP_Endpoint;
<?php
/**
* Plugin Name: Bad plugin with fatal errors
* Description: For testing purposes only.
* Author: Pierre Gordon
* Version: 0.1.0
* License: GPLv2 or later
*/
// All credit goes to Weston Ruter <https://github.com/westonruter>
@pierlon
pierlon / validation-errors.json
Created March 23, 2021 07:06
Massive AMP validation error result
This file has been truncated, but you can view the full file.
{
"results": [
{
"error": {
"code": "DISALLOWED_PROCESSING_INSTRUCTION",
"node_name": "php",
"parent_name": "div",
"text": "<!--/amp-source-stack {\"block_name\":\"core\\/html\",\"post_id\":1641}--",
"node_type": 7,
"sources": [