Skip to content

Commit

Permalink
Release v2.2.4 (PR #948)
Browse files Browse the repository at this point in the history
Release v2.2.4
wordpressfan authored Dec 23, 2024
2 parents 4597689 + 2b8b2fd commit bc7476d
Showing 146 changed files with 2,238 additions and 2,977 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/lint_phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PHP Stan lint

on:
pull_request:
branches:
- trunk
- develop
- branch-*
- feature/*
- enhancement/*

jobs:
run:
runs-on: ${{ matrix.operating-system }}

strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2']

name: WPRocket lint with PHP Stan. PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none # XDebug can be enabled here 'coverage: xdebug'
tools: composer:v2

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-scripts

- name: Lint with PHP Stan
run: composer run-stan -- --error-format=github

100 changes: 50 additions & 50 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
name: Unit/Integration tests

on:
pull_request:
branches:
- trunk
- develop
- branch-*
pull_request:
branches:
- trunk
- develop
- branch-*

jobs:
run:
runs-on: ${{ matrix.operating-system }}
run:
runs-on: ${{ matrix.operating-system }}

strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4']
wp-versions: ['latest']
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.0', '8.1', '8.2']
wp-versions: ['latest']

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

env:
WP_TESTS_DIR: "/tmp/tests/phpunit"
WP_CORE_DIR: "/tmp/wordpress-develop"
IMAGIFY_TESTS_API_KEY: ${{ secrets.IMAGIFY_TESTS_API_KEY }}
env:
WP_TESTS_DIR: "/tmp/tests/phpunit"
WP_CORE_DIR: "/tmp/wordpress-develop"
IMAGIFY_TESTS_API_KEY: ${{ secrets.IMAGIFY_TESTS_API_KEY }}

steps:
- name: Checkout
uses: actions/checkout@v2
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none # XDebug can be enabled here 'coverage: xdebug'
tools: composer:v2, phpunit
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none # XDebug can be enabled here 'coverage: xdebug'
tools: composer:v2, phpunit

- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Start mysql service
run: sudo /etc/init.d/mysql start

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-scripts
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-scripts --ignore-platform-reqs

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

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

- name: Test
run: composer run-tests
- name: Test
run: composer run-tests
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.3']
php-versions: ['7.3', '7.4']
wp-versions: ['5.3']

name: WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.
@@ -27,19 +27,36 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mysqli
coverage: none # XDebug can be enabled here 'coverage: xdebug'
tools: composer:v2
tools: composer:v2, phpunit

- name: Start mysql service
run: sudo /etc/init.d/mysql start

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

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

@@ -49,8 +66,8 @@ jobs:
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Remove unmet dependencies by legacy versions
run: composer remove --dev --no-scripts coenjacobs/mozart
- name: Require PHPUnit 7.5 for WP compatibility
run: composer require --dev --no-scripts phpunit/phpunit "^7.5" -W

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-scripts
69 changes: 0 additions & 69 deletions .github/workflows/test_php8.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,3 +8,4 @@
composer.lock
package-lock.json
/_dev/node_modules
.phpunit.result.cache
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -155,6 +155,12 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
Please report security bugs found in the site-reviews plugin's source code through the [Patchstack Vulnerability Disclosure Program](https://patchstack.com/database/vdp/imagify). The Patchstack team will assist you with verification, CVE assignment and take care of notifying the developers of this plugin.

## Changelog
### 2.2.4
- Enhancement: Deactivate by default calculation of the media elements used for the filters in the Media Library view.
- Enhancement: Remove unnecessary calls to the API on each page load.
- Enhancement: Update the UI of the banners, remove the unnecessary step before the checkout.
- 3rd-party compatibility: Fix a problem when an unstyled banner was displayed on Gravity Forms plugin view.

### 2.2.3.2
- Enhancement: Optimize and cache the modal attachment counter database query.

8 changes: 8 additions & 0 deletions Tests/Fixtures/classes/ThirdParty/Plugins/GravityForm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
if ( ! class_exists( 'GFCommon' ) ) {
class GFForms{
public static function is_gravity_page() {
return true;
}
}
}
27 changes: 27 additions & 0 deletions Tests/Fixtures/classes/ThirdParty/Plugins/gravityForms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

return [
'test_data' => [
'testShouldReturnStylesAndScriptWhenConflictModeIsOn' => [
'config' => [
'is_plugin_active' => true,
'filter' => 'gform_noconflict_styles',
],
'expected' => [
'styles' => [
'imagify-admin-bar',
'imagify-admin',
'imagify-notices',
'imagify-pricing-modal',
],
'scripts' => [
'imagify-admin-bar',
'imagify-admin',
'imagify-notices',
'imagify-pricing-modal',
'imagify-sweetalert',
]
],
],
]
];
Loading

0 comments on commit bc7476d

Please sign in to comment.