77% leaddevs-chatbot

Code Review | Leaddevs Messenger Live Chatbot

WordPress plugin Leaddevs Messenger Live Chatbot scored 77% from 54 tests.

About plugin

  • Plugin page: leaddevs-chatbot
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.3
  • WordPress version: 6.3.1
  • First release: Dec 31, 2019
  • Latest release: Dec 31, 2019
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: najmulcse (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 605 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.49ms] Passed 4 tests

An overview of server-side resources used by Leaddevs Messenger Live Chatbot
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.37 ▲0.74
Dashboard /wp-admin3.32 ▲0.0246.07 ▼1.79
Posts /wp-admin/edit.php3.37 ▲0.0243.81 ▼5.98
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.73 ▼17.60
Media Library /wp-admin/upload.php3.24 ▲0.0132.51 ▼0.59

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Leaddevs Messenger Live Chatbot
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,934 ▲19913.64 ▼0.738.41 ▲5.7643.78 ▼1.95
Dashboard /wp-admin2,232 ▲414.91 ▼0.99113.26 ▲6.5842.78 ▲0.15
Posts /wp-admin/edit.php2,112 ▲232.05 ▲0.0433.83 ▼7.1234.31 ▲0.20
Add New Post /wp-admin/post-new.php1,534 ▲1523.39 ▲0.14681.65 ▼3.4766.97 ▲8.30
Media Library /wp-admin/upload.php1,411 ▲264.21 ▲0.0392.83 ▼8.0840.52 ▼4.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/leaddevs-chatbot/src/public/partials/facebook-messenger-live-chat.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Leaddevs\\WPFBMessenger\\includes\\Application\\WPFBMessengerChatBot' not found in wp-content/plugins/leaddevs-chatbot/src/admin/partials/facebook-messenger-live-chat-admin-display.php:15

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)
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt might help

leaddevs-chatbot/leaddevs-chatbot.php 77% from 13 tests

"Leaddevs Messenger Live Chatbot" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: Keep the plugin description shorter than 140 characters (currently 148 characters long)

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
Everything looks great! No dangerous files found in this plugin1,398 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP202918191,114
CSS14932215
JavaScript2146647
JSON20022

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity10.27
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods70
▷ Static methods57.14%
▷ Public methods6390.00%
▷ Protected methods00.00%
▷ Private methods710.00%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.12MB with 0.05MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/admin/images/messenger.png29.03KB28.30KB▼ 2.50%
src/assets/screenshot-1.PNG33.63KB13.92KB▼ 58.61%
src/admin/images/messenger_chat_logo.png23.17KB9.62KB▼ 58.47%
src/assets/screenshot-2.PNG35.83KB15.40KB▼ 57.03%