10% ch-captcha

Code Review | CH Captcha

WordPress plugin CH Captcha scored10%from 54 tests.

About plugin

  • Plugin page: ch-captcha
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 28, 2016
  • Latest release: Jul 18, 2016
  • Number of updates: 26
  • Update frequency: every 3.1 days
  • Top authors: ckhandla94 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /3,069 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • The plugin did not install without errors
    • > Error in wp-content/plugins/ch-captcha/ch-captcha.php+100
    Uncaught ArgumentCountError: Too few arguments to function WP_chc::plugin_path(), 0 passed in wp-content/plugins/ch-captcha/ch-captcha.php on line 36 and exactly 1 expected in wp-content/plugins/ch-captcha/ch-captcha.php:100
    Stack trace:
    #0 wp-content/plugins/ch-captcha/ch-captcha.php(36): WP_chc->plugin_path()
    #1 wp-content/plugins/ch-captcha/ch-captcha.php(76): WP_chc->__construct()
    #2 wp-content/plugins/ch-captcha/ch-captcha.php(106): WP_chc::instance()
    #3 wp-content/plugins/ch-captcha/ch-captcha.php(109): WP_CHC()
    #4 wp-admin/includes/plugin.php(2318): include_once('/var/www/wordpr...')
    #5 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.51ms] Passed 4 tests

This is a short check of server-side resources used by CH Captcha
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0044.32 ▲1.09
Dashboard /wp-admin3.31 ▲0.0048.53 ▼3.43
Posts /wp-admin/edit.php3.36 ▲0.0049.34 ▲2.59
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.49 ▼10.35
Media Library /wp-admin/upload.php3.23 ▲0.0037.09 ▼1.36

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for CH Captcha
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.82 ▲0.461.84 ▼0.3044.05 ▼1.58
Dashboard /wp-admin2,206 ▲184.85 ▼1.08100.68 ▼7.8840.00 ▼5.98
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0233.05 ▼4.5833.34 ▼2.96
Add New Post /wp-admin/post-new.php1,533 ▲1423.17 ▼0.23677.20 ▼11.9656.75 ▲2.14
Media Library /wp-admin/upload.php1,388 ▼34.16 ▼0.0699.79 ▼16.0644.71 ▼4.45

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% 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 fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WP_CHC() in wp-content/plugins/ch-captcha/includes/custom-captcha.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CHC_Form_Field' not found in wp-content/plugins/ch-captcha/includes/contact-from-captcha.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === ch-captcha === )
Please take inspiration from this readme.txt

ch-captcha/ch-captcha.php 85% from 13 tests

This is the main PHP file of "CH Captcha" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path folder was not found ("/i18n/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected735 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP517435735

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity15.00
▷ Minimum class complexity7.00
▷ Maximum class complexity28.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods48
▷ Static methods12.08%
▷ Public methods4491.67%
▷ Protected methods36.25%
▷ Private methods12.08%
Functions1
▷ Named functions1100.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
No PNG images were found in this plugin