72% nm-contact-forms

Code Review | NM Contact Forms

WordPress plugin NM Contact Forms scored72%from 54 tests.

About plugin

  • Plugin page: nm-contact-forms
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.5
  • WordPress version: 6.3.1
  • First release: Dec 28, 2014
  • Latest release: Mar 1, 2020
  • Number of updates: 130
  • Update frequency: every 14.5 days
  • Top authors: frankenstein-uk (83.85%)bigloltrash (16.92%)

Code review

54 tests

User reviews

24 reviews

Install metrics

500+ active /34,554 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.12MB] [CPU: ▼4.40ms] Passed 4 tests

A check of server-side resources used by NM Contact Forms
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.83 ▼1.37
Dashboard /wp-admin3.43 ▲0.1345.82 ▼4.56
Posts /wp-admin/edit.php3.54 ▲0.1947.31 ▼0.40
Add New Post /wp-admin/post-new.php6.01 ▲0.1283.08 ▼11.26
Media Library /wp-admin/upload.php3.35 ▲0.1243.11 ▲8.57
Settings /wp-admin/admin.php?page=nm_settings3.3731.44
Forms list /wp-admin/admin.php?page=nm_forms_list3.3732.77
Detailed Forms /wp-admin/admin.php?page=nm_forms3.3930.78

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
recovery_mode_email_last_sent
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

NM Contact Forms: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲7813.32 ▼1.361.56 ▼0.3340.57 ▼2.53
Dashboard /wp-admin2,233 ▲425.00 ▲0.1095.79 ▼18.7382.32 ▲37.89
Posts /wp-admin/edit.php2,120 ▲312.41 ▲0.4236.42 ▲2.0734.26 ▼0.99
Add New Post /wp-admin/post-new.php1,688 ▲17422.18 ▲4.62656.48 ▼43.4251.72 ▼2.72
Media Library /wp-admin/upload.php1,415 ▲274.31 ▲0.0994.57 ▼12.8981.44 ▲34.85
Settings /wp-admin/admin.php?page=nm_settings1,2591.8829.3330.27
Forms list /wp-admin/admin.php?page=nm_forms_list1,0501.8526.6435.20
Detailed Forms /wp-admin/admin.php?page=nm_forms7021.536.9415.34

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 52 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nm_settings
    • > Notice in wp-content/plugins/nm-contact-forms/admin/settings.php+163
    Trying to access array offset on value of type bool
  • 46 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nm_forms_list
    • > Notice in wp-content/plugins/nm-contact-forms/admin/formslist.php+252
    Undefined variable: form
  • 67 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nm_forms_list
    • > Notice in wp-content/plugins/nm-contact-forms/admin/formslist.php+252
    Trying to access array offset on value of type null
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nm_forms_list
    • > Notice in wp-content/plugins/nm-contact-forms/admin/formslist.php+252
    Undefined variable: field
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nm_forms_list
    • > Notice in wp-content/plugins/nm-contact-forms/admin/formslist.php+200
    Undefined variable: NbChamps
    • > GET request to /wp-admin/admin.php?page=nm_forms
    • > Parse error in wp-content/plugins/nm-contact-forms/admin/forms.php+435
    syntax error, unexpected end of file

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/nm-contact-forms/templates/email_template.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: fields in wp-content/plugins/nm-contact-forms/templates/email_template.php on line 923
    • > PHP Notice
      Undefined variable: subject in wp-content/plugins/nm-contact-forms/templates/email_template.php on line 920
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/nm-contact-forms/admin/formslist.php:4
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/nm-contact-forms/templates/email_template.php on line 923
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/nm-contact-forms/admin/forms.php on line 435
    • > PHP Fatal error
      Uncaught Error: Call to a member function nm_donate() on null in wp-content/plugins/nm-contact-forms/admin/settings.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/nm-contact-forms/index.php:33

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 issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
  • Screenshots: No descriptions were found for these screenshots #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #6, #7, #8, #9 in nm-contact-forms/assets to your readme.txt
Please take inspiration from this readme.txt

nm-contact-forms/index.php 85% from 13 tests

The main PHP file in "NM Contact Forms" ver. 2.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 240 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("nm-contact-forms.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin3,011 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5328962,198
JavaScript113218464
CSS2831349

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity233.00
▷ Minimum class complexity233.00
▷ Maximum class complexity233.00
Average method complexity13.83
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/adminlogo2-v2.png1.05KB0.12KB▼ 88.85%
admin/images/donation.png14.26KB4.29KB▼ 69.88%
admin/images/logo-v2x48.png2.33KB1.33KB▼ 42.93%
admin/images/batman_new.png1.14KB0.31KB▼ 72.76%
admin/images/nm_close.png1.12KB0.29KB▼ 73.62%