84% contact-form-7-civicrm-integration

Code Review | Contact Form 7 CiviCRM integration

WordPress plugin Contact Form 7 CiviCRM integration scored84%from 54 tests.

About plugin

  • Plugin page: contact-form-7-ci...
  • Plugin version: 1.9
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.8
  • WordPress version: 6.3.1
  • First release: Feb 12, 2016
  • Latest release: Jan 7, 2022
  • Number of updates: 29
  • Update frequency: every 74.4 days
  • Top authors: jaapjansma (75.86%)aydun (27.59%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /4,281 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.13ms] Passed 4 tests

An overview of server-side resources used by Contact Form 7 CiviCRM integration
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.91 ▼6.93
Dashboard /wp-admin3.32 ▲0.0145.45 ▼1.84
Posts /wp-admin/edit.php3.37 ▲0.0144.92 ▼3.55
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.53 ▼8.20
Media Library /wp-admin/upload.php3.24 ▲0.0133.64 ▼1.58
CiviCRM Contact Form 7 Settings /wp-admin/options-general.php?page=cf7_civi_admin3.2530.99

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Contact Form 7 CiviCRM integration
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.44 ▼0.941.57 ▼0.2038.30 ▼8.44
Dashboard /wp-admin2,213 ▲254.82 ▼0.99102.29 ▲2.2140.31 ▼1.51
Posts /wp-admin/edit.php2,090 ▲12.01 ▲0.0034.58 ▼0.2732.35 ▼3.12
Add New Post /wp-admin/post-new.php1,517 ▼1917.59 ▼5.60670.27 ▲0.5458.12 ▲0.61
Media Library /wp-admin/upload.php1,392 ▲44.29 ▲0.1094.80 ▲0.6839.97 ▼1.45
CiviCRM Contact Form 7 Settings /wp-admin/options-general.php?page=cf7_civi_admin8532.0331.1729.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/contact-form-7-civicrm-integration/views/civicrm_panel.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/contact-form-7-civicrm-integration/contact-form-7-civi.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/contact-form-7-civicrm-integration/views/settings.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === contact-form-7-civicrm-integration === )
The official readme.txt might help

contact-form-7-civicrm-integration/contact-form-7-civi.php 92% from 13 tests

"Contact Form 7 CiviCRM integration" version 1.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("contact-form-7-civicrm-integration.php" instead of "contact-form-7-civi.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin546 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP687209485
Markdown114044
JavaScript14017

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity17.00
▷ Minimum class complexity2.00
▷ Maximum class complexity30.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods33
▷ Static methods1957.58%
▷ Public methods3193.94%
▷ Protected methods00.00%
▷ Private methods26.06%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin