From 828e1dec191bcae5ca278d486574bb177f367ee2 Mon Sep 17 00:00:00 2001 From: Marius Cristea Date: Mon, 9 Sep 2019 20:05:26 +0300 Subject: [PATCH] fix: preload lazyload js file when lazyload setting is active --- cypress/integration/test_woo.js | 2 +- inc/admin.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/integration/test_woo.js b/cypress/integration/test_woo.js index 80e942df..40156672 100644 --- a/cypress/integration/test_woo.js +++ b/cypress/integration/test_woo.js @@ -17,7 +17,7 @@ describe( 'Check product page', function () { cy.get( '.woocommerce-product-gallery__wrapper .zoomImg' ).should( 'have.attr', 'src' ).and( 'include', 'i.optimole.com' ).and( 'include', 'w:auto/h:auto' ); } ); it( 'All images should have proper tags', function () { - cy.get( 'img' ).should( 'have.attr', 'src' ).and( 'include', 'i.optimole.com' ); + cy.get( 'img:not(.emoji)' ).should( 'have.attr', 'src' ).and( 'include', 'i.optimole.com' ); } ); } ); describe( 'Test quick view', function () { diff --git a/inc/admin.php b/inc/admin.php index 843870b1..76acd22b 100755 --- a/inc/admin.php +++ b/inc/admin.php @@ -383,10 +383,10 @@ public function add_dns_prefetch( $hints, $relation_type ) { if ( ! $this->settings->is_enabled() ) { return $hints; } - $hints[] = sprintf( '//%s', $this->settings->get_cdn_url() ); + $hints[] = sprintf( 'https://%s', $this->settings->get_cdn_url() ); - if ( ! $this->settings->use_lazyload() ) { - $hints[] = sprintf( '//%s', OPTML_JS_CDN ); + if ( $this->settings->use_lazyload() ) { + $hints[] = sprintf( 'https://%s', OPTML_JS_CDN ); } return $hints;