84% cf7-conditional-fields

Code Review | Conditional Fields for Contact Form 7

WordPress plugin Conditional Fields for Contact Form 7 scored84%from 54 tests.

About plugin

  • Plugin page: cf7-conditional-f...
  • Plugin version: 2.4.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 1, 2016
  • Latest release: Nov 23, 2023
  • Number of updates: 289
  • Update frequency: every 9.5 days
  • Top authors: Jules Colle (100%)

Code review

54 tests

User reviews

155 reviews

Install metrics

100,000+ active /4,228,192 total downloads

Benchmarks

Plugin footprint 83% 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 gracefully, with no errors

Server metrics [RAM: ▲0.20MB] [CPU: ▼4.29ms] Passed 4 tests

An overview of server-side resources used by Conditional Fields for Contact Form 7
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1741.53 ▲0.25
Dashboard /wp-admin3.52 ▲0.1746.70 ▼18.97
Posts /wp-admin/edit.php3.63 ▲0.2750.13 ▲5.43
Add New Post /wp-admin/post-new.php6.12 ▲0.2395.26 ▼1.78
Media Library /wp-admin/upload.php3.44 ▲0.2134.63 ▲3.35
Conditional Fields /wp-admin/admin.php?page=wpcf7cf3.4132.09

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Conditional Fields for Contact Form 7
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲17013.39 ▼1.178.32 ▲6.4137.65 ▼3.52
Dashboard /wp-admin2,211 ▲345.64 ▲0.1395.57 ▼0.6041.69 ▼2.71
Posts /wp-admin/edit.php2,117 ▲172.03 ▲0.0539.10 ▼0.6837.79 ▲2.66
Add New Post /wp-admin/post-new.php1,542 ▲623.01 ▼0.12564.44 ▼106.1752.46 ▼8.15
Media Library /wp-admin/upload.php1,419 ▲224.23 ▼0.04101.37 ▲5.3343.59 ▲2.26
Conditional Fields /wp-admin/admin.php?page=wpcf7cf1,0572.1927.4545.50

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/cf7-conditional-fields/init.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/cf7-conditional-fields/init.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cf7-conditional-fields/tg_pane_group.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-conditional-fields/admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-conditional-fields/cf7cf.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-conditional-fields/wpcf7cf-options.php:74

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: conditional fields, forms, contact form 7, wordpress

cf7-conditional-fields/contact-form-7-conditional-fields.php 92% from 13 tests

The main PHP file in "Conditional Fields for Contact Form 7" ver. 2.4.3 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("cf7-conditional-fields.php" instead of "contact-form-7-conditional-fields.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected19,204 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
SVG60010,987
JavaScript109874093,278
HTML72,283212,987
PHP7276141913
CSS511358780
Sass1561259

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity26.50
▷ Minimum class complexity6.00
▷ Maximum class complexity47.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods939.13%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions41
▷ Named functions3790.24%
▷ Anonymous functions49.76%
Constants25
▷ Global constants25100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin