10% my-contact-form

Code Review | Contact form

WordPress plugin Contact form scored10%from 54 tests.

About plugin

  • Plugin page: my-contact-form
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.8.1
  • WordPress version: 6.3.1
  • First release: Feb 19, 2014
  • Latest release: Mar 29, 2014
  • Number of updates: 19
  • Update frequency: every 2.1 days
  • Top authors: prempal88niet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,599 total downloads

Benchmarks

Plugin footprint 58% 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
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/my-contact-form/contact.php+79
    Undefined variable: attachments

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.42ms] Passed 4 tests

Server-side resources used by Contact form
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.21 ▲2.42
Dashboard /wp-admin3.31 ▲0.0145.75 ▼3.37
Posts /wp-admin/edit.php3.37 ▲0.0149.29 ▲1.14
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.37 ▼12.82
Media Library /wp-admin/upload.php3.24 ▲0.0132.53 ▼2.63
Contact List /wp-admin/admin.php?page=contact-list3.1829.50
Contact Form /wp-admin/admin.php?page=contact-form3.1826.97

Server storage [IO: ▲0.01MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: 1 new table, 6 new options
New tables
wp_cf_contact
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Contact form: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,195 ▲46014.05 ▼0.685.27 ▲3.4639.64 ▼9.03
Dashboard /wp-admin2,316 ▲1254.99 ▼0.83108.51 ▼2.2886.96 ▲40.67
Posts /wp-admin/edit.php2,211 ▲1222.36 ▲0.3639.58 ▼0.5433.70 ▲0.48
Add New Post /wp-admin/post-new.php6,292 ▲4,75023.62 ▲5.25872.33 ▲231.5745.76 ▼12.69
Media Library /wp-admin/upload.php1,508 ▲1264.43 ▲0.1997.63 ▼7.2583.31 ▲40.56
Contact List /wp-admin/admin.php?page=contact-list9211.9624.3726.00
Contact Form /wp-admin/admin.php?page=contact-form9041.9527.7223.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=contact-form
    • > Notice in wp-content/plugins/my-contact-form/html/form.php+20
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=contact-list
    • > Notice in wp-content/plugins/my-contact-form/html/contact-list.php+40
    Undefined index: act
    • > GET request to /wp-admin/admin.php?page=contact-form
    • > Notice in wp-content/plugins/my-contact-form/html/form.php+39
    Undefined variable: name
    • > GET request to /wp-admin/admin.php?page=contact-form
    • > Notice in wp-content/plugins/my-contact-form/html/form.php+40
    Undefined variable: email
    • > GET request to /wp-admin/admin.php?page=contact-form
    • > Notice in wp-content/plugins/my-contact-form/html/form.php+41
    Undefined variable: mob
    • > GET request to /wp-admin/admin.php?page=contact-form
    • > Notice in wp-content/plugins/my-contact-form/html/form.php+42
    Undefined variable: msg

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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/my-contact-form/html/form.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: comments, spam

my-contact-form/contact.php 92% from 13 tests

This is the main PHP file of "Contact form" version 1.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("my-contact-form.php" instead of "contact.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin311 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP59625267
JavaScript117037
CSS1007

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.12
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%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/contact.png0.58KB0.30KB▼ 48.65%