Skip to content

Commit 4679d42

Browse files
authored
Replace Mozart by Strauss (#1016)
1 parent 8fa82fe commit 4679d42

74 files changed

Lines changed: 4721 additions & 3436 deletions

File tree

Some content is hidden

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

.distignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
/composer.lock
1616
/gruntfile.js
1717
/package.json
18+
/package-lock.json
1819
/phpcs.xml
1920
/README.md
2021
/SECURITY.md

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
/.jshintrc export-ignore
1616
/composer.lock export-ignore
1717
/gruntfile.js export-ignore
18+
/package-lock.json export-ignore
1819
/phpcs.xml export-ignore
1920
/phpstan.neon.dist export-ignore
2021
/README.md export-ignore

.github/workflows/deploy-tag.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
steps:
1111

1212
- name: Checkout
13-
uses: actions/checkout@master
13+
uses: actions/checkout@v6
1414

1515
- name: Setup PHP
1616
uses: shivammathur/setup-php@v2
@@ -19,8 +19,11 @@ jobs:
1919
coverage: none # XDebug can be enabled here 'coverage: xdebug'
2020
tools: composer:v2
2121

22+
- name: Install Strauss
23+
run: sh -c 'test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/latest/download/strauss.phar'
24+
2225
- name: Build
23-
run: composer install -a --no-dev
26+
run: composer install -o --no-dev
2427

2528
- name: WordPress Plugin Deploy
2629
uses: 10up/action-wordpress-plugin-deploy@stable

.github/workflows/lint_phpcs.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PHP CodeSniffer lint
1+
name: PHPCS
22

33
on:
44
pull_request:
@@ -18,11 +18,11 @@ jobs:
1818
operating-system: [ubuntu-latest]
1919
php-versions: ['8.3']
2020

21-
name: WPRocket lint with PHPCS. PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.
21+
name: PHP ${{ matrix.php-versions }}
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v6
2626

2727
- name: Setup PHP
2828
uses: shivammathur/setup-php@v2
@@ -31,8 +31,11 @@ jobs:
3131
coverage: none # XDebug can be enabled here 'coverage: xdebug'
3232
tools: composer:v2
3333

34+
- name: Install Strauss
35+
run: sh -c 'test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/latest/download/strauss.phar'
36+
3437
- name: Install dependencies
35-
run: composer install --prefer-dist --no-interaction --no-scripts
38+
run: composer install --no-interaction
3639

37-
- name: Lint with phpcs
40+
- name: Run PHPCS
3841
run: composer phpcs

.github/workflows/lint_phpstan.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PHP Stan lint
1+
name: PHPStan
22

33
on:
44
pull_request:
@@ -15,15 +15,14 @@ jobs:
1515
runs-on: ${{ matrix.operating-system }}
1616

1717
strategy:
18-
fail-fast: false
1918
matrix:
2019
operating-system: [ubuntu-latest]
21-
php-versions: ['8.2']
20+
php-versions: ['8.3']
2221

23-
name: WPRocket lint with PHP Stan. PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.
22+
name: PHP ${{ matrix.php-versions }}
2423
steps:
2524
- name: Checkout
26-
uses: actions/checkout@v4
25+
uses: actions/checkout@v6
2726

2827
- name: Setup PHP
2928
uses: shivammathur/setup-php@v2
@@ -32,9 +31,12 @@ jobs:
3231
coverage: none # XDebug can be enabled here 'coverage: xdebug'
3332
tools: composer:v2
3433

34+
- name: Install Strauss
35+
run: sh -c 'test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/latest/download/strauss.phar'
36+
3537
- name: Install dependencies
36-
run: composer install --prefer-dist --no-interaction --no-scripts
38+
run: composer install --no-interaction
3739

38-
- name: Lint with PHP Stan
40+
- name: Run PHPStan
3941
run: composer run-stan -- --error-format=github
4042

.github/workflows/test.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
operating-system: [ubuntu-latest]
21-
php-versions: ['8.0', '8.1', '8.2']
21+
php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4']
2222
wp-versions: ['latest']
2323

24-
name: WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.
24+
name: WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }}
2525

