84% cf7-data-source

Code Review | Data Source for Contact Form 7

WordPress plugin Data Source for Contact Form 7 scored84%from 54 tests.

About plugin

  • Plugin page: cf7-data-source
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.5-6.4
  • WordPress version: 6.3.1
  • First release: Mar 31, 2021
  • Latest release: Nov 19, 2023
  • Number of updates: 88
  • Update frequency: every 10.9 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

400+ active /10,969 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.49MB] [CPU: ▲6.66ms] Passed 4 tests

This is a short check of server-side resources used by Data Source for Contact Form 7
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4839.99 ▲2.97
Dashboard /wp-admin3.82 ▲0.5151.48 ▲6.17
Posts /wp-admin/edit.php3.87 ▲0.5155.25 ▲7.57
Add New Post /wp-admin/post-new.php6.34 ▲0.4595.92 ▲15.95
Media Library /wp-admin/upload.php3.74 ▲0.5147.27 ▲9.92
Extensions /wp-admin/admin.php?page=cf7-datasource-addons3.6535.82

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 84 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
installed_cf7-data-source
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Data Source for Contact Form 7
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.27 ▼0.121.73 ▲0.0238.78 ▼7.42
Dashboard /wp-admin2,198 ▲185.68 ▲0.1093.59 ▲1.4839.59 ▼2.81
Posts /wp-admin/edit.php2,100 ▼31.94 ▼0.0140.55 ▼0.8038.11 ▼2.61
Add New Post /wp-admin/post-new.php1,526 ▼323.28 ▲0.09631.43 ▼46.7151.51 ▼1.51
Media Library /wp-admin/upload.php1,403 ▼04.16 ▼0.0997.08 ▼0.8642.54 ▲0.52
Extensions /wp-admin/admin.php?page=cf7-datasource-addons1,0282.1623.6733.44

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • installed_cf7-data-source
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'CF7_DATASOURCE_ADDONS' not found in wp-content/plugins/cf7-data-source/add-ons/server-side.addon.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CF7_DATASOURCE_ADDONS' not found in wp-content/plugins/cf7-data-source/add-ons/post-generator.addon.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CF7_DATASOURCE_ADDONS' not found in wp-content/plugins/cf7-data-source/add-ons/complementary-controls.addon.php:154
    • > PHP Fatal error
      Uncaught Error: Class 'CF7_DATASOURCE_ADDONS' not found in wp-content/plugins/cf7-data-source/add-ons/to-database.addon.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CF7_DATASOURCE_ADDONS' not found in wp-content/plugins/cf7-data-source/add-ons/json-generator.addon.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CF7_DATASOURCE_ADDONS' not found in wp-content/plugins/cf7-data-source/add-ons/pdf-generator.addon.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-data-source/banner.php:105
    • > PHP Fatal error
      Uncaught Error: Class 'CF7_DATASOURCE_ADDONS' not found in wp-content/plugins/cf7-data-source/add-ons/csv-generator.addon.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CF7_DATASOURCE_ADDONS' not found in wp-content/plugins/cf7-data-source/add-ons/user-registration.addon.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-data-source/banner.php:105

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: contact form, wpcf7, cf7, contact form db, database...

cf7-data-source/cf7-datasource.php 85% from 13 tests

"Data Source for Contact Form 7" version 1.1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cf7-data-source.php" instead of "cf7-datasource.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 253 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected4,985 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
PHP233821042,309
JavaScript19180961,842
PO File1135181341
CSS204217311
HTML110181
SVG1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.14
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes14.76%
▷ Concrete classes2095.24%
▷ Final classes00.00%
Methods117
▷ Static methods108.55%
▷ Public methods9581.20%
▷ Protected methods108.55%
▷ Private methods1210.26%
Functions10
▷ Named functions110.00%
▷ Anonymous functions990.00%
Constants0
▷ Global constants00.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
17 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
add-ons/complementary-controls.addon/controls/data-table/image.png0.51KB0.78KB0.00%
add-ons/server-side.addon/image.png0.81KB0.81KB0.12%
add-ons/to-database.addon/image.png2.43KB2.02KB▼ 17.01%
add-ons/complementary-controls.addon/image.png2.12KB1.96KB▼ 7.47%
add-ons/complementary-controls.addon/controls/data-table/vendor/DataTables-1.11.3/images/sort_desc_disabled.png0.14KB0.25KB0.00%