Skip to content

Commit

Permalink
Merge branch 'develop' into stable for v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stklcode committed Nov 13, 2023
2 parents cbf3bbe + b3c4b17 commit dfab34a
Show file tree
Hide file tree
Showing 29 changed files with 3,988 additions and 3,142 deletions.
6 changes: 3 additions & 3 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/.git
/.github
/.wordpress-org
/bin
/node_modules
/tests
/vendor
Expand All @@ -15,11 +14,12 @@
/.gitignore
/.stylelintrc.json
/.travis.yml
/clover.xml
/composer.json
/package.json
/package-lock.json
/composer.lock
/phpcs.xml
/phpunit.xml

/sonar-project.properties
/tests-clover.xml
/tests-junit.xml
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "plugin:@wordpress/eslint-plugin/es5",
"extends": "plugin:@wordpress/eslint-plugin/recommended",
"env": {
"browser": true,
"jquery": true
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
/package-lock.json export-ignore
/phpcs.xml export-ignore
/phpunit.xml export-ignore
/sonar-project.properties export-ignore
20 changes: 14 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Test
on: push
on: [ push, pull_request ]
jobs:
unit:
runs-on: ubuntu-latest
Expand All @@ -8,7 +8,9 @@ jobs:
php: [ '7.4', '8.0', '8.1', '8.2' ]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -17,15 +19,21 @@ jobs:
- name: Install
run: composer install --no-interaction
- name: Unit tests
run: composer test
- name: Coverage Report
run: |
composer test
sed -i 's#'$GITHUB_WORKSPACE'#/github/workspace#g' tests-*.xml
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wordpress-plugin-asset-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wordpress-plugin-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ js/*.min.js
vendor/
node_modules/
.phpunit.result.cache
clover.xml
tests-*.xml
Binary file modified .wordpress-org/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

### 1.5.0 ###
* Replace `FILTER_SANIITZE_STRING` deprecated since PHP 8.1+ (#126) (#127)
* Enforce use of custom Safe Browsing API key (#104) (#108)
* Separate settings page from manual scanning with overhauled UI (#107)
* Update JS to ES2015 (IE11 no longer supported) (#32)

### 1.4.4 ###
* Fix warning on SafeBrowsing API errors with PHP 8.1+ (#123)
* Tested up to WordPress 6.2
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TD4AMD2D8EMZW
* Requires at least: 4.1
* Requires PHP: 5.2
* Tested up to: 6.2
* Stable tag: 1.4.4
* Tested up to: 6.4
* Stable tag: 1.5.0
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -41,6 +41,12 @@ A complete documentation is available on the [AntiVirus website](https://antivir

## Changelog ##

### 1.5.0 ###
* Fix deprecation warning with PHP 8.1+ (#126) (#127)
* Enforce use of custom Safe Browsing API key (#104) (#108)
* Separate settings page from manual scanning with overhauled UI (#107)
* Update JS to ES2015 (IE11 no longer supported) (#32)

### 1.4.4 ###
* Fix warning on SafeBrowsing API errors with PHP 8.1+ (#123)
* Tested up to WordPress 6.2
Expand Down Expand Up @@ -90,6 +96,11 @@ For the complete changelog, check out our [GitHub repository](https://github.com

## Upgrade Notice ##

### 1.5.0 ###
This update finally removed support for Safe Browsing API without an API key.
If you are using this feature and did not provide your own key yet, it will be disabled.
Can be easily enabled again, just enter a key.

### 1.4.4 ###
This is a small maintenance release which fixes a PHP warning on Safe Browsing API errors with PHP 8.1.

Expand Down
12 changes: 6 additions & 6 deletions antivirus.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
* Text Domain: antivirus
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Version: 1.4.4
* Version: 1.5.0
*
* @package AntiVirus
*/

/*
Copyright (C) 2009-2015 Sergej Müller
Copyright (C) 2016-2021 pluginkollektiv
Copyright (C) 2016-2023 pluginkollektiv
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -42,17 +42,17 @@
/**
* Plugin autoloader.
*
* @param string $class The classname.
* @param string $class_name The classname.
*/
function antivirus_autoload( $class ) {
if ( in_array( $class, array( 'AntiVirus', 'AntiVirus_CheckInternals', 'AntiVirus_SafeBrowsing', 'AntiVirus_ChecksumVerifier' ), true ) ) {
function antivirus_autoload( $class_name ) {
if ( in_array( $class_name, array( 'AntiVirus', 'AntiVirus_CheckInternals', 'AntiVirus_SafeBrowsing', 'AntiVirus_ChecksumVerifier' ), true ) ) {
require_once sprintf(
'%s%s%s%sclass-%s.php',
dirname( __FILE__ ),
DIRECTORY_SEPARATOR,
'inc',
DIRECTORY_SEPARATOR,
strtolower( str_replace( '_', '-', $class ) )
strtolower( str_replace( '_', '-', $class_name ) )
);
}
}
Expand Down
85 changes: 0 additions & 85 deletions bin/install-wp-tests.sh

This file was deleted.

10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"ext-json": "*"
},
"require-dev": {
"php": ">=7.3",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"10up/wp_mock": "^0.5",
"php": ">=7.4",
"dealerdirect/phpcodesniffer-composer-installer": "^v1.0",
"10up/wp_mock": "^1.0",
"matthiasmullie/minify": "^1.3",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpunit/phpunit": "^9",
"squizlabs/php_codesniffer": "^3.7",
"wp-coding-standards/wpcs": "^2.3"
"wp-coding-standards/wpcs": "^3.0"
},
"scripts": {
"post-install-cmd": [
Expand Down Expand Up @@ -52,7 +52,7 @@
"minifyjs js/script.js > js/script.min.js"
],
"test": [
"phpunit --coverage-clover clover.xml"
"phpunit"
]
},
"config": {
Expand Down
Loading

0 comments on commit dfab34a

Please sign in to comment.