78% product-list-field-for-contact-form-7

Code Review | Product Dropdown Field For Contact Form 7

WordPress plugin Product Dropdown Field For Contact Form 7 scored 78% from 54 tests.

About plugin

  • Plugin page: product-list-fiel...
  • Plugin version: 1.0
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 26, 2022
  • Latest release: Oct 2, 2023
  • Number of updates: 9
  • Update frequency: every 54.9 days
  • Top authors: silverplugins217 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 1,261 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.46ms] Passed 4 tests

An overview of server-side resources used by Product Dropdown Field For Contact Form 7
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.35 ▲0.63
Dashboard /wp-admin3.31 ▲0.0050.31 ▲1.40
Posts /wp-admin/edit.php3.36 ▲0.0048.15 ▲1.63
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.61 ▼5.51
Media Library /wp-admin/upload.php3.23 ▲0.0034.54 ▲4.31

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 63 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Product Dropdown Field For Contact Form 7
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲8213.64 ▼0.321.91 ▲0.0544.45 ▼7.24
Dashboard /wp-admin2,209 ▲214.85 ▼0.05111.14 ▲12.2943.11 ▼3.01
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0433.49 ▼7.3034.96 ▼0.73
Add New Post /wp-admin/post-new.php1,546 ▲3223.13 ▲5.58581.05 ▼92.3552.03 ▼6.99
Media Library /wp-admin/upload.php1,391 ▲64.26 ▲0.0293.39 ▼8.0641.92 ▼6.04

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/product-list-field-for-contact-form-7/woocommerce-product-list-field-cf7.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-list-field-for-contact-form-7/main/resources/wplfcf7-installation-require.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-list-field-for-contact-form-7/main/resources/wplfcf7-load-js-css.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-list-field-for-contact-form-7/main/resources/wplfcf7-language.php:4

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Contributors: Plugin contributors field is missing
The official readme.txt might help

product-list-field-for-contact-form-7/woocommerce-product-list-field-cf7.php 85% from 13 tests

The principal PHP file in "Product Dropdown Field For Contact Form 7" v. 1.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("product-list-field-for-contact-form-7.php" instead of "woocommerce-product-list-field-cf7.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin5,358 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript501,1733234,479
CSS3570511
PHP67722368

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/star.png39.75KB10.35KB▼ 73.95%