73% bsk-gravity-forms-custom-validation

Code Review | BSK Forms Validation

WordPress plugin BSK Forms Validation scored73%from 54 tests.

About plugin

  • Plugin page: bsk-gravity-forms...
  • Plugin version: 1.6.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Aug 18, 2020
  • Latest release: May 6, 2023
  • Number of updates: 10
  • Update frequency: every 99.1 days
  • Top authors: bannersky (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /1,794 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.60MB] [CPU: ▲0.31ms] Passed 4 tests

An overview of server-side resources used by BSK Forms Validation
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.6447.82 ▲10.37
Dashboard /wp-admin3.94 ▲0.6351.95 ▼1.17
Posts /wp-admin/edit.php3.99 ▲0.6351.90 ▲5.40
Add New Post /wp-admin/post-new.php6.47 ▲0.5986.04 ▼10.95
Media Library /wp-admin/upload.php3.80 ▲0.5741.19 ▲7.98
Settings /wp-admin/admin.php?page=bsk-forms-cv-settings3.8047.28
Validaiton List /wp-admin/admin.php?page=bsk-forms-cv3.7736.87
Blocked form data /wp-admin/admin.php?page=bsk-forms-cv-blocked-data3.7737.96

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 33 new files
Database: 4 new tables, 7 new options
New tables
wp_bsk_gfcv_items
wp_bsk_gfcv_list
wp_bsk_gfcv_hits
wp_bsk_gfcv_entries
New WordPress options
db_upgraded
widget_recent-comments
_bsk_gfcv_db_ver_
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

BSK Forms Validation: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲16713.48 ▼0.878.99 ▲7.2942.56 ▼2.84
Dashboard /wp-admin2,227 ▲475.81 ▲0.1488.51 ▲0.1637.03 ▼6.51
Posts /wp-admin/edit.php2,135 ▲382.01 ▼0.1139.98 ▲2.1436.42 ▲0.09
Add New Post /wp-admin/post-new.php1,555 ▲2922.90 ▼0.30633.89 ▲12.2251.00 ▼14.54
Media Library /wp-admin/upload.php1,432 ▲324.31 ▲0.15104.98 ▲2.3243.46 ▼1.85
Settings /wp-admin/admin.php?page=bsk-forms-cv-settings1,5095.85112.6729.32
Validaiton List /wp-admin/admin.php?page=bsk-forms-cv9882.0924.9136.89
Blocked form data /wp-admin/admin.php?page=bsk-forms-cv-blocked-data1,0382.0823.6932.79

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 cannot be uninstalled
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method BSK_GFCV::bsk_gfcv_uninstall() should not be called statically
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/bsk-gravity-forms-custom-validation/classes/dashboard/items.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/bsk-gravity-forms-custom-validation/classes/dashboard/entries.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/bsk-gravity-forms-custom-validation/classes/dashboard/lists.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/bsk-gravity-forms-custom-validation/classes/dashboard/items.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/bsk-gravity-forms-custom-validation/classes/dashboard/lists.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/bsk-gravity-forms-custom-validation/classes/dashboard/lists.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/bsk-gravity-forms-custom-validation/classes/dashboard/entries.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/bsk-gravity-forms-custom-validation/classes/dashboard/entries.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/bsk-gravity-forms-custom-validation/classes/dashboard/items.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Menu item in Dashboard), #2 (Add rule to list), #3 (Apply validation list to Gravity Forms form field)
Please take inspiration from this readme.txt

bsk-gravity-forms-custom-validation/bsk-gravityforms-cv.php 85% from 13 tests

The primary PHP file in "BSK Forms Validation" version 1.6.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 157 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("bsk-gravity-forms-custom-validation.php" instead of "bsk-gravityforms-cv.php")

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
Success! There were no dangerous files found in this plugin4,043 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP216861573,565
CSS15814268
JavaScript26119210

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity31.16
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity6.07
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods113
▷ Static methods1715.04%
▷ Public methods11198.23%
▷ Protected methods00.00%
▷ Private methods21.77%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
6 PNG files occupy 0.31MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png91.48KB31.86KB▼ 65.17%
screenshot-1.png36.80KB12.85KB▼ 65.09%
images/active0.png14.99KB1.11KB▼ 92.58%
images/active1.png15.01KB1.06KB▼ 92.96%
images/delete-2.png1.45KB0.28KB▼ 80.89%