From 43d3f30382082ef42b2f97b3f35aaa37c8788a5a Mon Sep 17 00:00:00 2001 From: tijmen Date: Tue, 2 Dec 2025 22:06:23 +0100 Subject: [PATCH 1/9] chore: update support for wordpress69 --- .github/workflows/integration-tests.yml | 2 +- config/docker/68-83.Dockerfile | 1 - config/docker/69-83.Dockerfile | 1 + config/wp-version.conf | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 config/docker/68-83.Dockerfile create mode 100644 config/docker/69-83.Dockerfile diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 763fa51..0d98884 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -21,7 +21,7 @@ jobs: - { wp: 60, php: 74 } - { wp: 63, php: 80 } - { wp: 67, php: 82 } - - { wp: 68, php: 83 } + - { wp: 69, php: 83 } steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/config/docker/68-83.Dockerfile b/config/docker/68-83.Dockerfile deleted file mode 100644 index e47ac4c..0000000 --- a/config/docker/68-83.Dockerfile +++ /dev/null @@ -1 +0,0 @@ -FROM wordpress:6.8-php8.3-apache \ No newline at end of file diff --git a/config/docker/69-83.Dockerfile b/config/docker/69-83.Dockerfile new file mode 100644 index 0000000..8a5f892 --- /dev/null +++ b/config/docker/69-83.Dockerfile @@ -0,0 +1 @@ +FROM wordpress:6.9-php8.3-apache \ No newline at end of file diff --git a/config/wp-version.conf b/config/wp-version.conf index 59f3270..df12d54 100644 --- a/config/wp-version.conf +++ b/config/wp-version.conf @@ -5,4 +5,4 @@ 60_74=wordpress:6.0-php7.4-apache 63_80=wordpress:6.3-php8.0-apache 67_82=wordpress:6.7-php8.2-apache -68_83=wordpress:6.8-php8.3-apache \ No newline at end of file +69_83=wordpress:6.9-php8.3-apache \ No newline at end of file From d0a256d78b7445bf42f979bb852155c416d14739 Mon Sep 17 00:00:00 2001 From: tijmen Date: Sun, 7 Dec 2025 20:05:15 +0100 Subject: [PATCH 2/9] prevent flakyness in test due to compression status not updating quick enough --- test/integration/compression.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/compression.spec.ts b/test/integration/compression.spec.ts index e8fbf43..05ddffd 100644 --- a/test/integration/compression.spec.ts +++ b/test/integration/compression.spec.ts @@ -151,7 +151,7 @@ test.describe('compression', () => { await page.goto('/wp-admin/upload.php'); await page.getByRole('button', { name: 'Compress', exact: true }).click(); - await expect(page.getByText('2 sizes compressed')).toBeVisible(); + await expect(page.getByText('2 sizes compressed')).toBeVisible({ timeout: 2000 }); }); test('compress button in edit screen should compress webp images', async () => { @@ -167,7 +167,7 @@ test.describe('compression', () => { await page.goto('/wp-admin/upload.php'); await page.getByRole('button', { name: 'Compress', exact: true }).click(); - await expect(page.getByText('3 sizes compressed')).toBeVisible(); + await expect(page.getByText('3 sizes compressed')).toBeVisible({ timeout: 2000 }); }); test('compress button should compress uncompressed sizes', async () => { From 6244f1ca7ba282486ef4cf77ca83ab91b8a77372 Mon Sep 17 00:00:00 2001 From: tijmen Date: Sun, 7 Dec 2025 20:08:03 +0100 Subject: [PATCH 3/9] prevent flakyness in test due to compression status not updating quick enough --- test/integration/compression.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/integration/compression.spec.ts b/test/integration/compression.spec.ts index 05ddffd..140d7d0 100644 --- a/test/integration/compression.spec.ts +++ b/test/integration/compression.spec.ts @@ -151,7 +151,8 @@ test.describe('compression', () => { await page.goto('/wp-admin/upload.php'); await page.getByRole('button', { name: 'Compress', exact: true }).click(); - await expect(page.getByText('2 sizes compressed')).toBeVisible({ timeout: 2000 }); + // check interval is 5s so wait atleast 6s + await expect(page.getByText('2 sizes compressed')).toBeVisible({ timeout: 6000 }); }); test('compress button in edit screen should compress webp images', async () => { @@ -167,7 +168,8 @@ test.describe('compression', () => { await page.goto('/wp-admin/upload.php'); await page.getByRole('button', { name: 'Compress', exact: true }).click(); - await expect(page.getByText('3 sizes compressed')).toBeVisible({ timeout: 2000 }); + // check interval is 5s so wait atleast 6s + await expect(page.getByText('3 sizes compressed')).toBeVisible({ timeout: 6000 }); }); test('compress button should compress uncompressed sizes', async () => { From de2fbb248291b70db650959aba1d366d75c711eb Mon Sep 17 00:00:00 2001 From: tijmen Date: Thu, 11 Dec 2025 15:49:12 +0100 Subject: [PATCH 4/9] chore: return post id in end2end test because publishing flow changed --- test/integration/conversion.spec.ts | 20 ++++++++++++-------- test/integration/utils.ts | 23 ++++++++++------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/test/integration/conversion.spec.ts b/test/integration/conversion.spec.ts index 7736207..2b04e54 100644 --- a/test/integration/conversion.spec.ts +++ b/test/integration/conversion.spec.ts @@ -49,14 +49,18 @@ test.describe('conversion', () => { test('will display the optimized image on a page', async () => { const media = await uploadMedia(page, 'input-example.jpg'); - const postURL = await newPost(page, { - title: 'test', - content: `
`, - }, WPVersion); - - await page.goto(postURL); - - const picture = await page.locator('picture:has(source[srcset*="input-example.avif"][type="image/avif"])'); + const postID = await newPost( + page, + { + title: 'test', + content: `
`, + }, + WPVersion + ); + + await page.goto(`/?p=${postID}`); + + const picture = await page.locator('picture:has(source[srcset*="input-example.avif"][type="image/avif"])'); await expect(picture).toBeVisible(); }); }); diff --git a/test/integration/utils.ts b/test/integration/utils.ts index 0fd4009..5bcfbc7 100644 --- a/test/integration/utils.ts +++ b/test/integration/utils.ts @@ -9,11 +9,8 @@ export async function uploadMedia(page: Page, file: string): Promise { await page.getByLabel('Upload').click(); const fileChooser = await fileChooserPromise; await fileChooser.setFiles(path.join(__dirname, `../fixtures/${file}`)); - await Promise.all([ - page.waitForURL('**/wp-admin/upload.php**', { waitUntil: 'load' }), - page.locator('#html-upload').click(), - ]); - + await Promise.all([page.waitForURL('**/wp-admin/upload.php**', { waitUntil: 'load' }), page.locator('#html-upload').click()]); + await page.goto('/wp-admin/upload.php?mode=list'); const row = await page.locator('table.wp-list-table tbody > tr').first(); @@ -23,10 +20,7 @@ export async function uploadMedia(page: Page, file: string): Promise { const rowID = await row.getAttribute('id'); const attachmentID = rowID?.split('-')[1]; - await Promise.all([ - page.waitForURL(new RegExp(`/wp-admin/post\\.php\\?post=${attachmentID}&action=edit$`), { waitUntil: 'load' }), - page.goto(`/wp-admin/post.php?post=${attachmentID}&action=edit`), - ]); + await Promise.all([page.waitForURL(new RegExp(`/wp-admin/post\\.php\\?post=${attachmentID}&action=edit$`), { waitUntil: 'load' }), page.goto(`/wp-admin/post.php?post=${attachmentID}&action=edit`)]); return page.locator('input[name="attachment_url"]').inputValue(); } @@ -260,13 +254,16 @@ export async function newPost(page: Page, options: NewPostOptions, WPVersion: nu }, content); await page.getByRole('button', { name: 'Publish', exact: true }).click(); await page.getByLabel('Editor publish').getByRole('button', { name: 'Publish', exact: true }).click(); - await page.getByLabel('Editor publish').getByRole('link', { name: 'View Post' }).click(); } else { await page.locator('#content-html').click(); await page.locator('#content').fill(content); await page.locator('#publish').click(); - await page.getByRole('link', { name: 'View Post' }).first().click(); } - - return page.url(); + await page.waitForURL('**/wp-admin/post.php**'); + const url = new URL(page.url()); + const postID = url.searchParams.get('post'); + if (!postID) { + throw new Error('unable to get post id from url'); + } + return postID; } From 807eb2539d174c4594a15c0297ee91bbb3d0f62c Mon Sep 17 00:00:00 2001 From: tijmen Date: Thu, 11 Dec 2025 16:23:25 +0100 Subject: [PATCH 5/9] Remove unused file --- config/mysql/additional.cnf | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 config/mysql/additional.cnf diff --git a/config/mysql/additional.cnf b/config/mysql/additional.cnf deleted file mode 100644 index 9158531..0000000 --- a/config/mysql/additional.cnf +++ /dev/null @@ -1,3 +0,0 @@ -[mysqld] -# Required for WordPress 3.8 and below. -sql-mode="NO_ENGINE_SUBSTITUTION" From 907775099214fdb540a4c076ae913649dc40b846 Mon Sep 17 00:00:00 2001 From: tijmen Date: Thu, 11 Dec 2025 16:37:54 +0100 Subject: [PATCH 6/9] Pin checks on 8.2 and run unit tests on 5.6 and 8.2 --- .github/workflows/check-test.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-test.yml b/.github/workflows/check-test.yml index aa3ec00..31810fb 100644 --- a/.github/workflows/check-test.yml +++ b/.github/workflows/check-test.yml @@ -12,9 +12,6 @@ jobs: check: runs-on: ubuntu-latest timeout-minutes: 10 - strategy: - matrix: - php: ['7.4'] steps: - name: Checkout Code uses: actions/checkout@v3 @@ -22,7 +19,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - php: ${{ matrix.php }} + php: '8.2' - name: PHPCS run: ./bin/check-style @@ -33,7 +30,7 @@ jobs: timeout-minutes: 10 strategy: matrix: - php: ['7.4'] + php: ['5.6', '8.2'] steps: - name: Checkout Code uses: actions/checkout@v3 From a79c582cc891abf61021827715e8e2393fbc0eec Mon Sep 17 00:00:00 2001 From: tijmen Date: Thu, 11 Dec 2025 16:46:20 +0100 Subject: [PATCH 7/9] Run check on 8.2 --- .github/workflows/check-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-test.yml b/.github/workflows/check-test.yml index 31810fb..8c12921 100644 --- a/.github/workflows/check-test.yml +++ b/.github/workflows/check-test.yml @@ -12,6 +12,9 @@ jobs: check: runs-on: ubuntu-latest timeout-minutes: 10 + strategy: + matrix: + php: ['8.2'] steps: - name: Checkout Code uses: actions/checkout@v3 @@ -19,7 +22,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - php: '8.2' + php: ${{ matrix.php }} - name: PHPCS run: ./bin/check-style From c4216e1f2f58f9a4305fa63e78da869fd1c1a11f Mon Sep 17 00:00:00 2001 From: tijmen Date: Thu, 11 Dec 2025 16:55:53 +0100 Subject: [PATCH 8/9] Use 7.4 for check --- .github/workflows/check-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-test.yml b/.github/workflows/check-test.yml index 8c12921..6b92d1d 100644 --- a/.github/workflows/check-test.yml +++ b/.github/workflows/check-test.yml @@ -14,7 +14,7 @@ jobs: timeout-minutes: 10 strategy: matrix: - php: ['8.2'] + php: ['7.4'] steps: - name: Checkout Code uses: actions/checkout@v3 From 7394b30d092bd73b3d65ab8d32679cbfdbcf627e Mon Sep 17 00:00:00 2001 From: tijmen Date: Sun, 21 Dec 2025 20:35:01 +0100 Subject: [PATCH 9/9] Revert php version on unit tests --- .github/workflows/check-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-test.yml b/.github/workflows/check-test.yml index 6b92d1d..aa3ec00 100644 --- a/.github/workflows/check-test.yml +++ b/.github/workflows/check-test.yml @@ -33,7 +33,7 @@ jobs: timeout-minutes: 10 strategy: matrix: - php: ['5.6', '8.2'] + php: ['7.4'] steps: - name: Checkout Code uses: actions/checkout@v3