83% zopim-live-chat

Code Review | Zendesk Chat

WordPress plugin Zendesk Chat scored83%from 54 tests.

About plugin

  • Plugin page: zopim-live-chat
  • Plugin version: 1.4.18
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.5
  • WordPress version: 6.3.1
  • First release: Jan 20, 2010
  • Latest release: Aug 20, 2020
  • Number of updates: 182
  • Update frequency: every 21.2 days
  • Top authors: bencxr (69.23%)zendesk_official (29.67%)miogalang (2.2%)

Code review

54 tests

User reviews

27 reviews

Install metrics

20,000+ active /1,322,102 total downloads

Benchmarks

Plugin footprint 83% 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.05MB] [CPU: ▼3.39ms] Passed 4 tests

Analyzing server-side resources used by Zendesk Chat
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.16 ▼1.02
Dashboard /wp-admin3.35 ▲0.0548.25 ▼0.54
Posts /wp-admin/edit.php3.47 ▲0.1151.89 ▲0.71
Add New Post /wp-admin/post-new.php5.96 ▲0.0790.13 ▼11.26
Media Library /wp-admin/upload.php3.28 ▲0.0536.92 ▼0.74

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Zendesk Chat
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲4714.33 ▲0.101.72 ▼0.2642.81 ▼0.35
Dashboard /wp-admin2,199 ▲195.56 ▼0.0683.16 ▼9.9176.25 ▲33.09
Posts /wp-admin/edit.php2,122 ▲221.98 ▼0.0236.28 ▲0.5731.49 ▼4.76
Add New Post /wp-admin/post-new.php1,544 ▲1623.01 ▼0.31666.54 ▼16.67118.46 ▲50.11
Media Library /wp-admin/upload.php1,413 ▲134.17 ▼0.01101.71 ▼15.5677.08 ▲28.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: messages in wp-content/plugins/zopim-live-chat/includes/views/linked-view.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/zopim-live-chat/zopim.php:22
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/zopim-live-chat/includes/views/linked-view.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_notices() on null in wp-content/plugins/zopim-live-chat/includes/views/login-form.php:4
    • > PHP Notice
      Undefined variable: notices in wp-content/plugins/zopim-live-chat/includes/views/login-form.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/zopim-live-chat/includes/views/linked-view.php:7
    • > PHP Notice
      Undefined variable: messages in wp-content/plugins/zopim-live-chat/includes/views/login-form.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/zopim-live-chat/includes/views/login-form.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Zopim_Base_View' not found in wp-content/plugins/zopim-live-chat/includes/class-linked-view.php:3
    • > PHP Warning
      require_once(wp-content/plugins/zopim-live-chat/dev/wp-settings.php): failed to open stream: No such file or directory in wp-content/plugins/zopim-live-chat/dev/wp-config.php on line 89

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)
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: Please delete some tags, you are using 33 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (Chat window on your website - active chat), #2 (Account Configuration - Link Up), #3 (Account Configuration - Linked Up with Launch Dashboard), #4 (Dashboard View - Open new browser tab), #5 (Widget Customization from Dashboard)
You can take inspiration from this readme.txt

zopim-live-chat/zopim.php 77% from 13 tests

The main PHP file in "Zendesk Chat" ver. 1.4.18 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time 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
  • Domain Path: The domain path is invalid: folder "/language" does not exist
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("zopim-live-chat.php" instead of "zopim.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,171 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP142514781,032
CSS110069
Markdown119042
make18621
Dockerfile1104
JavaScript1003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity14.75
▷ Minimum class complexity1.00
▷ Maximum class complexity115.00
Average method complexity4.51
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes00.00%
Methods48
▷ Static methods816.67%
▷ Public methods4287.50%
▷ Protected methods36.25%
▷ Private methods36.25%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants38
▷ Global constants3386.84%
▷ Class constants513.16%
▷ Public constants5100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 3.47MB with 2.45MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png470.66KB137.30KB▼ 70.83%
screenshot-4.png1,262.21KB358.17KB▼ 71.62%
screenshot-1.png644.68KB199.74KB▼ 69.02%
screenshot-5.png722.41KB211.80KB▼ 70.68%
screenshot-2.png453.89KB134.74KB▼ 70.31%