10% samba-ai

Code Review | Samba.ai for WooCommerce

WordPress plugin Samba.ai for WooCommerce scored 10% from 54 tests.

About plugin

  • Plugin page: samba-ai
  • Plugin version: 1.1.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7.4-5.9
  • WordPress version: 6.3.1
  • First release: May 22, 2022
  • Latest release: May 30, 2022
  • Number of updates: 5
  • Update frequency: every 2.4 days
  • Top authors: sambaai (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 432 total downloads

Benchmarks

Plugin footprint 22% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/samba-ai/pluginRequirementsChecks/wpContentFolderSecuritySetup.php+77
    Undefined variable: tmp

Server metrics [RAM: ▼1.90MB] [CPU: ▼51.27ms] Passed 4 tests

This is a short check of server-side resources used by Samba.ai for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.376.38 ▼35.24
Dashboard /wp-admin2.11 ▼1.206.60 ▼38.10
Posts /wp-admin/edit.php2.11 ▼1.258.41 ▼40.53
Add New Post /wp-admin/post-new.php2.11 ▼3.787.49 ▼91.21
Media Library /wp-admin/upload.php2.11 ▼1.126.25 ▼27.27

Server storage [IO: ▲0.12MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • Illegal file modification found: 2 files (0.29KB) outside of "wp-content/plugins/samba-ai/" and "wp-content/uploads/"
    • (new file) wp-content/sambaAiExport/.htaccess
    • (new file) wp-content/sambaAiExport/.htpasswd
Filesystem: 36 new files
Database: 1 new table, 9 new options
New tables
wp_samba_ai_widgets
New WordPress options
sambaAiPrehash
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
sambaAiUserAnalyticsId
sambaAiTrialMode
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Samba.ai for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,478 ▼25713.62 ▼0.770.50 ▼1.1918.64 ▼26.73
Dashboard /wp-admin2,216 ▲254.94 ▲0.05110.68 ▼0.7243.69 ▼0.32
Posts /wp-admin/edit.php2,102 ▲132.04 ▲0.0141.50 ▼1.7635.79 ▲3.10
Add New Post /wp-admin/post-new.php1,527 ▼123.36 ▲5.07657.80 ▲54.0658.89 ▼6.38
Media Library /wp-admin/upload.php1,404 ▲164.27 ▲0.0894.51 ▼1.3348.49 ▲7.50

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/samba-ai/pluginRequirementsChecks/wpContentFolderSecuritySetup.php+77
    Undefined variable: tmp
  • Zombie tables detected upon uninstall: 1 table
    • wp_samba_ai_widgets
  • This plugin does not fully uninstall, leaving 9 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • sambaAiPrehash
    • sambaAiTrialMode
    • sambaAiUserAnalyticsId

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/samba-ai/frontEnd/sambaAiAnalyticsHook.php:3
    • > PHP Warning
      mkdir(): No such file or directory in wp-content/plugins/samba-ai/pluginRequirementsChecks/wpContentFolderCheck.php on line 4
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/samba-ai/pluginRequirementsChecks/wpContentFolderCheck.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/samba-ai/frontEnd/sambaAiAnalytics_loggedUserTracking.php:3
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/samba-ai/pluginRequirementsChecks/wpContentFolderCheck.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/samba-ai/frontEnd/sambaAiAnalytics_orderTracking.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_charset_collate() on null in wp-content/plugins/samba-ai/ajaxCalls/widgetManager.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/samba-ai/wpFunctionality/wpCronJob.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/samba-ai/ajaxCalls/widgetShortcodes.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/samba-ai/frontEnd/sambaAiAnalytics_singleProductTracking.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: samba, sambaai for woocommerce, sambaai, woocommerce

samba-ai/samba-ai.php 85% from 13 tests

The main file in "Samba.ai for WooCommerce" v. 1.1.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("7.4" instead of "7.2")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.5" instead of "5.7.4")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected2,192 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP253591251,228
JavaScript3144103706
PO File14350123
Sass116068
CSS20067

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions55
▷ Named functions5192.73%
▷ Anonymous functions47.27%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/sambaIcon.png0.40KB0.29KB▼ 27.49%