78% traum-captcha

Code Review | Traum Captcha

WordPress plugin Traum Captcha scored78%from 54 tests.

About plugin

  • Plugin page: traum-captcha
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.2.2
  • WordPress version: 6.3.1
  • First release: Apr 17, 2019
  • Latest release: Jun 27, 2019
  • Number of updates: 4
  • Update frequency: every 18.0 days
  • Top authors: jysafe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /493 total downloads

Benchmarks

Plugin footprint 82% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼1.70ms] 75% from 4 tests

Analyzing server-side resources used by Traum Captcha
It is recommended to improve the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 904.11ms on /wp-admin/admin.php?page=traum_captcha_update)
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0442.41 ▲1.99
Dashboard /wp-admin3.36 ▲0.0551.18 ▼3.07
Posts /wp-admin/edit.php3.41 ▲0.0550.51 ▲1.53
Add New Post /wp-admin/post-new.php5.94 ▲0.0594.83 ▼7.25
Media Library /wp-admin/upload.php3.28 ▲0.0544.00 ▲8.45
Update /wp-admin/admin.php?page=traum_captcha_update3.24904.11
Database /wp-admin/admin.php?page=traum_captcha_database3.2234.36
Traum Captcha /wp-admin/admin.php?page=traum_captcha3.2431.05
Captcha Settings /wp-admin/admin.php?page=traum_captcha_setting3.2432.67

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
recovery_mode_email_last_sent
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Traum Captcha
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲8913.17 ▼1.211.65 ▼0.3539.29 ▼6.75
Dashboard /wp-admin2,241 ▲534.87 ▲0.02103.40 ▼3.2241.07 ▼1.13
Posts /wp-admin/edit.php2,124 ▲352.02 ▼0.0240.78 ▲4.4037.57 ▲0.96
Add New Post /wp-admin/post-new.php1,571 ▲5718.15 ▲0.64623.14 ▼40.4258.21 ▲5.91
Media Library /wp-admin/upload.php1,423 ▲354.21 ▲0.0096.54 ▼10.8144.75 ▼1.14
Update /wp-admin/admin.php?page=traum_captcha_update7111.536.9317.77
Database /wp-admin/admin.php?page=traum_captcha_database8272.0626.8535.22
Traum Captcha /wp-admin/admin.php?page=traum_captcha8081.9932.7247.76
Captcha Settings /wp-admin/admin.php?page=traum_captcha_setting7622.0325.3225.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=traum_captcha_update
    • > Error in wp-content/plugins/traum-captcha/functions.php+209
    Uncaught Error: Cannot use object of type WP_Error as array in wp-content/plugins/traum-captcha/functions.php:209
    Stack trace:
    #0 wp-content/plugins/traum-captcha/options.php(144): traum_captcha_update()
    #1 wp-includes/class-wp-hook.php(310): traum_captcha_update_display()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=traum_captcha_database
    • > Warning in wp-admin/includes/template.php+1771
    call_user_func() expects parameter 1 to be a valid callback, function 'traum_captcha_database' not found or invalid function name

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/traum-captcha/functions.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/traum-captcha/options.php:42

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (none) image not found
The official readme.txt might help

traum-captcha/functions.php 92% from 13 tests

The entry point to "Traum Captcha" version 1.0.4 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("traum-captcha.php" instead of "functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected64,508 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
SQL1203263,754
PHP696167676
PO File1263478

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity13.00
▷ Minimum class complexity2.00
▷ Maximum class complexity27.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods1878.26%
▷ Protected methods417.39%
▷ Private methods14.35%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/bg.png1.55KB0.14KB▼ 90.79%