83% bootstrap-for-contact-form-7

Code Review | Bootstrap for Contact Form 7

WordPress plugin Bootstrap for Contact Form 7 scored83%from 54 tests.

About plugin

  • Plugin page: bootstrap-for-con...
  • Plugin version: 1.4.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.9
  • WordPress version: 6.3.1
  • First release: Nov 4, 2014
  • Latest release: May 24, 2018
  • Number of updates: 47
  • Update frequency: every 27.6 days
  • Top authors: flixos90 (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

20,000+ active /305,776 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.41ms] Passed 4 tests

A check of server-side resources used by Bootstrap for Contact Form 7
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.50 ▲1.11
Dashboard /wp-admin3.34 ▲0.0350.81 ▼3.69
Posts /wp-admin/edit.php3.39 ▲0.0350.75 ▲0.50
Add New Post /wp-admin/post-new.php5.92 ▲0.0385.51 ▼23.15
Media Library /wp-admin/upload.php3.26 ▲0.0333.16 ▼7.28

Server storage [IO: ▲0.16MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
It is recommended to fix the following issues
  • Illegal file modification found: 1 file (4.00KB) outside of "wp-content/plugins/bootstrap-for-contact-form-7/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Bootstrap for Contact Form 7
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲9013.19 ▼1.072.22 ▲0.3243.61 ▼3.80
Dashboard /wp-admin2,232 ▲265.84 ▼0.0796.33 ▼11.2243.98 ▼1.22
Posts /wp-admin/edit.php2,111 ▲142.01 ▼0.0434.49 ▼2.2040.48 ▲5.13
Add New Post /wp-admin/post-new.php1,565 ▲2518.30 ▼0.18649.82 ▲25.5157.97 ▲10.91
Media Library /wp-admin/upload.php1,408 ▲84.13 ▼0.0797.97 ▼10.3242.78 ▼7.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • 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
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 18× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bootstrap-for-contact-form-7/bootstrap-for-contact-form-7.php:68
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bootstrap-for-contact-form-7/modules/select.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bootstrap-for-contact-form-7/modules/acceptance.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bootstrap-for-contact-form-7/modules/checkbox.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bootstrap-for-contact-form-7/modules/submit.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bootstrap-for-contact-form-7/modules/text.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bootstrap-for-contact-form-7/modules/number.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'CF7BS_Component' not found in wp-content/plugins/bootstrap-for-contact-form-7/classes/CF7BS_Button_Group.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bootstrap-for-contact-form-7/modifications.php:92
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bootstrap-for-contact-form-7/modules/textarea.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: contact form 7 addon, cf7bs, wpcf7, bootstrap, addon...

bootstrap-for-contact-form-7/bootstrap-for-contact-form-7.php 92% from 13 tests

"Bootstrap for Contact Form 7" version 1.4.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 142 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
There were no executable files found in this plugin2,749 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP205001692,514
JavaScript43124178
CSS2101057

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 136)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity43.80
▷ Minimum class complexity9.00
▷ Maximum class complexity161.00
Average method complexity8.38
▷ Minimum method complexity1.00
▷ Maximum method complexity136.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods1033.33%
▷ Protected methods1343.33%
▷ Private methods723.33%
Functions58
▷ Named functions58100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected