10% widget-contact-form-7

Code Review | Widget Contact Form 7

WordPress plugin Widget Contact Form 7 scored10%from 54 tests.

About plugin

  • Plugin page: widget-contact-fo...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.8
  • WordPress version: 6.3.1
  • First release: Jul 25, 2013
  • Latest release: Mar 31, 2014
  • Number of updates: 5
  • Update frequency: every 51.0 days
  • Top authors: DigitalCourt (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

2,000+ active /47,976 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/widget-contact-form-7/cf7-widget.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; Widget_CF7 has a deprecated constructor

Server metrics [RAM: ▼1.92MB] [CPU: ▼53.85ms] Passed 4 tests

A check of server-side resources used by Widget Contact Form 7
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.407.79 ▼36.52
Dashboard /wp-admin2.08 ▼1.225.65 ▼39.99
Posts /wp-admin/edit.php2.08 ▼1.275.89 ▼38.43
Add New Post /wp-admin/post-new.php2.08 ▼3.805.35 ▼100.47
Media Library /wp-admin/upload.php2.08 ▼1.145.02 ▼28.79

Server storage [IO: ▲0.00MB] [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: 2 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_custom_cf7
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Widget Contact Form 7: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.23 ▼1.422.00 ▲0.2843.87 ▼0.02
Dashboard /wp-admin2,206 ▲184.89 ▼0.01111.52 ▲8.9441.21 ▲1.63
Posts /wp-admin/edit.php2,092 ▲32.02 ▼0.0241.43 ▲0.9535.39 ▼0.09
Add New Post /wp-admin/post-new.php1,534 ▲523.36 ▲5.19629.51 ▼14.9953.58 ▼9.52
Media Library /wp-admin/upload.php1,382 ▼04.24 ▼0.0396.59 ▼0.4139.56 ▼3.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/widget-contact-form-7/cf7-widget.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; Widget_CF7 has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_custom_cf7
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widget-contact-form-7/cf7-widget.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

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

The main PHP file in "Widget Contact Form 7" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("widget-contact-form-7.php" instead of "cf7-widget.php")

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
Good job! No executable or dangerous file extensions detected58 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1151058

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 files were detected