73% drag-and-drop-form-builder-for-contact-form-7

Code Review | Live Drag and Drop Builder for Contact Form 7

WordPress plugin Live Drag and Drop Builder for Contact Form 7 scored73%from 54 tests.

About plugin

  • Plugin page: drag-and-drop-for...
  • Plugin version: 1.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.2
  • WordPress version: 6.3.1
  • First release: Jul 23, 2018
  • Latest release: Jul 5, 2023
  • Number of updates: 25
  • Update frequency: every 72.3 days
  • Top authors: JoseVega (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /14,206 total downloads

Benchmarks

Plugin footprint 64% 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: ▲5.05MB] [CPU: ▲22.50ms] 50% from 4 tests

A check of server-side resources used by Live Drag and Drop Builder for Contact Form 7
Please take the time to fix the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,219.81ms on /wp-admin/options-general.php?page=wpvsfb_welcome_page)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.05MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.93 ▲5.4760.87 ▲19.96
Dashboard /wp-admin8.96 ▲5.6573.98 ▲26.85
Posts /wp-admin/edit.php8.96 ▲5.6082.35 ▲34.15
Add New Post /wp-admin/post-new.php9.36 ▲3.47105.87 ▲12.07
Media Library /wp-admin/upload.php8.96 ▲5.7264.26 ▲31.11
CF7 Form Builder /wp-admin/options-general.php?page=wpvsfb_welcome_page8.961,219.81
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9558.92

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 255 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
fs_accounts
fs_active_plugins
widget_recent-comments
widget_recent-posts
db_upgraded
wpvsfb_welcome_redirect
fs_debug_mode

Browser metrics Passed 4 tests

Live Drag and Drop Builder for Contact Form 7: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲8713.24 ▼1.144.47 ▲2.4228.95 ▼17.28
Dashboard /wp-admin2,228 ▲405.83 ▲0.94111.03 ▼0.7545.33 ▼2.16
Posts /wp-admin/edit.php2,114 ▲222.05 ▼0.1243.13 ▲6.1338.01 ▲4.28
Add New Post /wp-admin/post-new.php1,523 ▼1022.50 ▼0.54653.13 ▼4.5458.90 ▼3.91
Media Library /wp-admin/upload.php1,410 ▲254.21 ▼0.0199.67 ▼0.8847.15 ▲4.82
CF7 Form Builder /wp-admin/options-general.php?page=wpvsfb_welcome_page9791.7126.4755.14
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0722.2126.9833.42

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/drag-and-drop-form-builder-for-contact-form-7/vendor/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • fs_debug_mode
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • fs_active_plugins
    • widget_theysaidso_widget
    • fs_accounts
    • wpvsfb_welcome_redirect
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function fs_dynamic_init() in wp-content/plugins/drag-and-drop-form-builder-for-contact-form-7/inc/freemius.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/drag-and-drop-form-builder-for-contact-form-7/vendor/vg-plugin-sdk/samples/email-optin-form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/drag-and-drop-form-builder-for-contact-form-7/core/views/metabox.php:113
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/drag-and-drop-form-builder-for-contact-form-7/core/index.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/drag-and-drop-form-builder-for-contact-form-7/views/welcome-page-content.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/drag-and-drop-form-builder-for-contact-form-7/vendor/vg-plugin-sdk/views/page-template.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: cf7, wpcf7, contact form 7, contact form 7 db

drag-and-drop-form-builder-for-contact-form-7/index.php 85% from 13 tests

The main file in "Live Drag and Drop Builder for Contact Form 7" v. 1.2.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("drag-and-drop-form-builder-for-contact-form-7.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin55,158 lines of code in 157 files:
LanguageFilesBlank linesComment linesLines of code
PHP1258,11917,27133,788
JSON10010,040
SVG30128,891
JavaScript93243301,614
CSS181858706
PO File14150119

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity88.78
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes51
▷ Abstract classes23.92%
▷ Concrete classes4996.08%
▷ Final classes00.00%
Methods1,298
▷ Static methods19915.33%
▷ Public methods90769.88%
▷ Protected methods171.31%
▷ Private methods37428.81%
Functions101
▷ Named functions101100.00%
▷ Anonymous functions00.00%
Constants145
▷ Global constants9867.59%
▷ Class constants4732.41%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.44MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/assets/imgs/previews-forms/form-green-cf7.png62.30KB18.52KB▼ 70.27%
core/assets/imgs/previews-forms/form-plain-cf7.png111.69KB30.33KB▼ 72.85%
core/assets/imgs/previews-forms/form-red-cf7.png61.67KB18.51KB▼ 69.99%
vendor/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/freemius/assets/img/drag-and-drop-form-builder-for-contact-form-7.png3.12KB2.85KB▼ 8.43%