10% ultimate-captcha

Code Review | Ultimate Captcha reCAPTCHA Plugin for WordPress

WordPress plugin Ultimate Captcha reCAPTCHA Plugin for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: ultimate-captcha
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8
  • WordPress version: 6.3.1
  • First release: Jan 8, 2018
  • Latest release: Oct 5, 2021
  • Number of updates: 11
  • Update frequency: every 124.3 days
  • Top authors: UsersUltra (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /868 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/ultimate-captcha/classes/ultimatecaptcha.class.php+1157
    Undefined index: email_password_change_staff

Server metrics [RAM: ▼1.19MB] [CPU: ▼48.38ms] Passed 4 tests

Analyzing server-side resources used by Ultimate Captcha reCAPTCHA Plugin for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.80 ▼0.669.80 ▼28.83
Dashboard /wp-admin2.82 ▼0.4811.36 ▼38.70
Posts /wp-admin/edit.php2.82 ▼0.5411.55 ▼39.83
Add New Post /wp-admin/post-new.php2.82 ▼3.0710.73 ▼86.15
Media Library /wp-admin/upload.php2.82 ▼0.4112.48 ▼18.94
More Functionality! /wp-admin/admin.php?page=ultimatecaptcha&tab=pro2.8210.53
Ultimate Captcha /wp-admin/admin.php?page=ultimatecaptcha2.8211.21

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 209 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
ultimatecaptcha_ini_setup
db_upgraded
widget_recent-posts
ultimatecaptcha_pro_active
can_compress_scripts
widget_recent-comments
ultimatecaptcha_options
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Ultimate Captcha reCAPTCHA Plugin for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,063 ▲30215.86 ▲1.4526.39 ▲24.7442.86 ▼4.91
Dashboard /wp-admin2,240 ▲635.82 ▲0.1491.81 ▲4.3876.97 ▲31.18
Posts /wp-admin/edit.php2,152 ▲522.85 ▲0.8446.95 ▲11.2136.33 ▼1.68
Add New Post /wp-admin/post-new.php1,574 ▲4424.11 ▲1.10650.74 ▼44.5697.44 ▲35.49
Media Library /wp-admin/upload.php1,456 ▲565.40 ▲1.1597.59 ▼13.0886.22 ▲38.29
More Functionality! /wp-admin/admin.php?page=ultimatecaptcha&tab=pro9252.7530.5734.99
Ultimate Captcha /wp-admin/admin.php?page=ultimatecaptcha8692.7034.2932.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/ultimate-captcha/classes/ultimatecaptcha.class.php+1157
    Undefined index: email_password_change_staff
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • ultimatecaptcha_ini_setup
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • ultimatecaptcha_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • ultimatecaptcha_pro_active

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ultimatecaptcha
    • > Notice in wp-content/plugins/ultimate-captcha/classes/ultimatecaptcha.class.php+1157
    Undefined index: email_password_change_staff
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ultimatecaptcha
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the ultimate_captchastyle handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ultimatecaptcha
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the ultimate_captchastyle handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ultimatecaptcha
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the ultimatecaptcha_recaptcha_js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ultimatecaptcha
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the ultimatecaptcha_recaptcha_js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ultimatecaptcha
    • > Notice in wp-content/plugins/ultimate-captcha/classes/ultimatecaptcha.class.php+1245
    Undefined variable: custom_badge
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ultimatecaptcha
    • > Notice in wp-content/plugins/ultimate-captcha/classes/ultimatecaptcha.class.php+1512
    Undefined property: UltimateCaptchaPlugin::$valid_c

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'UltimateCaptchaCommon' not found in wp-content/plugins/ultimate-captcha/classes/ultimatecaptcha.class.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/ultimate-captcha/addons/profiles/admin/admin.php on line 14
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ultimate-captcha/addons/profiles/admin/admin.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/ultimate-captcha/addons/profiles/admin/admin.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ultimate-captcha/addons/profiles/index.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'UltimateCaptchaCommon' not found in wp-content/plugins/ultimate-captcha/classes/ultimatecaptcha.messaging.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ultimatecaptcha
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/ultimate-captcha/admin/scripts/admin.js:107:55)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ultimatecaptcha
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (reCaptcha on Login Form), #2 (reCaptcha on Registration Form), #3 (reCaptcha on Popup Registration Form), #4 (reCaptcha on Custom Login Form (Pro)), #5 (reCaptcha on Custom Registration Form (Pro)), #6 (reCaptcha on Custom Password Reset Form (Pro)), #7 (Password Strength (Pro))
You can take inspiration from this readme.txt

ultimate-captcha/index.php 92% from 13 tests

The primary PHP file in "Ultimate Captcha reCAPTCHA Plugin for WordPress" version 1.0.5 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ultimate-captcha.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin26,300 lines of code in 123 files:
LanguageFilesBlank linesComment linesLines of code
CSS131,2812026,735
JavaScript425571,0406,131
PHP182,3523434,277
SVG3003,158
Sass2350482,649
LESS2350642,635
PO File1312355715

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity82.40
▷ Minimum class complexity14.00
▷ Maximum class complexity215.00
Average method complexity4.04
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods134
▷ Static methods10.75%
▷ Public methods134100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
53 PNG files occupy 0.22MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/imagcropper/img/cut_icon.png3.93KB0.82KB▼ 79.23%
admin/images/logo-welcome.png23.63KB4.17KB▼ 82.33%
admin/images/Star.png4.04KB1.35KB▼ 66.63%
admin/img/ui-bg_glass_75_e6e6e6_1x400.png0.26KB0.15KB▼ 42.37%
admin/img/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%