10% dd-contact-form

Code Review | DD Contact Form

WordPress plugin DD Contact Form scored10%from 54 tests.

About plugin

  • Plugin page: dd-contact-form
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.2
  • WordPress version: 6.3.1
  • First release: May 9, 2014
  • Latest release: Feb 23, 2016
  • Number of updates: 11
  • Update frequency: every 59.6 days
  • Top authors: Davedub (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /8,392 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/dd-contact-form/inc/functions.php+408
    Uncaught Error: Call to undefined function mysql_result() in wp-content/plugins/dd-contact-form/inc/functions.php:408
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): dd_contact_form_activation()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.75ms] Passed 4 tests

Server-side resources used by DD Contact Form
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.12 ▼2.96
Dashboard /wp-admin3.31 ▲0.0045.19 ▼8.87
Posts /wp-admin/edit.php3.36 ▲0.0045.51 ▲1.56
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.04 ▼11.35
Media Library /wp-admin/upload.php3.23 ▲0.0033.03 ▲0.20

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 53 new files
Database: 4 new tables, 6 new options
New tables
wp_contact
wp_contact_methods
wp_contact_info
wp_enquiries
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by DD Contact Form
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.18 ▼1.181.73 ▼0.0542.83 ▲3.52
Dashboard /wp-admin2,206 ▲184.85 ▼1.05108.32 ▲0.8536.66 ▼5.17
Posts /wp-admin/edit.php2,092 ▼02.02 ▲0.0336.30 ▼4.3535.21 ▲0.21
Add New Post /wp-admin/post-new.php1,538 ▲523.32 ▲0.21666.23 ▲47.9359.36 ▼2.14
Media Library /wp-admin/upload.php1,388 ▼04.28 ▲0.0694.34 ▼2.4139.84 ▼1.41

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-includes/option.php+2520
    Trying to access array offset on value of type null
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/dd-contact-form/inc/ddManagerPage.php:26
    • > PHP Notice
      Undefined index: ddcf_session_initialised in wp-content/plugins/dd-contact-form/inc/ddContactSession.php on line 83
    • > PHP Fatal error
      Uncaught Error: Call to undefined function check_ajax_referer() in wp-content/plugins/dd-contact-form/inc/ddContactSession.php:89
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/dd-contact-form/inc/ddOptionsPage.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function check_ajax_referer() in wp-content/plugins/dd-contact-form/inc/ddManagerSession.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_singular() in wp-content/plugins/dd-contact-form/inc/ddContactPage.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dd-contact-form/inc/functions.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dd-contact-form/inc/functions.php:44

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: contact form, form, contacts management, contact, davedub

dd-contact-form/ddContactForm.php 85% from 13 tests

The primary PHP file in "DD Contact Form" version 1.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 768 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("dd-contact-form.php" instead of "ddContactForm.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin5,344 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript55265052,932
PHP93193661,979
CSS578101433

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity3.50
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods7
▷ Static methods00.00%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
28 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-bg_inset-soft_0_6EBBE4_1x100.png0.20KB0.08KB▼ 58.62%
css/images/ui-bg_flat_0_333_40x100.png0.21KB0.08KB▼ 60.45%
css/images/ui-bg_inset-soft_15_121212_1x100.png0.27KB0.17KB▼ 35.74%
css/images/ui-icons_f1f1f1_256x240.png6.76KB4.17KB▼ 38.20%