Skip to content

Commit

Permalink
fix: preload lazyload js file when lazyload setting is active
Browse files Browse the repository at this point in the history
  • Loading branch information
selul committed Sep 9, 2019
1 parent a0f30e7 commit 828e1de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/test_woo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
6 changes: 3 additions & 3 deletions inc/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 828e1de

Please sign in to comment.