10% kcaptcha

Code Review | Kcaptcha

WordPress plugin Kcaptcha scored10%from 54 tests.

About plugin

  • Plugin page: kcaptcha
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6.1
  • WordPress version: 6.3.1
  • First release: Sep 19, 2014
  • Latest release: Sep 14, 2016
  • Number of updates: 9
  • Update frequency: every 80.8 days
  • Top authors: ksolves (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,210 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/kcaptcha/kcaptcha.php+155
    Undefined variable: login_form

Server metrics [RAM: ▼1.96MB] [CPU: ▼56.63ms] Passed 4 tests

An overview of server-side resources used by Kcaptcha
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.446.48 ▼39.60
Dashboard /wp-admin2.05 ▼1.266.75 ▼52.15
Posts /wp-admin/edit.php2.05 ▼1.316.98 ▼40.43
Add New Post /wp-admin/post-new.php2.05 ▼3.847.38 ▼94.35
Media Library /wp-admin/upload.php2.05 ▼1.186.31 ▼29.49
Kcaptcha /wp-admin/options-general.php?page=kcaptcha/kcaptcha.php2.057.88

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 9 new files
Database: 1 new table, 6 new options
New tables
wp_kcaptcha_setting
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Kcaptcha: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.35 ▼0.002.20 ▲0.3543.63 ▼3.13
Dashboard /wp-admin2,196 ▲195.52 ▼0.1495.28 ▼6.5844.54 ▼0.45
Posts /wp-admin/edit.php2,107 ▲71.98 ▼0.0035.39 ▼0.1634.71 ▼1.67
Add New Post /wp-admin/post-new.php1,530 ▲421.04 ▼2.12620.98 ▼24.8059.40 ▼2.74
Media Library /wp-admin/upload.php1,404 ▲14.19 ▼0.09104.92 ▲3.6044.45 ▲0.67
Kcaptcha /wp-admin/options-general.php?page=kcaptcha/kcaptcha.php7942.0226.0527.25

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/kcaptcha/kcaptcha.php+155
    Undefined variable: login_form
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_kcaptcha_setting
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=kcaptcha/kcaptcha.php
    • > Notice in wp-content/plugins/kcaptcha/admin/setting.php+48
    Undefined variable: login_form
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=kcaptcha/kcaptcha.php
    • > Notice in wp-content/plugins/kcaptcha/admin/setting.php+49
    Undefined variable: register_form
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=kcaptcha/kcaptcha.php
    • > Notice in wp-content/plugins/kcaptcha/admin/setting.php+51
    Undefined variable: comments_form
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=kcaptcha/kcaptcha.php
    • > Notice in wp-content/plugins/kcaptcha/admin/setting.php+50
    Undefined variable: lost_password_form
    • > GET request to /wp-admin/options-general.php?page=kcaptcha/kcaptcha.php
    • > Notice in wp-content/plugins/kcaptcha/admin/setting.php+52
    Undefined variable: hide_register

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 fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/kcaptcha/lib/createcaptcha.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/kcaptcha/admin/setting.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/kcaptcha/kcaptcha.php:58
    • > PHP Warning
      Cannot modify header information - headers already sent by (output started at wp-content/plugins/kcaptcha/lib/phptextClass.php:67) in wp-content/plugins/kcaptcha/lib/phptextClass.php on line 68

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: wordpress-captcha-plugin, login-captcha, form-captcha, comment-captcha, anti-spam...

kcaptcha/kcaptcha.php Passed 13 tests

The entry point to "Kcaptcha" version 1.0.1 is a PHP file that has certain tags in its header comment area
62 characters long description:
This is a plugin to add captcha to anywhere in website's form.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected394 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP455174301
CSS10093

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.34
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods240.00%
▷ Protected methods360.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin