83% tawkto-live-chat

Code Review | Tawk.To Live Chat

WordPress plugin Tawk.To Live Chat scored83%from 54 tests.

About plugin

  • Plugin page: tawkto-live-chat
  • Plugin version: 0.8.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 1, 2013
  • Latest release: Nov 16, 2023
  • Number of updates: 85
  • Update frequency: every 43.1 days
  • Top authors: tawkto (76.47%)alvinsotawk (21.18%)norberttawkto (4.71%)

Code review

54 tests

User reviews

135 reviews

Install metrics

200,000+ active /3,357,851 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.69ms] Passed 4 tests

An overview of server-side resources used by Tawk.To Live Chat
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0334.08 ▼7.53
Dashboard /wp-admin3.33 ▲0.0346.33 ▼6.12
Posts /wp-admin/edit.php3.45 ▲0.0949.63 ▲2.80
Add New Post /wp-admin/post-new.php5.91 ▲0.0394.12 ▲10.14
Media Library /wp-admin/upload.php3.26 ▲0.0333.55 ▲4.10
Tawk.to /wp-admin/options-general.php?page=tawkto_plugin3.3333.30

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
tawkto-embed-widget-widget-id
tawkto-visibility-options
widget_recent-comments
tawkto-embed-widget-page-id
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
tawkto-version
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Tawk.To Live Chat
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5714.24 ▼0.462.01 ▲0.1438.88 ▼4.93
Dashboard /wp-admin2,202 ▲225.65 ▲0.0191.76 ▼10.1540.54 ▼2.72
Posts /wp-admin/edit.php2,104 ▲41.97 ▲0.0341.32 ▲3.0636.37 ▲1.43
Add New Post /wp-admin/post-new.php1,528 ▲223.24 ▲0.13597.92 ▼90.3958.38 ▼1.93
Media Library /wp-admin/upload.php1,404 ▲74.18 ▲0.01101.53 ▲1.9245.39 ▲1.97
Tawk.to /wp-admin/options-general.php?page=tawkto_plugin1,3562.5740.9345.90

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/tawkto-live-chat/templates/widget.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_file_data() in wp-content/plugins/tawkto-live-chat/tawkto.php:352

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: You are using too many tags: 20 tag instead of maximum 10
You can take inspiration from this readme.txt

tawkto-live-chat/tawkto.php 85% from 13 tests

The primary PHP file in "Tawk.To Live Chat" version 0.8.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("tawkto-live-chat.php" instead of "tawkto.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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 detected2,326 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP233768041,778
CSS14256229
JavaScript2270159
JSON20085
Markdown229075

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity14.81
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.46
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes16
▷ Abstract classes16.25%
▷ Concrete classes1593.75%
▷ Final classes00.00%
Methods92
▷ Static methods4346.74%
▷ Public methods8086.96%
▷ Protected methods44.35%
▷ Private methods88.70%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants14
▷ Global constants214.29%
▷ Class constants1285.71%
▷ Public constants12100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.29MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png49.67KB24.11KB▼ 51.46%
screenshot-6.png59.29KB24.61KB▼ 58.48%
screenshot-2.png43.65KB17.42KB▼ 60.08%
assets/tawky_big.png3.71KB2.44KB▼ 34.11%
screenshot-4.png83.92KB38.83KB▼ 53.73%