10% contact-form-by-contactmetrics

Code Review | Contact Form by ContactMetrics

WordPress plugin Contact Form by ContactMetrics scored10%from 54 tests.

About plugin

  • Plugin page: contact-form-by-c...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-3.9
  • WordPress version: 6.3.1
  • First release: Nov 13, 2013
  • Latest release: Jun 6, 2014
  • Number of updates: 27
  • Update frequency: every 7.6 days
  • Top authors: contactmetrics (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,108 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/contact-form-by-contactmetrics/contact-form-contactmetrics.php+35
    Undefined index: Email_destination

Server metrics [RAM: ▼1.89MB] [CPU: ▼48.80ms] Passed 4 tests

Server-side resources used by Contact Form by ContactMetrics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.365.53 ▼31.34
Dashboard /wp-admin2.12 ▼1.185.93 ▼40.96
Posts /wp-admin/edit.php2.12 ▼1.246.56 ▼39.45
Add New Post /wp-admin/post-new.php2.12 ▼3.776.96 ▼83.43
Media Library /wp-admin/upload.php2.12 ▼1.115.44 ▼26.80

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
contactmetrics_email
contactmetrics_css
contactmetrics_basic
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Contact Form by ContactMetrics: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.16 ▼0.221.78 ▲0.2844.32 ▲5.88
Dashboard /wp-admin2,210 ▲325.56 ▼0.0981.62 ▼24.6078.41 ▲35.29
Posts /wp-admin/edit.php2,118 ▲181.97 ▼0.0141.22 ▲3.8735.33 ▲0.05
Add New Post /wp-admin/post-new.php1,693 ▲16722.02 ▼1.00722.27 ▲20.4559.92 ▲1.21
Media Library /wp-admin/upload.php1,415 ▲124.12 ▼0.2398.65 ▲3.4370.61 ▲26.64

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/contact-form-by-contactmetrics/contact-form-contactmetrics.php+35
    Undefined index: Email_destination
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_theysaidso_widget
    • db_upgraded
    • contactmetrics_email
    • can_compress_scripts
    • theysaidso_admin_options
    • contactmetrics_basic
    • widget_recent-posts
    • contactmetrics_css
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined index: Email_destination in wp-content/plugins/contact-form-by-contactmetrics/contact-form-contactmetrics.php on line 35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/contact-form-by-contactmetrics/contact-form-contactmetrics.php:47

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: analytics, contacts, contact form plugin, contact form, contact...

contact-form-by-contactmetrics/contact-form-contactmetrics.php 92% from 13 tests

The main file in "Contact Form by ContactMetrics" v. 1.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("contact-form-by-contactmetrics.php" instead of "contact-form-contactmetrics.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin5,554 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
CSS2959185,274
PHP13920279
JavaScript1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.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
8 PNG files occupy 0.17MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/get_tracking_code.png1.63KB1.55KB▼ 4.44%
assets/images/example.png11.90KB3.13KB▼ 73.68%
includes/screenshot.png47.80KB21.83KB▼ 54.35%
assets/images/metrics_example.png90.82KB28.74KB▼ 68.35%
assets/images/add-site.png5.54KB3.64KB▼ 34.35%