78% freshchat

Code Review | Freshchat

WordPress plugin Freshchat scored 78% from 54 tests.

About plugin

  • Plugin page: freshchat
  • Plugin version: 2.3.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8.2
  • WordPress version: 6.3.1
  • First release: Sep 26, 2017
  • Latest release: Dec 27, 2021
  • Number of updates: 43
  • Update frequency: every 36.1 days
  • Top authors: freshchat (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

3,000+ active / 41,405 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.96ms] Passed 4 tests

An overview of server-side resources used by Freshchat
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.57 ▲0.75
Dashboard /wp-admin3.31 ▲0.0145.32 ▼5.64
Posts /wp-admin/edit.php3.36 ▲0.0147.37 ▲0.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0196.97 ▲0.33
Media Library /wp-admin/upload.php3.24 ▲0.0133.51 ▼2.63

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Freshchat
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲8613.23 ▼1.134.86 ▲3.1642.55 ▲2.57
Dashboard /wp-admin2,224 ▲364.86 ▼0.03105.93 ▼4.0242.19 ▼1.28
Posts /wp-admin/edit.php2,104 ▲152.04 ▼0.0039.37 ▲2.4833.77 ▲2.18
Add New Post /wp-admin/post-new.php1,529 ▲1517.67 ▲0.04608.72 ▼74.5847.92 ▼3.58
Media Library /wp-admin/upload.php1,406 ▲184.21 ▲0.0294.66 ▼12.9240.88 ▼4.45

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/freshchat/freshchat.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/freshchat/widget-settings/add_to_page.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/freshchat/widget-settings/menu.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/freshchat/widget-settings/main.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid URI ("")
You can look at the official readme.txt

freshchat/freshchat.php Passed 13 tests

Analyzing the main PHP file in "Freshchat" version 2.3.4
82 characters long description:
Modern messaging software that your sales and customer engagement teams will love.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin225 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP53430210
CSS12015

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 6.54MB with 3.49MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png3,024.04KB1,073.53KB▼ 64.50%
screenshot-2.png2,974.90KB1,128.54KB▼ 62.06%
screenshot-3.png688.68KB233.51KB▼ 66.09%
assets/freshchat_wp_2x.png1.07KB0.65KB▼ 38.94%
assets/freshchat_wp_blue_2x.png1.01KB0.65KB▼ 35.40%