63% zalo-official-live-chat

Code Review | Zalo Official Live Chat

WordPress plugin Zalo Official Live Chat scored 63% from 53 tests.

About plugin

  • Plugin page: zalo-official-liv...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7.2
  • WordPress version: 5.8.1
  • First release: Jul 21, 2021
  • Latest release: Jul 21, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: nghialuu (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 89 total downloads

Benchmarks

Plugin footprint 48% 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 gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼253.16ms] Passed 4 tests

This is a short check of server-side resources used by Zalo Official Live Chat
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1844.29 ▲19.65
Dashboard /wp-admin3.11 ▲0.0649.95 ▲4.87
Posts /wp-admin/edit.php3.22 ▲0.1251.89 ▲6.96
Add New Post /wp-admin/post-new.php5.48 ▲0.05110.61 ▼1,031.98
Media Library /wp-admin/upload.php3.06 ▲0.0545.11 ▲7.52
Zalo OA Chat /wp-admin/options-general.php?page=zalo-oa-chat3.0337.51

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Zalo Official Live Chat
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,797 ▲19216.63 ▲0.8137.58 ▲27.4553.17 ▲4.11
Dashboard /wp-admin2,955 ▲1026.17 ▲0.32185.58 ▲33.04167.24 ▲62.25
Posts /wp-admin/edit.php2,715 ▲92.68 ▼0.0274.79 ▲9.81117.75 ▲21.79
Add New Post /wp-admin/post-new.php1,663 ▼19016.05 ▼3.12465.18 ▲80.40139.59 ▲29.12
Media Library /wp-admin/upload.php1,781 ▲95.00 ▲0.01224.44 ▲68.36156.96 ▲39.07
Zalo OA Chat /wp-admin/options-general.php?page=zalo-oa-chat1,1272.34121.15129.58

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin cannot be uninstalled
    • > Error in wp-content/plugins/zalo-official-live-chat/nl-zalo-official-chat.php+55
    Uncaught Error: Class 'NL_Zalo_Official_Chat_Deactivator' not found in /var/www/wordpress/wp-content/plugins/zalo-official-live-chat/nl-zalo-official-chat.php:55Stack trace:#0 /var/www/wordpress/wp-includes/class-wp-hook.php(303): deactivate_nl_zalo_official_chat()#1 /var/www/wordpress/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()#2 /var/www/wordpress/wp-includes/plugin.php(470): WP_Hook->do_action()#3 /var/www/wordpress/wp-admin/includes/plugin.php(821): do_action()#4 /var/www/wordpress/wp-admin/wp-api.php(338): deactivate_plugins()#5 /var/www/wordpress/wp-admin/wp-api.php(128): Potrivit_Wp_Api->pluginUninstall()#6 /var/www/wordpress/wp-admin/wp-api.php(478): Potrivit_Wp_Api->_executeMethod()#7 /var/www/wordpress/wp-admin/wp-api.php(511): Potrivit_Wp_Api->run()#8 {main}thrown
  • Uninstaller has failed for this plugin, leaving 22 files (0.05MB) in the plugin directory
    • (new file) admin/css/nl-zalo-official-chat-admin.css
    • (new file) includes/class-nl-zalo-official-chat-deactivator.php
    • (new file) includes/class-nl-zalo-official-chat-activator.php
    • (new file) admin/class-nl-zalo-official-chat-admin.php
    • (new file) README.txt
    • (new file) LICENSE.txt
    • (new file) admin/partials/nl-zalo-official-chat-admin-display.php
    • (new file) admin/js/nl-zalo-official-chat-admin.js
    • (new file) admin/index.php
    • (new file) includes/class-nl-zalo-official-chat-i18n.php
    • ...
  • Zombie WordPress options detected upon uninstall: 1 option
    • recovery_mode_email_last_sent

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/zalo-official-live-chat/admin/partials/nl-zalo-official-chat-admin-display.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/zalo-official-live-chat/public/partials/nl-zalo-official-chat-public-display.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is stored in the /assets directory.), #2 (This is the second screen shot)
You can look at the official readme.txt

zalo-official-live-chat/nl-zalo-official-chat.php 85% from 13 tests

The primary PHP file in "Zalo Official Live Chat" version 1.0.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("zalo-official-live-chat.php" instead of "nl-zalo-official-chat.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected346 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12136548310
CSS28826
JavaScript255410

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity1.57
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.14
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods310.34%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin