Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/140 Bump WordPress and PHP minimums #143

Merged
merged 9 commits into from
Aug 22, 2022
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP minimum', version: 'WordPress/WordPress#4.9'}
- {name: 'WP minimum', version: 'WordPress/WordPress#5.7'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '7.4'
tools: composer:v2
coverage: none

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/php-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
php_compatibility:
name: PHP minimum 5.6
name: PHP minimum 7.4
runs-on: ubuntu-latest

steps:
Expand All @@ -21,12 +21,12 @@ jobs:
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
php-version: 7.4
tools: composer:v2
coverage: none

- name: Install dependencies
run: composer update -W

- name: Check PHP Compatibility
run: vendor/bin/phpcs simple-local-avatars.php includes/ --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 5.6-
run: vendor/bin/phpcs simple-local-avatars.php includes/ --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 7.4-
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ jobs:
strategy:
fail-fast: false
matrix:
# We claim to support from 5.6+ but WP Mock only supports 7.1+
# Also an issue with WP Mock not working on PHPUnit 9.5+, which PHP 7.3+ needs.
# php: [ '5.6', '7.0', '7.4', '8.0', '8.1' ]
php: [ '7.1', '7.2' ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7.1 and 7.2 looks like a deprecated support, needs to be updated to 7.4 and 8.0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should, but need to fix the PHPUnit test failure issue first as mentioned above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, c46a733


steps:
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"source": "https://github.com/10up/simple-local-avatars"
},
"require": {
"php": ">=5.6"
"php": ">=7.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we put 7.4 here?

Copy link
Member Author

@faisal-alvi faisal-alvi Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had put 7.4 but as mentioned in the comment above, it upgrades the PHPUnit to 9.5.21 and all tests failed. Hence I reverted it back to 7.1 (0712ba0) that fixed this issue. Any suggestions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the PHPUnit failure was due to the fix required in the upstream and the PR is already raised 10up/wp_mock#164.

Upgraded to 7.4 (c46a733)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getAnnotations() error is fixed by changing parent::setUp() to \WP_Mock::setUp() in the test declarations 2b8e160

But there are still 3 tests fail after this fix

Tests: 30, Assertions: 270, Errors: 1, Failures: 2.

},
"require-dev": {
"10up/phpcs-composer": "dev-master",
Expand All @@ -28,12 +28,12 @@
},
"scripts": {
"lint": [
"phpcs . --runtime-set testVersion 5.6-"
"phpcs . --runtime-set testVersion 7.4-"
],
"lint-fix": [
"phpcbf ."
],
"phpcs:compat": "vendor/bin/phpcs simple-local-avatars.php includes --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 5.6-"
"phpcs:compat": "vendor/bin/phpcs simple-local-avatars.php includes --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 7.4-"
},
"minimum-stability": "dev"
}
41 changes: 19 additions & 22 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
<phpunit
bootstrap="tests/phpunit/bootstrap.php"
backupGlobals="false"
processIsolation="false"
colors="false">
<testsuites>
<testsuite name="Simple Local Avatars">
<directory suffix="Test.php">./tests/phpunit</directory>
<exclude>tests/phpunit/multisite</exclude>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">includes</directory>
<exclude></exclude>
</whitelist>
</filter>
<php>
<ini name="error_reporting" value="32767" />
<ini name="display_errors" value="1" />
<ini name="display_startup_errors" value="1" />
</php>
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/phpunit/bootstrap.php" backupGlobals="false" processIsolation="false" colors="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">includes</directory>
</include>
<exclude/>
</coverage>
<testsuites>
<testsuite name="Simple Local Avatars">
<directory suffix="Test.php">./tests/phpunit</directory>
<exclude>tests/phpunit/multisite</exclude>
</testsuite>
</testsuites>
<php>
<ini name="error_reporting" value="32767"/>
<ini name="display_errors" value="1"/>
<ini name="display_startup_errors" value="1"/>
</php>
</phpunit>
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: jakemgold, 10up, thinkoomph, jeffpaul, faisal03
Donate link: https://10up.com/plugins/simple-local-avatars-wordpress/
Tags: avatar, gravatar, user photos, users, profile
Requires at least: 4.6
Requires at least: 5.7
Tested up to: 6.0
Requires PHP: 5.6
Requires PHP: 7.4
Stable tag: 2.5.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down
4 changes: 2 additions & 2 deletions simple-local-avatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Plugin URI: https://10up.com/plugins/simple-local-avatars-wordpress/
* Description: Adds an avatar upload field to user profiles. Generates requested sizes on demand, just like Gravatar! Simple and lightweight.
* Version: 2.5.0
* Requires at least: 4.6
* Requires PHP: 5.6
* Requires at least: 5.7
* Requires PHP: 7.4
* Author: Jake Goldman, 10up
* Author URI: https://10up.com
* License: GPLv2 or later
Expand Down