83% conditional-fields-in-contact-form-7

Code Review | Conditional fields in Contact Form 7

WordPress plugin Conditional fields in Contact Form 7 scored83%from 54 tests.

About plugin

  • Plugin page: conditional-field...
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.9
  • WordPress version: 6.3.1
  • First release: Aug 3, 2019
  • Latest release: May 15, 2022
  • Number of updates: 8
  • Update frequency: every 127.1 days
  • Top authors: ketovpavel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /5,036 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
Installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼1.14ms] Passed 4 tests

Analyzing server-side resources used by Conditional fields in Contact Form 7
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1240.39 ▲0.93
Dashboard /wp-admin3.46 ▲0.1646.83 ▼0.43
Posts /wp-admin/edit.php3.58 ▲0.2243.60 ▼2.94
Add New Post /wp-admin/post-new.php6.04 ▲0.1693.74 ▲4.69
Media Library /wp-admin/upload.php3.39 ▲0.1635.17 ▼2.12
Conditional fields /wp-admin/admin.php?page=cfcf73.3531.17

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
cfcf7_options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Conditional fields in Contact Form 7
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲14213.65 ▼1.028.30 ▲5.6541.65 ▼4.55
Dashboard /wp-admin2,205 ▲145.80 ▲0.71102.82 ▼13.0039.19 ▼5.87
Posts /wp-admin/edit.php2,091 ▲22.03 ▲0.0333.34 ▼3.2333.89 ▼1.34
Add New Post /wp-admin/post-new.php1,516 ▼323.12 ▲0.04573.69 ▼103.3855.34 ▼25.58
Media Library /wp-admin/upload.php1,393 ▲54.19 ▼0.0698.73 ▼9.4043.12 ▼2.45
Conditional fields /wp-admin/admin.php?page=cfcf78482.0627.4325.51

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • cfcf7_options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

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 | 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 fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/conditional-fields-in-contact-form-7/cfcf7-options.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/conditional-fields-in-contact-form-7/admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/conditional-fields-in-contact-form-7/init.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/conditional-fields-in-contact-form-7/cfcf7.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/conditional-fields-in-contact-form-7/init.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/conditional-fields-in-contact-form-7/tg_pane_group.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes: You can look at the official readme.txt

conditional-fields-in-contact-form-7/index.php 85% from 13 tests

The primary PHP file in "Conditional fields in Contact Form 7" version 1.0.4 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("conditional-fields-in-contact-form-7.php" instead of "index.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,537 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP622093721
JavaScript217231523
CSS277161
PO File14955132

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods425.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants17
▷ Global constants17100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin