10% chat-forms

Code Review | Chat Forms

WordPress plugin Chat Forms scored10%from 54 tests.

About plugin

  • Plugin page: chat-forms
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.3
  • WordPress version: 6.3.1
  • First release: Oct 1, 2019
  • Latest release: Oct 1, 2019
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: chatforms (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /678 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/chat-forms/wpcform-post-type.php+367
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.72MB] [CPU: ▼55.11ms] Passed 4 tests

A check of server-side resources used by Chat Forms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.195.82 ▼36.93
Dashboard /wp-admin2.30 ▼1.017.85 ▼46.72
Posts /wp-admin/edit.php2.30 ▼1.069.04 ▼38.76
Add New Post /wp-admin/post-new.php2.30 ▼3.607.89 ▼98.04
Media Library /wp-admin/upload.php2.30 ▼0.948.69 ▼24.49
Chat Forms /wp-admin/edit.php?post_type=wpcform2.308.15
Form Submission Log /wp-admin/edit.php?post_type=wpcform&page=wpcform-entry-log-page2.307.92
Add New Chat Form /wp-admin/post-new.php?post_type=wpcform2.307.62

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Chat Forms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲17013.41 ▼1.217.74 ▲6.0141.11 ▼3.57
Dashboard /wp-admin2,226 ▲465.52 ▼0.1091.75 ▼3.9275.93 ▲35.43
Posts /wp-admin/edit.php2,149 ▲521.99 ▼0.0239.12 ▲3.4034.81 ▲1.64
Add New Post /wp-admin/post-new.php1,564 ▲3623.01 ▼0.04733.02 ▲96.6561.19 ▲7.89
Media Library /wp-admin/upload.php1,446 ▲554.24 ▼0.00103.75 ▲6.2974.33 ▲28.20
Chat Forms /wp-admin/edit.php?post_type=wpcform1,1651.9233.3930.96
Form Submission Log /wp-admin/edit.php?post_type=wpcform&page=wpcform-entry-log-page1,0982.0225.1732.02
Add New Chat Form /wp-admin/post-new.php?post_type=wpcform1,7212.6457.7484.37
Chat Forms /wp-admin/wpcform-options.php260.420.0916.64

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
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/chat-forms/wpcform-post-type.php+367
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • wpcform_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wpcform
    • > Deprecated in wp-content/plugins/chat-forms/wpcform-post-type.php+367
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/chat-forms/wpcform-core.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/chat-forms/wpcform-core.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/chat-forms/wpcform-core.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/chat-forms/wpcform-logging.php:28
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/chat-forms/wpcform-core.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/chat-forms/wpcform-post-type.php:24

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/wpcform-options.php
    • > Network (severe)
    wp-admin/wpcform-options.php - Failed to load resource: the server responded with a status of 404 (Not Found)

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
7 plugin tags: spreadsheet, forms, google forms, google docs, chat forms...

chat-forms/index.php 85% from 13 tests

The main file in "Chat Forms" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("chat-forms.php" instead of "index.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Good job! No executable or dangerous file extensions detected6,910 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PO File46977892,010
JavaScript63343651,863
PHP53438151,622
CSS3129811,395
SVG20020

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity33.50
▷ Minimum class complexity27.00
▷ Maximum class complexity40.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods630.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants16100.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
There were not PNG files found in your plugin