68% order-on-chat-for-woocommerce

Code Review | Chat Button- Leads and Order over Chat

WordPress plugin Chat Button- Leads and Order over Chat scored 68% from 54 tests.

About plugin

  • Plugin page: order-on-chat-for...
  • Plugin version: 1.6.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.0
  • WordPress version: 5.9.2
  • First release: Sep 18, 2019
  • Latest release: Aug 30, 2021
  • Number of updates: 45
  • Update frequency: every 15.8 days
  • Top authors: mvvapps (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active / 17,192 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.43MB] [CPU: ▼286.90ms] Passed 4 tests

An overview of server-side resources used by Chat Button- Leads and Order over Chat
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /8.37 ▲4.8583.65 ▲26.41
Dashboard /wp-admin8.38 ▲4.9867.41 ▲28.96
Posts /wp-admin/edit.php8.39 ▲4.7562.77 ▲19.62
Add New Post /wp-admin/post-new.php10.10 ▲3.14118.08 ▼1,205.83
Media Library /wp-admin/upload.php8.39 ▲5.0946.38 ▲12.20
WhatsApp Button /wp-admin/options-general.php?page=mvvwo_admin_ui8.3949.90
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius8.3952.00

Server storage [IO: ▲4.20MB] [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: 183 new files
Database: no new tables, 5 new options
New WordPress options
fs_debug_mode
fs_gdpr
mvvwo_version
fs_active_plugins
fs_accounts

Browser metrics Passed 4 tests

Checking browser requirements for Chat Button- Leads and Order over Chat
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,010 ▲28817.54 ▲2.317.80 ▲2.032.66 ▲0.66
Dashboard /wp-admin3,107 ▲2568.06 ▲1.91140.57 ▼1.27171.24 ▲7.36
Posts /wp-admin/edit.php2,949 ▲2585.12 ▲1.8877.20 ▲14.11154.85 ▲10.93
Add New Post /wp-admin/post-new.php1,676 ▼3520.52 ▼0.17387.89 ▼45.99154.86 ▼18.84
Media Library /wp-admin/upload.php1,734 ▲395.50 ▼0.03111.84 ▼25.16205.45 ▼21.15
WhatsApp Button /wp-admin/options-general.php?page=mvvwo_admin_ui1,6025.76102.93364.51
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,6784.2367.90113.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/order-on-chat-for-woocommerce/freemius/includes/class-freemius.php+8552
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 5 options in the database
    • mvvwo_version
    • fs_gdpr
    • fs_active_plugins
    • fs_accounts
    • fs_debug_mode

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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/order-on-chat-for-woocommerce/freemius/templates/ajax-loader.php
    • > /wp-content/plugins/order-on-chat-for-woocommerce/includes/views/admin-head.php
    • > /wp-content/plugins/order-on-chat-for-woocommerce/includes/views/admin-root.php
    • > /wp-content/plugins/order-on-chat-for-woocommerce/includes/views/footer-scripts.php
    • > /wp-content/plugins/order-on-chat-for-woocommerce/includes/views/header.php
  • 85× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/order-on-chat-for-woocommerce/includes/views/admin-head.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/order-on-chat-for-woocommerce/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: config in wp-content/plugins/order-on-chat-for-woocommerce/includes/views/header.php on line 187
    • > PHP Notice
      Undefined variable: config in wp-content/plugins/order-on-chat-for-woocommerce/includes/views/header.php on line 35
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/order-on-chat-for-woocommerce/includes/views/header.php on line 31
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/order-on-chat-for-woocommerce/includes/views/header.php on line 43
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/order-on-chat-for-woocommerce/includes/views/header.php on line 31
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/order-on-chat-for-woocommerce/includes/views/header.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mvvwo_translate() in wp-content/plugins/order-on-chat-for-woocommerce/includes/views/cart-button.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/order-on-chat-for-woocommerce/freemius/templates/partials/network-activation.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% 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: whatsapp button, woocommerce order on whatsapp, click to chat, woocommerce

order-on-chat-for-woocommerce/start.php 85% from 13 tests

This is the main PHP file of "Chat Button- Leads and Order over Chat" version 1.6.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Requires at least: The required version number must match the one declared in readme.txt ("3.9" instead of "4.0")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("order-on-chat-for-woocommerce.php" instead of "start.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected32,044 lines of code in 139 files:
LanguageFilesBlank linesComment linesLines of code
PHP1207,49616,29731,592
Markdown1680214
JavaScript63459197
JSON10027
CSS110014

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,907)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity85.08
▷ Minimum class complexity1.00
▷ Maximum class complexity2,907.00
Average method complexity4.62
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes49
▷ Abstract classes24.08%
▷ Concrete classes4795.92%
▷ Final classes00.00%
Methods1,170
▷ Static methods17815.21%
▷ Public methods82970.85%
▷ Protected methods151.28%
▷ Private methods32627.86%
Functions104
▷ Named functions10197.12%
▷ Anonymous functions32.88%
Constants129
▷ Global constants10480.62%
▷ Class constants2519.38%
▷ Public constants25100.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
5 PNG files occupy 0.27MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/profile.png5.83KB2.52KB▼ 56.72%
freemius/assets/img/order-on-chat-for-woocommerce.png13.93KB5.25KB▼ 62.30%
assets/product_pos_chart.png232.23KB97.70KB▼ 57.93%