62% chat-on-desk

Code Review | Chat On Desk Order Notifications - WooCommerce

WordPress plugin Chat On Desk Order Notifications - WooCommerce scored62%from 54 tests.

About plugin

  • Plugin page: chat-on-desk
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 17, 2023
  • Latest release: Jul 13, 2023
  • Number of updates: 8
  • Update frequency: every 4.3 days
  • Top authors: cozyvision1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /89 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.17MB] [CPU: ▼0.62ms] Passed 4 tests

An overview of server-side resources used by Chat On Desk Order Notifications - WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1848.63 ▲5.71
Dashboard /wp-admin3.47 ▲0.1755.37 ▲5.30
Posts /wp-admin/edit.php3.52 ▲0.1750.03 ▼2.04
Add New Post /wp-admin/post-new.php6.08 ▲0.1987.89 ▼11.44
Media Library /wp-admin/upload.php3.39 ▲0.1745.13 ▲8.52
Abandoned Carts /wp-admin/admin.php?page=cod-ab-cart-reports3.3042.08
Abandoned Carts /wp-admin/admin.php?page=cod-ab-cart3.2730.66
Chat On Desk /wp-admin/admin.php?page=chat-on-desk3.4944.70
Chat On Desk /wp-admin/options-general.php?page=chat-on-desk3.3239.24

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 166 new files
Database: 3 new tables, 9 new options
New tables
wp_chatondesk_renewal_reminders
wp_cod_captured_wc_fields
wp_chatondesk_booking_reminder
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
chatondesk_upgrade_settings
can_compress_scripts
recovery_mode_email_last_sent
widget_recent-comments
chatondesk_activation_date

Browser metrics Passed 4 tests

Checking browser requirements for Chat On Desk Order Notifications - WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲11113.29 ▼1.322.73 ▲0.6943.74 ▲0.00
Dashboard /wp-admin2,235 ▲504.99 ▼0.87124.79 ▲13.0545.64 ▲4.28
Posts /wp-admin/edit.php2,124 ▲322.15 ▲0.1545.10 ▲2.5936.97 ▲2.60
Add New Post /wp-admin/post-new.php6,431 ▲4,91229.67 ▲6.46918.73 ▲240.5741.55 ▼14.82
Media Library /wp-admin/upload.php1,420 ▲354.51 ▲0.31103.92 ▼1.5944.07 ▼5.10
Abandoned Carts /wp-admin/admin.php?page=cod-ab-cart-reports1,1272.5539.3530.67
Abandoned Carts /wp-admin/admin.php?page=cod-ab-cart6921.536.8818.76
Chat On Desk /wp-admin/admin.php?page=chat-on-desk2,5212.4957.6034.34
Chat On Desk /wp-admin/options-general.php?page=chat-on-desk2,5242.4852.6629.98

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
  • Zombie tables detected upon uninstall: 2 tables
    • wp_chatondesk_renewal_reminders
    • wp_chatondesk_booking_reminder
  • The uninstall procedure has failed, leaving 9 options in the database
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • chatondesk_upgrade_settings
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • chatondesk_activation_date
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=cod-ab-cart
    • > Error in wp-content/plugins/chat-on-desk/helper/class-abandonedcart.php+486
    Uncaught Error: Class 'ChatOnDesk\SA_Admin_Table' not found in wp-content/plugins/chat-on-desk/helper/class-abandonedcart.php:486
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): ChatOnDesk\SA_Cart_Admin::display_page()
    #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/admin.php(259): do_action()
    #4 {main}
    thrown

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 take a closer look at the following
  • 60× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'SA_Forminator' not found in wp-content/plugins/chat-on-desk/views/forminator_customer_template.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'NinjaForm' not found in wp-content/plugins/chat-on-desk/views/ninja_customer_template.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/chat-on-desk/helper/class-codelementorwidget.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/chat-on-desk/views/cod-to-prepaid-setting-template.php:4
    • > PHP Notice
      Undefined variable: templates in wp-content/plugins/chat-on-desk/views/sharecart-template.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/chat-on-desk/views/booking-reminder-template.php on line 12
    • > PHP Notice
      Undefined variable: sms_text in wp-content/plugins/chat-on-desk/template/dropdown.php on line 12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/chat-on-desk/views/booking-reminder-template.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/chat-on-desk/views/sharecart-template.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WPCF7_ContactForm' not found in wp-content/plugins/chat-on-desk/views/cf7-template.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=cod-ab-cart-reports
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=cod-ab-cart-reports - Access to XMLHttpRequest at 'http://www.chatondesk.com/api/countrylist.json' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=chat-on-desk
    • > Network (severe)
    http://www.chatondesk.com/api/countrylist.json - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=chat-on-desk
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=chat-on-desk - Access to XMLHttpRequest at 'http://www.chatondesk.com/api/countrylist.json' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/admin.php?page=chat-on-desk
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=chat-on-desk 0:0 Uncaught SyntaxError: Unexpected end of JSON input
    • > GET request to /wp-admin/options-general.php?page=chat-on-desk
    • > Javascript (severe) in unknown
    /wp-admin/options-general.php?page=chat-on-desk - Access to XMLHttpRequest at 'http://www.chatondesk.com/api/countrylist.json' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/options-general.php?page=chat-on-desk
    • > Javascript (severe) in unknown
    /wp-admin/options-general.php?page=chat-on-desk 0:0 Uncaught SyntaxError: Unexpected end of JSON input

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: mobile verification, order notification, whatsapp plugin, woocommerce whatsapp integration

chat-on-desk/ChatOnDesk-wc-order-sms.php 85% from 13 tests

Analyzing the main PHP file in "Chat On Desk Order Notifications - WooCommerce" version 1.0.0
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("chat-on-desk.php" instead of "ChatOnDesk-wc-order-sms.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.6" instead of "2.0.0")

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
Everything looks great! No dangerous files found in this plugin39,225 lines of code in 157 files:
LanguageFilesBlank linesComment linesLines of code
PHP1314,71913,06332,767
JavaScript183684656,340
CSS50088
JSON30030

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity29.27
▷ Minimum class complexity1.00
▷ Maximum class complexity247.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity60.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes113
▷ Abstract classes21.77%
▷ Concrete classes11198.23%
▷ Final classes00.00%
Methods1,392
▷ Static methods37827.16%
▷ Public methods1,34296.41%
▷ Protected methods423.02%
▷ Private methods80.57%
Functions57
▷ Named functions3357.89%
▷ Anonymous functions2442.11%
Constants105
▷ Global constants1514.29%
▷ Class constants9085.71%
▷ Public constants90100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.24MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/flags.png69.20KB23.42KB▼ 66.16%
images/www.chatondesk.com.png6.13KB3.51KB▼ 42.77%
images/chosen-sprite.png0.63KB0.88KB0.00%
images/flags@2x.png170.28KB68.04KB▼ 60.04%
images/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%