2626
env:
2727
WP_TESTS_DIR: "/tmp/tests/phpunit"
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v4
33+
uses: actions/checkout@v6
3434

3535
- name: Setup PHP
3636
uses: shivammathur/setup-php@v2
@@ -62,14 +62,20 @@ jobs:
6262
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
6363
restore-keys: ${{ runner.os }}-composer-
6464

65+
- name: Install Strauss
66+
run: sh -c 'test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/latest/download/strauss.phar'
67+
6568
- name: Install dependencies
66-
run: composer install --prefer-dist --no-interaction --no-scripts --ignore-platform-reqs
69+
run: composer install --no-interaction
6770

6871
- name: Install tests
6972
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:3306 ${{ matrix.wp-versions }}
7073

7174
- name: Mysql8 auth plugin workaround
7275
run: sudo mysql -u root -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';"
7376

74-
- name: Test
75-
run: composer run-tests
77+
- name: Unit tests
78+
run: composer test-unit
79+
80+
- name: Integration tests
81+
run: composer test-integration

.github/workflows/test_legacy.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
operating-system: [ubuntu-latest]
21-
php-versions: ['7.3', '7.4']
21+
php-versions: ['7.4']
2222
wp-versions: ['5.9']
2323

24-
name: WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.
24+
name: WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }}
2525

2626
env:
2727
WP_TESTS_DIR: "/tmp/tests/phpunit"
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v4
33+
uses: actions/checkout@v6
3434

3535
- name: Setup PHP
3636
uses: shivammathur/setup-php@v2
@@ -72,11 +72,17 @@ jobs:
7272
- name: Setup problem matchers for PHPUnit
7373
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
7474

75+
- name: Install Strauss
76+
run: sh -c 'test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/latest/download/strauss.phar'
77+
7578
- name: Install dependencies
76-
run: composer install --prefer-dist --no-interaction --no-scripts
79+
run: composer install --no-interaction
7780

7881
- name: Install tests
7982
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:3306 ${{ matrix.wp-versions }}
8083

81-
- name: Test
82-
run: composer run-tests
84+
- name: Unit tests
85+
run: composer test-unit
86+
87+
- name: Integration tests
88+
run: composer test-integration

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
/node_modules
33
/Tests/env/local
44
/vendor
5+
56
# Files
67
.DS_Store
78
/gruntlocalconf.json
8-
composer.lock
9-
package-lock.json
109
/_dev/node_modules
1110
.phpunit.result.cache
11+
bin/strauss.phar
12+
composer.lock

bin/.gitkeep

Whitespace-only changes.

classes/Admin/PluginFamilySubscriber.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,50 @@ public function install_activate() {
5555
public function display_error_notice() {
5656
$this->plugin_family->display_error_notice();
5757
}
58+
59+
/**
60+
* Enqueue block editor assets.
61+
*
62+
* @return void
63+
*/
64+
public function enqueue_assets(): void {
65+
$this->plugin_family->enqueue_assets();
66+
}
67+
68+
/**
69+
* Install Imagify using the ajax request.
70+
*
71+
* @return void
72+
*/
73+
public function install_imagify(): void {
74+
$this->plugin_family->install_imagify();
75+
}
76+
77+
/**
78+
* Enqueue Admin assets.
79+
*
80+
* @param string $page Page ID.
81+
* @return void
82+
*/
83+
public function enqueue_admin_assets( $page ): void {
84+
$this->plugin_family->enqueue_admin_assets( $page );
85+
}
86+
87+
/**
88+
* Insert admin footer JS templates.
89+
*
90+
* @return void
91+
*/
92+
public function insert_footer_templates(): void {
93+
$this->plugin_family->insert_footer_templates();
94+
}
95+
96+
/**
97+
* Dismiss promote Imagify using the ajax request.
98+
*
99+
* @return void
100+
*/
101+
public function dismiss_promote_imagify(): void {
102+
$this->plugin_family->dismiss_promote_imagify();
103+
}
58104
}

0 commit comments

Comments
 (0)