77% widget-for-contact-form-7

Code Review | Widget for Contact form 7

WordPress plugin Widget for Contact form 7 scored 77% from 54 tests.

About plugin

  • Plugin page: widget-for-contac...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.0.2
  • WordPress version: 5.9.2
  • First release: Mar 15, 2017
  • Latest release: Sep 4, 2019
  • Number of updates: 11
  • Update frequency: every 81.7 days
  • Top authors: olezhyk5 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active / 4,129 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲4.00MB] [CPU: ▼254.17ms] 75% from 4 tests

A check of server-side resources used by Widget for Contact form 7
It is recommended to improve the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 2,189.89ms on /wp-admin/admin.php?page=widget-for-contact-form-7)
PageMemory (MB)CPU Time (ms)
Home /7.90 ▲4.3977.75 ▲25.35
Dashboard /wp-admin7.92 ▲4.5254.34 ▲16.98
Posts /wp-admin/edit.php7.92 ▲4.2865.21 ▲20.34
Add New Post /wp-admin/post-new.php9.77 ▲2.80209.79 ▼1,070.81
Media Library /wp-admin/upload.php7.92 ▲4.6344.90 ▲16.82
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius7.9245.14
Widget for Contact form 7 /wp-admin/admin.php?page=widget-for-contact-form-77.922,189.89

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 170 new files
Database: no new tables, 6 new options
New WordPress options
fs_gdpr
fs_accounts
fs_active_plugins
fs_api_cache
fs_debug_mode
widget_wpc7w_contact_form

Browser metrics Passed 4 tests

Checking browser requirements for Widget for Contact form 7
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,794 ▲5016.03 ▲0.715.52 ▼0.392.23 ▲0.07
Dashboard /wp-admin2,926 ▲726.15 ▼0.02115.03 ▼19.54176.54 ▼38.18
Posts /wp-admin/edit.php2,719 ▲283.24 ▲0.0066.21 ▼0.08162.37 ▲20.06
Add New Post /wp-admin/post-new.php1,669 ▲822.79 ▲6.61526.74 ▲81.83208.16 ▲47.84
Media Library /wp-admin/upload.php1,720 ▲225.52 ▲0.03140.18 ▼29.27273.75 ▲88.49
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius1,4432.6953.65131.53
Widget for Contact form 7 /wp-admin/admin.php?page=widget-for-contact-form-71,2812.4453.90168.95

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • fs_api_cache
    • fs_debug_mode
    • fs_gdpr
    • fs_accounts
    • fs_active_plugins
    • widget_wpc7w_contact_form

Smoke tests 50% 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 0% 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 fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/widget-for-contact-form-7/freemius/templates/ajax-loader.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/widget-for-contact-form-7/freemius/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/widget-for-contact-form-7/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/widget-for-contact-form-7/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/widget-for-contact-form-7/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/widget-for-contact-form-7/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/widget-for-contact-form-7/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/widget-for-contact-form-7/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/widget-for-contact-form-7/freemius/templates/account/partials/addon.php on line 7

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: ""
Please take inspiration from this readme.txt

widget-for-contact-form-7/wpc7w.php 85% from 13 tests

The primary PHP file in "Widget for Contact form 7" version 1.0.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("widget-for-contact-form-7.php" instead of "wpc7w.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 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
No dangerous file extensions were detected41,015 lines of code in 132 files:
LanguageFilesBlank linesComment linesLines of code
PHP1066,68915,29828,030
PO File105,7106,91312,558
JavaScript33459194
Markdown1610192
JSON10027
CSS100013
SVG1001

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,609)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity81.46
▷ Minimum class complexity1.00
▷ Maximum class complexity2,609.00
Average method complexity4.52
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes46
▷ Abstract classes24.35%
▷ Concrete classes4495.65%
▷ Final classes00.00%
Methods1,084
▷ Static methods17015.68%
▷ Public methods75369.46%
▷ Protected methods151.38%
▷ Private methods31629.15%
Functions93
▷ Named functions9298.92%
▷ Anonymous functions11.08%
Constants119
▷ Global constants9680.67%
▷ Class constants2319.33%
▷ Public constants23100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%