Skip to content

Commit e3dbe4b

Browse files
authored
Merge branch 'master' into dependabot/composer/phpunit/phpunit-tw-11
2 parents 49ea52e + 371ff44 commit e3dbe4b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+787
-611
lines changed

.distignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
/.wordpress-org
22
/.git
33
/.github
4+
/.idea
5+
/.phpunit.cache
46
/bin
57
/build
68
/diagrams
79
/docs
810
/legacy-tests
11+
/multisite-language-switcher
912
/node_modules
1013
/src
1114
/tests
1215
.distignore
1316
.gitattributes
1417
.gitignore
18+
1519
.scrutinizer.yml
1620
Changelog.md
1721
Diagrams.md

.github/workflows/deploy.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout project
12-
uses: actions/checkout@v1
12+
uses: actions/checkout@v4
1313
- name: Composer dependencies
14-
run: composer install --no-dev
15-
- name: Build
16-
run: |
17-
npm install
18-
npm run build
14+
run: composer install --no-dev --no-interaction --optimize-autoloader
15+
- name: Composer build
16+
run: composer run-script build
1917
- name: WordPress Plugin Deploy
2018
uses: 10up/action-wordpress-plugin-deploy@stable
2119
env:

.github/workflows/plugin-check.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Plugin Check
2+
on: # rebuild any PRs and main branch changes
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- 'releases/*'
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Composer dependencies
16+
run: composer install --no-dev --no-interaction --optimize-autoloader
17+
- name: Build
18+
run: composer run-script build
19+
- name: Run plugin check
20+
uses: wordpress/plugin-check-action@v1
21+
with:
22+
build-dir: './multisite-language-switcher'

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Test
1+
name: UnitTests and CodeCoverage
22
on: [push]
33
jobs:
44
unit-tests:
55
runs-on: ubuntu-latest
66
steps:
77
- name: Checkout project
8-
uses: actions/checkout@v1
8+
uses: actions/checkout@v4
99
- name: Composer dependencies
1010
run: composer install
1111
- name: Run Testsuite
@@ -16,7 +16,7 @@ jobs:
1616
if: github.ref == 'refs/heads/master'
1717
steps:
1818
- name: Checkout project
19-
uses: actions/checkout@v1
19+
uses: actions/checkout@v4
2020
- name: Composer dependencies
2121
run: composer install
2222
- name: Run Testsuite

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
.idea/
2+
.phpunit.result.cache
3+
.phpunit.cache
14
composer.lock
25
composer.phar
6+
multisite-language-switcher/
7+
multisite-language-switcher.zip
38
package-lock.json
49
phpunit.xml.bak
5-
.idea/
6-
.phpunit.result.cache
7-
.phpunit.cache
810
tests/coverage/
911
tests/playwright-results/
1012
tests/playwright-report/

MultisiteLanguageSwitcher.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ function get_the_msls( $attr ): string {
7676
* @param string[] $arr
7777
*/
7878
function the_msls( array $arr = array() ): void {
79+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
7980
echo get_the_msls( $arr );
8081
}
8182

bin/git-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ ZIP_ARCHIVE="$PROJECT_ROOT/$PLUGIN_NAME.zip"
88
rm -f $ZIP_ARCHIVE
99
rm -rf $BUILD_PATH && mkdir $BUILD_PATH
1010

11-
rsync -arvp --exclude-from=$PROJECT_ROOT/build/exclude $PROJECT_ROOT/ $BUILD_PATH/
11+
rsync -arvp --exclude-from=$PROJECT_ROOT/.distignore $PROJECT_ROOT/ $BUILD_PATH/
1212
cd $PROJECT_ROOT && zip -r $ZIP_ARCHIVE $PLUGIN_NAME

build/translations.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

composer.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"squizlabs/php_codesniffer": "^3.9",
2020
"phpcompatibility/php-compatibility": "^9.3",
2121
"wp-coding-standards/wpcs": "^3.0",
22-
"smeghead/php-class-diagram": "^1.3"
22+
"smeghead/php-class-diagram": "^1.3",
23+
"phpstan/phpstan-mockery": "^1.1"
2324
},
2425
"autoload": {
2526
"psr-4": {
@@ -44,6 +45,18 @@
4445
"flags-svg": "php bin/flags-svg.php > css/flags.php",
4546
"diagram:class": "vendor/bin/php-class-diagram --php8 includes > diagrams/msls-class.puml",
4647
"diagram:package": "vendor/bin/php-class-diagram --package-diagram --php8 includes > diagrams/msls-package.puml",
48+
"git-release": "bin/git-release.sh",
49+
"build": [
50+
"@prepare",
51+
"@flags-png",
52+
"@flags-svg",
53+
"npm install",
54+
"npm run build",
55+
"npm run uglify",
56+
"npm run less",
57+
"npm run build-msls-block",
58+
"@git-release"
59+
],
4760
"githooks": [
4861
"if [ -e bin/githooks/pre-commit ]; then cp bin/githooks/pre-commit ./.git/hooks/; fi",
4962
"if [ -e .git/hooks/pre-commit ]; then chmod 0755 .git/hooks/pre-commit; fi"

0 commit comments

Comments
 (0)