Renew now
diff --git a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/Extractor/extract.php b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/Extractor/extract.php
index 6b00002dff..4867d2f562 100644
--- a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/Extractor/extract.php
+++ b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/Extractor/extract.php
@@ -19,7 +19,7 @@
'.header-bg-image' => [
[
'selector' => '.header-bg-image',
- 'url' => 'url(\'http://localhost/app/themes/avadanta-trade/assets/images/header-bg.jpg\')',
+ 'url' => 'http://localhost/app/themes/avadanta-trade/assets/images/header-bg.jpg',
'original' => 'url(\'http://localhost/app/themes/avadanta-trade/assets/images/header-bg.jpg\')',
'block' => ".header-bg-image
{
@@ -30,7 +30,7 @@
'.internal-css-background-image' => [
[
'selector' => '.internal-css-background-image',
- 'url' => 'url(\'/wp-content/rocket-test-data/images/paper.jpeg\')',
+ 'url' => '/wp-content/rocket-test-data/images/paper.jpeg',
'original' => 'url("/wp-content/rocket-test-data/images/paper.jpeg")',
'block' => '.internal-css-background-image{
width: 100%;
@@ -43,7 +43,7 @@
'.internal-css-background-images' => [
[
'selector' => '.internal-css-background-images',
- 'url' => "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test.png')",
+ 'url' => "https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test.png",
'original' => "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test.png')",
'block' => ".internal-css-background-images{
width: 100%;
@@ -54,7 +54,7 @@
],
[
'selector' => '.internal-css-background-images',
- 'url' => 'url(\'/wp-content/rocket-test-data/images/paper.jpeg\')',
+ 'url' => '/wp-content/rocket-test-data/images/paper.jpeg',
'original' => 'url( "/wp-content/rocket-test-data/images/paper.jpeg" )',
'block' => '.internal-css-background-images{
width: 100%;
@@ -67,7 +67,7 @@
'.fl-node-reyn24wd18os > .fl-row-content-wrap' => [
[
'selector' => '.fl-node-reyn24wd18os > .fl-row-content-wrap',
- 'url' => "url('https://www.villmarksbua.no/wp-content/uploads/2022/03/nordic-pocket-saw-foldbar-tursag-for-tre-og-metall.jpg')",
+ 'url' => "https://www.villmarksbua.no/wp-content/uploads/2022/03/nordic-pocket-saw-foldbar-tursag-for-tre-og-metall.jpg",
'original' => 'url(https://www.villmarksbua.no/wp-content/uploads/2022/03/nordic-pocket-saw-foldbar-tursag-for-tre-og-metall.jpg)',
'block' => '.fl-node-reyn24wd18os > .fl-row-content-wrap {
background-image: url(https://www.villmarksbua.no/wp-content/uploads/2022/03/nordic-pocket-saw-foldbar-tursag-for-tre-og-metall.jpg);
@@ -77,7 +77,7 @@
'.internal-css-background-image-gradient' => [
[
'selector' => '.internal-css-background-image-gradient',
- 'url' => 'url(\'/wp-content/rocket-test-data/images/paper.jpeg\')',
+ 'url' => '/wp-content/rocket-test-data/images/paper.jpeg',
'original' => 'url("/wp-content/rocket-test-data/images/paper.jpeg")',
'block' => '.internal-css-background-image-gradient{
width: 100%;
@@ -89,7 +89,7 @@
'.internal-css-background' => [
[
'selector' => '.internal-css-background',
- 'url' => "url('/wp-content/rocket-test-data/images/test.png')",
+ 'url' => "/wp-content/rocket-test-data/images/test.png",
'original' => "url('/wp-content/rocket-test-data/images/test.png')",
'block' => ".internal-css-background{
background: url('/wp-content/rocket-test-data/images/test.png');
@@ -99,7 +99,7 @@
'.internal-css-background404' => [
[
'selector' => '.internal-css-background404',
- 'url' => "url('/wp-content/rocket-test-data/images/testnotExist.png')",
+ 'url' => "/wp-content/rocket-test-data/images/testnotExist.png",
'original' => "url('/wp-content/rocket-test-data/images/testnotExist.png')",
'block' => ".internal-css-background404{
background: url('/wp-content/rocket-test-data/images/testnotExist.png');
@@ -109,7 +109,7 @@
'#internal-BG-images' => [
[
'selector' => '#internal-BG-images',
- 'url' => 'url(\'/wp-content/rocket-test-data/images/butterfly.avif\')',
+ 'url' => '/wp-content/rocket-test-data/images/butterfly.avif',
'original' => 'url(/wp-content/rocket-test-data/images/butterfly.avif)',
'block' => '#internal-BG-images {
background: url(/wp-content/rocket-test-data/images/butterfly.avif) right bottom no-repeat, url(/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff) left top repeat;
@@ -118,7 +118,7 @@
],
[
'selector' => '#internal-BG-images',
- 'url' => 'url(\'/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff\')',
+ 'url' => '/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff',
'original' => 'url(/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff)',
'block' => '#internal-BG-images {
background: url(/wp-content/rocket-test-data/images/butterfly.avif) right bottom no-repeat, url(/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff) left top repeat;
@@ -127,13 +127,13 @@
],
[
'selector' => '#internal-BG-images',
- 'url' => 'url(\'/wp-content/rocket-test-data/images/butterfly.avif\')',
+ 'url' => '/wp-content/rocket-test-data/images/butterfly.avif',
'original' => 'url(/wp-content/rocket-test-data/images/butterfly.avif)',
'block' => '#internal-BG-images{background:url(/wp-content/rocket-test-data/images/butterfly.avif) right bottom no-repeat, url(/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff) left top repeat;padding:15px;}'
],
[
'selector' => '#internal-BG-images',
- 'url' => 'url(\'/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff\')',
+ 'url' => '/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff',
'original' => 'url(/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff)',
'block' => '#internal-BG-images{background:url(/wp-content/rocket-test-data/images/butterfly.avif) right bottom no-repeat, url(/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff) left top repeat;padding:15px;}'
],
@@ -141,7 +141,7 @@
'[class^="icon-"], [class*=" icon-"]' => [
[
'selector' => '[class^="icon-"], [class*=" icon-"]',
- 'url' => "url('../img/glyphicons-halflings.png')",
+ 'url' => "../img/glyphicons-halflings.png",
'original' => 'url("../img/glyphicons-halflings.png")',
'block' => '[class^="icon-"], [class*=" icon-"] {
display: inline-block;
@@ -160,7 +160,7 @@
'[title~="wp-rocket"]' => [
[
'selector' => '[title~="wp-rocket"]',
- 'url' => "url('/wp-content/rocket-test-data/images/wp-rocket.svg')",
+ 'url' => "/wp-content/rocket-test-data/images/wp-rocket.svg",
'original' => 'url("/wp-content/rocket-test-data/images/wp-rocket.svg")',
'block' => '[title~="wp-rocket"] {
background: url("/wp-content/rocket-test-data/images/wp-rocket.svg") no-repeat;
@@ -170,7 +170,7 @@
'[title~="wp-rocket-image"]' => [
[
'selector' => '[title~="wp-rocket-image"]',
- 'url' => "url('/wp-content/rocket-test-data/images/wp-rocket.svg')",
+ 'url' => "/wp-content/rocket-test-data/images/wp-rocket.svg",
'original' => 'url("/wp-content/rocket-test-data/images/wp-rocket.svg")',
'block' => '[title~="wp-rocket-image"] {
background-image: url("/wp-content/rocket-test-data/images/wp-rocket.svg") no-repeat;
@@ -180,7 +180,7 @@
'.external-css-background-image' => [
[
'selector' => '.external-css-background-image',
- 'url' => 'url(\'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/paper.jpeg\')',
+ 'url' => 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/paper.jpeg',
'original' => 'url("https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/paper.jpeg")',
'block' => '.external-css-background-image{
width: 100%;
@@ -193,7 +193,7 @@
'.external-css-background-images' => [
[
'selector' => '.external-css-background-images',
- 'url' => "url('/wp-content/rocket-test-data/images/test.png')",
+ 'url' => "/wp-content/rocket-test-data/images/test.png",
'original' => "url('/wp-content/rocket-test-data/images/test.png')",
'block' => '.external-css-background-images{
width: 100%;
@@ -204,7 +204,7 @@
],
[
'selector' => '.external-css-background-images',
- 'url' => 'url(\'/wp-content/rocket-test-data/images/paper.jpeg\')',
+ 'url' => '/wp-content/rocket-test-data/images/paper.jpeg',
'original' => 'url( "/wp-content/rocket-test-data/images/paper.jpeg" )',
'block' => '.external-css-background-images{
width: 100%;
@@ -217,7 +217,7 @@
'.external-css-background-image-gradient' => [
[
'selector' => '.external-css-background-image-gradient',
- 'url' => 'url(\'/wp-content/rocket-test-data/images/paper.jpeg\')',
+ 'url' => '/wp-content/rocket-test-data/images/paper.jpeg',
'original' => 'url(/wp-content/rocket-test-data/images/paper.jpeg)',
'block' => '.external-css-background-image-gradient{
width: 100%;
@@ -229,7 +229,7 @@
'.external-css-background' => [
[
'selector' => '.external-css-background',
- 'url' => "url('/test.png')",
+ 'url' => "/test.png",
'original' => "url('/test.png')",
'block' => ".external-css-background{
background: url('/test.png') no-repeat;
@@ -239,7 +239,7 @@
],
[
'selector' => '.external-css-background',
- 'url' => "url('/test2.png')",
+ 'url' => "/test2.png",
'original' => "url('/test2.png')",
'block' => ".external-css-background{
background: url('/test.png') no-repeat;
@@ -251,7 +251,7 @@
'.external-css-backgroundsvg' => [
[
'selector' => '.external-css-backgroundsvg',
- 'url' => "url('https://upload.wikimedia.org/wikipedia/commons/1/11/Test-Logo.svg')",
+ 'url' => "https://upload.wikimedia.org/wikipedia/commons/1/11/Test-Logo.svg",
'original' => "url('https://upload.wikimedia.org/wikipedia/commons/1/11/Test-Logo.svg')",
'block' => ".external-css-backgroundsvg{
/*
diff --git a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/MappingFormatter/format.php b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/MappingFormatter/format.php
index 4db627d1e4..5b3751e46c 100644
--- a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/MappingFormatter/format.php
+++ b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/MappingFormatter/format.php
@@ -18,13 +18,15 @@
'expected' => [
[
'selector' => '#first_id',
- 'style' => ':root{--wpr-bg-a122ad12df3: http://example.org;}',
+ 'style' => '#first_id{--wpr-bg-a122ad12df3: url(\'http://example.org\');}',
'hash' => 'a122ad12df3',
+ 'url' => 'http://example.org',
],
[
'selector' => '#second_id',
- 'style' => ':root{--wpr-bg-a122ad12df2: http://example.org/test;}',
+ 'style' => '#second_id{--wpr-bg-a122ad12df2: url(\'http://example.org/test\');}',
'hash' => 'a122ad12df2',
+ 'url' => 'http://example.org/test',
]
]
],
@@ -116,83 +118,99 @@
'expected' => [
[
'selector' => '#first_id',
- 'style' => ':root{--wpr-bg-a122ad12df3: http://example.org;}',
+ 'style' => '#first_id::before{--wpr-bg-a122ad12df3: url(\'http://example.org\');}',
'hash' => 'a122ad12df3',
+ 'url' => 'http://example.org',
],
[
'selector' => '#second_id, #test',
- 'style' => ':root{--wpr-bg-a122ad12df2: http://example.org/test;}',
+ 'style' => '#second_id::after, #test{--wpr-bg-a122ad12df2: url(\'http://example.org/test\');}',
'hash' => 'a122ad12df2',
+ 'url' => 'http://example.org/test',
],
[
'selector' => 'body',
- 'style' => ':root{--wpr-bg-a122ad12df3: http://example.org/test;}',
+ 'style' => '::after{--wpr-bg-a122ad12df3: url(\'http://example.org/test\');}',
'hash' => 'a122ad12df3',
+ 'url' => 'http://example.org/test',
],
[
'selector' => 'body',
- 'style' => ':root{--wpr-bg-a122ad12df3: http://example.org/test;}',
+ 'style' => '::after{--wpr-bg-a122ad12df3: url(\'http://example.org/test\');}',
'hash' => 'a122ad12df3',
+ 'url' => 'http://example.org/test',
],
[
'selector' => 'dd:nth-last-of-type(3n)',
- 'style' => ':root{--wpr-bg-a21ss2: images/underline.png;}',
+ 'style' => 'dd:nth-last-of-type(3n){--wpr-bg-a21ss2: url(\'images/underline.png\');}',
'hash' => 'a21ss2',
+ 'url' => 'images/underline.png',
],
[
'selector' => '.background-image~*',
- 'style' => ':root{--wpr-bg-a21ss4: images/maxime-lebrun-6g3Akg708E0-unsplash.jpg;}',
+ 'style' => '.background-image~:after{--wpr-bg-a21ss4: url(\'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg\');}',
'hash' => 'a21ss4',
+ 'url' => 'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg',
],
[
'selector' => '.background-image>*',
- 'style' => ':root{--wpr-bg-a21ss8: images/maxime-lebrun-6g3Akg708E0-unsplash.jpg;}',
+ 'style' => '.background-image>:before,.background-image>:after{--wpr-bg-a21ss8: url(\'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg\');}',
'hash' => 'a21ss8',
+ 'url' => 'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg',
],
[
'selector' => '.background-image>*',
- 'style' => ':root{--wpr-bg-a21ss18: images/maxime-lebrun-6g3Akg708E0-unsplash.jpg;}',
+ 'style' => '.background-image>::before,.background-image>::after{--wpr-bg-a21ss18: url(\'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg\');}',
'hash' => 'a21ss18',
+ 'url' => 'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg',
],
[
'selector' => '.background-image>*',
- 'style' => ':root{--wpr-bg-a21ss18: images/maxime-lebrun-6g3Akg708E0-unsplash.jpg;}',
+ 'style' => '.background-image>::before{--wpr-bg-a21ss18: url(\'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg\');}',
'hash' => 'a21ss18',
+ 'url' => 'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg',
],
[
'selector' => '.background-image',
- 'style' => ':root{--wpr-bg-a21ss25: images/maxime-lebrun-6g3Akg708E0-unsplash.jpg;}',
+ 'style' => '.background-image::first-letter{--wpr-bg-a21ss25: url(\'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg\');}',
'hash' => 'a21ss25',
+ 'url' => 'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg',
],
[
'selector' => '.subscribe',
- 'style' => ':root{--wpr-bg-a21ss25: images/maxime-lebrun-6g3Akg708E0-unsplash.jpg;}',
+ 'style' => '.subscribe:active{--wpr-bg-a21ss25: url(\'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg\');}',
'hash' => 'a21ss25',
+ 'url' => 'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg',
],
[
'selector' => '.subscribe',
- 'style' => ':root{--wpr-bg-a21ss25: images/maxime-lebrun-6g3Akg708E0-unsplash.jpg;}',
+ 'style' => '.subscribe:focus{--wpr-bg-a21ss25: url(\'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg\');}',
'hash' => 'a21ss25',
+ 'url' => 'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg',
],
[
'selector' => '.subscribe',
- 'style' => ':root{--wpr-bg-a21ss25: images/maxime-lebrun-6g3Akg708E0-unsplash.jpg;}',
+ 'style' => '.subscribe:hover{--wpr-bg-a21ss25: url(\'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg\');}',
'hash' => 'a21ss25',
+ 'url' => 'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg',
],
[
'selector' => 'a',
- 'style' => ':root{--wpr-bg-a21ss25: images/maxime-lebrun-6g3Akg708E0-unsplash.jpg;}',
+ 'style' => 'a:visited{--wpr-bg-a21ss25: url(\'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg\');}',
'hash' => 'a21ss25',
+ 'url' => 'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg'
],
[
'selector' => '.subscribe',
- 'style' => ':root{--wpr-bg-a21ss25: images/maxime-lebrun-6g3Akg708E0-unsplash.jpg;}',
+ 'style' => '.subscribe:focus-within{--wpr-bg-a21ss25: url(\'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg\');}',
'hash' => 'a21ss25',
+ 'url' => 'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg',
],
[
'selector' => '.subscribe',
- 'style' => ':root{--wpr-bg-a21ss25: images/maxime-lebrun-6g3Akg708E0-unsplash.jpg;}',
+ 'style' => '.subscribe:focus-visible{--wpr-bg-a21ss25: url(\'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg\');}',
'hash' => 'a21ss25',
+ 'url' => 'images/maxime-lebrun-6g3Akg708E0-unsplash.jpg',
],
]
],
diff --git a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/TagGenerator/generate.php b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/TagGenerator/generate.php
index 91337995de..ef28a4dde8 100644
--- a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/TagGenerator/generate.php
+++ b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Front/TagGenerator/generate.php
@@ -1,7 +1,7 @@
+
diff --git a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyCssFiles.php b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyCssFiles.php
index f3b13a04e1..a44adce682 100644
--- a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyCssFiles.php
+++ b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyCssFiles.php
@@ -122,12 +122,15 @@
],
'extract' => [
'content1' => [
- 'selector' => [
- [
- 'url' => 'url'
+ 'css_file' => 'example.org/css',
+ 'results' => [
+ 'selector' => [
+ [
+ 'url' => 'url'
+ ]
]
]
- ]
+ ],
],
'rule_format' => [
[
@@ -181,9 +184,22 @@
]]),
],
'generate_url' => [
- 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/lazyload_css_background_images2.css' => 'example.org/css3',
- '/wp-content/rocket-test-data/styles/lazyload_css_background_images.css' => 'example.org/css',
- 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/lazyload_css_background_images.min.css' => 'example.org/css2',
+ [
+ 'url' => 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/lazyload_css_background_images2.css',
+ 'output' => 'example.org/css3'
+ ],
+ [
+ 'url' => '/wp-content/rocket-test-data/styles/lazyload_css_background_images.css',
+ 'output' => 'example.org/css',
+ ],
+ [
+ 'url' => '/wp-content/rocket-test-data/styles/lazyload_css_background_images.css',
+ 'output' => 'example.org/css',
+ ],
+ [
+ 'url' => 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/lazyload_css_background_images.min.css',
+ 'output' => 'example.org/css2',
+ ],
],
'generate_path' => [
'/wp-content/rocket-test-data/styles/lazyload_css_background_images.css' => 'path1',
diff --git a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyInlineCss.php b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyInlineCss.php
index 75c80ccdf6..b85a5e4b74 100644
--- a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyInlineCss.php
+++ b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyInlineCss.php
@@ -90,7 +90,7 @@
'data' => [
'css_inline' => [
$css_content
- ],
+ ],
],
'extract' => [],
'rule_format' => [],
@@ -123,17 +123,20 @@
],
'extract' => [
$css_content => [
- 'selector' => [
- [
- 'url' => '/wp-content/rocket-test-data/images/paper.jpeg',
- ],
- [
- 'url' => 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test.png',
+ 'css_file' => '',
+ 'results' => [
+ 'selector' => [
+ [
+ 'url' => '/wp-content/rocket-test-data/images/paper.jpeg',
+ ],
+ [
+ 'url' => 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test.png',
+ ],
+ [
+ 'url' => '/wp-content/rocket-test-data/images/paper.jpeg',
+ ],
],
- [
- 'url' => '/wp-content/rocket-test-data/images/paper.jpeg',
- ],
- ]
+ ],
],
],
'rule_format' => [
diff --git a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/CSS/external.css.json b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/CSS/external.css.json
index 26469b2f64..7f65076f4e 100644
--- a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/CSS/external.css.json
+++ b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/CSS/external.css.json
@@ -1 +1 @@
-[{"selector":".external-css-background","style":":root{--wpr-bg-17ef10: url('https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg');}","hash":"17ef10"},{"selector":".external-css-background-image","style":":root{--wpr-bg-18ef11: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"18ef11"},{"selector":".external-css-background-images","style":":root{--wpr-bg-19ef12: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/.\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"19ef12"},{"selector":".external-css-background-images","style":":root{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18"},{"selector":".external-css-background-image-gradient","style":":root{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18"},{"selector":".external-css-background-image-space","style":":root{--wpr-bg-20ef13: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/..\/rocket-test-data\/images\/papertest.jpeg');}","hash":"20ef13"},{"selector":".external-css-background-image-space","style":":root{--wpr-bg-21ef14: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/papertest.jpeg');}","hash":"21ef14"}]
+[{"selector":".external-css-background","style":".external-css-background{--wpr-bg-17ef10: url('https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg');}","hash":"17ef10","url":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg"},{"selector":".external-css-background-image","style":".external-css-background-image{--wpr-bg-18ef11: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"18ef11","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".external-css-background-images","style":".external-css-background-images{--wpr-bg-19ef12: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/.\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"19ef12","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/.\/wp-content\/rocket-test-data\/images\/test.png"},{"selector":".external-css-background-images","style":".external-css-background-images{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".external-css-background-image-gradient","style":".external-css-background-image-gradient{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".external-css-background-image-space","style":".external-css-background-image-space{--wpr-bg-20ef13: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/..\/rocket-test-data\/images\/papertest.jpeg');}","hash":"20ef13","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/..\/rocket-test-data\/images\/papertest.jpeg"},{"selector":".external-css-background-image-space","style":".external-css-background-image-space{--wpr-bg-21ef14: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/papertest.jpeg');}","hash":"21ef14","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/papertest.jpeg"}]
diff --git a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/CSS/lazyload.css.json b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/CSS/lazyload.css.json
index fd00aaf012..6cd6a224c1 100644
--- a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/CSS/lazyload.css.json
+++ b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/CSS/lazyload.css.json
@@ -1 +1 @@
-[{"selector":".external-css-background","style":":root{--wpr-bg-16ef9: url('http:\/\/example.org\/test.png');}","hash":"16ef9"},{"selector":".external-css-backgroundsvg","style":":root{--wpr-bg-17ef10: url('https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg');}","hash":"17ef10"},{"selector":".external-css-background-image","style":":root{--wpr-bg-18ef11: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"18ef11"},{"selector":".external-css-background-images","style":":root{--wpr-bg-15ef8: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"15ef8"},{"selector":".external-css-background-images","style":":root{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18"},{"selector":".external-css-background-image-gradient","style":":root{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18"}]
+[{"selector":".external-css-background","style":".external-css-background{--wpr-bg-16ef9: url('http:\/\/example.org\/test.png');}","hash":"16ef9","url":"http:\/\/example.org\/test.png"},{"selector":".external-css-backgroundsvg","style":".external-css-backgroundsvg{--wpr-bg-17ef10: url('https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg');}","hash":"17ef10","url":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg"},{"selector":".external-css-background-image","style":".external-css-background-image{--wpr-bg-18ef11: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"18ef11","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".external-css-background-images","style":".external-css-background-images{--wpr-bg-15ef8: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"15ef8","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/test.png"},{"selector":".external-css-background-images","style":".external-css-background-images{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".external-css-background-image-gradient","style":".external-css-background-image-gradient{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"}]
diff --git a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/HTML/html_excluded.php b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/HTML/html_excluded.php
index bde8ce5ae7..7bf875ada2 100644
--- a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/HTML/html_excluded.php
+++ b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/HTML/html_excluded.php
@@ -37,16 +37,16 @@
}
-->
-
+ .external-css-background-images{--wpr-bg-15ef8: url('http://example.org/wp-content/rocket-test-data/images/test.png');}.external-css-background-images{--wpr-bg-25ef18: url('http://example.org/wp-content/rocket-test-data/images/paper.jpeg');}.external-css-background-images{--wpr-bg-19ef12: url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/./wp-content/rocket-test-data/images/test.png');}
+ const rocket_pairs = [{"selector":".external-css-background","style":".external-css-background{--wpr-bg-16ef9: url('http:\/\/example.org\/test.png');}","hash":"16ef9","url":"http:\/\/example.org\/test.png"},{"selector":".external-css-backgroundsvg","style":".external-css-backgroundsvg{--wpr-bg-17ef10: url('https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg');}","hash":"17ef10","url":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg"},{"selector":".external-css-background-image","style":".external-css-background-image{--wpr-bg-18ef11: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"18ef11","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".external-css-background-image-gradient","style":".external-css-background-image-gradient{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".external-css-background","style":".external-css-background{--wpr-bg-17ef10: url('https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg');}","hash":"17ef10","url":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg"},{"selector":".external-css-background-image-space","style":".external-css-background-image-space{--wpr-bg-20ef13: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/..\/rocket-test-data\/images\/papertest.jpeg');}","hash":"20ef13","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/..\/rocket-test-data\/images\/papertest.jpeg"},{"selector":".external-css-background-image-space","style":".external-css-background-image-space{--wpr-bg-21ef14: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/papertest.jpeg');}","hash":"21ef14","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/papertest.jpeg"},{"selector":".internal-css-background","style":".internal-css-background{--wpr-bg-15ef8: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"15ef8","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/test.png"},{"selector":".internal-css-background404","style":".internal-css-background404{--wpr-bg-22ef15: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/testnotExist.png');}","hash":"22ef15","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/testnotExist.png"},{"selector":"#internal-BG-images","style":"#internal-BG-images{--wpr-bg-23ef16: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/butterfly.avif');}","hash":"23ef16","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/butterfly.avif"},{"selector":"#internal-BG-images","style":"#internal-BG-images{--wpr-bg-24ef17: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/file_example_TIFF_1MB.tiff');}","hash":"24ef17","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/file_example_TIFF_1MB.tiff"},{"selector":".internal-css-background-image","style":".internal-css-background-image{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".internal-css-background-images","style":".internal-css-background-images{--wpr-bg-26ef19: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"26ef19","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/test.png"},{"selector":".internal-css-background-images","style":".internal-css-background-images{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".internal-css-background-image-gradient","style":".internal-css-background-image-gradient{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"}]; const rocket_excluded_pairs = [{"selector":".external-css-background-images","style":".external-css-background-images{--wpr-bg-15ef8: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"15ef8","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/test.png"},{"selector":".external-css-background-images","style":".external-css-background-images{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".external-css-background-images","style":".external-css-background-images{--wpr-bg-19ef12: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/.\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"19ef12","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/.\/wp-content\/rocket-test-data\/images\/test.png"}];
diff --git a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/HTML/html_output.php b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/HTML/html_output.php
index f86d2caebc..6a4d24e2ba 100644
--- a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/HTML/html_output.php
+++ b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/HTML/html_output.php
@@ -38,16 +38,16 @@
}
-->
-
+ const rocket_pairs = [{"selector":".external-css-background","style":".external-css-background{--wpr-bg-16ef9: url('http:\/\/example.org\/test.png');}","hash":"16ef9","url":"http:\/\/example.org\/test.png"},{"selector":".external-css-backgroundsvg","style":".external-css-backgroundsvg{--wpr-bg-17ef10: url('https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg');}","hash":"17ef10","url":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg"},{"selector":".external-css-background-image","style":".external-css-background-image{--wpr-bg-18ef11: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"18ef11","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".external-css-background-images","style":".external-css-background-images{--wpr-bg-15ef8: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"15ef8","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/test.png"},{"selector":".external-css-background-images","style":".external-css-background-images{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".external-css-background-image-gradient","style":".external-css-background-image-gradient{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".external-css-background","style":".external-css-background{--wpr-bg-hash: url('http:\/\/example.org\/test_excluded.png');}","hash":"hash","url":"http:\/\/example.org\/test_excluded.png"},{"selector":".external-css-background","style":".external-css-background{--wpr-bg-17ef10: url('https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg');}","hash":"17ef10","url":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/11\/Test-Logo.svg"},{"selector":".external-css-background-images","style":".external-css-background-images{--wpr-bg-19ef12: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/.\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"19ef12","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/.\/wp-content\/rocket-test-data\/images\/test.png"},{"selector":".external-css-background-image-space","style":".external-css-background-image-space{--wpr-bg-20ef13: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/..\/rocket-test-data\/images\/papertest.jpeg');}","hash":"20ef13","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/styles\/..\/rocket-test-data\/images\/papertest.jpeg"},{"selector":".external-css-background-image-space","style":".external-css-background-image-space{--wpr-bg-21ef14: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/papertest.jpeg');}","hash":"21ef14","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/papertest.jpeg"},{"selector":".internal-css-background","style":".internal-css-background{--wpr-bg-15ef8: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"15ef8","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/test.png"},{"selector":".internal-css-background404","style":".internal-css-background404{--wpr-bg-22ef15: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/testnotExist.png');}","hash":"22ef15","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/testnotExist.png"},{"selector":"#internal-BG-images","style":"#internal-BG-images{--wpr-bg-23ef16: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/butterfly.avif');}","hash":"23ef16","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/butterfly.avif"},{"selector":"#internal-BG-images","style":"#internal-BG-images{--wpr-bg-24ef17: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/file_example_TIFF_1MB.tiff');}","hash":"24ef17","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/file_example_TIFF_1MB.tiff"},{"selector":".internal-css-background-image","style":".internal-css-background-image{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".internal-css-background-images","style":".internal-css-background-images{--wpr-bg-26ef19: url('https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/test.png');}","hash":"26ef19","url":"https:\/\/new.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/test.png"},{"selector":".internal-css-background-images","style":".internal-css-background-images{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"},{"selector":".internal-css-background-image-gradient","style":".internal-css-background-image-gradient{--wpr-bg-25ef18: url('http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg');}","hash":"25ef18","url":"http:\/\/example.org\/wp-content\/rocket-test-data\/images\/paper.jpeg"}]; const rocket_excluded_pairs = [];
Background images from internal CSS
diff --git a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/maybeReplaceCssImages.php b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/maybeReplaceCssImages.php
index 74bd343f04..f72957137d 100644
--- a/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/maybeReplaceCssImages.php
+++ b/tests/Fixtures/inc/Engine/Media/Lazyload/CSS/Subscriber/integration/maybeReplaceCssImages.php
@@ -33,18 +33,18 @@
],
'excluded' => [],
'hash_mapping' => [
- "url('http://example.org/wp-content/rocket-test-data/images/test.png')" => '15ef8',
- "url('http://example.org/test.png')" => '16ef9',
- "url('https://upload.wikimedia.org/wikipedia/commons/1/11/Test-Logo.svg')" => '17ef10',
- "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/paper.jpeg')" => '18ef11',
- "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/./wp-content/rocket-test-data/images/test.png')" => '19ef12',
- "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/../rocket-test-data/images/papertest.jpeg')" => '20ef13',
- "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/papertest.jpeg')" => '21ef14',
- "url('http://example.org/wp-content/rocket-test-data/images/testnotExist.png')" => '22ef15',
- "url('http://example.org/wp-content/rocket-test-data/images/butterfly.avif')" => '23ef16',
- "url('http://example.org/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff')" => '24ef17',
- "url('http://example.org/wp-content/rocket-test-data/images/paper.jpeg')" => '25ef18',
- "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test.png')" => '26ef19',
+ "http://example.org/wp-content/rocket-test-data/images/test.png" => '15ef8',
+ "http://example.org/test.png" => '16ef9',
+ "https://upload.wikimedia.org/wikipedia/commons/1/11/Test-Logo.svg" => '17ef10',
+ "https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/paper.jpeg" => '18ef11',
+ "https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/./wp-content/rocket-test-data/images/test.png" => '19ef12',
+ "https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/../rocket-test-data/images/papertest.jpeg" => '20ef13',
+ "https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/papertest.jpeg" => '21ef14',
+ "http://example.org/wp-content/rocket-test-data/images/testnotExist.png" => '22ef15',
+ "http://example.org/wp-content/rocket-test-data/images/butterfly.avif" => '23ef16',
+ "http://example.org/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff" => '24ef17',
+ "http://example.org/wp-content/rocket-test-data/images/paper.jpeg" => '25ef18',
+ "https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test.png" => '26ef19',
],
],
'expected' => [
@@ -93,18 +93,18 @@
'http://example.org/wp-content/rocket-test-data/styles/excluded.css'
],
'hash_mapping' => [
- "url('http://example.org/wp-content/rocket-test-data/images/test.png')" => '15ef8',
- "url('http://example.org/test.png')" => '16ef9',
- "url('https://upload.wikimedia.org/wikipedia/commons/1/11/Test-Logo.svg')" => '17ef10',
- "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/paper.jpeg')" => '18ef11',
- "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/./wp-content/rocket-test-data/images/test.png')" => '19ef12',
- "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/../rocket-test-data/images/papertest.jpeg')" => '20ef13',
- "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/papertest.jpeg')" => '21ef14',
- "url('http://example.org/wp-content/rocket-test-data/images/testnotExist.png')" => '22ef15',
- "url('http://example.org/wp-content/rocket-test-data/images/butterfly.avif')" => '23ef16',
- "url('http://example.org/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff')" => '24ef17',
- "url('http://example.org/wp-content/rocket-test-data/images/paper.jpeg')" => '25ef18',
- "url('https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test.png')" => '26ef19',
+ "http://example.org/wp-content/rocket-test-data/images/test.png" => '15ef8',
+ "http://example.org/test.png" => '16ef9',
+ "https://upload.wikimedia.org/wikipedia/commons/1/11/Test-Logo.svg" => '17ef10',
+ "https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/paper.jpeg" => '18ef11',
+ "https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/./wp-content/rocket-test-data/images/test.png" => '19ef12',
+ "https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/../rocket-test-data/images/papertest.jpeg" => '20ef13',
+ "https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/papertest.jpeg" => '21ef14',
+ "http://example.org/wp-content/rocket-test-data/images/testnotExist.png" => '22ef15',
+ "http://example.org/wp-content/rocket-test-data/images/butterfly.avif" => '23ef16',
+ "http://example.org/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff" => '24ef17',
+ "http://example.org/wp-content/rocket-test-data/images/paper.jpeg" => '25ef18',
+ "https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test.png" => '26ef19',
],
],
'expected' => [
diff --git a/tests/Fixtures/inc/Engine/Preload/Subscriber/updateCacheRow.php b/tests/Fixtures/inc/Engine/Preload/Subscriber/updateCacheRow.php
index d7ed13bbb3..5811b45931 100644
--- a/tests/Fixtures/inc/Engine/Preload/Subscriber/updateCacheRow.php
+++ b/tests/Fixtures/inc/Engine/Preload/Subscriber/updateCacheRow.php
@@ -3,6 +3,7 @@
'testCallActionWhenPreloaded' => [
'config' => [
'regexes' => [],
+ 'manual_preload' => true,
'links' => [
[
'url' => 'http://example.org',
@@ -25,6 +26,7 @@
'testNoCallActionWhenNotPreloaded' => [
'config' => [
'regexes' => [],
+ 'manual_preload' => true,
'links' => [
[
'url' => 'http://example.org',
@@ -49,6 +51,7 @@
'regexes' => [
'(.*)example.org(.*)'
],
+ 'manual_preload' => true,
'links' => [
[
'url' => 'http://example.org',
@@ -66,5 +69,23 @@
],
]
]
- ]
+ ],
+ 'testShouldBailOutWHenPreloadDisabled' => [
+ 'config' => [
+ 'regexes' => [],
+ 'manual_preload' => false,
+ 'links' => [
+ ],
+ 'is_preloaded' => false,
+ ],
+ 'expected' => [
+ 'url' => 'http://example.org',
+ 'exists' => false,
+ 'links' => [
+ [
+ 'url' => 'http://example.org',
+ ],
+ ],
+ ],
+ ],
];
diff --git a/tests/Integration/inc/Engine/Preload/Subscriber/updateCacheRow.php b/tests/Integration/inc/Engine/Preload/Subscriber/updateCacheRow.php
index 2275f4c721..beed3a6534 100644
--- a/tests/Integration/inc/Engine/Preload/Subscriber/updateCacheRow.php
+++ b/tests/Integration/inc/Engine/Preload/Subscriber/updateCacheRow.php
@@ -22,6 +22,7 @@ public function set_up()
{
parent::set_up();
add_filter('rocket_preload_exclude_urls', [$this, 'excluded']);
+ add_filter('pre_get_rocket_option_manual_preload', [$this, 'manual_preload']);
}
public static function tear_down_after_class()
@@ -33,6 +34,7 @@ public static function tear_down_after_class()
public function tear_down()
{
remove_filter('rocket_preload_exclude_urls', [$this, 'excluded']);
+ remove_filter('pre_get_rocket_option_manual_preload', [$this, 'rucss']);
parent::tear_down();
}
@@ -48,6 +50,7 @@ public function testShouldDoAsExpected($config, $expected) {
do_action('rocket_after_process_buffer');
+
if($config['is_preloaded']) {
$this->assertGreaterThan( 0, did_action('rocket_preload_completed') );
}
@@ -64,4 +67,8 @@ public function providerTestData() {
public function excluded($regexes): array {
return array_merge($regexes, $this->config['regexes']);
}
+
+ public function manual_preload() {
+ return $this->config['manual_preload'];
+ }
}
diff --git a/tests/Integration/inc/ThirdParty/Plugins/Smush/isSmushIframesLazyloadActive.php b/tests/Integration/inc/ThirdParty/Plugins/Smush/isSmushIframesLazyloadActive.php
index ddb24e9724..d4c9ce5452 100644
--- a/tests/Integration/inc/ThirdParty/Plugins/Smush/isSmushIframesLazyloadActive.php
+++ b/tests/Integration/inc/ThirdParty/Plugins/Smush/isSmushIframesLazyloadActive.php
@@ -7,6 +7,7 @@
* @group ThirdParty
* @group Smush
* @group WithSmush
+ * @requires PHP >= 7.4
*/
class Test_IsSmushIframesLazyloadActive extends SmushSubscriberTestCase {
/**
diff --git a/tests/Integration/inc/ThirdParty/Plugins/Smush/isSmushLazyloadActive.php b/tests/Integration/inc/ThirdParty/Plugins/Smush/isSmushLazyloadActive.php
index 31da1ce9bd..36ed92d8e2 100644
--- a/tests/Integration/inc/ThirdParty/Plugins/Smush/isSmushLazyloadActive.php
+++ b/tests/Integration/inc/ThirdParty/Plugins/Smush/isSmushLazyloadActive.php
@@ -7,6 +7,7 @@
* @group ThirdParty
* @group Smush
* @group WithSmush
+ * @requires PHP >= 7.4
*/
class Test_IsSmushLazyloadActive extends SmushSubscriberTestCase {
/**
diff --git a/tests/Integration/inc/ThirdParty/Plugins/Smush/maybeDeactivateRocketLazyload.php b/tests/Integration/inc/ThirdParty/Plugins/Smush/maybeDeactivateRocketLazyload.php
index ebdabd519b..7007a50f29 100644
--- a/tests/Integration/inc/ThirdParty/Plugins/Smush/maybeDeactivateRocketLazyload.php
+++ b/tests/Integration/inc/ThirdParty/Plugins/Smush/maybeDeactivateRocketLazyload.php
@@ -7,6 +7,7 @@
* @group ThirdParty
* @group Smush
* @group WithSmush
+ * @requires PHP >= 7.4
*/
class Test_MaybeDeactivateRocketLazyload extends SmushSubscriberTestCase {
private $option_hook_prefix = 'pre_get_rocket_option_';
diff --git a/tests/Unit/inc/Engine/Common/Cache/FilesystemCache/generateUrl.php b/tests/Unit/inc/Engine/Common/Cache/FilesystemCache/generateUrl.php
index 2b819fcd9a..2a11a491ca 100644
--- a/tests/Unit/inc/Engine/Common/Cache/FilesystemCache/generateUrl.php
+++ b/tests/Unit/inc/Engine/Common/Cache/FilesystemCache/generateUrl.php
@@ -72,8 +72,6 @@ public function testShouldReturnAsExpected( $config, $expected )
return $default;
});
- $this->filesystem->expects()->exists($expected['path'])->andReturn($config['exists']);
-
$this->assertSame($expected['output'], $this->filesystemcache->generate_url($config['url']));
}
diff --git a/tests/Unit/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyCssFiles.php b/tests/Unit/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyCssFiles.php
index 7229464049..a65c7bccf7 100644
--- a/tests/Unit/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyCssFiles.php
+++ b/tests/Unit/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyCssFiles.php
@@ -48,8 +48,8 @@ public function testShouldReturnAsExpected( $config, $expected )
$this->fetcher->expects()->fetch($path, $data['path'])->andReturn($data['content']);
}
- foreach ($config['extract'] as $content => $urls) {
- $this->extractor->expects()->extract($content)->andReturn($urls);
+ foreach ($config['extract'] as $content => $conf) {
+ $this->extractor->expects()->extract($content, $conf['css_file'])->andReturn($conf['results']);
}
foreach ($config['rule_format'] as $url_tag) {
@@ -69,8 +69,8 @@ public function testShouldReturnAsExpected( $config, $expected )
$this->filesystem_cache->expects()->set($url, $content);
}
- foreach ($config['generate_url'] as $url => $output) {
- $this->filesystem_cache->expects()->generate_url($url)->andReturn($output);
+ foreach ($config['generate_url'] as $conf) {
+ $this->filesystem_cache->expects()->generate_url($conf['url'])->atLeast(1)->atMost(2)->andReturn($conf['output']);
}
foreach ($config['generate_path'] as $url => $path) {
diff --git a/tests/Unit/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyInlineCss.php b/tests/Unit/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyInlineCss.php
index 4b7eccae59..abaaee3f56 100644
--- a/tests/Unit/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyInlineCss.php
+++ b/tests/Unit/inc/Engine/Media/Lazyload/CSS/Subscriber/createLazyInlineCss.php
@@ -24,8 +24,8 @@ public function testShouldReturnAsExpected( $config, $expected )
{
Functions\when('wp_generate_uuid4')->justReturn('hash');
- foreach ($config['extract'] as $content => $urls) {
- $this->extractor->expects()->extract($content)->andReturn($urls);
+ foreach ($config['extract'] as $content => $conf) {
+ $this->extractor->expects()->extract($content, $conf['css_file'])->andReturn($conf['results']);
}
foreach ($config['rule_format'] as $url_tag) {
diff --git a/tests/Unit/inc/Engine/Optimization/RUCSS/Strategy/Strategies/DefaultProcess/execute.php b/tests/Unit/inc/Engine/Optimization/RUCSS/Strategy/Strategies/DefaultProcess/execute.php
index 8c01ec125e..69a4206a00 100644
--- a/tests/Unit/inc/Engine/Optimization/RUCSS/Strategy/Strategies/DefaultProcess/execute.php
+++ b/tests/Unit/inc/Engine/Optimization/RUCSS/Strategy/Strategies/DefaultProcess/execute.php
@@ -1,33 +1,26 @@
used_css_query = $this->createMock( UsedCSS_Query::class );
- $this->wpr_clock = Mockery::mock(WPRClock::class);
-
- $this->strategy = new DefaultProcess($this->used_css_query, $this->wpr_clock);
-
-
+ $this->wpr_clock = Mockery::mock( WPRClock::class );
+ $this->strategy = new DefaultProcess( $this->used_css_query, $this->wpr_clock );
}
public function tearDown(): void {
@@ -37,28 +30,34 @@ public function tearDown(): void {
/**
* @dataProvider configTestData
*/
- public function testShouldBehaveAsExpected( $config, $expected )
- {
+ public function testShouldBehaveAsExpected( $config, $expected ) {
if ( $config['row_details']->retries >= count( $config['time_table'] ) ) {
- Actions\expectDone('rocket_preload_unlock_url')->with($config['row_details']->url);
+ Actions\expectDone( 'rocket_preload_unlock_url' )->with( $config['row_details']->url );
+ $this->used_css_query->expects( self::once() )
+ ->method( 'make_status_failed' )
+ ->with( $config['row_details']->id, strval( $config['job_details']['code'] ), $config['job_details']['message'] );
+ $this->strategy->execute( $config['row_details'], $config['job_details'] );
- $this->used_css_query->expects(self::once())->method('make_status_failed')->with($config['row_details']->id, strval($config['job_details']['code']), $config['job_details']['message']);
- $this->strategy->execute($config['row_details'], $config['job_details']);
return;
}
- $this->used_css_query->expects(self::once())->method('increment_retries')->with( $config['row_details']->id, (int) $config['row_details']->retries);
+ $this->used_css_query->expects( self::once() )
+ ->method( 'increment_retries' )
+ ->with( $config['row_details']->id, (int) $config['job_details']['code'] );
- Filters\expectApplied('rocket_rucss_retry_duration')->andReturn($config['duration_retry']);
+ Filters\expectApplied( 'rocket_rucss_retry_duration' )->andReturn( $config['duration_retry'] );
- $this->wpr_clock->expects('current_time')->with('timestamp', true)->andReturn(0);
+ $this->wpr_clock->expects( 'current_time' )->with( 'timestamp', true )->andReturn( 0 );
// update the `next_retry_time` column.
- $this->used_css_query->expects(self::once())->method('update_message')->with($config['row_details']->id, $config['job_details']['code'], $config['job_details']['message'], $config['row_details']->error_message);
- $this->used_css_query->expects(self::once())->method('update_next_retry_time')->with($config['job_id'], $config['duration_retry']);
+ $this->used_css_query->expects( self::once() )
+ ->method( 'update_message' )
+ ->with( $config['row_details']->id, $config['job_details']['code'], $config['job_details']['message'], $config['row_details']->error_message );
+ $this->used_css_query->expects( self::once() )
+ ->method( 'update_next_retry_time' )
+ ->with( $config['job_id'], $config['duration_retry'] );
- $this->strategy->execute($config['row_details'], $config['job_details']);
- return;
+ $this->strategy->execute( $config['row_details'], $config['job_details'] );
}
}
diff --git a/tests/Unit/inc/Engine/Preload/Subscriber/onPermalinkChanged.php b/tests/Unit/inc/Engine/Preload/Subscriber/onPermalinkChanged.php
index fe31bb7c02..fdf5da6e5a 100644
--- a/tests/Unit/inc/Engine/Preload/Subscriber/onPermalinkChanged.php
+++ b/tests/Unit/inc/Engine/Preload/Subscriber/onPermalinkChanged.php
@@ -38,7 +38,7 @@ protected function setUp(): void
}
public function testShouldDoAsExpected() {
- $this->queue->expects()->add_job_preload_job_load_initial_sitemap_async();
+ $this->options->expects()->get('manual_preload', false)->andReturn(false);
$this->query->expects(self::once())->method('remove_all');
$this->queue->expects()->cancel_pending_jobs();
$this->subscriber->on_permalink_changed();
diff --git a/wp-rocket.php b/wp-rocket.php
index e3ac8ac983..60c7010f7c 100755
--- a/wp-rocket.php
+++ b/wp-rocket.php
@@ -3,7 +3,7 @@
* Plugin Name: WP Rocket
* Plugin URI: https://wp-rocket.me
* Description: The best WordPress performance plugin.
- * Version: 3.15.6
+ * Version: 3.15.7
* Requires at least: 5.8
* Requires PHP: 7.3
* Code Name: Iego
@@ -20,7 +20,7 @@
defined( 'ABSPATH' ) || exit;
// Rocket defines.
-define( 'WP_ROCKET_VERSION', '3.15.6' );
+define( 'WP_ROCKET_VERSION', '3.15.7' );
define( 'WP_ROCKET_WP_VERSION', '5.8' );
define( 'WP_ROCKET_WP_VERSION_TESTED', '6.3.1' );
define( 'WP_ROCKET_PHP_VERSION', '7.3' );