89% svg-captcha

Code Review | SVG Captcha

WordPress plugin SVG Captcha scored89%from 54 tests.

About plugin

  • Plugin page: svg-captcha
  • Plugin version: 1.0.11
  • PHP compatiblity: 6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 10, 2023
  • Latest release: Jun 29, 2023
  • Number of updates: 12
  • Update frequency: every 9.3 days
  • Top authors: rafasashi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /493 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.79MB] [CPU: ▲4.10ms] Passed 4 tests

A check of server-side resources used by SVG Captcha
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.30 ▲0.8352.98 ▲13.14
Dashboard /wp-admin4.13 ▲0.8258.94 ▲8.87
Posts /wp-admin/edit.php4.18 ▲0.8256.18 ▲2.99
Add New Post /wp-admin/post-new.php6.64 ▲0.7690.88 ▼8.59
Media Library /wp-admin/upload.php3.99 ▲0.7651.28 ▲15.15
Captcha /wp-admin/options-general.php?page=svg_captcha_settings3.9844.73

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
svg_captcha_version
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by SVG Captcha
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,898 ▲15213.95 ▼0.4310.35 ▲8.3241.54 ▼3.25
Dashboard /wp-admin2,218 ▲274.87 ▼0.0299.20 ▼5.9942.25 ▲1.73
Posts /wp-admin/edit.php2,095 ▲32.03 ▼0.0336.32 ▼4.6135.76 ▼0.82
Add New Post /wp-admin/post-new.php1,545 ▲1718.24 ▲0.15619.32 ▼24.8070.51 ▲15.92
Media Library /wp-admin/upload.php1,397 ▲64.26 ▲0.07102.30 ▼2.4046.15 ▲1.22
Captcha /wp-admin/options-general.php?page=svg_captcha_settings1,0573.3550.2426.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • svg_captcha_version
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 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 Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Contributors: The plugin contributors field is missing
  • Screenshots: Add images for these screenshots: #1 (SVG Captcha for comments), #2 (SVG Captcha for login form), #3 (SVG Captcha general settings), #4 (SVG Captcha location settings), #5 (SVG Captcha customizations)
The official readme.txt might help

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

"SVG Captcha" version 1.0.11's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
51 characters long description:
Validate your forms with a self hosted SVG Captcha.

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
There were no executable files found in this plugin2,269 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP95891,1652,133
JavaScript73325130
JSON1004
Markdown1002
CSS1010

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity40.86
▷ Minimum class complexity3.00
▷ Maximum class complexity107.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods105
▷ Static methods54.76%
▷ Public methods7571.43%
▷ Protected methods00.00%
▷ Private methods3028.57%
Functions15
▷ Named functions853.33%
▷ Anonymous functions746.67%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png38.80KB14.43KB▼ 62.82%
screenshot-3.png18.68KB7.12KB▼ 61.88%
screenshot-4.png21.51KB8.08KB▼ 62.43%
screenshot-2.png22.86KB9.28KB▼ 59.40%
screenshot-1.png11.31KB10.52KB▼ 6.94%