10% wati-chat-and-notification

Code Review | WATI Chat and Notification

WordPress plugin WATI Chat and Notification scored 10% from 54 tests.

About plugin

  • Plugin page: wati-chat-and-not...
  • Plugin version: 1.1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 19, 2021
  • Latest release: Sep 1, 2023
  • Number of updates: 37
  • Update frequency: every 25.0 days
  • Top authors: matthew0913 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

700+ active / 4,863 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

Server metrics [RAM: ▼0.11MB] [CPU: ▼11.08ms] Passed 4 tests

Analyzing server-side resources used by WATI Chat and Notification
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0450.60 ▲9.04
Dashboard /wp-admin3.26 ▼0.0435.20 ▼16.35
Posts /wp-admin/edit.php3.33 ▼0.0339.67 ▼8.64
Add New Post /wp-admin/post-new.php5.49 ▼0.4083.26 ▼20.53
Media Library /wp-admin/upload.php3.27 ▲0.0437.06 ▲1.21

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 14 new files
Database: 2 new tables, 6 new options
New tables
wp_wati_setting
wp_wati_abandonment
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WATI Chat and Notification
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲7913.30 ▼1.095.01 ▲2.8136.54 ▼9.45
Dashboard /wp-admin2,214 ▲264.83 ▼1.05112.12 ▼1.8343.18 ▲0.20
Posts /wp-admin/edit.php2,102 ▲132.05 ▲0.0539.58 ▼5.2639.07 ▲4.49
Add New Post /wp-admin/post-new.php1,547 ▲2823.46 ▲0.16674.76 ▲48.4853.75 ▼4.28
Media Library /wp-admin/upload.php1,396 ▲84.21 ▼0.1198.90 ▼12.8844.32 ▲0.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_wati_abandonment
    • wp_wati_setting
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      include_once(WP_WATI_DIRmodules/cart-abandonment/class-wati-cart-abandonment.php): failed to open stream: No such file or directory in wp-content/plugins/wati-chat-and-notification/modules/cart-abandonment/class-wati-module-loader.php on line 46
    • > PHP Warning
      Use of undefined constant WP_WATI_DIR - assumed 'WP_WATI_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wati-chat-and-notification/modules/cart-abandonment/class-wati-module-loader.php on line 46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wati-chat-and-notification/modules/cart-abandonment/includes/admin/wati-admin-settings.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wati-chat-and-notification/classes/class-wati-loader.php:76
    • > PHP Warning
      Use of undefined constant WP_WATI_DIR - assumed 'WP_WATI_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wati-chat-and-notification/modules/cart-abandonment/class-wati-cart-abandonment.php on line 88
    • > PHP Warning
      Use of undefined constant WP_WATI_URL - assumed 'WP_WATI_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wati-chat-and-notification/modules/cart-abandonment/class-wati-cart-abandonment.php on line 89
    • > PHP Warning
      include_once(): Failed opening 'WP_WATI_DIRmodules/cart-abandonment/class-wati-cart-abandonment.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wati-chat-and-notification/modules/cart-abandonment/class-wati-module-loader.php on line 46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wati-chat-and-notification/classes/class-wati-loader.php:76
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wati-chat-and-notification/classes/class-wati-settings.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wati-chat-and-notification/modules/cart-abandonment/class-wati-cart-abandonment.php:39

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: abandoned, whatsapp, cart recovery, woocommerce

wati-chat-and-notification/wati-chat-and-notification.php 92% from 13 tests

The principal PHP file in "WATI Chat and Notification" v. 1.1.2 is loaded by WordPress automatically on each request
The following require your attention:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.4" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,234 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP82262441,003
JavaScript2433231

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity16.60
▷ Minimum class complexity2.00
▷ Maximum class complexity55.00
Average method complexity2.66
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods48
▷ Static methods510.42%
▷ Public methods4797.92%
▷ Protected methods00.00%
▷ Private methods12.08%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants29
▷ Global constants29100.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin