Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pierlon committed Oct 28, 2019
1 parent 740c180 commit 9d49114
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions includes/class-amp-theme-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -2464,12 +2464,13 @@ public static function enqueue_paired_browsing_client() {
* non-AMP page and its AMP version to review any discrepancies.
*/
public static function serve_paired_browsing_experience() {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( ! isset( $_GET[ self::PAIRED_BROWSING_QUERY_VAR ] ) ) {
return;
}

if ( ! is_admin_bar_showing() ) {
wp_die( esc_html__( 'The admin bar must be showing to use paired browsing mode.' ) );
wp_die( esc_html__( 'The admin bar must be showing to use paired browsing mode.', 'amp' ) );
}

$url = remove_query_arg( self::PAIRED_BROWSING_QUERY_VAR );
Expand All @@ -2480,7 +2481,7 @@ public static function serve_paired_browsing_experience() {
<html>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<title><?php esc_html_e( 'Loading...', 'amp-to-amp' ); ?></title>
<title><?php esc_html_e( 'Loading...', 'amp' ); ?></title>
<style>
html,body {
margin: 0;
Expand Down Expand Up @@ -2515,10 +2516,10 @@ public static function serve_paired_browsing_experience() {
<iframe src="<?php echo esc_url( $url ); ?>" id="non-amp" sandbox="allow-forms allow-scripts allow-same-origin allow-popups"></iframe>
<iframe src="<?php echo esc_url( $amp_url ); ?>" id="amp" sandbox="allow-forms allow-scripts allow-same-origin allow-popups"></iframe>
<script>
const ampSlug = <?php echo wp_json_encode( amp_get_slug() ); ?>;
const ampPairedBrowsingQueryVar = <?php echo wp_json_encode( self::PAIRED_BROWSING_QUERY_VAR ); ?>;
const ampSlug = <?php echo wp_json_encode( amp_get_slug() ); ?>;
const ampPairedBrowsingQueryVar = <?php echo wp_json_encode( self::PAIRED_BROWSING_QUERY_VAR ); ?>;
</script>
<script src="<?php echo esc_url( amp_get_asset_url( '/js/amp-paired-browsing-app.js' ) ); ?>"></script>
<script src="<?php echo esc_url( amp_get_asset_url( '/js/amp-paired-browsing-app.js' ) ); // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript ?>"></script>
</body>
</html>
<?php
Expand Down

0 comments on commit 9d49114

Please sign in to comment.