diff --git a/.cursor/rules/agents.mdc b/.cursor/rules/agents.mdc new file mode 100644 index 00000000..b1c13d7a --- /dev/null +++ b/.cursor/rules/agents.mdc @@ -0,0 +1,7 @@ +--- +description: Contribution guidelines for Antispam Bee +globs: ["**/*"] +alwaysApply: true +--- + +Read AGENTS.md for the full contribution guidelines. diff --git a/.distignore b/.distignore index a06fd9a8..b2eb7af4 100644 --- a/.distignore +++ b/.distignore @@ -1,29 +1,30 @@ # Directories -/.git +/.cursor /.github /.wordpress-org /bin -/node_modules +/docs /tests -/vendor # Files /.distignore -/.eslintrc.json +/.editorconfig /.gitattributes /.gitignore /.sonarcloud.properties -/.stylelintrc.json +/.windsurfrules +/.wp-env.json +/AGENTS.md +/CLAUDE.md +/CONVENTIONS.md +/README.md /composer.json /composer.lock -/composer-php-5-4.json /docker-compose.yml -/DOCKER_ENV -/package.json /package-lock.json +/package.json /phpcs.xml +/phpstan-bootstrap.php /phpunit.xml.dist -/README.md -/output.log -/docker_tag -/behat.yml +/playwright.config.ts +/typos.toml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..79207a40 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,22 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# WordPress Coding Standards +# https://make.wordpress.org/core/handbook/coding-standards/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab +indent_size = 4 + +[{.jshintrc,*.json,*.yml}] +indent_style = space +indent_size = 2 + +[{*.txt,wp-config-sample.php}] +end_of_line = crlf diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 782125e7..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "extends": "plugin:@wordpress/eslint-plugin/es5", - "env": { - "browser": true, - "jquery": true - }, - "globals": { - "Raphael": "readonly", - "getAnchors": "readonly" - }, - "rules": { - "camelcase": 0, - "eqeqeq": 0, - "no-mixed-operators": 0, - "no-redeclare": 0, - "no-shadow": 0, - "no-unused-expressions": 0, - "no-unused-vars": 0, - "vars-on-top": 0 - } -} diff --git a/.gitattributes b/.gitattributes index 643ea97a..7bf0052b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,25 +1,29 @@ # Directories +/.cursor export-ignore /.github export-ignore /.wordpress-org export-ignore /bin export-ignore -/node_modules export-ignore +/docs export-ignore /tests export-ignore -/vendor export-ignore # Files /.distignore export-ignore -/.eslintrc.json export-ignore +/.editorconfig export-ignore /.gitattributes export-ignore /.gitignore export-ignore /.sonarcloud.properties export-ignore -/.stylelintrc.json export-ignore -/behat.yml export-ignore +/.windsurfrules export-ignore +/.wp-env.json export-ignore +/AGENTS.md export-ignore +/CLAUDE.md export-ignore +/CONVENTIONS.md export-ignore +/README.md export-ignore /composer.json export-ignore -/composer.lock export-ignore -/composer-php-5-4.json export-ignore /docker-compose.yml export-ignore -/package.json export-ignore /package-lock.json export-ignore +/package.json export-ignore /phpcs.xml export-ignore +/phpstan-bootstrap.php export-ignore /phpunit.xml.dist export-ignore -/README.md export-ignore +/playwright.config.ts export-ignore +/typos.toml export-ignore diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000..bd6a7d6b --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1 @@ +Read AGENTS.md for the full contribution guidelines. diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 45bde066..07f96fa9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,100 +1,130 @@ -name: Tests, Behat, Coding Standards +name: Tests, Coding Standards on: push: branches: - - 'master' + - master + - v3 pull_request: jobs: - test: + test-unit: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['7.2', '5.4'] + php-versions: ['8.5', '7.4'] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} 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 + tools: composer + - name: Install run: | composer install - ./vendor/bin/phpunit -c ./phpunit.xml.dist - behat: - runs-on: ubuntu-22.04 - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: pluginkollektiv_antispambee_behat - ports: - - '8888:3306' - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + - name: Run tests + run: | + composer test:unit + + test-e2e: + runs-on: ubuntu-latest strategy: + fail-fast: false matrix: include: - php: '8.5' wordpress: 'nightly' + - php: '8.5' + wordpress: 'latest' + - php: '8.5' + wordpress: '7.0' - php: '8.4' - wordpress: '6.8' + wordpress: '6.9' - php: '8.3' - wordpress: '6.7' + wordpress: '6.8' - php: '8.2' - wordpress: '6.3' + wordpress: '6.7' - php: '8.1' - wordpress: '6.2' + wordpress: '6.6' - php: '8.0' wordpress: '6.0' - - php: '7.3' - wordpress: '5.0' - - php: '7.2' - wordpress: '4.6' + - php: '7.4' + wordpress: '5.6' steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: '22' + cache: 'npm' + - name: Install npm dependencies + run: npm ci + - name: Install Playwright browsers + run: npx playwright install chromium --with-deps - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: mbstring, intl, pdo_mysql, zip - ini-values: post_max_size=256M, short_open_tag=On - tools: phpunit, composer - - name: Start mysql service - run: sudo /etc/init.d/mysql start - - name: Install XVFB - run: sudo apt-get update && sudo apt-get install xvfb - - name: Run tests + tools: composer + - name: Install Composer dependencies + run: composer install --no-dev --optimize-autoloader + - name: Configure wp-env for matrix run: | - composer install --ignore-platform-req=php - xvfb-run -n 99 ./bin/behat.sh - env: - WORDPRESS_VERSION: ${{ matrix.wordpress }} - NAP_LENGTH: 10 - - name: Cleanup xvfb - uses: bcomnes/cleanup-xvfb@v1 + case "${{ matrix.wordpress }}" in + nightly) CORE="WordPress/WordPress" ;; + latest) CORE="https://wordpress.org/latest.zip" ;; + *) CORE="https://wordpress.org/wordpress-${{ matrix.wordpress }}.zip" ;; + esac + echo "{\"core\":\"${CORE}\",\"phpVersion\":\"${{ matrix.php }}\"}" | tee .wp-env.override.json + - name: Start wp-env + run: npm run env:start + - name: Run E2E tests + run: npm run test:e2e + - name: Upload test report on failure + if: failure() + uses: actions/upload-artifact@v7 + with: + name: playwright-report-php${{ matrix.php }}-wp${{ matrix.wordpress }} + path: tests/e2e/report/ + retention-days: 7 + - name: Stop wp-env + if: always() + run: npm run env:stop + + phpstan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.5' + tools: composer + - name: Install Composer dependencies + run: composer install --ignore-platform-req=php + - name: Run PHPStan + run: composer phpstan + quality: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.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: '22' + php-version: '8.5' + tools: composer - name: Run code style checks for CSS, JavaScript and PHP run: | composer install --ignore-platform-req=php - npm install - composer lint-all + ./vendor/bin/phpcs --config-set ignore_warnings_on_exit 1 composer cs + + spelling: + name: Typos + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: crate-ci/typos@master diff --git a/.github/workflows/wordpress-plugin-asset-update.yml b/.github/workflows/wordpress-plugin-asset-update.yml index 9f36410c..5293e9f8 100644 --- a/.github/workflows/wordpress-plugin-asset-update.yml +++ b/.github/workflows/wordpress-plugin-asset-update.yml @@ -9,11 +9,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.5' tools: composer - name: Build run: composer install --ignore-platform-reqs diff --git a/.github/workflows/wordpress-plugin-deploy.yml b/.github/workflows/wordpress-plugin-deploy.yml index 06c7c53c..a46498ce 100644 --- a/.github/workflows/wordpress-plugin-deploy.yml +++ b/.github/workflows/wordpress-plugin-deploy.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 with: diff --git a/.gitignore b/.gitignore index a091677a..21a7e536 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,29 @@ -css/*.min.css -js/*.min.js -.idea/ -node_modules/ -tmp/ -vendor/ -chromedriver -DOCKER_ENV -driver.tar.gz -driver.zip -geckodrier -nohup.out -package-lock.json +# Directories +/.aider/ +/.claude/ +/.idea/ +/assets/dist +/build/ +/**/node_modules/ +/test-results/ +/tests/e2e/report/ +/tmp/ +/**/vendor/ + +# Files +/.aider.conf.yml +/.phpunit.result.cache +/.windsurfrules +/.wp-env.override.json +/AGENTS.local.md +/CLAUDE.local.md +/CONVENTIONS.local.md +/DOCKER_ENV +/chromedriver +/composer.lock +/driver.tar.gz +/driver.zip +/geckodriver +/nohup.out +/output.log +/yarn.lock diff --git a/.stylelintrc.json b/.stylelintrc.json deleted file mode 100644 index 68e038b0..00000000 --- a/.stylelintrc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "@wordpress/stylelint-config", - "rules": { - "declaration-property-unit-allowed-list": null, - "font-weight-notation": null, - "font-family-no-missing-generic-family-keyword": null, - "no-descending-specificity": null, - "selector-class-pattern": null, - "selector-id-pattern": null - } -} diff --git a/.windsurfrules b/.windsurfrules new file mode 100644 index 00000000..bd6a7d6b --- /dev/null +++ b/.windsurfrules @@ -0,0 +1 @@ +Read AGENTS.md for the full contribution guidelines. diff --git a/.wp-env.json b/.wp-env.json new file mode 100644 index 00000000..4eeddb3d --- /dev/null +++ b/.wp-env.json @@ -0,0 +1,24 @@ +{ + "core": "WordPress/WordPress", + "phpVersion": "8.2", + "plugins": [ + "." + ], + "config": { + "WP_DEBUG": true, + "WP_DEBUG_LOG": true, + "WP_DEBUG_DISPLAY": true, + "WP_ENVIRONMENT_TYPE": "production" + }, + "lifecycleScripts": { + "afterStart": "node tests/e2e/language-api/start.js", + "afterDestroy": "node tests/e2e/language-api/stop.js" + }, + "env": { + "tests": { + "mappings": { + "wp-content/mu-plugins": "./tests/e2e/env/mu-plugins" + } + } + } +} diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..eabc4188 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,106 @@ +# AI Agent Guidelines + +General rules for AI agents contributing to this project. + +## What is project code + +Project code lives in `src/`, `tests/`, and the root PHP files (e.g. `antispam_bee.php`). Ignore +`vendor/` and `node_modules/` when searching, reviewing, or reasoning about the code — both are +gitignored, installed locally by `composer install` / `npm install`, and contain only third-party +dependencies you must not modify. The plugin ships **no** runtime dependencies; everything in +`vendor/` is a `require-dev` code-quality tool (PHPCS, PHPStan, PHPUnit, WP-CLI, WPCS, …), so +treating it as project code produces false findings. + +## Code quality — verify before every commit + +| Check | Command | +|-------------------------|----------------------------------------------| +| PHP code style | `composer cs` | +| PHPStan static analysis | `composer phpstan` | +| PHP unit tests | `composer test:unit` | +| E2E tests | `npm run env:start`, then `npm run test:e2e` | + +Fix code style violations automatically with `composer csfix`. + +Target PHP 7.2+. Avoid syntax introduced in PHP 7.4 or later: typed properties, arrow functions ( +`fn =>`), `match` expressions, null-coalescing assignment (`??=`). The `phpcs.xml` ruleset enforces +this via PHPCompatibilityWP. + +## WordPress & security conventions + +- **Capability checks** — gate every admin action with `current_user_can( 'manage_options' )` before + reading `$_GET`/`$_POST` or writing data. +- **Nonces** — verify with `check_admin_referer()` (form submissions) or `wp_verify_nonce()` (AJAX); + generate with `wp_nonce_field()` / `wp_create_nonce()`. +- **Sanitize input** — use `sanitize_text_field( wp_unslash( $value ) )`, `sanitize_key()`, + `absint()`, etc. on all untrusted input at the point of reading. +- **Escape output** — use `esc_html()`, `esc_attr()`, `esc_url()`, or `wp_kses()` at the point of + output; never store pre-escaped values. +- **Text domain** — always `'antispam-bee'` (matches the plugin slug); do not use a variable or a + different string. + +## Inline documentation + +Document every hook (`apply_filters()` / `do_action()`) following the +[WordPress PHP inline documentation standards](https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/). + +- **Placement** — put the DocBlock on the line immediately preceding the `apply_filters()` / + `do_action()` call. If the call is embedded in an expression or condition, extract it into a + variable so the DocBlock attaches directly to the call. +- **Tag order** — summary, then optional description, then `@since`, then `@param` (one per hook + argument, aligned). +- **No `@return`** — hook DocBlocks never use `@return`. Action hooks return nothing, and filter + hooks always return their first parameter. +- **`@since`** — use the three-digit version in which the hook was introduced (e.g. `@since 2.9.4`). + For a hook that already exists on `master`, trace the introducing commit and its release version; + for a hook new to `v3`, use `@since 3.0.0`. +- Reuse of a WordPress core hook (e.g. `pre_comment_user_ip`, `allow_empty_comment`) is documented + the same way, with the `@since` reflecting when this plugin started applying it. + +## Git workflow + +- Always work on a **feature branch** based on `v3` +- Never commit directly to `v3` or `master` +- Use conventional commit messages: `feat:`, `fix:`, `test:`, `refactor:`, `chore:`, etc. + +## Ignore / export files + +Three files control what is excluded from VCS and distributions. Keep them in sync when adding new +dotfiles or dev-only assets. + +### `.gitignore` + +Excludes local artifacts from git tracking. + +- Directories use a trailing `/` (e.g. `/build/`) — required to match directories only, not + same-named files +- Use `/` prefix for root-level entries (e.g. `/.idea/`) +- Use `/**/` prefix for entries that must also match in subdirectories (e.g. `/**/node_modules/`, + `/**/vendor/`) +- Keep each section (`# Directories`, `# Files`) sorted alphabetically + +### `.distignore` + +Excludes files from `wp dist-zip` plugin packages. WP-CLI does not support glob syntax — use plain +root-relative paths only. + +- No trailing `/` on directories (not needed by WP-CLI) +- Always use `/` prefix (e.g. `/bin`, `/node_modules`) +- Keep each section (`# Directories`, `# Files`) sorted alphabetically + +### `.gitattributes` + +Excludes tracked files from `git archive` exports via `export-ignore`. + +- Only tracked files and directories need an entry here — gitignored paths are already absent from + archives +- Always use `/` prefix (e.g. `/.github export-ignore`) +- No trailing `/` on directories (not needed) +- Keep each section (`# Directories`, `# Files`) sorted alphabetically + +## Pull requests + +- Base branch: `v3` +- Include a short summary of what changed and why +- Add test steps when the change affects user-facing behavior; pure code style fixes do not need + them diff --git a/CHANGELOG.md b/CHANGELOG.md index 4268e649..fd44b543 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,392 +1,470 @@ ## Changelog ## +### 3.0.0 – WIP ### + +* **English** + * Complete code rewrite and backend UI overhaul + * Allows extending Antispam Bee with your own rules + * Allows using Antispam Bee rules for other reactions than comments, for example, forms + +* **Deutsch** + * Kompletter Code-Rewrite und Überarbeitung des Backend-User-Interfaces + * Möglichkeit der Erweiterung von Antispam Bee um eigene Spam-Regeln + * Erlaubt die Nutzung von Antispam Bee für andere Reaktionen als Kommentare, beispielsweise + Formulare + ### 2.11.12 ### + * **English** - * Fix: Fatal error in the dashboard spam counter (Thanks @robertstaddon!) + * Fix: Fatal error in the dashboard spam counter (Thanks @robertstaddon!) * **Deutsch** - * Fix: Fatal Error im Dashboard Spam-Counter (Danke @robertstaddon!) + * Fix: Fatal Error im Dashboard Spam-Counter (Danke @robertstaddon!) ### 2.11.11 ### + * **English** - * Enhancement: Add shorturl.fm spam pattern + * Enhancement: Add a shorturl.fm spam pattern * **Deutsch** - * Verbesserung: Hinzufügen eines Musters für shorturl.fm Spam + * Verbesserung: Hinzufügen eines Musters für shorturl.fm Spam ### 2.11.10 ### + * **English** - * Fix: remove build-tool warnings from minified Javascript and CSS resources + * Fix: remove build-tool warnings from minified JavaScript and CSS resources * **Deutsch** - * Fix: Build-Tool-Warnungen aus minifizierten Javascript und CSS Ressourcen entfernt + * Fix: Build-Tool-Warnungen aus minifizierten JavaScript und CSS Ressourcen entfernt ### 2.11.9 ### + * **English** - * Tweak: Improved compatibility with unquoted HTML attributes in comment forms - * Maintenance: Tested up to WordPress 7.0 + * Tweak: Improved compatibility with unquoted HTML attributes in comment forms + * Maintenance: Tested up to WordPress 7.0 * **Deutsch** - * Tweak: Kompatibilität mit nicht in Anführungszeichen gesetzten HTML-Attributen in Kommentarformularen verbessert - * Wartung: Getestet mit WordPress 7.0 + * Tweak: Kompatibilität mit nicht in Anführungszeichen gesetzten HTML-Attributen in + Kommentarformularen verbessert + * Wartung: Getestet mit WordPress 7.0 ### 2.11.8 ### + * **English** - * Tweak: Minor code changes and housekeeping - * Tweak: Add link to Patchstack in readme - * Maintenance: Tested up to WordPress 6.8 + * Tweak: Minor code changes and housekeeping + * Tweak: Add a link to Patchstack in readme + * Maintenance: Tested up to WordPress 6.8 * **Deutsch** - * Tweak: Kleinere Code-Änderungen und Aufräumarbeiten - * Tweak: Link zu Patchstack in readme hinzugefügt - * Wartung: Getestet mit WordPress 6.8 + * Tweak: Kleinere Code-Änderungen und Aufräumarbeiten + * Tweak: Link zu Patchstack in readme hinzugefügt + * Wartung: Getestet mit WordPress 6.8 ### 2.11.7 ### + * **English** - * Tweak: Use SCRIPT_NAME instead of REQUEST_URI to check path - * Fix: Remove `add_reasons_to_defaults()` from general initialization for better WordPress 6.7 compatibility - * Maintenance: Tested up to WordPress 6.7 + * Tweak: Use SCRIPT_NAME instead of REQUEST_URI to check the path + * Fix: Remove `add_reasons_to_defaults()` from general initialization for better WordPress 6.7 + compatibility + * Maintenance: Tested up to WordPress 6.7 * **Deutsch** - * Tweak: Verwende SCRIPT_NAME anstelle von REQUEST_URI, um den Pfad zu prüfen - * Fix: Entfernen von `add_reasons_to_defaults()` von der allgemeinen Initialisierung für bessere WordPress 6.7 Kompatibilität - * Wartung: Getestet mit WordPress 6.7 + * Tweak: Verwende SCRIPT_NAME anstelle von REQUEST_URI, um den Pfad zu prüfen + * Fix: Entfernen von `add_reasons_to_defaults()` von der allgemeinen Initialisierung für bessere + WordPress 6.7 Kompatibilität + * Wartung: Getestet mit WordPress 6.7 ### 2.11.6 ### + * **English** - * Fix: Delete missed out option on uninstall (Thanks @okvee!) - * Tweak: Minor i18n improvements (Thanks Pedro!) - * Tweak: Minor code changes and housekeeping - * Tweak: Updated dependencies + * Fix: Delete a missed-out option on uninstallation (Thanks @okvee!) + * Tweak: Minor i18n improvements (Thanks Pedro!) + * Tweak: Minor code changes and housekeeping + * Tweak: Updated dependencies * **Deutsch** - * Fix: Bei Deinstallation wurde eine Option nicht korrekt gelöscht (Danke @okvee!) - * Tweak: Kleinere i18n-Verbesserungen (Danke Pedro!) - * Tweak: Kleinere Code-Änderungen und Aufräumarbeiten - * Tweak: Aktualisierte Abhängigkeiten + * Fix: Bei Deinstallation wurde eine Option nicht korrekt gelöscht (Danke @okvee!) + * Tweak: Kleinere i18n-Verbesserungen (Danke Pedro!) + * Tweak: Kleinere Code-Änderungen und Aufräumarbeiten + * Tweak: Aktualisierte Abhängigkeiten ### 2.11.5 ### -IMPORTANT: If you use the country check and are behind a proxy or similar, you need to use the `antispam_bee_trusted_ip` filter to get the correct IP from a header like `HTTP_X_FORWARDED` (don’t return an empty value here, otherwise all comments are marked as spam). -WICHTIG: Wenn du den Spam-Check für bestimmte Länder verwendest und hinter einem Proxy oder ähnlich bist, musst du den `antispam_bee_trusted_ip`-Filter verwenden, um die richtige Adresse des Users von einem Header wie `HTTP_X_FORWARDED` zu bekommen (hier darfst du keinen leeren String zurückgeben, sonst werden alle Kommentare als Spam markiert). + +IMPORTANT: If you use the country check and are behind a proxy or similar, you need to use the +`antispam_bee_trusted_ip` filter to get the correct IP from a header like `HTTP_X_FORWARDED` (don’t +return an empty value here, otherwise all comments are marked as spam). +WICHTIG: Wenn du den Spam-Check für bestimmte Länder verwendest und hinter einem Proxy oder ähnlich +bist, musst du den `antispam_bee_trusted_ip`-Filter verwenden, um die richtige Adresse des Users von +einem Header wie `HTTP_X_FORWARDED` zu bekommen (hier darfst du keinen leeren String zurückgeben, +sonst werden alle Kommentare als Spam markiert). + * **English** - * Fix: Usage of core filter `pre_comment_user_ip` breaks ASB if the IP address is removed for GDPR compliance + * Fix: Usage of core filter `pre_comment_user_ip` breaks ASB if the IP address is removed for + GDPR compliance * **Deutsch** - * Fix: Die Verwendung des Core-Filters `pre_comment_user_ip` sorgt für Fehler, wenn die IP-Adresse für die Einhaltung der DSGVO entfernt wird + * Fix: Die Verwendung des Core-Filters `pre_comment_user_ip` sorgt für Fehler, wenn die + IP-Adresse für die Einhaltung der DSGVO entfernt wird ### 2.11.4 ### -IMPORTANT: If you use the country check and are behind a proxy or similar, you need to use the `pre_comment_user_ip` filter to get the correct IP from a header like `HTTP_X_FORWARDED`. -WICHTIG: Wenn du den Spam-Check für bestimmte Länder verwendest und hinter einem Proxy oder ähnlich bist, musst du den `pre_comment_user_ip`-Filter verwenden, um die richtige Adresse des Users von einem Header wie `HTTP_X_FORWARDED` zu bekommen. + +IMPORTANT: If you use the country check and are behind a proxy or similar, you need to use the +`pre_comment_user_ip` filter to get the correct IP from a header like `HTTP_X_FORWARDED`. +WICHTIG: Wenn du den Spam-Check für bestimmte Länder verwendest und hinter einem Proxy oder ähnlich +bist, musst du den `pre_comment_user_ip`-Filter verwenden, um die richtige Adresse des Users von +einem Header wie `HTTP_X_FORWARDED` zu bekommen. + * **English** - * Fix: Read client IP for country check from `REMOTE_ADDR` only (filterable via `pre_comment_user_ip`) - * Fix: No spam reason in spam notification email, and related PHP warning - * Fix: Remove outdated info from readme - * Enhancement: Show upgrade notice on plugin overview page - * Maintenance: Tested up to WordPress 6.3 + * Fix: Read client IP for country check from `REMOTE_ADDR` only (filterable via + `pre_comment_user_ip`) + * Fix: No spam reason in spam notification email and related PHP warning + * Fix: Remove outdated info from readme + * Enhancement: Show the upgrade notice on the plugin overview page + * Maintenance: Tested up to WordPress 6.3 * **Deutsch** - * Fix: Client-IP wird nur noch aus `REMOTE_ADDR` ermittelt (filterbar über `pre_comment_user_ip`) - * Fix: Der Spam-Grund wird wieder korrekt in der Benachrichtigungs-E-Mail zu Spam angezeigt und die damit zusammenhängende PHP-Warning behoben - * Fix: Veraltete Infos aus der Readme wurden entfernt - * Verbesserung: Upgrade-Hinweis wird auch in der Plugin-Übersicht angezeigt - * Wartung: Getestet mit WordPress 6.3 + * Fix: Client-IP wird nur noch aus `REMOTE_ADDR` ermittelt (filterbar über + `pre_comment_user_ip`) + * Fix: Der Spam-Grund wird wieder korrekt in der Benachrichtigungs-E-Mail zu Spam angezeigt und + die damit zusammenhängende PHP-Warning behoben + * Fix: Veraltete Infos aus der Readme wurden entfernt + * Verbesserung: Upgrade-Hinweis wird auch in der Plugin-Übersicht angezeigt + * Wartung: Getestet mit WordPress 6.3 ### 2.11.3 ### + * **English** - * Fix: Multiselect for "Delete comments by spam reasons" was not saving values - * Fix: Fix broken link for ISO country codes - * Maintenance: Added test for PHP 8.2 - * Maintenance: Tested up to WordPress 6.2 + * Fix: Multiselect for "Delete comments by spam reasons" was not saving values + * Fix: Fix a broken link for ISO country codes + * Maintenance: Added test for PHP 8.2 + * Maintenance: Tested up to WordPress 6.2 * **Deutsch** - * Behoben: Multiselect für "Kommentare aus Spamgründen löschen" speicherte keine Werte - * Fix: Fehlerhafter Link für ISO-Ländercodes behoben - * Wartung: Test für PHP 8.2 hinzugefügt - * Wartung: Getestet mit WordPress 6.2 - + * Behoben: Multiselect für "Kommentare aus Spamgründen löschen" speicherte keine Werte + * Fix: Fehlerhafter Link für ISO-Ländercodes behoben + * Wartung: Test für PHP 8.2 hinzugefügt + * Wartung: Getestet mit WordPress 6.2 + ### 2.11.2 ### + * **English** - * Tweak: remove superfluous translations - * Tweak: make FAQ link an anchor link - * Fix: spam counter no longer raises a warning with PHP 8.1 if no spam is present yet - * Fix: spam reasons are now localized correctly - * Fix: Translations were loaded twice on some admin pages - * Maintenance: Tested up to WordPress 6.1 + * Tweak: remove superfluous translations + * Tweak: make an FAQ link an anchor link + * Fix: spam counter no longer raises a warning with PHP 8.1 if no spam is present yet + * Fix: spam reasons are now localized correctly + * Fix: Translations were loaded twice on some admin pages + * Maintenance: Tested up to WordPress 6.1 * **Deutsch** - * Tweak: Überflüssige Übersetzungen entfernt - * Tweak: Link zu den FAQ ist jetzt ein Anker-Link - * Fix: Der Spam-Zähler erzeugt mit PHP 8.1 keine Warnung mehr, wenn noch kein Spam vorhanden ist - * Fix: Spam-Gründe werden nun korrekt übersetzt - * Fix: Übersetzungen wurden auf einzelnen Adminseiten doppelt geladen - * Wartung: Getestet mit WordPress 6.1 + * Tweak: Überflüssige Übersetzungen entfernt + * Tweak: Link zu den FAQ ist jetzt ein Anker-Link + * Fix: Der Spam-Zähler erzeugt mit PHP 8.1 keine Warnung mehr, wenn noch kein Spam vorhanden ist + * Fix: Spam-Gründe werden nun korrekt übersetzt + * Fix: Übersetzungen wurden auf einzelnen Adminseiten doppelt geladen + * Wartung: Getestet mit WordPress 6.1 ### 2.11.1 ### + * **English** - * Tweak: remove superfluous type attribute from inline script tag - * Maintenance: Tested up to WordPress 6.0 + * Tweak: remove superfluous type attribute from the inline script tag + * Maintenance: Tested up to WordPress 6.0 * **Deutsch** - * Tweak: Überflüssiges type-Attribut von script-Tag entfernt - * Wartung: Getestet mit WordPress 6.0 + * Tweak: Überflüssiges type-Attribut von script-Tag entfernt + * Wartung: Getestet mit WordPress 6.0 ### 2.11.0 ### + * **English** - * Fix: Allow empty comments if `allow_empty_comment` is set to true - * Fix: Add `aria-label` to work around bug in a11y testing tools - * Fix: Change priority for `comment_form_field_comment` from 10 to 99 - * Tweak: Updated some FAQ entries - * Tweak: Updated build tooling + * Fix: Allow empty comments if `allow_empty_comment` is set to true + * Fix: Add `aria-label` to work around bug in a11y testing tools + * Fix: Change priority for `comment_form_field_comment` from 10 to 99 + * Tweak: Updated some FAQ entries + * Tweak: Updated build tooling * **Deutsch** - * Fix: Leere Kommentare erlauben, wenn der Filter `allow_empty_comment` gesetzt ist - * Fix: Ein `aria-label` hinzugefügt, um einen bekannten Fehler bei Tests zu umgehen - * Fix: Änderung der Priorität vom Filter `comment_form_field_comment` von 10 auf 99 - * Tweak: Aktualisierungen in der FAQ - * Tweak: Optimierungen am Build-Prozess + * Fix: Leere Kommentare erlauben, wenn der Filter `allow_empty_comment` gesetzt ist + * Fix: Ein `aria-label` hinzugefügt, um einen bekannten Fehler bei Tests zu umgehen + * Fix: Änderung der Priorität vom Filter `comment_form_field_comment` von 10 auf 99 + * Tweak: Aktualisierungen in der FAQ + * Tweak: Optimierungen am Build-Prozess ### 2.10.0 ### + * **English** - * Fix: Switch from ip2country.info to iplocate.io for country check - * Enhancement: Use filter to add the honeypot field instead of output buffering for new installations and added option to switch between the both ways - * Tweak: Added comment user agent to regex pattern check - * Tweak: Make the ping detection filterable to support new comment types - * Tweak: Updated internal documentation links - * Tweak: Several updates and optimizations in the testing process - * Tweak: Adjust color palette to recent WP version - * Tweak: Adjust wording in variables and option names - * Readme: Add new contributor and clean up unused code - -* **Deutsch** - * Fix: Wechsel von ip2country.info zu iplocate.io für die Länderprüfung - * Verbesserung: Bei neuen Installationen wird ein Filter zum Hinzufügen des Honeypot-Felds genutzt statt Output-Buffering. Es wurde eine Option hinzugefügt, zwischen den beiden Wegen zu wechseln - * Tweak: Kommentar User-Agent zu Regex-Pattern hinzugefügt - * Tweak: Die Ping-Erkennung ist jetzt filterbar, um neue Kommentartypen zu unterstützen - * Tweak: Aktualisierte Links zur internen Dokumentation - * Tweak: Verschiedene Aktualisierungen und Optimierungen im Testprozess - * Tweak: Farbpalette an aktuelle WP-Version anpassen - * Tweak: Wortlaut in Variablen und Optionsnamen wurden angepasst - * Readme: Neuer Contributor hinzugefügt und unbenutzten Code bereinigt + * Fix: Switch from ip2country.info to iplocate.io for country check + * Enhancement: Use filter to add the honeypot field instead of output buffering for new + installations and added an option to switch between the both ways + * Tweak: Added comment user agent to regex pattern check + * Tweak: Make the ping detection filterable to support new comment types + * Tweak: Updated internal documentation links + * Tweak: Several updates and optimizations in the testing process + * Tweak: Adjust color palette to a recent WP version + * Tweak: Adjust wording in variables and option names + * Readme: Add new contributor and clean up unused code + +* **Deutsch** + * Fix: Wechsel von ip2country.info zu iplocate.io für die Länderprüfung + * Verbesserung: Bei neuen Installationen wird ein Filter zum Hinzufügen des Honeypot-Felds + genutzt statt Output-Buffering. Es wurde eine Option hinzugefügt, zwischen den beiden Wegen zu + wechseln + * Tweak: Kommentar User-Agent zu Regex-Pattern hinzugefügt + * Tweak: Die Ping-Erkennung ist jetzt filterbar, um neue Kommentartypen zu unterstützen + * Tweak: Aktualisierte Links zur internen Dokumentation + * Tweak: Verschiedene Aktualisierungen und Optimierungen im Testprozess + * Tweak: Farbpalette an aktuelle WP-Version anpassen + * Tweak: Wortlaut in Variablen und Optionsnamen wurden angepasst + * Readme: Neuer Contributor hinzugefügt und unbenutzten Code bereinigt ### 2.9.4 ### + * **English** - * Enhancement: Add filter to allow ajax calls - * Tweak: Better wording for BBCode feature in plugin description - * Tweak: Better screenshots in the plugin directory - * Maintenance: Tested up to WordPress 5.7 + * Enhancement: Add filter to allow ajax calls + * Tweak: Better wording for BBCode feature in plugin description + * Tweak: Better screenshots in the plugin directory + * Maintenance: Tested up to WordPress 5.7 * **Deutsch** - * Verbesserung: Filter hinzugefügt, um Ajax-Aufrufe zuzulassen - * Tweak: Bessere Formulierung für BBCode-Funktion in Plugin-Beschreibung - * Tweak: Bessere Screenshots im Plugin-Verzeichnis - * Wartung: Getestet mit WordPress 5.7 + * Verbesserung: Filter hinzugefügt, um Ajax-Aufrufe zuzulassen + * Tweak: Bessere Formulierung für BBCode-Funktion in Plugin-Beschreibung + * Tweak: Bessere Screenshots im Plugin-Verzeichnis + * Wartung: Getestet mit WordPress 5.7 ### 2.9.3 ### + * **English** - * Fixed: Compatibility with WordPress 5.5 - * Fixed: Undefined index on spam list page - * Tweak: Better wording on settings page - * Tweak: AMP compatibility - * Tweak: Protect CSS from overwrite through bad themes + * Fixed: Compatibility with WordPress 5.5 + * Fixed: Undefined index on the spam list page + * Tweak: Better wording on the settings page + * Tweak: AMP compatibility + * Tweak: Protect CSS from overwriting through bad themes * **Deutsch** - * Fix: Kompatibilität mit WordPress 5.5 - * Fix: Undefined index in Spamliste - * Tweak: Inklusivere Sprache unter Einstellungen - * Tweak: AMP-Kompatibilität - * Tweak: Schütze CSS besser vor Überschreiben durch schlechte Themes + * Fix: Kompatibilität mit WordPress 5.5 + * Fix: Undefined index in Spamliste + * Tweak: Inklusivere Sprache unter Einstellungen + * Tweak: AMP-Kompatibilität + * Tweak: Schütze CSS besser vor Überschreiben durch schlechte Themes ### 2.9.2 ### + * **English** - * Fix: Delete comment meta for deleted old spam. For the cleanup of older orphaned comment meta we suggest the usage of [WP Sweep](https://wordpress.org/plugins/wp-sweep/) - * Fix: Statistic in dashboard showed wrong value - * Tweak: Change autocomplete attribute to "new-password" - * Tweak: Autoptimize compatibility improved - * Tweak: Renamed blacklist/whitelist to a better phrase - * Tweak: Added new pattern - * Tweak: UI and text optimizations - * Tweak: Better compatibility with some server configurations - * Tweak: Make spam reason sortable and filterable - * Tweak: Add spam reason for manually marked spam - * Maintenance: Deleted unused code - * Maintenance: Removed Fake IP check (unreliable and producing false positives) - * Maintenance: Fix some coding standard issues - * Maintenance: Tested up to WordPress 5.4 - * Maintenance: Tested up to PHP 7.4 - - -* **Deutsch** - * Fix: Lösche Kommentarmeta beim Löschen von Spamkommentaren. Für das Aufräumen alter verwaister Kommentarmetas empfehlen wir die Verwendung von [WP Sweep](https://de.wordpress.org/plugins/wp-sweep/) - * Fix: Dashboard Statistiken zeigten falschen Wert - * Tweak: Änderung des autocomplete Attributs zu "new-password" - * Tweak: Kompatibilität mit Autoptimize verbessert - * Tweak: "Blacklist/Whitelist" umbenannt - * Tweak: Neue Spamerkennungsmuster hinzugefügt - * Tweak: UI und Textverbesserungen - * Tweak: Erhöhte Kompatibilität mit einigen Serverkonfigurationen - * Tweak: Kommentare nach Spamgrund sortier- und filterbar gemacht - * Tweak: Neuer Spamgrund für manuell markierten Spam eingeführt - * Maintenance: Ungenutzter Code wurde gelöscht - * Maintenance: Der Fake IP check wurde entfernt. Dieser war unzuverlässig und produzierte falsche Ergebnisse - * Maintenance: Einige Probleme mit unseren Coding standards wurden gefixt - * Maintenance: Getestet bis WordPress 5.4 - * Maintenance: Getestet bis PHP 7.4 + * Fix: Delete comment meta for deleted old spam. For the cleanup of older orphaned comment meta + we suggest the usage of [WP Sweep](https://wordpress.org/plugins/wp-sweep/) + * Fix: Statistics in the dashboard showed the wrong value + * Tweak: Change the autocomplete attribute to "new-password" + * Tweak: Autoptimize compatibility improved + * Tweak: Renamed blacklist/whitelist to a better phrase + * Tweak: Added a new pattern + * Tweak: UI and text optimizations + * Tweak: Better compatibility with some server configurations + * Tweak: Make spam reason sortable and filterable + * Tweak: Add spam reason for manually marked spam + * Maintenance: Deleted unused code + * Maintenance: Removed Fake IP check (unreliable and producing false positives) + * Maintenance: Fix some coding standard issues + * Maintenance: Tested up to WordPress 5.4 + * Maintenance: Tested up to PHP 7.4 + + +* **Deutsch** + * Fix: Lösche Kommentarmeta beim Löschen von Spamkommentaren. Für das Aufräumen alter verwaister + Kommentarmetas empfehlen wir die Verwendung + von [WP Sweep](https://de.wordpress.org/plugins/wp-sweep/) + * Fix: Dashboard Statistiken zeigten falschen Wert + * Tweak: Änderung des autocomplete Attributs zu "new-password" + * Tweak: Kompatibilität mit Autoptimize verbessert + * Tweak: "Blacklist/Whitelist" umbenannt + * Tweak: Neue Spamerkennungsmuster hinzugefügt + * Tweak: UI und Textverbesserungen + * Tweak: Erhöhte Kompatibilität mit einigen Serverkonfigurationen + * Tweak: Kommentare nach Spamgrund sortier- und filterbar gemacht + * Tweak: Neuer Spamgrund für manuell markierten Spam eingeführt + * Maintenance: Ungenutzter Code wurde gelöscht + * Maintenance: Der Fake IP Check wurde entfernt. Dieser war unzuverlässig und produzierte + falsche Ergebnisse + * Maintenance: Einige Probleme mit unseren Coding standards wurden gefixt + * Maintenance: Getestet bis WordPress 5.4 + * Maintenance: Getestet bis PHP 7.4 ### 2.9.1 ### + * **English** - * Improved backend accessibility - * Prefilled comment textareas do now work with the honeypot - * Compatible with the AMP plugin (https://wordpress.org/plugins/amp/) - * Improved dashboard tooltips - * Improvements for the language detection API - * Scalable IP look up for local spam database + * Improved backend accessibility + * Prefilled comment textareas do now work with the honeypot + * Compatible with the AMP plugin (https://wordpress.org/plugins/amp/) + * Improved dashboard tooltips + * Improvements for the language detection API + * Scalable IP look up for a local spam database * **Deutsch** - * Verbesserte Barrierefreiheit im Backend - * Vorausgefüllte Kommentarfelder arbeiten jetzt mit dem Honeypot zusammen - * Kompatibel mit dem AMP Plugin (https://wordpress.org/plugins/amp/) - * Verbesserte Tooltips im Dashboard - * Verbesserte Kommunikation mit der Spracherkennungs-API - * Skalierbarer IP-Abgleich für den lokalen Datenbank-Check. + * Verbesserte Barrierefreiheit im Backend + * Vorausgefüllte Kommentarfelder arbeiten jetzt mit dem Honeypot zusammen + * Kompatibel mit dem AMP Plugin (https://wordpress.org/plugins/amp/) + * Verbesserte Tooltips im Dashboard + * Verbesserte Kommunikation mit der Spracherkennungs-API + * Skalierbarer IP-Abgleich für den lokalen Datenbank-Check. ### 2.9.0 ### + * **English** - * Introduction of coding standards. - * Switch to franc language detection API for the language check. - * Do not longer overwrite the IP address WordPress saves with the comment by using `pre_comment_user_ip`. - * Do not show "Trust commenters with a Gravatar" if the "Show Gravatar" option is not set. - * Skip the checks, when I ping myself. - * Fixes some wrong usages of the translation functions. - * Use the regular expressions check also for trackbacks. - * Add option to delete Antispam Bee related data when plugin gets deleted via the admin interface. - * Save a hashed + salted IP for every comment - * New check for incoming Trackbacks. - * Introduction of behat tests. - * Updates the used JavaScript library for the statistics widget. - * Bugfix in the "Comment form used outside of posts" option. - -* **Deutsch** - * Einführung von Coding Standards. - * Wechsel auf die Franc Spracherkennungs API für den Sprach-Check. - * Beendet das Überschreiben der IP Adresse via `pre_comment_user_ip`, welche WordPress mit dem Kommentar speichert. - * Zeige die Option "Vertraue Kommentaren mit Gravatar" nur an wenn die Option "Zeige Gravatar" aktiviert ist. - * Überspringe die Filter, wenn ich mich selbst anpinge. - * Repariert einige falsche Verwendungsweisen der Übersetzungsfunktionalitäten. - * Wende den reguläre Ausdrücke Check auch auf Trackbacks an. - * Option hinzugefügt, dass Daten von Antispam Bee gelöscht werden, wenn das Plugin über das Admin Interface gelöscht wird. - * Speichere für jeden Kommentar eine salted Hash der IP Adresse. - * Ein neuer Check für eingehende Trackbacks. - * Einführung von Behat tests. - * Aktualisiert die genutzte JavaScript Bibliothek für das Statistik Widget. - * Bugfix in der "Kommentarformular wird außerhalb von Beiträgen verwendet" Einstellung + * Introduction of coding standards. + * Switch to franc language detection API for the language check. + * Do no longer overwrite the IP address WordPress saves with the comment by using + `pre_comment_user_ip`. + * Do not show "Trust commenters with a Gravatar" if the "Show Gravatar" option is not set. + * Skip the checks when I ping myself. + * Fixes some wrong usages of the translation functions. + * Use the regular expressions check also for trackbacks. + * Add an option to delete Antispam Bee related data when the plugin gets deleted via the admin + interface. + * Save a hashed + salted IP for every comment + * New check for incoming trackbacks. + * Introduction of behat tests. + * Updates the used JavaScript library for the statistics widget. + * Bugfix in the "Comment form used outside posts" option. + +* **Deutsch** + * Einführung von Coding Standards. + * Wechsel auf die Franc Spracherkennungs API für den Sprach-Check. + * Beendet das Überschreiben der IP-Adresse via `pre_comment_user_ip`, welche WordPress mit dem + Kommentar speichert. + * Zeige die Option "Vertraue Kommentaren mit Gravatar" nur an, wenn die Option "Zeige Gravatar" + aktiviert ist. + * Überspringe die Filter, wenn ich mich selbst anpinge. + * Repariert einige falsche Verwendungsweisen der Übersetzungsfunktionalitäten. + * Wende die regulären Ausdrücke Check auch auf Trackbacks an. + * Option hinzugefügt, dass Daten von Antispam Bee gelöscht werden, wenn das Plugin über das + Admin Interface gelöscht wird. + * Speichere für jeden Kommentar eine salted Hash der IP Adresse. + * Ein neuer Check für eingehende Trackbacks. + * Einführung von Behat tests. + * Aktualisiert die genutzte JavaScript-Bibliothek für das Statistik-Widget. + * Bugfix in der "Kommentarformular wird außerhalb von Beiträgen verwendet" Einstellung ### 2.8.1 ### * **English** - * PHP 5.3 compatibility - * Bugfix where a spam trackback produced a fatal error - * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/8?closed=1 + * PHP 5.3 compatibility + * Bugfix where a spam trackback produced a fatal error + * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/8?closed=1 * **Deutsch** - * PHP 5.3 Kompatibilität wieder hergestellt - * Bugfix: Ein Spam Trackback produzierte einen Fatal Error - * Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/8?closed=1 + * PHP 5.3 Kompatibilität wieder hergestellt + * Bugfix: Ein Spam Trackback produzierte einen Fatal Error + * Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/8?closed=1 ### 2.8.0 ### * **English** - * Removed stopforumspam.com to avoid potential GDPR violation - * Improves IP handling to comply with GDPR - * Improves PHP7.2 compatibility - * Fixes small bug on mobile views - * Allow more than one language in language check - * Minor interface improvements - * Remove old russian and Dutch translation files - * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/4?closed=1 + * Removed stopforumspam.com to avoid potential GDPR violation + * Improves IP handling to comply with GDPR + * Improves PHP7.2 compatibility + * Fixes a small bug on mobile views + * Allow more than one language in language check + * Minor interface improvements + * Remove old Russian and Dutch translation files + * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/4?closed=1 * **Deutsch** - - Entfernt stopforumspam.com zur Vorbeugung möglicher DSGVO-Verletzungen - - Verändert den Umgang mit IP-Adressen um der DSGVO zu entsprechen - - Verbessert PHP7.2-Kompatibilität - - Behebt einen CSS-Bugfix der mobilen Darstellung - - Erlaube mehr als eine Sprache im Sprachencheck - - Verberesserungen an der Benutzeroberfläche - - Entfernt alte russische und holländische Sprachversionen - - Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/4?closed=1 + - Entfernt stopforumspam.com zur Vorbeugung möglicher DSGVO-Verletzungen + - Verändert den Umgang mit IP-Adressen, um der DSGVO zu entsprechen + - Verbessert PHP7.2-Kompatibilität + - Behebt einen CSS-Bugfix der mobilen Darstellung + - Erlaube mehr als eine Sprache im Sprachencheck + - Verberesserungen an der Benutzeroberfläche + - Entfernt alte russische und holländische Sprachversionen + - Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/4?closed=1 ### 2.7.1 ### * **English** - * Fixes an incompatibility with Chrome autofill - * Fixes some incompatibilities with other plugins/themes where the comment field was left empty - * Support for RTL - * Solve some translation/language issues - * A new filter to add languages to the language check - * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/6?closed=1 + * Fixes an incompatibility with Chrome autofill + * Fixes some incompatibilities with other plugins/themes where the comment field was left empty + * Support for RTL + * Solve some translation/language issues + * A new filter to add languages to the language check + * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/6?closed=1 * **Deutsch** - - Behebt eine Inkompatibilität mit Chromes Autofill-Funktion - - Behebt einige Inkompatibilitäten mit anderen Plugins/Themes, wo das Kommentarfeld leer bliebt - - Unterstützt RTL-Sprachen - - Behebt einige Probleme im Bereich Sprache/Übersetzung - - Bietet einen neuen Filter zum HInzufügen von Sprachen zum Sprach-Check - - Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/6?closed=1 + - Behebt eine Inkompatibilität mit Chromes Autofill-Funktion + - Behebt einige Inkompatibilitäten mit anderen Plugins/Themes, wo das Kommentarfeld leer bliebt + - Unterstützt RTL-Sprachen + - Behebt einige Probleme im Bereich Sprache/Übersetzung + - Bietet einen neuen Filter zum HInzufügen von Sprachen zum Sprach-Check + - Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/6?closed=1 ### 2.7.0 ### + * **English** - * Country check is back again (thanks to Sergej Müller for his amazing work and the service page) - * Improved Honeypot - * Language check through Google Translate API is back again (thanks to [Simon Kraft](https://simonkraft.de/) for offering to cover the costs) - * More default Regexes - * Unit Test Framework - * Accessibility and GUI improvements - * An [english documentation](https://github.com/pluginkollektiv/antispam-bee/wiki) is now available, too. Some corrections in the german documentation. - * Some bugfixes - Among other things for WPML compatibility - * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/3?closed=1 - -* **Deutsch** - * Die Länderprüfung ist wieder zurück (dank an Sergej Müller für seine fantastische Arbeit und die Service-Seite) - * Der Honeypot wurde verbessert - * Die Sprachenprüfung über die Google Translate API ist wieder zurück (Dank an [Simon Kraft](https://simonkraft.de/), der sich angeboten hat, die Kosten zu übernehmen) - * Mehr Standard-Regexe - * Verbesserungen an Barrierefreiheit und Benutzer-Oberfläche - * Eine [englische Dokumentation](https://github.com/pluginkollektiv/antispam-bee/wiki) ist jetzt verfügbar. Einige Korrekturen in der deutschen Dokumentation. - * Einige Fehlerkorrekturen - Unter anderem für WPML-Kompatibilität - * Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/3?closed=1 + * Country check is back again (thanks to Sergej Müller for his amazing work and the service + page) + * Improved Honeypot + * Language check through Google Translate API is back again (thanks + to [Simon Kraft](https://simonkraft.de/) for offering to cover the costs) + * More default Regexes + * Unit Test Framework + * Accessibility and GUI improvements + * The [English documentation](https://github.com/pluginkollektiv/antispam-bee/wiki) is now + available, too. Some corrections in the German documentation. + * Some bugfixes - Among other things for WPML compatibility + * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/3?closed=1 + +* **Deutsch** + * Die Länderprüfung ist wieder zurück (dank an Sergej Müller für seine fantastische Arbeit und + die Service-Seite) + * Der Honeypot wurde verbessert + * Die Sprachenprüfung über die Google Translate API ist wieder zurück (Dank + an [Simon Kraft](https://simonkraft.de/), der sich angeboten hat, die Kosten zu übernehmen) + * Mehr Standard-Regexe + * Verbesserungen an Barrierefreiheit und Benutzer-Oberfläche + * Eine [englische Dokumentation](https://github.com/pluginkollektiv/antispam-bee/wiki) ist jetzt + verfügbar. Einige Korrekturen in der deutschen Dokumentation. + * Einige Fehlerkorrekturen - Unter anderem für WPML-Kompatibilität + * Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/3?closed=1 ### 2.6.9 ### + * **English** - * Updates donation links throughout the plugin - * Fixes an error were JavaScript on the dashboard was erroneously being enqueued - * Ensures compatibility with the latest WordPress version + * Updates donation links throughout the plugin + * Fixes an error where JavaScript on the dashboard was erroneously being enqueued + * Ensures compatibility with the latest WordPress version * **Deutsch** - * Aktualisierung der Spenden Links im gesamten Plugin - * Behebt einen Fehler, durch den auf dem Dashboard fälschlicherweise JavaScript geladen wird - * Gewährleistet die Kompatibilität mit der neuesten WordPress-Version + * Aktualisierung der Spenden Links im gesamten Plugin + * Behebt einen Fehler, durch den auf dem Dashboard fälschlicherweise JavaScript geladen wird + * Gewährleistet die Kompatibilität mit der neuesten WordPress-Version ### 2.6.8 ### + * **English** - * added a POT file - * updated German translation, added formal version - * updated plugin text domain to include a dash instead of an underscore - * updated, translated + formatted README.md - * updated expired link URLs in plugin and languages files - * updated [plugin authors](https://gist.github.com/glueckpress/f058c0ab973d45a72720) + * added a POT file + * updated German translation, added a formal version + * updated plugin text domain to include a dash instead of an underscore + * updated, translated + formatted README.md + * updated expired link URLs in plugin and languages files + * updated [plugin authors](https://pluginkollektiv.org/hello-world/) * **Deutsch** - * eine POT-Datei hinzugefügt - * deutsche Übersetzung aktualisiert, formale Version hinzugefügt - * Die Text Domain des Plugins in der ReadMe aktualisiert. Statt einem Unterstrich enthält der Name nun ein Bindestrich. - * README.md aktualisiert, übersetzt und formatiert - * verwaiste Link-Adressen in dem Plugin und den Sprachdateien aktualisiert - * [Plugin Autor](https://gist.github.com/glueckpress/f058c0ab973d45a72720) aktualisiert + * eine POT-Datei hinzugefügt + * deutsche Übersetzung aktualisiert und formale Version hinzugefügt + * Die Text-Domain des Plugins wird in der ReadMe aktualisiert. Statt eines Unterstrichs enthält + der Name nun einen Bindestrich. + * README.md aktualisiert, übersetzt und formatiert + * verwaiste Link-Adressen in dem Plugin und den Sprachdateien aktualisiert + * [Plugin Autor](https://pluginkollektiv.org/de/hallo-welt/) aktualisiert ### 2.6.7 ### + * **English** - * Removal of functions *Block comments from specific countries* and *Allow comments only in certain language* for financial reasons + * Removal of functions *Block comments from specific countries* and *Allow comments only in + certain language* for financial + reasons - [more information](https://antispambee.pluginkollektiv.org/news/2015/removal-of-allow-comments-only-in-certain-language/) * **Deutsch** - * Entfernung der Funktionen *Kommentare nur in einer Sprache zulassen* und *Bestimmte Länder blockieren bzw. erlauben* aus finanziellen Gründen - [Hintergrund-Informationen](https://antispambee.pluginkollektiv.org/news/2015/removal-of-allow-comments-only-in-certain-language/) + * Entfernung der Funktionen *Kommentare nur in einer Sprache zulassen* und *Bestimmte Länder + blockieren bzw. erlauben* aus finanziellen + Gründen - [Hintergrund-Informationen](https://antispambee.pluginkollektiv.org/de/news/2015/ausfall-kommentare-nur-in-einer-sprache-zulassen/) ### 2.6.6 ### + * **English** * Switch to the official Google Translation API * *Release time investment (Development & QA): 2.5 h* @@ -395,26 +473,37 @@ WICHTIG: Wenn du den Spam-Check für bestimmte Länder verwendest und hinter ein * *Release-Zeitaufwand (Development & QA): 2,5 Stunden* ### 2.6.5 ### + * **English** - * Fix: Return parameters on `dashboard_glance_items` callback / thx [@toscho](https://twitter.com/toscho) - * New function: [Trust commenters with a Gravatar](https://antispambee.pluginkollektiv.org/documentation#gravatar) / thx [@glueckpress](https://twitter.com/glueckpress) - * Additional plausibility checks and filters - * *Release time investment (Development & QA): 12 h* + * Fix: Return parameters on `dashboard_glance_items` callback / + thx [@toscho](https://twitter.com/toscho) + * New + function: [Trust commenters with a Gravatar](https://antispambee.pluginkollektiv.org/documentation#gravatar) / + thx [@glueckpress](https://twitter.com/glueckpress) + * Additional plausibility checks and filters + * *Release time investment (Development & QA): 12 h* * **Deutsch** - * Fix: Parameter-Rückgabe bei `dashboard_glance_items` / thx [@toscho](https://twitter.com/toscho) - * Neue Funktion: [Kommentatoren mit Gravatar vertrauen](https://antispambee.pluginkollektiv.org/de/dokumentation#gravatar) / thx [@glueckpress](https://twitter.com/glueckpress) - * Zusätzliche Plausibilitätsprüfungen und Filter - * *Release-Zeitaufwand (Development & QA): 12 Stunden* + * Fix: Parameter-Rückgabe bei `dashboard_glance_items` / + thx [@toscho](https://twitter.com/toscho) + * Neue + Funktion: [Kommentatoren mit Gravatar vertrauen](https://antispambee.pluginkollektiv.org/de/dokumentation#gravatar) / + thx [@glueckpress](https://twitter.com/glueckpress) + * Zusätzliche Plausibilitätsprüfungen und Filter + * *Release-Zeitaufwand (Development & QA): 12 Stunden* ### 2.6.4 ### + * **English** - * Consideration of the comment time (Spam if a comment was written in less than 5 seconds) - * *Release time investment (Development & QA): 6.25 h* + * Consideration of the comment time (Spam if a comment was written in less than 5 + seconds) - [more information](https://antispambee.pluginkollektiv.org/news/2014/antispam-bee-2-6-4/) + * *Release time investment (Development & QA): 6.25 h* * **Deutsch** - * Berücksichtigung der Kommentarzeit (Spam, wenn ein Kommentar in unter 5 Sekunden verfasst) - [Hintergrund-Informationen](https://antispambee.pluginkollektiv.org/news/2014/antispam-bee-2-6-4/) - * *Release-Zeitaufwand (Development & QA): 6,25 Stunden* + * Berücksichtigung der Kommentarzeit (Spam, wenn ein Kommentar in unter 5 Sekunden + verfasst) - [Hintergrund-Informationen](https://antispambee.pluginkollektiv.org/news/2014/antispam-bee-2-6-4/) + * *Release-Zeitaufwand (Development & QA): 6,25 Stunden* ### 2.6.3 ### + * **English** * Sorting for the Antispam Bee column in the spam comments overview * Code refactoring around the use of REQUEST_URI @@ -425,6 +514,7 @@ WICHTIG: Wenn du den Spam-Check für bestimmte Länder verwendest und hinter ein * *Release-Zeitaufwand (Development & QA): 2,75 Stunden* ### 2.6.2 ### + * **English** * Improving detection of fake IPs * *Release time investment (Development & QA): 11 h* @@ -433,6 +523,7 @@ WICHTIG: Wenn du den Spam-Check für bestimmte Länder verwendest und hinter ein * *Release-Zeitaufwand (Development & QA): 11 Stunden* ### 2.6.1 ### + * **English** * Code refactoring of options management * Support for `HTTP_FORWARDED_FOR` header @@ -443,339 +534,388 @@ WICHTIG: Wenn du den Spam-Check für bestimmte Länder verwendest und hinter ein * *Release-Zeitaufwand (Development & QA): 8,5 Stunden* ### 2.6.0 ### + * **English** - * Optimizations for WordPress 3.8 - * Clear invalid UTF-8 characters in comment fields - * Spam reason as a column in the table with spam comments + * Optimizations for WordPress 3.8 + * Clear invalid UTF-8 characters in comment fields + * Spam reason as a column in the table with spam comments * **Deutsch** - * Optimierungen für WordPress 3.8 - * Zusatzprüfung auf Nicht-UTF-8-Zeichen in Kommentardaten - * Spamgrund als Spalte in der Übersicht mit Spamkommentaren + * Optimierungen für WordPress 3.8 + * Zusatzprüfung auf Nicht-UTF-8-Zeichen in Kommentardaten + * Spamgrund als Spalte in der Übersicht mit Spamkommentaren ### 2.5.9 ### + * **English** - * Dashboard widget changes to work with [Statify](http://statify.de) + * Dashboard widget changes to work with [Statify](http://statify.de) * **Deutsch** - * Anpassung des Dashboard-Skriptes für die Zusammenarbeit mit [Statify](http://statify.de) + * Anpassung des Dashboard-Skriptes für die Zusammenarbeit mit [Statify](http://statify.de) ### 2.5.8 ### + * **English** - * Switch from TornevallDNSBL to [Stop Forum Spam](http://www.stopforumspam.com) - * New JS library for the Antispam Bee dashboard chart + * Switch from TornevallDNSBL to [Stop Forum Spam](http://www.stopforumspam.com) + * New JS library for the Antispam Bee dashboard chart * **Deutsch** - * Umstellung von TornevallDNSBL zu [Stop Forum Spam](http://www.stopforumspam.com) - * Neue JS-Bibliothek für das Dashboard-Widget + * Umstellung von TornevallDNSBL zu [Stop Forum Spam](http://www.stopforumspam.com) + * Neue JS-Bibliothek für das Dashboard-Widget ### 2.5.7 ### + * **English** - * Optional logfile with spam entries e.g. for [Fail2Ban](https://help.ubuntu.com/community/Fail2ban) - * Filter `antispam_bee_notification_subject` for a custom subject in notifications + * Optional logfile with spam entries e.g. + for [Fail2Ban](https://help.ubuntu.com/community/Fail2ban) + * Filter `antispam_bee_notification_subject` for a custom subject in notifications * **Deutsch** - * Optionale Spam-Logdatei z.B. für [Fail2Ban](https://wiki.ubuntuusers.de/fail2ban/) - * Filter `antispam_bee_notification_subject` für eigenen Betreff in Benachrichtigungen + * Optionale Spam-Logdatei z.B. für [Fail2Ban](https://wiki.ubuntuusers.de/fail2ban/) + * Filter `antispam_bee_notification_subject` für eigenen Betreff in Benachrichtigungen ### 2.5.6 ### + * **English** - * [Added new detection/patterns for spam comments](https://antispambee.pluginkollektiv.org/news/2013/new-patterns-in-antispam-bee-2-5-6/) + * [Added new detection/patterns for spam comments](https://antispambee.pluginkollektiv.org/news/2013/new-patterns-in-antispam-bee-2-5-6/) * **Deutsch** - * [Neue Erkennungsmuster für Spam hinzugefügt](https://antispambee.pluginkollektiv.org/de/news/2013/neue-erkennungsmuster-in-antispam-bee-2-5-6/) + * [Neue Erkennungsmuster für Spam hinzugefügt](https://antispambee.pluginkollektiv.org/de/news/2013/neue-erkennungsmuster-in-antispam-bee-2-5-6/) ### 2.5.5 ### + * **English** - * Detection and filtering of spam comments that try to exploit the latest [W3 Total Cache and WP Super Cache Vulnerability](http://blog.sucuri.net/2013/05/w3-total-cache-and-wp-super-cache-vulnerability-being-targeted-in-the-wild.html). + * Detection and filtering of spam comments that try to exploit the + latest [W3 Total Cache and WP Super Cache Vulnerability](http://blog.sucuri.net/2013/05/w3-total-cache-and-wp-super-cache-vulnerability-being-targeted-in-the-wild.html). * **Deutsch** - * Erkennung und Ausfilterung von Spam-Kommentaren, die versuchen, [Sicherheitslücken von W3 Total Cache und WP Super Cache](http://blog.sucuri.net/2013/05/w3-total-cache-and-wp-super-cache-vulnerability-being-targeted-in-the-wild.html) auszunutzen. [Ausführliche Informationen](https://antispambee.pluginkollektiv.org/de/news/2013/antispam-bee-nun-auch-als-antimalware-plugin/). + * Erkennung und Ausfilterung von Spam-Kommentaren, die + versuchen, [Sicherheitslücken von W3 Total Cache und WP Super Cache](http://blog.sucuri.net/2013/05/w3-total-cache-and-wp-super-cache-vulnerability-being-targeted-in-the-wild.html) + auszunutzen. [Ausführliche Informationen](https://antispambee.pluginkollektiv.org/de/news/2013/antispam-bee-nun-auch-als-antimalware-plugin/). ### 2.5.4 ### + * **English** - * Jubilee edition - * New mascot for Antispam Bee - * Advanced Scanning on IP, URL and e-mail address of incoming comments in local blog spam database + * Jubilee edition + * New mascot for Antispam Bee + * Advanced Scanning on IP, URL and e-mail address of incoming comments in the local blog spam + database * **Deutsch** - * Jubiläumsausgabe: [Details zum Update](https://plus.googlehttps://antispambee.pluginkollektiv.org/de/news/2013/jubilaeumsausgabe-antispam-bee-2-5-4/) - * Neues Maskottchen für Antispam Bee - * Erweiterte Prüfung eingehender Kommentare in lokaler Blog-Spamdatenbank auf IP, URL und E-Mail-Adresse + * + Jubiläumsausgabe: [Details zum Update](https://antispambee.pluginkollektiv.org/de/news/2013/jubilaeumsausgabe-antispam-bee-2-5-4/) + * Neues Maskottchen für Antispam Bee + * Erweiterte Prüfung eingehender Kommentare in lokaler Blog-Spamdatenbank auf IP, URL und + E-Mail-Adresse ### 2.5.3 ### + * **English** - * Optimization of regular expression + * Optimization of regular expression * **Deutsch** - * Optimierung des Regulären Ausdrucks + * Optimierung des regulären Ausdrucks ### 2.5.2 ### + * **English** - * New: Use of regular expressions with predefined and own identification patterns - * Change the filter order - * Improvements to the language file + * New: Use of regular expressions with predefined and own identification patterns + * Change the filter order + * Improvements to the language file * **Deutsch** - * Neu: [Reguläre Ausdrücke anwenden](hhttps://antispambee.pluginkollektiv.org/de/dokumentation#regex) mit vordefinierten und eigenen Erkennungsmustern - * Änderung der Filter-Reihenfolge - * Verbesserungen an der Sprachdatei + * + Neu: [Reguläre Ausdrücke anwenden](hhttps://antispambee.pluginkollektiv.org/de/dokumentation#regex) + mit vordefinierten und eigenen Erkennungsmustern + * Änderung der Filter-Reihenfolge + * Verbesserungen an der Sprachdatei ### 2.5.1 ### + * **English** - * Treat BBCode as spam - * IP anonymization in the country evaluation - * More transparency by added Privacy Policy - * PHP 5.2.4 as a requirement (is also the prerequisite for WP 3.4) + * Treat BBCode as spam + * IP anonymization in the country evaluation + * More transparency by added Privacy Policy + * PHP 5.2.4 as a requirement (is also the prerequisite for WP 3.4) * **Deutsch** - * [BBCode im Kommentar als Spamgrund](hhttps://antispambee.pluginkollektiv.org/de/dokumentation#bbcode) - * IP-Anonymisierung bei der Länderprüfung - * [Mehr Transparenz](https://antispambee.pluginkollektiv.org/de/news/2012/datenschutz-update/) durch hinzugefügte Datenschutzhinweise - * PHP 5.2.4 als Voraussetzung (ist zugleich die Voraussetzung für WP 3.4) + * [BBCode im Kommentar als Spamgrund](hhttps://antispambee.pluginkollektiv.org/de/dokumentation#bbcode) + * IP-Anonymisierung bei der Länderprüfung + * [Mehr Transparenz](https://antispambee.pluginkollektiv.org/de/news/2012/datenschutz-update/) + durch hinzugefügte Datenschutzhinweise + * PHP 5.2.4 als Voraussetzung (ist zugleich die Voraussetzung für WP 3.4) ### 2.5.0 ### + * **English** - * [Edition 2012](https://antispambee.pluginkollektiv.org/news/2012/edition-2012/) + * [Edition 2012](https://antispambee.pluginkollektiv.org/news/2012/edition-2012/) * **Deutsch** - * [Edition 2012](https://antispambee.pluginkollektiv.org/de/news/2012/edition-2012/) + * [Edition 2012](https://antispambee.pluginkollektiv.org/de/news/2012/edition-2012/) ### 2.4.6 ### + * **English** - * Russian translation - * Change the secret string + * Russian translation + * Change the secret string * **Deutsch** - * Russische Übersetzung - * Veränderung der Secret-Zeichenfolge + * Russische Übersetzung + * Veränderung der Secret-Zeichenfolge ### 2.4.5 ### + * **English** - * Revised layout settings - * Deletion of Project Honey Pot - * TornevallNET as new DNSBL service - * WordPress 3.4 as a minimum requirement - * WordPress 3.5 support - * Recast of the online manual + * Revised layout settings + * Deletion of Project Honey Pot + * TornevallNET as a new DNSBL service + * WordPress 3.4 as a minimum requirement + * WordPress 3.5 support + * Recast of the online manual * **Deutsch** - * Überarbeitetes Layout der Einstellungen - * Streichung von Project Honey Pot - * TornevallNET als neuer DNSBL-Dienst - * WordPress 3.4 als Mindestvoraussetzung - * WordPress 3.5 Unterstützung - * Neufassung des Online-Handbuchs + * Überarbeitetes Layout der Einstellungen + * Streichung von Project Honey Pot + * TornevallNET als neuer DNSBL-Dienst + * WordPress 3.4 als Mindestvoraussetzung + * WordPress 3.5 Unterstützung + * Neufassung des Online-Handbuchs ### 2.4.4 ### + * **English** - * Technical and visual support for WordPress 3.5 - * Modification of the file structure: from `xyz.dev.css` to `xyz.min.css` - * Retina screenshot + * Technical and visual support for WordPress 3.5 + * Modification of the file structure: from `xyz.dev.css` to `xyz.min.css` + * Retina screenshot * **Deutsch** - * Technische und optische Unterstützung für WordPress 3.5 - * Änderung der Dateistruktur: von `xyz.dev.css` zu `xyz.min.css` - * Retina Bildschirmfoto + * Technische und optische Unterstützung für WordPress 3.5 + * Änderung der Dateistruktur: von `xyz.dev.css` zu `xyz.min.css` + * Retina Bildschirmfoto ### 2.4.3 ### + * **English** - * Check for basic requirements - * Remove the sidebar plugin icon - * Set the Google API calls to SSL - * Compatibility with WordPress 3.4 - * Add retina plugin icon on options - * Depending on WordPress settings: anonymous comments allowed + * Check for basic requirements + * Remove the sidebar plugin icon + * Set the Google API calls to SSL + * Compatibility with WordPress 3.4 + * Add retina plugin icon on options + * Depending on WordPress settings: anonymous comments allowed * **Deutsch** - * Mindestvoraussetzungen werden nun überprüft - * Entfernung des Plugin Icons in der Sidebar - * Google API Aufrufe auf SSL umgestellt - * Kompatibilität mit WordPress 3.4 - * Retina Plugin Icon in den Einstellungen hinzugefügt - * In Abhängigkeit zu den Wordpress-Einstellungen: anonyme Kommentare erlauben + * Mindestvoraussetzungen werden nun überprüft + * Entfernung des Plugin Icons in der Sidebar + * Google API Aufrufe auf SSL umgestellt + * Kompatibilität mit WordPress 3.4 + * Retina Plugin Icon in den Einstellungen hinzugefügt + * In Abhängigkeit zu den Wordpress-Einstellungen: anonyme Kommentare erlauben ### 2.4.2 ### + * **English** - * New geo ip location service (without the api key) - * Code cleanup: Replacement of `@` characters by a function - * JS-Fallback for missing jQuery UI + * New geo ip location service (without the api key) + * Code cleanup: Replacement of `@` characters by a function + * JS-Fallback for missing jQuery UI * **Deutsch** - * Neuer IP-Geolocation-Dienst (ohne api key) - * Quelltext aufgeräumt: Austausch von `@` Zeichen durch eine Funktion - * S-Fallback für fehlende jQuery UI + * Neuer IP-Geolocation-Dienst (ohne api key) + * Quelltext aufgeräumt: Austausch von `@` Zeichen durch eine Funktion + * S-Fallback für fehlende jQuery UI ### 2.4.1 ### + * **English** - * Add russian translation - * Fix for the textarea replace - * Detect and hide admin notices + * Add Russian translation + * Fix for the textarea replace + * Detect and hide admin notices * **Deutsch** - * Russian Übersetzung hinzugefügt - * Fehlerbehebung bei dem ersetzten Textfeld - * Erkennen und verstecken von Admin-Mitteilungen + * Russian Übersetzung hinzugefügt + * Fehlerbehebung bei dem ersetzten Textfeld + * Erkennen und verstecken von Admin-Mitteilungen ### 2.4 ### + * **English** - * Support for IPv6 - * Source code revision - * Delete spam by reason - * Changing the user interface - * Requirements: PHP 5.1.2 and WordPress 3.3 + * Support for IPv6 + * Source code revision + * Delete spam by reason + * Changing the user interface + * Requirements: PHP 5.1.2 and WordPress 3.3 * **Deutsch** - * Unterstützung für IPv6 - * Quellcode Überarbeitung - * Spam mit Begründung löschen - * Änderung der Benutzeroberfläche - * Voraussetzungen: PHP 5.1.2 und WordPress 3.3 + * Unterstützung für IPv6 + * Quellcode Überarbeitung + * Spam mit Begründung löschen + * Änderung der Benutzeroberfläche + * Voraussetzungen: PHP 5.1.2 und WordPress 3.3 ### 2.3 ### + * **English** - * Xmas Edition + * Xmas Edition * **Deutsch** - * Weihnachtsausgabe + * Weihnachtsausgabe ### 2.2 ### + * **English** - * Interactive Dashboard Stats + * Interactive Dashboard Stats * **Deutsch** - * Interaktive Dashboard Statistik + * Interaktive Dashboard Statistik ### 2.1 ### + * **English** - * Remove Google Translate API support + * Remove Google Translate API support * **Deutsch** - * Google Translate API Unterstützung entfernt + * Google Translate API Unterstützung entfernt ### 2.0 ### + * **English** - * Allow comments only in certain language (English/German) - * Consider comments which are already marked as spam - * Dashboard Stats: Change from canvas to image format - * System requirements: WordPress 2.8 - * Removal of the migration script - * Increase plugin security + * Allow comments only in certain languages (English/German) + * Consider comments which are already marked as spam + * Dashboard Stats: Change from canvas to image format + * System requirements: WordPress 2.8 + * Removal of the migration script + * Increase plugin security * **Deutsch** - * Kommentare nur in bestimmten Sprachen erlauben (Englisch/Deutsch) - * Das Plugin kann nun Kommentare berücksichtigen, die bereits als Spam markiert wurden - * Dashboard-Statistik: Wechsel von canvas zu einem Bildformat - * Systemvoraussetzungen: WordPress 2.8 - * Entfernung des Migrationsscriptes - * Plugin Sicherheit verbessert + * Kommentare nur in bestimmten Sprachen erlauben (Englisch/Deutsch) + * Das Plugin kann nun Kommentare berücksichtigen, die bereits als Spam markiert wurden + * Dashboard-Statistik: Wechsel von canvas zu einem Bildformat + * Systemvoraussetzungen: WordPress 2.8 + * Entfernung des Migrationsscripts + * Plugin Sicherheit verbessert ### 1.9 ### + * **English** - * Dashboard History Stats (HTML5 Canvas) + * Dashboard History Stats (HTML5 Canvas) * **Deutsch** - * Dashboard Statistiken (HTML5 Canvas) + * Dashboard Statistiken (HTML5 Canvas) ### 1.8 ### + * **English** - * Support for the new IPInfoDB API (including API Key) + * Support for the new IPInfoDB API (including API Key) * **Deutsch** - * Unterstützung der neuen IPInfoDB API (einschließlich API-Key) + * Unterstützung der neuen IPInfoDB API (einschließlich API-Key) ### 1.7 ### + * **English** - * Black and whitelisting for specific countries - * "Project Honey Pot" as a optional spammer source - * Spam reason in the notification email - * Visual refresh of the notification email - * Advanced GUI changes + Fold-out options + * Black and whitelisting for specific countries + * "Project Honey Pot" as an optional spammer source + * Spam reason in the notification email + * Visual refresh of the notification email + * Advanced GUI changes + Fold-out options * **Deutsch** - * Schwarze und weiße Liste für bestimmte Länder - * "Project Honey Pot" als optionale Spammer-Quelle - * Spam-Begründung in der E-Mail-Benachrichtigung - * Visuelle Überarbeitung der E-Mail-Benachrichtigung - * Erweiterte Benutzeroberflächenanpassungen + ausklappbare Einstellungen + * Schwarze und weiße Liste für bestimmte Länder + * "Project Honey Pot" als optionale Spammer-Quelle + * Spam-Begründung in der E-Mail-Benachrichtigung + * Visuelle Überarbeitung der E-Mail-Benachrichtigung + * Erweiterte Benutzeroberflächenanpassungen + ausklappbare Einstellungen ### 1.6 ### + * **English** - * Support for WordPress 3.0 - * System requirements: WordPress 2.7 - * Code optimization + * Support for WordPress 3.0 + * System requirements: WordPress 2.7 + * Code optimization * **Deutsch** - * Unterstützung für WordPress 3.0 - * Systemvoraussetzungen: WordPress 2.7 - * Quelltext optimiert + * Unterstützung für WordPress 3.0 + * Systemvoraussetzungen: WordPress 2.7 + * Quelltext optimiert ### 1.5 ### + * **English** - * Compatibility with WPtouch - * Add support for do_action - * Translation to Portuguese of Brazil + * Compatibility with WPtouch + * Add support for do_action + * Translation to Portuguese of Brazil * **Deutsch** - * Kompatibilität mit WPtouch - * Unterstützung für do_action hinzugefügt - * Übersetzung auf brasilianisches Portugiesisch + * Kompatibilität mit WPtouch + * Unterstützung für do_action hinzugefügt + * Übersetzung auf brasilianisches Portugiesisch ### 1.4 ### + * **English** - * Enable stricter inspection for incomming comments - * Do not check if the author has already commented and approved + * Enable stricter inspection for incoming comments + * Do not check if the author has already commented and approved * **Deutsch** - * strengere Kontrolle für eingehende Kommentare aktiviert - * Nicht auf Spam überprüfen, wenn der Autor bereits kommentiert hat und freigegeben wurde + * strengere Kontrolle für eingehende Kommentare aktiviert + * Nicht auf Spam überprüfen, wenn der Autor bereits kommentiert hat und freigegeben wurde ### 1.3 ### + * **English** - * New code structure - * Email notifications about new spam comments - * Novel Algorithm: Advanced spam checking + * New code structure + * Email notifications about new spam comments + * Novel Algorithm: Advanced spam checking * **Deutsch** - * Neue Quelltextstruktur - * E-Mail-Benachrichtigungen über neue Spam-Kommentare - * Neuartiger Algorithmus: Erweiterte Spamprüfung + * Neue Quelltextstruktur + * E-Mail-Benachrichtigungen über neue Spam-Kommentare + * Neuartiger Algorithmus: Erweiterte Spamprüfung ### 1.2 ### + * **English** - * Antispam Bee spam counter on dashboard + * Antispam Bee spam counter on dashboard * **Deutsch** - * Antispam Bee Spam-Zähler auf dem Dashboard + * Antispam Bee Spam-Zähler auf dem Dashboard ### 1.1 ### + * **English** - * Adds support for WordPress new changelog readme.txt standard - * Various changes for more speed, usability and security + * Adds support for WordPress new changelog readme.txt standard + * Various changes for more speed, usability and security * **Deutsch** - * Unterstützung des neuen readme.txt Standards für das Änderungsprotokoll hinzugefügt - * Verschiedene Änderungen für mehr Geschwindigkeit, Benutzerfreundlichkeit und Sicherheit + * Unterstützung des neuen readme.txt Standards für das Änderungsprotokoll hinzugefügt + * Verschiedene Änderungen für mehr Geschwindigkeit, Benutzerfreundlichkeit und Sicherheit ### 1.0 ### + * **English** - * Adds WordPress 2.8 support + * Adds WordPress 2.8 support * **Deutsch** - * WordPress 2.8 Unterstützung hinzugefügt + * WordPress 2.8 Unterstützung hinzugefügt ### 0.9 ### + * **English** - * Mark as spam only comments or only pings + * Mark as spam only comments or only pings * **Deutsch** - * nur Kommentare oder nur Pings als Spam markieren + * nur Kommentare oder nur Pings als Spam markieren ### 0.8 ### + * **English** - * Optical adjustments of the settings page - * Translation for Simplified Chinese, Spanish and Catalan + * Optical adjustments of the settings page + * Translation for Simplified Chinese, Spanish and Catalan * **Deutsch** - * Optische Anpassungen der Einstellungsseite - * Übersetzung für vereinfachtes Chinesisch, Spanisch und Katalanisch + * Optische Anpassungen der Einstellungsseite + * Übersetzung für vereinfachtes Chinesisch, Spanisch und Katalanisch ### 0.7 ### + * **English** - * Spam folder cleanup after X days - * Optional hide the "MARKED AS SPAM" note - * Language support for Italian and Turkish + * Spam folder cleanup after X days + * Optional hide the "MARKED AS SPAM" note + * Language support for Italian and Turkish * **Deutsch** - * Spam-Ordner Bereinigung nach n Tagen - * Optionales verstecken des "als Spam markiert" Hinweises - * Übersetzungen für Italienisch und Türkisch + * Spam-Ordner Bereinigung nach n Tagen + * Optionales Verstecken des "als Spam markiert" Hinweises + * Übersetzungen für Italienisch und Türkisch ### 0.6 ### + * **English** - * Language support for English, German, Russian + * Language support for English, German, Russian * **Deutsch** - * Übersetzungen für Englisch, Deutsch und Russisch + * Übersetzungen für Englisch, Deutsch und Russisch ### 0.5 ### + * **English** - * Workaround for empty comments + * Workaround for empty comments * **Deutsch** - * Problembehebung für leere Kommentare + * Problembehebung für leere Kommentare ### 0.4 ### + * **English** - * Option for trackback and pingback protection + * Option for trackback and pingback protection * **Deutsch** - * Einstellung für den Trackback- und Pingback-Schutz + * Einstellung für den Trackback- und Pingback-Schutz ### 0.3 ### + * **English** - * Trackback and Pingback spam protection + * Trackback and Pingback spam protection * **Deutsch** - * Trackback und Pingback Spam-Schutz + * Trackback und Pingback Spam-Schutz diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..b5274822 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,3 @@ +# Antispam Bee – Claude Code Guidelines + +General contribution rules (git workflow, code quality, PR format) are in [AGENTS.md](AGENTS.md). diff --git a/CONVENTIONS.md b/CONVENTIONS.md new file mode 100644 index 00000000..bd6a7d6b --- /dev/null +++ b/CONVENTIONS.md @@ -0,0 +1 @@ +Read AGENTS.md for the full contribution guidelines. diff --git a/README.md b/README.md index f2b342f2..bbe23d97 100644 --- a/README.md +++ b/README.md @@ -2,64 +2,94 @@ [](https://github.com/pluginkollektiv/antispam-bee/actions/workflows/tests.yml) [](https://wordpress.org/plugins/antispam-bee/) [](https://wordpress.org/plugins/antispam-bee/advanced/) [](https://wordpress.org/plugins/antispam-bee/advanced/) [](https://wordpress.org/plugins/antispam-bee/#reviews) [](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TD4AMD2D8EMZW) -Antispam plugin with a sophisticated toolset for effective day to day comment and trackback spam-fighting. Built with data protection and privacy in mind. +Antispam plugin with a sophisticated toolset for effective day-to-day comment and linkback +spam-fighting. Built with data protection and privacy in mind and extendable with your own +anti-spam rules and allows using Antispam Bee rules for other reactions than comments and linkbacks. ## Description ## -Say Goodbye to comment spam on your WordPress blog or website. *Antispam Bee* blocks spam comments and trackbacks effectively and without captchas. It is free of charge, ad-free and compliant with European data privacy standards. + +Say Goodbye to comment spam on your WordPress blog or website. *Antispam Bee* blocks spam comments +and linkbacks effectively and without captcha. It is free of charge, ad-free and compliant with +European data privacy standards. ### Feature/Settings Overview ### + * Trust approved commenters. * Trust commenters with a Gravatar. * Consider the comment time. * Treat BBCode links as spam. * Use regular expressions. -* Search local spam database for commenters previously marked as spammers. +* Search the local spam database for commenters previously marked as spammers. * Notify admins by e-mail about incoming spam. * Delete existing spam after n days. * Limit approval to comments/pings (will delete other comment types). * Select spam indicators to send comments to deletion directly. * Optionally exclude trackbacks and pingbacks from spam detection. -* Optionally spam-check comment forms on archive pages. -* Display spam statistics on the dashboard, including daily updates of spam detection rate and a total of blocked spam comments. +* Optionally, spam-check comment forms on archive pages. +* Display spam statistics on the dashboard, including daily updates of spam detection rate and a + total of blocked spam comments. ### Support ### -* Community support via the [support forums on wordpress.org](https://wordpress.org/support/plugin/antispam-bee) -* We don’t handle support via e-mail, Twitter, GitHub issues etc. + +* Community support via + the [support forums on WordPress.org](https://wordpress.org/support/plugin/antispam-bee) +* We don’t handle support via e-mail, Twitter, GitHub issues, etc. ### Contribute ### -* Active development of this plugin is handled [on GitHub](https://github.com/pluginkollektiv/antispam-bee). + +* Active development of this plugin is + handled [on GitHub](https://github.com/pluginkollektiv/antispam-bee). * Pull requests for documented bugs are highly appreciated. -* If you think you’ve found a bug (e.g. you’re experiencing unexpected behavior), please post at the [support forums](https://wordpress.org/support/plugin/antispam-bee) first. -* If you want to help us translate this plugin you can do so [on WordPress Translate](https://translate.wordpress.org/projects/wp-plugins/antispam-bee). -* To test the plugin on your local machine, simply run `docker-compose up` in the root folder and open `http://localhost:8081/` in your browser. +* If you think you’ve found a bug (e.g., you’re experiencing unexpected behavior), please post at + the [support forums](https://wordpress.org/support/plugin/antispam-bee) first. +* If you want to help us translate this plugin, you can do + so [on WordPress Translate](https://translate.wordpress.org/projects/wp-plugins/antispam-bee). +* To test the plugin on your local machine, simply run `npm install` and then `npm run env:start` in + the root folder and open `http://localhost:8888/` in your browser. + +### Donate ### -### Donate -[Donate for us via Paypal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TD4AMD2D8EMZW) +[Donate to us via PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TD4AMD2D8EMZW) ### Credits ### + * Author: [Sergej Müller](https://sergejmueller.github.io/) * Maintainers: [pluginkollektiv](https://pluginkollektiv.org) ## Installation ## -* If you don’t know how to install a plugin for WordPress, [here’s how](https://wordpress.org/documentation/article/manage-plugins/#automatic-plugin-installation-1). + +* If you don’t know how to install a plugin for + WordPress, [here’s how](https://wordpress.org/documentation/article/manage-plugins/#automatic-plugin-installation-1). ### Requirements ### -* PHP 5.2.4 or greater -* WordPress 4.5 or greater + +* PHP 7.2 or greater +* WordPress 4.6 or greater ### Settings ### -After you have activated *Antispam Bee* the plugin will block spam comments out of the box. However, you may want to visit *Settings → Antispam Bee* to configure your custom set of anti-spam options that works best for your site. + +After you have activated *Antispam Bee*, the plugin will block spam comments out of the box. +However, you may want to visit *Settings → Antispam Bee* to configure your custom set of anti-spam +options that works best for your site. ### Privacy Notice ### -On sites operating from within the EU the option *Use a public antispam database* should not be activated for privacy reasons. When that option has been activated, *Antispam Bee* will match full IP addresses from comments against a public spam database. Technically it is not possible to encrypt those IPs, because spam databases only store and operate with complete, unencrypted IP addresses. + +On sites operating from within the EU, the option *Use a public antispam database* should not be +activated for privacy reasons. When that option has been activated, *Antispam Bee* will match full +IP addresses from comments against a public spam database. Technically, it is not possible to +encrypt those IPs because spam databases only store and operate with complete, unencrypted IP +addresses. ## Responsible Disclosure ## -You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team helps validate, triage and handle any security vulnerabilities. [Report a security vulnerability.](https://patchstack.com/database/vdp/445425e4-f5dd-4404-80a7-690999f5bcb3) +You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack +team helps validate, triage and handle any security +vulnerabilities. [Report a security vulnerability.](https://patchstack.com/database/vdp/445425e4-f5dd-4404-80a7-690999f5bcb3) ## Frequently Asked Questions ## -A complete documentation is available on [antispambee.pluginkollektiv.org](https://antispambee.pluginkollektiv.org/documentation/). +Complete documentation is available +on [antispambee.pluginkollektiv.org](https://antispambee.pluginkollektiv.org/documentation/). ## Changelog ## diff --git a/antispam_bee.php b/antispam_bee.php old mode 100755 new mode 100644 index 8cabaa70..9136b563 --- a/antispam_bee.php +++ b/antispam_bee.php @@ -1,3040 +1,139 @@ 0, - ), - '', - 'no' - ); - - if ( self::get_option( 'cronjob_enable' ) ) { - self::init_scheduled_hook(); - } - } - - - /** - * Action to deactivate the plugin - * - * @since 0.1 - * @since 2.4 - */ - public static function deactivate() { - self::clear_scheduled_hook(); - } - - - /** - * Action deleting the plugin - * - * @since 2.4 - */ - public static function uninstall() { - if ( ! self::get_option( 'delete_data_on_uninstall' ) ) { - return; - } - global $wpdb; - - delete_option( 'antispam_bee' ); - delete_option( 'antispambee_db_version' ); - $wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->options . '`' ); - - //phpcs:disable WordPress.DB.PreparedSQL.NotPrepared - $sql = 'delete from `' . $wpdb->commentmeta . '` where `meta_key` IN ("antispam_bee_iphash", "antispam_bee_reason")'; - $wpdb->query( $sql ); - //phpcs:enable WordPress.DB.PreparedSQL.NotPrepared - } - - - - /* - * ############################ - * ######## INTERNAL ######## - * ############################ - */ - - /** - * Initialization of the internal variables - * - * @since 2.4 - * @since 2.7.0 - * @since 2.10.0 Change renamed country option names in options array - */ - private static function _init_internal_vars() { - self::$_base = plugin_basename( __FILE__ ); - - $salt = defined( 'NONCE_SALT' ) ? NONCE_SALT : ABSPATH; - self::$_salt = substr( sha1( $salt ), 0, 10 ); - - self::$defaults = array( - 'options' => array( - 'regexp_check' => 1, - 'spam_ip' => 1, - 'already_commented' => 1, - 'gravatar_check' => 0, - 'time_check' => 0, - 'ignore_pings' => 0, - - 'dashboard_chart' => 0, - 'dashboard_count' => 0, - - 'country_code' => 0, - 'country_denied' => '', - 'country_allowed' => '', - - 'translate_api' => 0, - 'translate_lang' => array(), - - 'bbcode_check' => 1, - - 'flag_spam' => 1, - 'email_notify' => 0, - 'no_notice' => 0, - 'cronjob_enable' => 0, - 'cronjob_interval' => 0, - - 'ignore_filter' => 0, - 'ignore_type' => 0, - - 'reasons_enable' => 0, - 'ignore_reasons' => array(), - - 'delete_data_on_uninstall' => 1, - ), - ); - } - - /** - * Adds spam reason labels to the `$defaults` array. - * - * That is done in an extra method instead of `_init_internal_vars` - * so that the translations are loaded before. - * - * @since 2.11.2 - */ - public static function add_reasons_to_defaults() { - self::$defaults['reasons'] = array( - 'css' => esc_attr__( 'Honeypot', 'antispam-bee' ), - 'time' => esc_attr__( 'Comment time', 'antispam-bee' ), - 'empty' => esc_attr__( 'Empty Data', 'antispam-bee' ), - 'localdb' => esc_attr__( 'Local DB Spam', 'antispam-bee' ), - 'server' => esc_attr__( 'Fake IP', 'antispam-bee' ), - 'country' => esc_attr__( 'Country Check', 'antispam-bee' ), - 'bbcode' => esc_attr__( 'BBCode', 'antispam-bee' ), - 'lang' => esc_attr__( 'Comment Language', 'antispam-bee' ), - 'regexp' => esc_attr__( 'Regular Expression', 'antispam-bee' ), - 'title_is_name' => esc_attr__( 'Identical Post title and blog title', 'antispam-bee' ), - 'manually' => esc_attr__( 'Manually', 'antispam-bee' ), - ); - } - - /** - * Check and return an array key - * - * @since 2.4.2 - * @since 2.10.0 Only return `null` if option does not exist. - * - * @param array $array Array with values. - * @param string $key Name of the key. - * @return mixed Value of the requested key. - */ - public static function get_key( $array, $key ) { - if ( empty( $array ) || empty( $key ) || ! isset( $array[ $key ] ) ) { - return null; - } - - return $array[ $key ]; - } - - /** - * Check if comment is a ping (pingback, trackback or something similar) - * - * @since 2.10.0 - * - * @param array $comment Treated commentary data. - * @return boolean `true` if ping and `false` if classic comment - */ - public static function is_ping( $comment ) { - $types = array( 'pingback', 'trackback', 'pings' ); - $is_ping = false; - - if ( in_array( self::get_key( $comment, 'comment_type' ), $types, true ) ) { - $is_ping = true; - } - - return apply_filters( 'antispam_bee_is_ping', $is_ping, $comment ); - } - - /** - * Localization of the admin pages - * - * @since 0.1 - * @since 2.4 - * - * @param string $page Mark the page. - * @return boolean True on success. - */ - private static function _current_page( $page ) { - // phpcs:disable WordPress.CSRF.NonceVerification.NoNonceVerification - switch ( $page ) { - case 'dashboard': - return ( empty( $GLOBALS['pagenow'] ) || ( ! empty( $GLOBALS['pagenow'] ) && 'index.php' === $GLOBALS['pagenow'] ) ); - - case 'options': - return ( ! empty( $_GET['page'] ) && 'antispam_bee' === $_GET['page'] ); - - case 'plugins': - return ( ! empty( $GLOBALS['pagenow'] ) && 'plugins.php' === $GLOBALS['pagenow'] ); - - case 'admin-post': - return ( ! empty( $GLOBALS['pagenow'] ) && 'admin-post.php' === $GLOBALS['pagenow'] ); - - case 'edit-comments': - return ( ! empty( $GLOBALS['pagenow'] ) && 'edit-comments.php' === $GLOBALS['pagenow'] ); - - default: - return false; - } - // phpcs:enable WordPress.CSRF.NonceVerification.NoNonceVerification - } - - - /** - * Add the link to the settings - * - * @since 1.1 - * - * @param array $data The action link array. - * @return array $data The action link array. - */ - public static function init_action_links( $data ) { - if ( ! current_user_can( 'manage_options' ) ) { - return $data; - } - - return array_merge( - $data, - array( - sprintf( - '%s', - add_query_arg( - array( - 'page' => 'antispam_bee', - ), - admin_url( 'options-general.php' ) - ), - esc_attr__( 'Settings', 'antispam-bee' ) - ), - ) - ); - } - - /** - * Meta links of the plugin - * - * @since 0.1 - * @since 2.6.2 - * - * @param array $input Existing links. - * @param string $file Current page. - * @return array $data Modified links. - */ - public static function init_row_meta( $input, $file ) { - if ( $file !== self::$_base ) { - return $input; - } - - return array_merge( - $input, - array( - '' . esc_html__( 'Donate', 'antispam-bee' ) . '', - '' . esc_html__( 'Support', 'antispam-bee' ) . '', - ) - ); - } - - /* - * ############################ - * ####### RESOURCES ######## - * ############################ - */ - - /** - * Registration of resources (CSS & JS) - * - * @since 1.6 - * @since 2.4.5 - */ - public static function init_plugin_sources() { - $plugin = get_plugin_data( __FILE__ ); - - wp_register_script( - 'ab_script', - plugins_url( 'js/scripts.min.js', __FILE__ ), - array( 'jquery' ), - $plugin['Version'] - ); - - wp_register_style( - 'ab_style', - plugins_url( 'css/styles.min.css', __FILE__ ), - array( 'dashicons' ), - $plugin['Version'] - ); - } - - - /** - * Initialization of the option page - * - * @since 0.1 - * @since 2.4.3 - */ - public static function add_sidebar_menu() { - $page = add_options_page( - 'Antispam Bee', - 'Antispam Bee', - 'manage_options', - 'antispam_bee', - array( - 'Antispam_Bee_GUI', - 'options_page', - ) - ); - - add_action( - 'admin_print_scripts-' . $page, - array( - __CLASS__, - 'add_options_script', - ) - ); - - add_action( - 'admin_print_styles-' . $page, - array( - __CLASS__, - 'add_options_style', - ) - ); - - add_action( - 'load-' . $page, - array( - __CLASS__, - 'init_options_page', - ) - ); - } - - - /** - * Initialization of JavaScript - * - * @since 1.6 - * @since 2.4 - */ - public static function add_options_script() { - wp_enqueue_script( 'ab_script' ); - } - - - /** - * Initialization of Stylesheets - * - * @since 1.6 - * @since 2.4 - */ - public static function add_options_style() { - wp_enqueue_style( 'ab_style' ); - } - - - /** - * Integration of the GUI - * - * @since 2.4 - */ - public static function init_options_page() { - require_once dirname( __FILE__ ) . '/inc/gui.class.php'; - } - - - - /* - * ############################ - * ####### DASHBOARD ######## - * ############################ - */ - - /** - * Display the spam counter on the dashboard - * - * @since 0.1 - * @since 2.6.5 - * - * @param array $items Initial array with dashboard items. - * @return array $items Merged array with dashboard items. - */ - public static function add_dashboard_count( $items = array() ) { - if ( ! current_user_can( 'manage_options' ) || ! self::get_option( 'dashboard_count' ) ) { - return $items; - } - - echo ''; - - $spam_count = intval( self::get_option( 'spam_count' ) ); - - $items[] = '' . esc_html( - sprintf( - // translators: The number of spam comments Antispam Bee blocked so far. - _n( - '%s Blocked', - '%s Blocked', - $spam_count, - 'antispam-bee' - ), - self::_get_spam_count() - ) - ) . ''; - - return $items; - } - - /** - * Initialize the dashboard chart - * - * @since 1.9 - * @since 2.5.6 - */ - public static function add_dashboard_chart() { - if ( ! current_user_can( 'publish_posts' ) || ! self::get_option( 'dashboard_chart' ) ) { - return; - } - - wp_add_dashboard_widget( - 'ab_widget', - 'Antispam Bee', - array( - __CLASS__, - 'show_spam_chart', - ) - ); +function pre_init(): void { + // Check if the min. required PHP version is available and if not, show an admin notice. + if ( version_compare( PHP_VERSION, '7.2', '<' ) ) { + add_action( 'admin_notices', __NAMESPACE__ . '\min_php_version_error' ); - add_action( - 'admin_head', - array( - __CLASS__, - 'add_dashboard_style', - ) - ); + // Stop the further processing of the plugin. + return; } - /** - * Print dashboard styles - * - * @since 1.9.0 - * @since 2.5.8 - */ - public static function add_dashboard_style() { - $plugin = get_plugin_data( __FILE__ ); + // Check if the `DOMDocument` class exists. + if ( ! class_exists( 'DOMDocument' ) ) { + add_action( 'admin_notices', __NAMESPACE__ . '\domdocument_class_error' ); - wp_register_style( - 'ab_chart', - plugins_url( 'css/dashboard.min.css', __FILE__ ), - array(), - $plugin['Version'] - ); - - wp_print_styles( 'ab_chart' ); - } - - - /** - * Print dashboard scripts - * - * @since 1.9.0 - * @since 2.5.8 - */ - public static function add_dashboard_script() { - if ( ! self::get_option( 'daily_stats' ) ) { - return; - } - - $plugin = get_plugin_data( __FILE__ ); - - wp_enqueue_script( - 'raphael', - plugins_url( 'js/raphael.min.js', __FILE__ ), - array(), - '2.1.0', - true - ); - - wp_enqueue_script( - 'ab-raphael', - plugins_url( 'js/raphael.helper.min.js', __FILE__ ), - array( 'raphael' ), - $plugin['Version'], - true - ); - - wp_enqueue_script( - 'ab_chart_js', - plugins_url( 'js/dashboard.min.js', __FILE__ ), - array( 'jquery', 'ab-raphael' ), - $plugin['Version'], - true - ); - } - - /** - * Print dashboard html - * - * @since 1.9.0 - * @since 2.5.8 - */ - public static function show_spam_chart() { - $items = (array) self::get_option( 'daily_stats' ); - - if ( empty( $items ) ) { - printf( - '
%s
| ' . date_i18n( 'j. F Y', $date ) . " | \n"; - } - $html .= "
|---|
| ' . (int) $count . " | \n"; - } - $html .= "