73% better-captcha-gravity-forms

Code Review | GravityCaptcha

WordPress plugin GravityCaptcha scored73%from 54 tests.

About plugin

  • Plugin page: better-captcha-gr...
  • Plugin version: 0.5.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 3, 2020
  • Latest release: Jun 3, 2023
  • Number of updates: 16
  • Update frequency: every 57.0 days
  • Top authors: zerozendesign (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,097 total downloads


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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.61MB] [CPU: ▲19.59ms] Passed 4 tests

An overview of server-side resources used by GravityCaptcha
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /8.50 ▲5.0364.09 ▲25.58
Dashboard /wp-admin8.52 ▲5.1771.02 ▲10.96
Posts /wp-admin/edit.php8.52 ▲5.1674.69 ▲26.30
Add New Post /wp-admin/post-new.php8.95 ▲3.07116.10 ▲15.52
Media Library /wp-admin/upload.php8.52 ▲5.2958.79 ▲28.68
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.5252.23

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 174 new files
Database: no new tables, 10 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for GravityCaptcha
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲5013.70 ▼0.611.61 ▼0.4928.99 ▼15.72
Dashboard /wp-admin2,230 ▲385.86 ▲0.93108.64 ▲2.7944.95 ▼0.13
Posts /wp-admin/edit.php2,110 ▲212.02 ▲0.0242.26 ▲5.5438.64 ▲8.33
Add New Post /wp-admin/post-new.php1,523 ▲123.09 ▼0.19587.01 ▼35.4853.54 ▲1.26
Media Library /wp-admin/upload.php1,409 ▲214.30 ▲0.1397.31 ▲2.6642.45 ▼1.54
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0561.7222.3426.61

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
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/better-captcha-gravity-forms/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • fs_debug_mode
    • theysaidso_admin_options
    • db_upgraded
    • fs_gdpr
    • fs_accounts
    • can_compress_scripts
    • widget_recent-comments
    • fs_active_plugins
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/better-captcha-gravity-forms/better-captcha-gravity-forms.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/better-captcha-gravity-forms/class-gravitycaptcha-addon.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention: The official readme.txt is a good inspiration

better-captcha-gravity-forms/better-captcha-gravity-forms.php 92% from 13 tests

"GravityCaptcha" version 0.5.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 485 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin31,447 lines of code in 128 files:
LanguageFilesBlank linesComment linesLines of code

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity86.50
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes00.00%
▷ Static methods17514.88%
▷ Public methods83671.09%
▷ Protected methods151.28%
▷ Private methods32527.64%
▷ Named functions96100.00%
▷ Anonymous functions00.00%
▷ Global constants10580.77%
▷ Class constants2519.23%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/lockicon.png12.27KB2.28KB▼ 81.42%
freemius/assets/img/better-captcha-gravity-forms.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/images/lockiconblack.png5.42KB3.17KB▼ 41.47%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%