78% spoki

Code Review | Spoki - Chat Buttons and WooCommerce Notifications

WordPress plugin Spoki - Chat Buttons and WooCommerce Notifications scored78%from 54 tests.

About plugin

  • Plugin page: spoki
  • Plugin version: 2.15.11
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 7, 2021
  • Latest release: Jun 29, 2023
  • Number of updates: 60
  • Update frequency: every 13.6 days
  • Top authors: reddoak (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

600+ active /16,541 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.49MB] [CPU: ▲0.88ms] Passed 4 tests

Analyzing server-side resources used by Spoki - Chat Buttons and WooCommerce Notifications
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4747.86 ▲4.21
Dashboard /wp-admin3.85 ▲0.5450.29 ▼6.77
Posts /wp-admin/edit.php3.90 ▲0.5454.87 ▲7.16
Add New Post /wp-admin/post-new.php6.36 ▲0.4893.73 ▼1.06
Media Library /wp-admin/upload.php3.71 ▲0.4847.65 ▲12.82
Seller Notifications /wp-admin/admin.php?page=spoki&tab=seller-notifications4.3042.42
Abandoned Carts /wp-admin/admin.php?page=spoki&tab=abandoned-carts4.3034.37
Spoki /wp-admin/admin.php?page=spoki&tab=welcome4.3037.16
Spoki /wp-admin/admin.php?page=spoki4.3038.00
Buttons /wp-admin/admin.php?page=spoki&tab=buttons4.3040.45
Invite a friend /wp-admin/admin.php?page=spoki&tab=invite-a-friend4.3039.24
Settings /wp-admin/admin.php?page=spoki&tab=settings3.9634.84
Customer Notifications /wp-admin/admin.php?page=spoki&tab=customer-notifications4.3039.09

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 63 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
_wp_spoki_setting
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Spoki - Chat Buttons and WooCommerce Notifications
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲16313.53 ▼0.764.99 ▲2.9433.77 ▼13.61
Dashboard /wp-admin2,298 ▲925.82 ▲0.9495.19 ▼6.2077.76 ▲31.16
Posts /wp-admin/edit.php2,180 ▲802.00 ▲0.0136.92 ▼0.8645.87 ▲10.38
Add New Post /wp-admin/post-new.php1,749 ▲21822.48 ▼0.66730.55 ▲36.0356.93 ▲2.86
Media Library /wp-admin/upload.php1,471 ▲684.23 ▼0.03100.06 ▼3.9880.54 ▲35.58
Seller Notifications /wp-admin/admin.php?page=spoki&tab=seller-notifications5,0761.7632.7461.70
Abandoned Carts /wp-admin/admin.php?page=spoki&tab=abandoned-carts5,0991.8833.2970.73
Spoki /wp-admin/admin.php?page=spoki&tab=welcome5,2941.7735.5874.98
Spoki /wp-admin/admin.php?page=spoki5,2971.7330.7549.98
Buttons /wp-admin/admin.php?page=spoki&tab=buttons5,0991.8932.0574.01
Invite a friend /wp-admin/admin.php?page=spoki&tab=invite-a-friend5,1901.8531.7679.23
Settings /wp-admin/admin.php?page=spoki&tab=settings5,1721.7632.7142.93
Customer Notifications /wp-admin/admin.php?page=spoki&tab=customer-notifications5,2071.9132.7972.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • theysaidso_admin_options
    • _wp_spoki_setting
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% 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 errors were triggered by the plugin
  • 32 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=spoki&tab=customer-notifications
    • > Notice in wp-content/plugins/spoki/spoki.php+860
    Undefined index: working_days_times
    • > GET request to /wp-admin/admin.php?page=spoki&tab=settings
    • > Notice in wp-content/plugins/spoki/spoki.php+755
    Undefined index: zip_code
    • > GET request to /wp-admin/admin.php?page=spoki&tab=settings
    • > Notice in wp-content/plugins/spoki/spoki.php+756
    Undefined index: province
    • > GET request to /wp-admin/admin.php?page=spoki&tab=settings
    • > Notice in wp-content/plugins/spoki/spoki.php+757
    Undefined index: country
    • > GET request to /wp-admin/admin.php?page=spoki&tab=settings
    • > Notice in wp-content/plugins/spoki/spoki.php+758
    Undefined index: route
    • > GET request to /wp-admin/admin.php?page=spoki&tab=settings
    • > Notice in wp-content/plugins/spoki/spoki.php+759
    Undefined index: city
    • > GET request to /wp-admin/admin.php?page=spoki&tab=settings
    • > Notice in wp-content/plugins/spoki/spoki.php+760
    Undefined index: vat_number
    • > GET request to /wp-admin/admin.php?page=spoki&tab=settings
    • > Notice in wp-content/plugins/spoki/spoki.php+761
    Undefined index: vat_name
    • > GET request to /wp-admin/admin.php?page=spoki&tab=settings
    • > Notice in wp-content/plugins/spoki/spoki.php+762
    Undefined index: c_f
    • > GET request to /wp-admin/admin.php?page=spoki&tab=settings
    • > Notice in wp-content/plugins/spoki/spoki.php+763
    Undefined index: pec
    • > GET request to /wp-admin/admin.php?page=spoki&tab=settings
    • > Notice in wp-content/plugins/spoki/spoki.php+764
    Undefined index: sid

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 take a closer look at the following
  • 21× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/spoki/includes/spoki-functions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/spoki/components/buttons-info-dialog.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function spoki_has_woocommerce() in wp-content/plugins/spoki/views/html-use-your-phone.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function spoki_has_woocommerce() in wp-content/plugins/spoki/views/html-welcome.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/spoki/widgets/class-elementor-spoki-button.php:9
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/spoki/includes/spoki-functions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/spoki/views/html-spoki-overview.php:5
    • > PHP Notice
      Undefined index: current_tab in wp-content/plugins/spoki/views/html-account-overview.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function spoki_has_woocommerce() in wp-content/plugins/spoki/views/html-invite-friend.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function spoki_has_woocommerce() in wp-content/plugins/spoki/views/html-onboarding.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Tags: You are using too many tags: 18 tag instead of maximum 10
You can take inspiration from this readme.txt

spoki/spoki.php 92% from 13 tests

The main PHP script in "Spoki - Chat Buttons and WooCommerce Notifications" version 2.15.11 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 141 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin9,328 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP233923906,272
PO File21,0471,2372,070
CSS51233667
JavaScript3327297
SVG20122

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.84
Average class complexity102.50
▷ Minimum class complexity8.00
▷ Maximum class complexity315.00
Average method complexity5.86
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods83
▷ Static methods33.61%
▷ Public methods7893.98%
▷ Protected methods22.41%
▷ Private methods33.61%
Functions18
▷ Named functions1266.67%
▷ Anonymous functions633.33%
Constants18
▷ Global constants18100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
20 PNG files occupy 1.30MB with 0.81MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/home-page-button.png30.31KB17.13KB▼ 43.47%
assets/images/elementor-button-2.png51.95KB15.12KB▼ 70.89%
assets/images/order-status.png138.05KB62.68KB▼ 54.60%
assets/images/tracking_example.png25.58KB7.24KB▼ 71.69%
assets/images/elementor-sections.png39.38KB11.42KB▼ 71.01%