77% captcha-eu

Code Review | Captcha.eu

WordPress plugin Captcha.eu scored77%from 54 tests.

About plugin

  • Plugin page: captcha-eu
  • Plugin version: 1.0.26
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Apr 29, 2023
  • Latest release: Oct 27, 2023
  • Number of updates: 25
  • Update frequency: every 7.3 days
  • Top authors: captchaeu (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /1,640 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.36MB] [CPU: ▼3.86ms] 75% from 4 tests

An overview of server-side resources used by Captcha.eu
It is recommended to improve the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 652.91ms on /wp-admin/admin.php?page=captcha-eu)
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4144.23 ▲1.20
Dashboard /wp-admin3.71 ▲0.3650.07 ▼8.52
Posts /wp-admin/edit.php3.76 ▲0.4050.05 ▲4.82
Add New Post /wp-admin/post-new.php6.23 ▲0.3484.90 ▼12.95
Media Library /wp-admin/upload.php3.57 ▲0.3447.64 ▲14.36
Overview /wp-admin/admin.php?page=captcha-eu3.62652.91
Settings /wp-admin/admin.php?page=captcha-eu-settings3.66136.77

Server storage [IO: ▲1.22MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 236 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Captcha.eu
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,002 ▲24114.33 ▼0.231.77 ▼0.0237.87 ▼6.84
Dashboard /wp-admin2,278 ▲1015.57 ▼0.1584.01 ▼4.2842.23 ▼2.37
Posts /wp-admin/edit.php2,169 ▲692.05 ▲0.1133.64 ▼3.3238.37 ▲1.35
Add New Post /wp-admin/post-new.php1,555 ▲1823.32 ▲4.99655.40 ▲22.3458.00 ▼10.57
Media Library /wp-admin/upload.php1,463 ▲634.21 ▼0.0895.57 ▼0.8943.03 ▲0.61
Overview /wp-admin/admin.php?page=captcha-eu1,1426.40121.0623.91
Settings /wp-admin/admin.php?page=captcha-eu-settings1,6056.57119.4733.28

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/captcha-eu/src/partials/chat.php
    • > /wp-content/plugins/captcha-eu/tests/phpunit/bootstrap.php
  • 132× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\Test\\PolyfillTestCase' not found in wp-content/plugins/captcha-eu/vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\Test\\TestCase' not found in wp-content/plugins/captcha-eu/vendor/composer/installers/tests/Composer/Installers/Test/MauticInstallerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/captcha-eu/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/captcha-eu/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/captcha-eu/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/captcha-eu/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/captcha-eu/vendor/composer/installers/src/Composer/Installers/KnownInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\Test\\TestCase' not found in wp-content/plugins/captcha-eu/vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/captcha-eu/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/captcha-eu/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: gdpr, form, anti-bot, contact, protection...

captcha-eu/wp-captcha.php 77% from 13 tests

The main PHP script in "Captcha.eu" version 1.0.26 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("captcha-eu.php" instead of "wp-captcha.php")
  • Git Repository: A Git repository was detected inside this plugin
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("/languages.")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected8,597 lines of code in 206 files:
LanguageFilesBlank linesComment linesLines of code
PHP1521,1571,8406,523
Markdown3730386
CSS12521334
JavaScript177364334
JSON300324
YAML8546226
SVG1901217
PO File1604130
Bourne Shell1363397
XML13026

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity3.94
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes142
▷ Abstract classes42.82%
▷ Concrete classes13897.18%
▷ Final classes10.72%
Methods363
▷ Static methods6217.08%
▷ Public methods29681.54%
▷ Protected methods4612.67%
▷ Private methods215.79%
Functions12
▷ Named functions325.00%
▷ Anonymous functions975.00%
Constants8
▷ Global constants450.00%
▷ Class constants450.00%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
19 PNG files occupy 0.61MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/elementor.png21.09KB7.53KB▼ 64.29%
.wordpress-org/icon-256x256.png11.39KB4.35KB▼ 61.83%
.wordpress-org/screenshot-1.png24.12KB12.18KB▼ 49.49%
.wordpress-org/banner-1544x500.png95.20KB33.57KB▼ 64.74%
assets/img/woocommerce.png9.90KB3.58KB▼ 63.81%