48% captcha-them-all

Code Review | Captcha Them All

WordPress plugin Captcha Them All scored48%from 54 tests.

About plugin

  • Plugin page: captcha-them-all
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 6, 2017
  • Latest release: Apr 18, 2023
  • Number of updates: 33
  • Update frequency: every 68.5 days
  • Top authors: fuzzguard (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

7,000+ active /27,931 total downloads

Benchmarks

Plugin footprint 30% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼9.17ms] Passed 4 tests

A check of server-side resources used by Captcha Them All
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.46 ▼2.76
Dashboard /wp-admin3.35 ▲0.0145.67 ▼15.45
Posts /wp-admin/edit.php3.40 ▲0.0548.20 ▲1.09
Add New Post /wp-admin/post-new.php5.93 ▲0.0479.36 ▼19.56
Media Library /wp-admin/upload.php3.27 ▲0.0438.64 ▲6.13
Captcha Them All /wp-admin/options-general.php?page=captcha-them-all-options3.2429.44

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 301 new files
Database: 1 new table, 8 new options
New tables
wp_CTA_ip_failed_atts
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
captcha-them-all
CTA_DB_version
widget_recent-comments

Browser metrics Passed 4 tests

Captcha Them All: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.65 ▼1.004.59 ▲2.7041.21 ▼1.55
Dashboard /wp-admin2,207 ▲195.83 ▼0.03104.44 ▼12.4539.69 ▼6.80
Posts /wp-admin/edit.php2,090 ▲12.01 ▼0.0139.60 ▲0.0134.54 ▼1.68
Add New Post /wp-admin/post-new.php1,540 ▲1923.35 ▲0.06632.96 ▲25.5350.60 ▼6.88
Media Library /wp-admin/upload.php1,392 ▲104.22 ▼0.0195.35 ▼3.8941.86 ▼3.31
Captcha Them All /wp-admin/options-general.php?page=captcha-them-all-options1,6202.3551.2926.54

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Error in wp-content/plugins/captcha-them-all/captcha-them-all.php+67
    Cannot declare class CaptchaThemAll, because the name is already in use
  • The plugin did not uninstall successfully, leaving 301 files (9.90MB) in the plugin directory
    • (new file) captcha-them-all.php
    • (new file) class-text.php
    • (new file) CaptchasDotNet.php
    • (new file) securimage/.htaccess
    • (new file) readme.txt
    • (new file) securimage/LICENSE.txt
    • (new file) securimage/AHGBold.ttf
    • (new file) securimage/README.FONT.txt
    • (new file) js/admin.js
    • (new file) css/cta.css
    • ...
  • Zombie tables detected upon uninstall: 1 table
    • wp_CTA_ip_failed_atts
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • captcha-them-all
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • CTA_DB_version
    • theysaidso_admin_options
    • db_upgraded

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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 take a closer look at the following
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/captcha-them-all/securimage/example_form.php
    • > /wp-content/plugins/captcha-them-all/securimage/securimage_show.php
    • > /wp-content/plugins/captcha-them-all/securimage/securimage_play.php
    • > /wp-content/plugins/captcha-them-all/visualcaptcha/vendor/slim/slim/tests/templates/test.php
    • > /wp-content/plugins/captcha-them-all/visualcaptcha/vendor/slim/slim/index.php
    • > /wp-content/plugins/captcha-them-all/securimage/example_form.ajax.php
  • 34× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/captcha-them-all/visualcaptcha/vendor/slim/slim/tests/Middleware/PrettyExceptionsTest.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/captcha-them-all/visualcaptcha/vendor/slim/slim/tests/Http/UtilTest.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/captcha-them-all/visualcaptcha/vendor/slim/slim/tests/Http/HeadersTest.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/captcha-them-all/visualcaptcha/vendor/slim/slim/tests/ViewTest.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'visualCaptcha_TestCase' not found in wp-content/plugins/captcha-them-all/visualcaptcha/vendor/emotionloop/visualcaptcha/tests/unit/CustomAssetsTest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Slim\\Middleware' not found in wp-content/plugins/captcha-them-all/visualcaptcha/vendor/slim/slim/Slim/Middleware/MethodOverride.php:49
    • > PHP Notice
      Undefined variable: foo in wp-content/plugins/captcha-them-all/visualcaptcha/vendor/slim/slim/tests/templates/test.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/captcha-them-all/visualcaptcha/vendor/slim/slim/tests/Middleware/MethodOverrideTest.php:57
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/captcha-them-all/visualcaptcha/vendor/slim/slim/tests/Middleware/SessionCookieTest.php:33
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/captcha-them-all/visualcaptcha/vendor/emotionloop/visualcaptcha/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/captcha-them-all/visualcaptcha/vendor/emotionloop/visualcaptcha/tests/bootstrap.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 27 tag instead of maximum 10
The official readme.txt is a good inspiration

captcha-them-all/captcha-them-all.php 92% from 13 tests

The main PHP script in "Captcha Them All" version 1.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.7" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin14,348 lines of code in 92 files:
LanguageFilesBlank linesComment linesLines of code
PHP652,5037,37412,029
JavaScript52531991,067
Markdown41830442
JSON800422
CSS4619252
HTML2262982
XML22030
YAML22024

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity19.55
▷ Minimum class complexity1.00
▷ Maximum class complexity360.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes65
▷ Abstract classes11.54%
▷ Concrete classes6498.46%
▷ Final classes00.00%
Methods941
▷ Static methods353.72%
▷ Public methods86091.39%
▷ Protected methods737.76%
▷ Private methods80.85%
Functions190
▷ Named functions52.63%
▷ Anonymous functions18597.37%
Constants66
▷ Global constants23.03%
▷ Class constants6496.97%
▷ Public constants64100.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
87 PNG files occupy 0.30MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
visualcaptcha/application.png106.03KB30.48KB▼ 71.25%
visualcaptcha/vendor/emotionloop/visualcaptcha/src/visualCaptcha/assets/images/pants.png1.06KB1.05KB▼ 0.83%
visualcaptcha/vendor/emotionloop/visualcaptcha/src/visualCaptcha/assets/images/tag@2x.png2.30KB1.64KB▼ 28.44%
visualcaptcha/vendor/emotionloop/visualcaptcha/src/visualCaptcha/assets/images/tag.png1.28KB0.98KB▼ 23.28%
visualcaptcha/vendor/emotionloop/visualcaptcha/src/visualCaptcha/assets/images/light-bulb.png1.24KB1.07KB▼ 13.80%