68% bsk-contact-form-7-blacklist

Code Review | BSK Contact Form 7 Blacklist

WordPress plugin BSK Contact Form 7 Blacklist scored68%from 54 tests.

About plugin

  • Plugin page: bsk-contact-form-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.0.1
  • WordPress version: 6.3.1
  • First release: Dec 16, 2018
  • Latest release: Apr 9, 2022
  • Number of updates: 5
  • Update frequency: every 242.8 days
  • Top authors: bannersky (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /983 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.88ms] Passed 4 tests

This is a short check of server-side resources used by BSK Contact Form 7 Blacklist
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0546.69 ▲1.38
Dashboard /wp-admin3.35 ▲0.0456.00 ▼7.31
Posts /wp-admin/edit.php3.46 ▲0.1054.48 ▼9.33
Add New Post /wp-admin/post-new.php5.95 ▲0.0699.38 ▼14.67
Media Library /wp-admin/upload.php3.27 ▲0.0440.59 ▼0.20
Blacklist /wp-admin/admin.php?page=bsk-cf7-blacklist3.2235.19

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: 2 new tables, 7 new options
New tables
wp_cf7_blacklist_list
wp_cf7_blacklist_items
New WordPress options
widget_theysaidso_widget
widget_recent-comments
_cf7_blacklist_db_ver_
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for BSK Contact Form 7 Blacklist
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.42 ▲0.032.29 ▲0.3250.48 ▲1.79
Dashboard /wp-admin2,202 ▲285.68 ▲0.06103.11 ▼24.8648.07 ▼25.41
Posts /wp-admin/edit.php2,105 ▲22.03 ▼0.0038.80 ▼13.0535.75 ▼9.49
Add New Post /wp-admin/post-new.php1,530 ▼117.60 ▼5.50691.62 ▼48.1953.64 ▼20.91
Media Library /wp-admin/upload.php1,404 ▲44.28 ▲0.08113.54 ▼18.6748.31 ▼7.76
Blacklist /wp-admin/admin.php?page=bsk-cf7-blacklist1,0492.2329.1935.96

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method CF7_Blacklist::cf7_blacklist_uninstall() should not be called statically
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=bsk-cf7-blacklist
    • > Notice in wp-content/plugins/bsk-contact-form-7-blacklist/classes/dashboard/dashboard-lists.php+104
    Undefined variable: current_list_view

SRP 50% 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 take a closer look at the following
  • 6× PHP files trigger server errors when accessed directly:
    • > 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-contact-form-7-blacklist/classes/dashboard/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-contact-form-7-blacklist/classes/dashboard/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-contact-form-7-blacklist/classes/dashboard/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-contact-form-7-blacklist/classes/dashboard/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-contact-form-7-blacklist/classes/dashboard/dashboard-items.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-contact-form-7-blacklist/classes/dashboard/dashboard-lists.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% 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: Please add images for these screenshots: #1 (Screen of blacklist.), #2 (Screen of items in blacklist.), #3 (Screen of apply blacklist items to field.), #4 (Prevent submitting if field value match items in blacklist.)
The official readme.txt is a good inspiration

bsk-contact-form-7-blacklist/bsk-contact-form-7-blacklist.php Passed 13 tests

"BSK Contact Form 7 Blacklist" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
95 characters long description:
Check Contact Form 7 fields value against your items and block submission according to setting.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,985 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP93151111,702
CSS1357168
JavaScript1355115

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity44.25
▷ Minimum class complexity7.00
▷ Maximum class complexity125.00
Average method complexity5.94
▷ Minimum method complexity1.00
▷ Maximum method complexity72.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods70
▷ Static methods11.43%
▷ Public methods70100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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
4 PNG files occupy 0.45MB with 0.29MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png90.66KB28.64KB▼ 68.41%
screenshot-4.png38.15KB17.61KB▼ 53.85%
screenshot-3.png191.64KB60.60KB▼ 68.38%
screenshot-2.png137.95KB46.26KB▼ 66.47%