diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 6379d068..00000000 --- a/.eslintrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": [ - "plugin:@wordpress/eslint-plugin/recommended" - ], - "env": { - "browser": true - }, - "rules": { - "max-len": [ - "error", - { - "code": 160 - } - ], - "prettier/prettier": 0 - }, - "parserOptions": { - "requireConfigFile": false - } -} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e7b91e45..b480c461 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['7.3', '7.2', '5.4'] + php-versions: ['7.3', '7.2'] steps: - uses: actions/checkout@master - name: Setup PHP @@ -15,9 +15,6 @@ jobs: extensions: mbstring, intl ini-values: post_max_size=256M, short_open_tag=On tools: phpunit, composer - - name: Set COMPOSER environment variable for 5.4 - if: matrix.php-versions == '5.4' - run: echo "COMPOSER=composer-php-5-4.json" >> $GITHUB_ENV - name: Run tests run: | composer install @@ -85,16 +82,9 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.2' - extensions: mbstring, intl - ini-values: post_max_size=256M, short_open_tag=On - tools: phpunit, composer - - uses: actions/setup-node@v2 - with: - node-version: '14' + php-version: '8.2' + tools: composer - name: Run code style checks for CSS, JavaScript and PHP run: | - composer install - npm install - composer lint-all + composer install --ignore-platform-req=php composer cs diff --git a/.stylelintrc.json b/.stylelintrc.json deleted file mode 100644 index 829a7dcf..00000000 --- a/.stylelintrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "@wordpress/stylelint-config", - "rules": { - } -} diff --git a/composer-php-5-4.json b/composer-php-5-4.json deleted file mode 100644 index 89160d79..00000000 --- a/composer-php-5-4.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "pluginkollektiv/antispam-bee", - "description": "Antispam Bee blocks spam comments and trackbacks effectively and without captchas.", - "keywords": [ - "WordPress", - "antispam", - "honeypot" - ], - "homepage": "https://pluginkollektiv.github.io/antispam-bee/", - "authors": [ - { - "name": "pluginkollektiv", - "homepage": "https://github.com/pluginkollektiv", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://github.com/pluginkollektiv/antispam-bee/issues", - "source": "https://github.com/pluginkollektiv/antispam-bee", - "docs": "https://github.com/pluginkollektiv/antispam-bee/blob/master/README.md" - }, - "type": "wordpress-plugin", - "license": "GPL-v2", - "require-dev": { - "phpunit/phpunit": "*", - "brain/monkey": "*" - }, - "config": { - "optimize-autoloader": true, - "platform": { - "php": "5.4" - } - }, - "autoload-dev": { - "classmap": [ - "antispam_bee.php", - "inc/" - ], - "psr-4": { - "AntispamBee\\Tests\\": "tests/" - } - } -} diff --git a/composer.json b/composer.json index 5e671322..5867e99d 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "phpcompatibility/phpcompatibility-wp": "^2.1", "phpunit/phpunit": "^4", "wp-cli/wp-cli-bundle": "@stable", - "wp-coding-standards/wpcs": "^2.3" + "wp-coding-standards/wpcs": "^3.0" }, "autoload": { "psr-4": { diff --git a/package.json b/package.json index d44971cd..5f32670d 100644 --- a/package.json +++ b/package.json @@ -3,34 +3,5 @@ "version": "3.0.0", "description": "Antispam Bee blocks spam comments and trackbacks effectively and without captchas.", "author": "pluginkollektiv", - "license": "GPL-2.0-or-later", - "main": "build/index.js", - "scripts": { - "build": "wp-scripts build", - "check-engines": "wp-scripts check-engines", - "check-licenses": "wp-scripts check-licenses", - "format:js": "wp-scripts format-js", - "format:js:src": "wp-scripts format-js ./src", - "lint:css": "wp-scripts lint-style", - "lint:css:src": "wp-scripts lint-style 'src/**/*.css'", - "lint:js": "wp-scripts lint-js", - "lint:js:src": "wp-scripts lint-js ./src", - "lint:md:docs": "wp-scripts lint-md-docs", - "lint:md:js": "wp-scripts lint-md-js", - "lint:pkg-json": "wp-scripts lint-pkg-json", - "packages-update": "wp-scripts packages-update", - "postpackages-update": "npm run build", - "start": "wp-scripts start", - "test:e2e": "wp-scripts test-e2e", - "test:unit": "wp-scripts test-unit-js" - }, - "devDependencies": { - "@wordpress/scripts": "^18.1.0", - "classnames": "^2.3.1", - "svg-spritemap-webpack-plugin": "^4.3.3", - "url-loader": "^4.1.1" - }, - "dependencies": { - "raphael": "^2.3.0" - } + "license": "GPL-2.0-or-later" } diff --git a/phpcs.xml b/phpcs.xml index edec387e..c2fdc042 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -52,7 +52,7 @@ - + diff --git a/src/Admin/CommentsColumns.php b/src/Admin/CommentsColumns.php index 5a803662..146e34bf 100644 --- a/src/Admin/CommentsColumns.php +++ b/src/Admin/CommentsColumns.php @@ -71,7 +71,7 @@ public static function register_plugin_columns( $columns ) { /** * Display plugin column values on comments screen * - * @param string $column Currently selected column. + * @param string $column Currently selected column. * @param integer $comment_id Comment ID. * * @since 2.6.0 @@ -141,19 +141,19 @@ public static function filter_columns() { global $wpdb; ?> + for="filter-by-comment-spam-reason"> %s', - $unique_id, - time(), - $script - ); + '%s', + $unique_id, + time(), + $script + ); } ); } diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 53e74e8f..00000000 --- a/webpack.config.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * External dependencies - */ -const path = require( 'path' ); -const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); -const SVGSpritemapPlugin = require( 'svg-spritemap-webpack-plugin' ); - -/** - * Webpack config (Development mode) - * - * @see https://developer.wordpress.org/block-editor/packages/packages-scripts/#provide-your-own-webpack-config - */ -module.exports = { - ...defaultConfig, - entry: { - backend: path.resolve( process.cwd(), 'assets/src', 'backend.js' ), - }, - output: { - filename: '[name].js', - path: path.resolve( process.cwd(), 'assets/dist' ), - }, - module: { - rules: [ - ...defaultConfig.module.rules, - { - test: /\.svg$/, - use: [ '@svgr/webpack', 'url-loader' ], - }, - ], - }, - plugins: [ - ...defaultConfig.plugins, - - /** - * Generate an SVG sprite. - * - * @see https://github.com/cascornelissen/svg-spritemap-webpack-plugin - */ - new SVGSpritemapPlugin( 'assets/src/images/icons/**/*.svg', { - output: { - filename: 'images/icons/sprite.svg', - }, - sprite: { - prefix: 'antispam-bee-', - }, - } ), - ], -};