10% gotcha-gesture-based-captcha

Code Review | Gotcha | Gesture-based Captcha

WordPress plugin Gotcha | Gesture-based Captcha scored10%from 54 tests.

About plugin

  • Plugin page: gotcha-gesture-ba...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 6.3.1
  • First release: Aug 30, 2013
  • Latest release: Nov 7, 2013
  • Number of updates: 6
  • Update frequency: every 19.7 days
  • Top authors: pienaro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /810 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/gotcha-gesture-based-captcha/process/gotcha.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; gotchaAPI has a deprecated constructor

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

An overview of server-side resources used by Gotcha | Gesture-based Captcha
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.07 ▼3.93
Dashboard /wp-admin3.31 ▲0.0053.34 ▲1.57
Posts /wp-admin/edit.php3.36 ▲0.0049.15 ▲0.93
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.41 ▼11.38
Media Library /wp-admin/upload.php3.23 ▲0.0037.78 ▲6.27

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 113 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Gotcha | Gesture-based Captcha: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.74 ▲0.451.68 ▲0.0947.69 ▲3.40
Dashboard /wp-admin2,195 ▲155.56 ▼0.1182.21 ▼5.4638.16 ▼2.56
Posts /wp-admin/edit.php2,103 ▼01.97 ▲0.0237.49 ▼0.5935.97 ▼0.70
Add New Post /wp-admin/post-new.php1,526 ▼223.22 ▲0.01693.59 ▲34.6857.83 ▲5.78
Media Library /wp-admin/upload.php1,403 ▲64.34 ▲0.0896.78 ▼11.5549.46 ▲3.42

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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 fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/gotcha-gesture-based-captcha/admin/js/script.php
  • 19× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gotcha-gesture-based-captcha/process/gotcha.php:140
    • > PHP Warning
      Use of undefined constant GPLUGINPATH - assumed 'GPLUGINPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/gotcha-gesture-based-captcha/admin/setting.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'gotchaAPI' not found in wp-content/plugins/gotcha-gesture-based-captcha/process/register.php:5
    • > PHP Warning
      include(GPLUGINPATH/admin/layout/setting.php): failed to open stream: No such file or directory in wp-content/plugins/gotcha-gesture-based-captcha/admin/libs/setting.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'gotchaAPI' not found in wp-content/plugins/gotcha-gesture-based-captcha/process/login.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gotcha-gesture-based-captcha/admin/libs/index.php:27
    • > PHP Warning
      include(GPLUGINPATH/admin/libs/setting.php): failed to open stream: No such file or directory in wp-content/plugins/gotcha-gesture-based-captcha/admin/setting.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'gotchaThemeSettingApp' not found in wp-content/plugins/gotcha-gesture-based-captcha/admin/setting.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function post_password_required() in wp-content/plugins/gotcha-gesture-based-captcha/comments.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gotcha-gesture-based-captcha/index.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid url: ""
  • Screenshots: Screenshot #1 (2.) image not found
You can look at the official readme.txt

gotcha-gesture-based-captcha/index.php 92% from 13 tests

The principal PHP file in "Gotcha | Gesture-based Captcha" v. 1.0.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("gotcha-gesture-based-captcha.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin9,964 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript171,1941,7855,931
PHP166693242,120
CSS10303551,913

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity15.00
▷ Minimum class complexity3.00
▷ Maximum class complexity39.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods87
▷ Static methods00.00%
▷ Public methods87100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
55 PNG files occupy 0.09MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/jslider.round - Copy.png1.83KB1.35KB▼ 26.08%
admin/images/setting/red.png3.27KB0.48KB▼ 85.45%
admin/images/custom_rgb_b.png0.98KB0.74KB▼ 25.00%
admin/images/colorpicker_hsb_b.png0.95KB0.76KB▼ 19.48%
admin/images/calendar.png1.07KB1.22KB0.00%