68% better-captcha

Code Review | Better Captcha

WordPress plugin Better Captcha scored68%from 54 tests.

About plugin

  • Plugin page: better-captcha
  • Plugin version: 2.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Apr 29, 2020
  • Latest release: May 24, 2022
  • Number of updates: 19
  • Update frequency: every 39.7 days
  • Top authors: bettersecurity (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,032 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.65MB] [CPU: ▼53.86ms] Passed 4 tests

This is a short check of server-side resources used by Better Captcha
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.34 ▼1.128.73 ▼41.81
Dashboard /wp-admin2.35 ▼0.9512.61 ▼40.06
Posts /wp-admin/edit.php2.35 ▼1.0012.59 ▼41.18
Add New Post /wp-admin/post-new.php2.35 ▼3.5313.69 ▼92.40
Media Library /wp-admin/upload.php2.35 ▼0.8811.55 ▼29.29
Better Captcha /wp-admin/options-general.php?page=better-captcha-settings2.3513.82

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Better Captcha
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.19 ▼0.161.77 ▼0.0141.52 ▼3.12
Dashboard /wp-admin2,202 ▲285.59 ▼0.1186.89 ▼6.2737.25 ▼4.49
Posts /wp-admin/edit.php2,107 ▲72.01 ▼0.1440.04 ▲0.5237.54 ▲2.16
Add New Post /wp-admin/post-new.php1,529 ▲323.67 ▲0.43683.10 ▼2.3562.35 ▲9.80
Media Library /wp-admin/upload.php1,407 ▲74.17 ▲0.0497.85 ▼16.5042.47 ▼6.05
Better Captcha /wp-admin/options-general.php?page=better-captcha-settings1,0522.0126.9633.91

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/better-captcha/better-captcha.php+293
    Trying to access array offset on value of type bool
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 15 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=better-captcha-settings
    • > Notice in wp-content/plugins/better-captcha/better-captcha.php+270
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/better-captcha/better-captcha.php

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: better, hcaptcha, captcha, maths, recaptcha...

better-captcha/better-captcha.php 85% from 13 tests

The principal PHP file in "Better Captcha" v. 2.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin365 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP25266365

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions34
▷ Named functions3397.06%
▷ Anonymous functions12.94%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
header.png10.50KB6.82KB▼ 35.03%
icon-36x36.png1.35KB0.88KB▼ 34.62%