63% ruby-help-desk

Code Review | Ruby Help Desk

WordPress plugin Ruby Help Desk scored63%from 54 tests.

About plugin

  • Plugin page: ruby-help-desk
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: May 26, 2017
  • Latest release: Apr 5, 2023
  • Number of updates: 25
  • Update frequency: every 85.6 days
  • Top authors: waseem_senjer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,150 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.59MB] [CPU: ▼38.52ms] Passed 4 tests

Server-side resources used by Ruby Help Desk
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0815.97 ▼25.84
Dashboard /wp-admin3.42 ▲0.1219.99 ▼27.38
Posts /wp-admin/edit.php3.43 ▲0.0721.84 ▼24.88
Add New Post /wp-admin/post-new.php3.42 ▼2.4718.41 ▼75.97
Media Library /wp-admin/upload.php3.43 ▲0.1919.35 ▼15.73
Products /wp-admin/edit-tags.php?taxonomy=tickets_products&post_type=support_ticket3.4320.66
All Tickets /wp-admin/edit.php?post_type=support_ticket3.4321.12
Custom Fields /wp-admin/edit.php?post_type=support_ticket&page=ruby-help-desk-custom-fields3.4318.00
Replies Templates /wp-admin/edit.php?post_type=replies_template3.4319.90
Create Ticket /wp-admin/post-new.php?post_type=support_ticket3.4319.71
Settings /wp-admin/edit.php?post_type=support_ticket&page=ruby-help-desk-settings3.4330.09
Knowledgebase /wp-admin/edit.php?post_type=help_knowledgebase3.4317.71
Statuses /wp-admin/edit-tags.php?taxonomy=tickets_status&post_type=support_ticket3.4319.93

Server storage [IO: ▲0.36MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 59 new files
Database: no new tables, 21 new options
New WordPress options
rhd_ticket_status_closed
rhd_[ruby_help_desk_signup]
rhd_[ruby_help_desk_login]
widget_theysaidso_widget
rhd_seeded
rhd_attachments
rhd_general
theysaidso_admin_options
rhd_sync_products
tickets_products_children
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ruby Help Desk
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,221 ▲48615.55 ▲1.181.86 ▲0.0441.97 ▼2.07
Dashboard /wp-admin2,562 ▲3736.75 ▲1.80141.11 ▲20.8951.20 ▲8.99
Posts /wp-admin/edit.php2,377 ▲2913.61 ▲1.5758.11 ▲20.6134.49 ▲0.27
Add New Post /wp-admin/post-new.php1,618 ▲8523.58 ▲0.43677.84 ▲12.7239.94 ▼13.88
Media Library /wp-admin/upload.php1,510 ▲1254.41 ▲0.2392.31 ▼6.2339.57 ▼3.94
Products /wp-admin/edit-tags.php?taxonomy=tickets_products&post_type=support_ticket1,6543.4744.5332.24
All Tickets /wp-admin/edit.php?post_type=support_ticket1,3823.6350.6127.76
Custom Fields /wp-admin/edit.php?post_type=support_ticket&page=ruby-help-desk-custom-fields1,5173.3854.4536.75
Replies Templates /wp-admin/edit.php?post_type=replies_template1,3503.6448.8426.69
Create Ticket /wp-admin/post-new.php?post_type=support_ticket2,0187.79169.0361.83
Settings /wp-admin/edit.php?post_type=support_ticket&page=ruby-help-desk-settings1,2573.5346.7626.64
Knowledgebase /wp-admin/edit.php?post_type=help_knowledgebase1,3583.5952.4628.17
Statuses /wp-admin/edit-tags.php?taxonomy=tickets_status&post_type=support_ticket1,8483.8661.3932.05

Uninstaller [IO: ▲0.00MB] [DB: ▲0.02MB] 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
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/ruby-help-desk/public/class-ruby-help-desk-public.php+298
    Undefined variable: ticket_id
  • Zombie WordPress options were found after uninstall: 21 options
    • rhd_[my_tickets]
    • rhd_attachments
    • rhd_general
    • widget_recent-comments
    • theysaidso_admin_options
    • tickets_products_children
    • can_compress_scripts
    • db_upgraded
    • rhd_[ruby_help_desk_login]
    • rhd_ticket_status_new
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=tickets_status&post_type=support_ticket
    • > Notice in wp-content/plugins/ruby-help-desk/public/class-ruby-help-desk-public.php+298
    Undefined variable: ticket_id
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=support_ticket
    • > Notice in wp-content/plugins/ruby-help-desk/admin/partials/ruby-help-desk-ticket-options-metabox.php+20
    Trying to access array offset on value of type bool

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
Please fix the following items
  • 9× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ruby-help-desk/admin/partials/ruby-help-desk-ticket-message-metabox.php
    • > /wp-content/plugins/ruby-help-desk/admin/partials/emails/reply_added_author.php
    • > /wp-content/plugins/ruby-help-desk/admin/partials/emails/ticket_reassigned.php
    • > /wp-content/plugins/ruby-help-desk/admin/partials/emails/ticket_opened_assignee.php
    • > /wp-content/plugins/ruby-help-desk/public/partials/shortcodes/shortcode-knowledgebase.php
    • > /wp-content/plugins/ruby-help-desk/admin/partials/ruby-help-desk-ticket-replies-metabox.php
    • > /wp-content/plugins/ruby-help-desk/admin/partials/emails/ticket_closed.php
    • > /wp-content/plugins/ruby-help-desk/admin/partials/emails/reply_added_assignee.php
    • > /wp-content/plugins/ruby-help-desk/admin/partials/emails/ticket_opened_author.php
  • 27× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: tickets_object in wp-content/plugins/ruby-help-desk/admin/partials/widgets/status.php on line 8
    • > PHP Notice
      Undefined variable: products in wp-content/plugins/ruby-help-desk/public/partials/shortcodes/shortcode-knowledgebase.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ruby-help-desk/public/partials/shortcodes/shortcode-my-tickets.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ruby-help-desk/admin/partials/pages/custom-fields.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ruby-help-desk/admin/partials/replies_templates/metabox_tags.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ruby-help-desk/public/partials/signup.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ruby-help-desk/admin/partials/emails/ticket_opened_assignee.php:94
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ruby-help-desk/admin/partials/emails/reply_added_author.php:94
    • > PHP Notice
      Undefined variable: attachments in wp-content/plugins/ruby-help-desk/admin/partials/ruby-help-desk-ticket-message-metabox.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_avatar() on null in wp-content/plugins/ruby-help-desk/admin/partials/ruby-help-desk-ticket-details-metabox.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
2 plugin tags: admin, helpdesk

ruby-help-desk/ruby-help-desk.php Passed 13 tests

Analyzing the main PHP file in "Ruby Help Desk" version 1.3.4
57 characters long description:
A simple Help Desk to support your customers efficiently.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin4,805 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP375641,5073,565
CSS48522749
PO File1143195316
JavaScript12814175

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity18.21
▷ Minimum class complexity1.00
▷ Maximum class complexity71.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods170
▷ Static methods158.82%
▷ Public methods15792.35%
▷ Protected methods00.00%
▷ Private methods137.65%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
admin/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
admin/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
admin/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
admin/images/vfb-form-items.png4.38KB3.21KB▼ 26.74%