10% contact-form-dashboard

Code Review | Contact Form Dashboard

WordPress plugin Contact Form Dashboard scored10%from 54 tests.

About plugin

  • Plugin page: contact-form-dash...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.7.3
  • WordPress version: 6.3.1
  • First release: Apr 17, 2017
  • Latest release: Apr 10, 2017
  • Number of updates: 6
  • Update frequency: every 4.5 days
  • Top authors: supwts (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /2,006 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/contact-form-dashboard/includes/class-entries.php+8
    Use of undefined constant CFD_PLUGIN_DEFAULT_CHANNEL - assumed 'CFD_PLUGIN_DEFAULT_CHANNEL' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.93MB] [CPU: ▼59.08ms] Passed 4 tests

This is a short check of server-side resources used by Contact Form Dashboard
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.406.11 ▼35.55
Dashboard /wp-admin2.08 ▼1.265.67 ▼59.32
Posts /wp-admin/edit.php2.08 ▼1.275.88 ▼44.28
Add New Post /wp-admin/post-new.php2.08 ▼3.805.39 ▼97.16
Media Library /wp-admin/upload.php2.08 ▼1.146.78 ▼31.00
Settings /wp-admin/admin.php?page=wts_wp_cfd_setting2.086.16
Messages /wp-admin/admin.php?page=wts_wp_cfd_messages2.085.40
Dashboard /wp-admin/admin.php?page=wts_wp_cfd_dashboard2.087.44

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 38 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
cfd
cfd_settings
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Contact Form Dashboard
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,926 ▲18014.08 ▼0.727.09 ▲5.2144.28 ▼6.61
Dashboard /wp-admin2,227 ▲395.02 ▲0.14108.36 ▲2.2064.54 ▲19.83
Posts /wp-admin/edit.php2,124 ▲352.25 ▲0.2634.28 ▼2.9633.06 ▼4.71
Add New Post /wp-admin/post-new.php1,696 ▲16321.75 ▼1.42682.15 ▼37.3430.61 ▼30.58
Media Library /wp-admin/upload.php1,418 ▲304.32 ▲0.11108.05 ▲4.0978.74 ▲30.92
Settings /wp-admin/admin.php?page=wts_wp_cfd_setting8811.7725.3426.94
Messages /wp-admin/admin.php?page=wts_wp_cfd_messages1,2431.7929.6131.37
Dashboard /wp-admin/admin.php?page=wts_wp_cfd_dashboard8141.7626.4426.24

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/contact-form-dashboard/contact-form-dashboard.php+30
    Undefined index: default_channel
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wts_wp_cfd_dashboard
    • > Notice in wp-content/plugins/contact-form-dashboard/contact-form-dashboard.php+30
    Undefined index: default_channel
    • > GET request to /wp-admin/admin.php?page=wts_wp_cfd_setting
    • > Notice in wp-content/plugins/contact-form-dashboard/backend/backend.php+764
    Undefined index: submit
    • > GET request to /wp-admin/admin.php?page=wts_wp_cfd_setting
    • > Notice in wp-content/plugins/contact-form-dashboard/backend/backend.php+765
    Undefined index: search_setting
    • > GET request to /wp-admin/admin.php?page=wts_wp_cfd_setting
    • > Notice in wp-content/plugins/contact-form-dashboard/backend/backend.php+766
    Undefined index: keyword_search_setting
    • > GET request to /wp-admin/admin.php?page=wts_wp_cfd_messages
    • > Notice in wp-content/plugins/contact-form-dashboard/backend/backend.php+207
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=wts_wp_cfd_messages
    • > Warning in wp-content/plugins/contact-form-dashboard/backend/classes/class-entries-list-table.php+40
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=wts_wp_cfd_messages
    • > Warning in wp-content/plugins/contact-form-dashboard/backend/classes/class-entries-list-table.php+256
    count(): Parameter must be an array or an object that implements Countable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wts_wp_cfd_messages
    • > Notice in wp-content/plugins/contact-form-dashboard/backend/classes/class-entries-list-table.php+322
    Undefined index: response_status

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/contact-form-dashboard/backend/view-entries.php
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/contact-form-dashboard/includes/access.php:3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/contact-form-dashboard/backend/classes/class-entries-list-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-dashboard/backend/classes/class-entries-list-table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/contact-form-dashboard/contact-form-dashboard.php:17
    • > PHP Warning
      Use of undefined constant CFD_PLUGIN_DIR - assumed 'CFD_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-dashboard/setting.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-dashboard/backend/backend.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/contact-form-dashboard/backend/classes/class-entries-list-table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/contact-form-dashboard/backend/classes/class-setting.php:6
    • > PHP Warning
      require_once(CFD_PLUGIN_DIR/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/contact-form-dashboard/setting.php on line 3
    • > PHP Warning
      Use of undefined constant CFD_PLUGIN_DEFAULT_CHANNEL - assumed 'CFD_PLUGIN_DEFAULT_CHANNEL' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-dashboard/includes/class-entries.php on line 8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5, #6, #7, #8 in contact-form-dashboard/assets to your readme.txt
Please take inspiration from this readme.txt

contact-form-dashboard/contact-form-dashboard.php 85% from 13 tests

This is the main PHP file of "Contact Form Dashboard" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Keep the plugin description shorter than 140 characters (currently 228 characters long)

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
There were no executable files found in this plugin14,166 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
CSS531257,712
SVG2002,959
PHP10490341,866
JavaScript45882041,629

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity45.75
▷ Minimum class complexity4.00
▷ Maximum class complexity96.00
Average method complexity6.26
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods34
▷ Static methods38.82%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon.png14.90KB0.41KB▼ 97.23%