68% captcha-bws

Code Review | Captcha by BestWebSoft - Spam Protection, Security Plugin for WordPress Forms

WordPress plugin Captcha by BestWebSoft - Spam Protection, Security Plugin for WordPress Forms scored68%from 54 tests.

About plugin

  • Plugin page: captcha-bws
  • Plugin version: 5.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 14, 2017
  • Latest release: Oct 19, 2023
  • Number of updates: 28
  • Update frequency: every 79.8 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

10,000+ active /107,259 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲1.01MB] [CPU: ▲4.48ms] Passed 4 tests

An overview of server-side resources used by Captcha by BestWebSoft - Spam Protection, Security Plugin for WordPress Forms
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.54 ▲1.0849.16 ▲7.17
Dashboard /wp-admin4.35 ▲1.0059.58 ▼8.64
Posts /wp-admin/edit.php4.40 ▲1.0558.67 ▲17.46
Add New Post /wp-admin/post-new.php6.89 ▲1.00101.63 ▲6.45
Media Library /wp-admin/upload.php4.21 ▲0.9847.03 ▲12.93

Server storage [IO: ▲8.70MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 338 new files
Database: 3 new tables, 8 new options
New tables
wp_cptch_packages
wp_cptch_images
wp_cptch_responses
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
bstwbsftwppdtplgns_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
cptch_options

Browser metrics Passed 4 tests

An overview of browser requirements for Captcha by BestWebSoft - Spam Protection, Security Plugin for WordPress Forms
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,882 ▲13614.44 ▼0.121.69 ▼0.0443.39 ▲1.53
Dashboard /wp-admin2,242 ▲625.61 ▼0.0496.88 ▲9.6350.78 ▲15.50
Posts /wp-admin/edit.php2,202 ▲1022.21 ▲0.2335.38 ▼2.7030.62 ▼7.36
Add New Post /wp-admin/post-new.php1,633 ▲9823.13 ▲4.71676.81 ▲72.4851.61 ▼11.32
Media Library /wp-admin/upload.php1,450 ▲474.21 ▲0.0197.12 ▲1.1142.96 ▲1.90
Allow List /wp-admin/captcha-allowlist.php260.420.1014.77
Settings /wp-admin/captcha.php260.420.097.28
Packages /wp-admin/captcha-packages.php260.420.117.81
BWS Panel /wp-admin/captcha.php?page=cptch-bws-panel260.420.066.58

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_cptch_responses
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 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
Please fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/captcha-bws/bws_menu/product_list.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/captcha-bws/captcha-bws.php:1985
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/captcha-bws/bws_menu/class-bws-settings.php:1453
    • > PHP Fatal error
      Uncaught Error: Class 'Bws_Settings_Tabs' not found in wp-content/plugins/captcha-bws/includes/class-cptch-settings-tabs.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/captcha-allowlist.php
    • > Network (severe)
    wp-admin/captcha-allowlist.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/captcha.php
    • > Network (severe)
    wp-admin/captcha.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/captcha-packages.php
    • > Network (severe)
    wp-admin/captcha-packages.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/captcha.php?page=cptch-bws-panel
    • > Network (severe)
    wp-admin/captcha.php?page=cptch-bws-panel - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Login form with Captcha.), #2 (Registration form with Captcha.), #3 (Lost password form with Captcha.), #4 (Comments form with Captcha.), #5 (Contact form with Captcha.), #6 (Login form with Optical Character Recognition Captcha Type.), #7 (Login form with Slide Captcha Type.), #8 (Captcha Settings page.), #9 (Captcha Packages page.), #10 (Captcha Allow List page.)
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

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

The primary PHP file in "Captcha by BestWebSoft - Spam Protection, Security Plugin for WordPress Forms" version 5.1.8 is used by WordPress to initiate all plugin functionality
63 characters long description:
#1 super security anti-spam captcha plugin for WordPress forms.

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 detected75,754 lines of code in 97 files:
LanguageFilesBlank linesComment linesLines of code
PO File5221,01334,83345,705
JSON30014,967
PHP148481,1738,063
CSS131692835,842
JavaScript111241671,010
SVG400167

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity82.67
▷ Minimum class complexity21.00
▷ Maximum class complexity210.00
Average method complexity8.10
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods69
▷ Static methods00.00%
▷ Public methods3956.52%
▷ Protected methods11.45%
▷ Private methods2942.03%
Functions124
▷ Named functions124100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
182 PNG files occupy 3.60MB with 1.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bws_menu/css/jquery-ui-styles/1.9.2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
images/package/arabic_bw/5.png2.05KB1.41KB▼ 31.19%
images/package/arabic_bw/0.png2.44KB1.68KB▼ 31.25%
images/package/dots_bt/7.png3.36KB2.39KB▼ 28.82%
screenshot-4.png59.65KB22.44KB▼ 62.38%