Skip to content

Commit 3b03655

Browse files
Merge branch 'master' of github.com:wcreateweb/wordpress-plugin into task/as3cf-compatibility
2 parents 5df8e2f + b1198b1 commit 3b03655

File tree

17 files changed

+610
-1116
lines changed

17 files changed

+610
-1116
lines changed

.github/workflows/integration-tests.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Integration Tests
33
on:
44
push:
55
branches:
6-
- '**'
6+
- 'master'
77
pull_request:
88
branches:
99
- '**'
@@ -14,7 +14,14 @@ jobs:
1414
timeout-minutes: 10
1515
strategy:
1616
matrix:
17-
wp-version: [67]
17+
include:
18+
- { wp: 40, php: 56 }
19+
- { wp: 40, php: 70 }
20+
- { wp: 57, php: 73 }
21+
- { wp: 60, php: 73 }
22+
- { wp: 63, php: 80 }
23+
- { wp: 67, php: 82 }
24+
- { wp: 67, php: 83 }
1825
steps:
1926
- name: Checkout code
2027
uses: actions/checkout@v4
@@ -52,11 +59,11 @@ jobs:
5259
if: steps.playwright-cache.outputs.cache-hit != 'true'
5360

5461
- name: Run script
55-
run: ./bin/integration-tests ${{ matrix.wp-version }}
62+
run: ./bin/integration-tests ${{ matrix.wp }} ${{ matrix.php}}
5663

5764
- uses: actions/upload-artifact@v4
5865
if: ${{ !cancelled() }}
5966
with:
60-
name: playwright-report
67+
name: playwright-report-${{ matrix.wp }}-${{ matrix.php }}
6168
path: playwright-report/
6269
retention-days: 30

.travis.yml

Lines changed: 0 additions & 124 deletions
This file was deleted.

.wp-env.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"plugins": ["."],
3-
"phpVersion": "7.2",
43
"config": {
54
"AWS_ENDPOINT": "http://host.docker.internal:4566",
65
"AWS_USE_PATH_STYLE_ENDPOINT": "true",

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ Got questions or feedback? Let us know! Contact us at [email protected].
2020
* Node LTS
2121

2222
### Running the plugin in WordPress
23-
1. Run `bin/run-wordpress <version>`. E.g. `bin/run-wordpress 60`.
24-
2. Connect to Wordpress on port `80<version>` (e.g. port `8060`).
23+
1. Run `bin/run-wordpress <wordpress version> <php version>`. E.g. `bin/run-wordpress 60 73`.
24+
2. Connect to Wordpress on port `80<wordpress version>` (e.g. port `8060`).
2525

2626
### Running the unit tests
2727
1. Run `bin/unit-tests <optional path to file>`.
2828

2929
### Running the integration tests
3030
1. Install Docker 1.12 and docker-compose.
3131
2. Install npm dependancies
32-
3. Run `bin/integration-tests <version>`. E.g. `bin/integration-tests 60`.
32+
3. Run `bin/integration-tests <wordpress version> <php version>`. E.g. `bin/integration-tests 60 80`.
3333

3434
### Check if the code follows WordPress standard
3535
1. Run `bin/check-style` to make sure there are no errors.

bin/integration-tests

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,20 @@ if [ -z "${WORDPRESS_VERSION}" ]; then
1414
exit 1
1515
fi
1616

17-
version_input="$1"
17+
wp_version_input="$1"
18+
php_version_input="$2"
1819

19-
## WordPress version ex. "6.7"
20-
export WORDPRESS_VERSION_FULL="${version_input:0:1}.${version_input:1}"
20+
## PHP Version ex "80"
21+
export PHP_VERSION="${php_version_input}"
22+
23+
## PHP Version ex "80"
24+
export PHP_VERSION_FULL="${PHP_VERSION:0:1}.${PHP_VERSION:1}"
2125

2226
## WordPress version ex "67"
23-
export WORDPRESS_VERSION="${version_input}"
27+
export WORDPRESS_VERSION="${wp_version_input}"
28+
29+
## WordPress version ex. "6.7"
30+
export WORDPRESS_VERSION_FULL="${WORDPRESS_VERSION:0:1}.${WORDPRESS_VERSION:1}"
2431
fi
2532

2633
export MYSQL_PWD=root
@@ -29,8 +36,10 @@ export WORDPRESS_PORT=80${WORDPRESS_VERSION}
2936
export WORDPRESS_URL=http://wordpress
3037
export WP_ENV_TESTS_PORT=80${WORDPRESS_VERSION}
3138
export WP_ENV_CORE=WordPress/Wordpress#${WORDPRESS_VERSION_FULL}
39+
export WP_ENV_PHP_VERSION=${PHP_VERSION_FULL}
3240
export MOCK_PORT=8100
3341

42+
3443
function wait_for_service_port {
3544
while ! curl -s localhost:$1 > /dev/null; do
3645
sleep 0.25

bin/run-mocks

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
port="$1"
4+
5+
MOCK_PORT=${port:-8100}
6+
7+
docker build -t mock-webservice -f config/Dockerfile-mock-webservice .
8+
docker run -d --name tinify-mock-api -p ${MOCK_PORT}:80 -v $(pwd)/test/mock-tinypng-webservice:/var/www/html mock-webservice
9+
10+
echo "To stop, run: bin/stop-mocks"

bin/run-wordpress

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,27 @@ if [ -z "${WORDPRESS_VERSION}" ]; then
1010
exit 1
1111
fi
1212

13-
version_input="$1"
14-
13+
wp_version_input="$1"
14+
php_version_input="$2"
15+
1516
## WordPress version ex. "6.7"
16-
export WORDPRESS_VERSION_FULL="${version_input:0:1}.${version_input:1}"
17+
export WORDPRESS_VERSION_FULL="${wp_version_input:0:1}.${wp_version_input:1}"
1718

1819
## WordPress version ex "67"
19-
export WORDPRESS_VERSION="${version_input}"
20+
export WORDPRESS_VERSION="${wp_version_input}"
2021

22+
## PHP Version ex "80"
23+
export PHP_VERSION="${php_version_input}"
24+
25+
## PHP Version ex "80"
26+
export PHP_VERSION_FULL="${PHP_VERSION:0:1}.${PHP_VERSION:1}"
27+
28+
echo "Starting WordPress ${WORDPRESS_VERSION_FULL} on PHP ${PHP_VERSION_FULL}"
2129
fi
2230

2331
export WP_ENV_TESTS_PORT=80${WORDPRESS_VERSION}
2432
export WP_ENV_CORE=WordPress/Wordpress#${WORDPRESS_VERSION_FULL}
33+
export WP_ENV_PHP_VERSION=${PHP_VERSION_FULL}
2534

2635
npx wp-env start
2736

bin/stop-mocks

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
docker stop $(docker ps -q --filter "ancestor=mock-webservice")
4+
docker rm $(docker ps -a -q --filter "ancestor=mock-webservice")

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default defineConfig({
44
testDir: './test',
55
fullyParallel: false,
66
forbidOnly: !!process.env.CI,
7-
retries: 0,
7+
retries: process.env.CI ? 1 : 0,
88
workers: 1,
99
reporter: 'html',
1010
use: {

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: TinyPNG
33
Donate link: https://tinypng.com/
44
Tags: compress images, compression, image size, page speed, performance
5-
Requires at least: 4.7
5+
Requires at least: 4.0
66
Tested up to: 6.7
77
Stable tag: 3.4.6
88
License: GPLv2 or later

0 commit comments

Comments
 (0)