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 Block Container Unique IDs plugin bootstrap. | |
* | |
* @package Google\AmpBlockContainerUniqueIds | |
* @author Weston Ruter, Google | |
* @license GPL-2.0-or-later | |
* @copyright 2021 Google Inc. | |
* | |
* @wordpress-plugin |
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 | |
/** | |
* PWA: Page-Specific Start URLs plugin bootstrap. | |
* | |
* @package PWA\PageSpecificStartUrls | |
* @author Weston Ruter, Google | |
* @license GPL-2.0-or-later | |
* @copyright 2021 Google Inc. | |
* | |
* @wordpress-plugin |
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 | |
use Sabberworm\CSS\Parser; | |
use Sabberworm\CSS\RuleSet\DeclarationBlock; | |
$dom = new DOMDocument(); | |
$dom->loadHTML( | |
' | |
<!DOCTYPE html> | |
<html> |
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 | |
const TEST_ID = 'foo'; | |
foreach ( [ 'sans_id_removal', 'with_id_removal' ] as $scenario ) { | |
echo "$scenario: "; | |
$dom = new DOMDocument(); | |
$dom->loadHTML( | |
'<!DOCTYPE html><html><head><meta charset=utf-8></head><body></body></html>' |
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 Sandboxing Levels Experimental Opt-in plugin bootstrap. | |
* | |
* @package Google\AMP_Sandboxing_Levels_Experimental_Optin | |
* @author Weston Ruter, Google | |
* @license GPL-2.0-or-later | |
* @copyright 2021 Google Inc. | |
* | |
* @wordpress-plugin |
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
<!-- wp:paragraph --> | |
<p>Page setup:</p> | |
<!-- /wp:paragraph --> | |
<!-- wp:list {"ordered":true} --> | |
<ol><li>Commenting is enabled.</li><li>There is at least one comment.</li><li>There is a custom script on the page.</li></ol> | |
<!-- /wp:list --> | |
<!-- wp:paragraph --> | |
<p>Therefore, in loose sandboxing:</p> |
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
document.addEventListener( 'DOMContentLoaded', () => { | |
document.getElementById( 'custom-scripts-container' ).classList.add( 'loaded' ); | |
document.querySelector( '#custom-scripts-container .results' ).innerHTML += '<li>External script ran!</li>'; | |
} ); |
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 | |
/** | |
* Postpone loading non-critical AMP scripts. | |
* | |
* @package Google\AmpPostponeScriptLoading | |
*/ | |
namespace Google\AmpPostponeScriptLoading; | |
use AmpProject\Dom\Document; |
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 | |
add_filter( | |
'render_block', | |
function ( $block_content, $block ) { | |
if ( | |
function_exists( 'is_amp_endpoint' ) | |
&& | |
is_amp_endpoint() | |
&& |
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 | |
/** | |
* FormActionRewriteSanitizer file. | |
* | |
* @package Google\AMP_Form_Submission_Proxy | |
*/ | |
namespace Google\AMP_Form_Submission_Proxy; | |
use AMP_Base_Sanitizer; |