84% image-captcha

Code Review | Image Captcha

WordPress plugin Image Captcha scored 84% from 54 tests.

About plugin

  • Plugin page: image-captcha
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.0.2
  • WordPress version: 6.3.1
  • First release: Jun 11, 2014
  • Latest release: Sep 2, 2022
  • Number of updates: 5
  • Update frequency: every 601.0 days
  • Top authors: captcha.soft (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

600+ active / 17,964 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▲0.48ms] Passed 4 tests

This is a short check of server-side resources used by Image Captcha
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1342.10 ▼5.90
Dashboard /wp-admin3.41 ▲0.1051.85 ▼1.84
Posts /wp-admin/edit.php3.52 ▲0.1653.65 ▲7.44
Add New Post /wp-admin/post-new.php5.99 ▲0.10100.98 ▲7.95
Media Library /wp-admin/upload.php3.33 ▲0.1037.26 ▲2.22

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Image Captcha
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲17813.67 ▼0.718.27 ▲6.4942.85 ▼0.58
Dashboard /wp-admin2,222 ▲345.85 ▲0.9695.15 ▼22.5941.94 ▼1.95
Posts /wp-admin/edit.php2,102 ▲132.00 ▲0.0038.71 ▲2.4334.02 ▼0.28
Add New Post /wp-admin/post-new.php1,555 ▲4119.10 ▲1.58603.85 ▼85.6653.59 ▼5.66
Media Library /wp-admin/upload.php1,404 ▲164.17 ▼0.0599.38 ▼4.3043.84 ▼0.87

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/image-captcha/image-captcha.php:461

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (screenshot-1.jpg is the captcha on the comment form.), #2 (screenshot-2.jpg is the captcha on the login form.), #3 (screenshot-3.jpg is the captcha settings on the admin plugins page.)
  • Tags: You are using too many tags: 22 tag instead of maximum 10
The official readme.txt might help

image-captcha/image-captcha.php Passed 13 tests

"Image Captcha" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
42 characters long description:
Image captcha for login page and comments.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected518 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP25225414
PO File2242486
JavaScript10018

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity56.00
▷ Minimum class complexity56.00
▷ Maximum class complexity56.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
21 PNG files occupy 0.13MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/refresh.png10.93KB5.51KB▼ 49.59%
images/06-91.png5.43KB1.95KB▼ 64.17%
images/06-61.png6.16KB2.07KB▼ 66.41%
images/06-11.png5.76KB2.02KB▼ 64.90%
images/06-06.png6.35KB2.23KB▼ 64.85%