78% zt-captcha

Code Review | ZT Captcha

WordPress plugin ZT Captcha scored78%from 54 tests.

About plugin

  • Plugin page: zt-captcha
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Jan 30, 2023
  • Latest release: Aug 29, 2023
  • Number of updates: 9
  • Update frequency: every 24.0 days
  • Top authors: teamzt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /454 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.27MB] [CPU: ▼7.50ms] Passed 4 tests

An overview of server-side resources used by ZT Captcha
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2938.51 ▼2.15
Dashboard /wp-admin3.58 ▲0.2447.38 ▼10.69
Posts /wp-admin/edit.php3.70 ▲0.3447.35 ▲0.39
Add New Post /wp-admin/post-new.php6.17 ▲0.2886.14 ▼17.56
Media Library /wp-admin/upload.php3.51 ▲0.2839.48 ▲3.91

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 20 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
zt_captcha_error_message

Browser metrics Passed 4 tests

An overview of browser requirements for ZT Captcha
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.61 ▼0.771.66 ▼0.0842.53 ▼0.50
Dashboard /wp-admin2,225 ▲375.85 ▲0.95105.83 ▲3.6340.10 ▼6.21
Posts /wp-admin/edit.php2,108 ▲192.00 ▲0.0138.91 ▲0.6636.00 ▼0.12
Add New Post /wp-admin/post-new.php1,546 ▲423.45 ▲5.10674.86 ▲35.6663.43 ▲13.94
Media Library /wp-admin/upload.php1,407 ▲284.22 ▼0.0099.49 ▼0.9240.77 ▼0.52

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 9 options in the database
    • zt_captcha_error_message
    • zt_captcha_font_families_name
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • zt_captcha_font_families
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/zt-captcha/zt-captcha.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zt-captcha/request/CaptchaRequest.php:13

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: login, register, comment, captcha for register, captcha...

zt-captcha/zt-captcha.php 92% from 13 tests

The main file in "ZT Captcha" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 271 characters long)

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
Good job! No executable or dangerous file extensions detected1,280 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP5145841,220
CSS38050
JavaScript21410

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity25.50
▷ Minimum class complexity14.00
▷ Maximum class complexity37.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods1487.50%
▷ Protected methods212.50%
▷ Private methods00.00%
Functions37
▷ Named functions2978.38%
▷ Anonymous functions821.62%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/check.png1.73KB0.72KB▼ 58.42%
img/left_arrow.png0.37KB0.24KB▼ 34.83%
img/right_arrow.png0.35KB0.23KB▼ 33.88%