10% giga-messenger-bots

Code Review | Giga Messenger - Express

WordPress plugin Giga Messenger - Express scored10%from 54 tests.

About plugin

  • Plugin page: giga-messenger-bots
  • Plugin version: 2.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7.4
  • WordPress version: 6.3.1
  • First release: Nov 11, 2016
  • Latest release: May 10, 2017
  • Number of updates: 12
  • Update frequency: every 14.2 days
  • Top authors: tanng (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /6,457 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/giga-messenger-bots/inc/helpers.php+71
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.96MB] [CPU: ▼56.12ms] Passed 4 tests

An overview of server-side resources used by Giga Messenger - Express
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.435.26 ▼40.08
Dashboard /wp-admin2.05 ▼1.267.17 ▼46.26
Posts /wp-admin/edit.php2.05 ▼1.317.04 ▼41.46
Add New Post /wp-admin/post-new.php2.05 ▼3.846.52 ▼96.66
Media Library /wp-admin/upload.php2.05 ▼1.186.15 ▼27.49
CRM /wp-admin/admin.php?page=crm2.056.36
Logger /wp-admin/admin.php?page=logger2.058.55
Settings /wp-admin/admin.php?page=giga2.057.18
Bot Builder /wp-admin/admin.php?page=bot-builder2.057.32

Server storage [IO: ▲3.48MB] [DB: ▲0.08MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 1,066 new files
Database: 5 new tables, 7 new options
New tables
wp_bot_leads_meta
wp_bot_leads
wp_bot_messages
wp_bot_instances
wp_bot_nodes
New WordPress options
widget_recent-posts
giga_db_version
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Giga Messenger - Express
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8813.22 ▼1.161.82 ▼0.1643.64 ▼1.40
Dashboard /wp-admin2,240 ▲524.92 ▼0.89112.18 ▼8.1267.13 ▲21.83
Posts /wp-admin/edit.php2,129 ▲431.98 ▲0.0038.25 ▲1.5734.78 ▲0.21
Add New Post /wp-admin/post-new.php1,552 ▲3318.52 ▼4.97705.44 ▼2.1765.04 ▲7.07
Media Library /wp-admin/upload.php1,422 ▲344.21 ▲0.0197.75 ▼11.1567.56 ▲22.60
CRM /wp-admin/admin.php?page=crm1,0112.0129.5127.91
Logger /wp-admin/admin.php?page=logger8822.0231.2826.82
Settings /wp-admin/admin.php?page=giga1,1022.5435.8829.71
Bot Builder /wp-admin/admin.php?page=bot-builder3,1513.7694.2165.07

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/giga-messenger-bots/inc/helpers.php+71
    Trying to access array offset on value of type bool
  • The plugin did not uninstall successfully, leaving 5 tables in the database
    • wp_bot_instances
    • wp_bot_leads_meta
    • wp_bot_leads
    • wp_bot_nodes
    • wp_bot_messages
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • giga_db_version
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bot-builder
    • > Notice in wp-content/plugins/giga-messenger-bots/inc/helpers.php+71
    Trying to access array offset on value of type bool
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bot-builder
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
    • > GET request to /wp-admin/admin.php?page=crm
    • > Warning in wp-content/plugins/giga-messenger-bots/inc/crm/class-lead-list-table.php+123
    Invalid argument supplied for foreach()

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/giga-messenger-bots/vendor/nikic/php-parser/grammar/rebuildParsers.php
    • > /wp-content/plugins/giga-messenger-bots/vendor/nikic/php-parser/test_old/run.php
    • > /wp-content/plugins/giga-messenger-bots/vendor/nikic/php-parser/grammar/analyze.php
  • 489× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PhpParser\ode\\Expr\\Cast' not found in wp-content/plugins/giga-messenger-bots/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\VarDumper\\Dumper\\DataDumperInterface' not found in wp-content/plugins/giga-messenger-bots/vendor/symfony/var-dumper/Dumper/AbstractDumper.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/giga-messenger-bots/vendor/symfony/translation/Tests/Loader/CsvFileLoaderTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PhpParser\ode\\Expr' not found in wp-content/plugins/giga-messenger-bots/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'PhpParser\\Serializer' not found in wp-content/plugins/giga-messenger-bots/vendor/nikic/php-parser/lib/PhpParser/Serializer/XML.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PhpParser\ode\\Expr' not found in wp-content/plugins/giga-messenger-bots/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/giga-messenger-bots/vendor/symfony/translation/Tests/Dumper/CsvFileDumperTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PhpParser\ode\\Stmt' not found in wp-content/plugins/giga-messenger-bots/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/giga-messenger-bots/vendor/symfony/translation/Dumper/JsonFileDumper.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PhpParser\ode\\Expr\\BinaryOp' not found in wp-content/plugins/giga-messenger-bots/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Screenshots: These screenshots lack descriptions #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #2, #20, #21, #3, #4, #5, #6, #7, #8, #9 in giga-messenger-bots/assets to your readme.txt
You can take inspiration from this readme.txt

giga-messenger-bots/giga-messenger-bots.php Passed 13 tests

The primary PHP file in "Giga Messenger - Express" version 2.3.1 is used by WordPress to initiate all plugin functionality
47 characters long description:
Rapid Messenger Bot for Developers & Marketers.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
These items require your attention
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/giga-messenger-bots/vendor/bin/php-parse.bat
65,338 lines of code in 862 files:
LanguageFilesBlank linesComment linesLines of code
PHP76212,44826,63750,722
CSS3112234,264
XSD392482,803
Markdown2583202,333
yacc3264101,665
JSON19001,406
PO File84535231,005
JavaScript4129419531
XML19120385
SQL44077142
YAML713054
Bourne Shell23513
Qt Linguist10010
DOS Batch1004
INI1001

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.53
▷ Minimum class complexity1.00
▷ Maximum class complexity174.00
Average method complexity1.73
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces115
Interfaces88
Traits7
Classes565
▷ Abstract classes407.08%
▷ Concrete classes52592.92%
▷ Final classes61.14%
Methods5,296
▷ Static methods4869.18%
▷ Public methods3,47665.63%
▷ Protected methods1,66031.34%
▷ Private methods1603.02%
Functions265
▷ Named functions13350.19%
▷ Anonymous functions13249.81%
Constants273
▷ Global constants114.03%
▷ Class constants26295.97%
▷ Public constants262100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/giga-ai.png15.49KB0.77KB▼ 95.01%