78% side-cart-woocommerce

Code Review | Side Cart Woocommerce (Ajax)

WordPress plugin Side Cart Woocommerce (Ajax) scored78%from 54 tests.

About plugin

  • Plugin page: side-cart-woocomm...
  • Plugin version: 2.4.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4
  • WordPress version: 6.3.1
  • First release: Apr 24, 2017
  • Latest release: Nov 21, 2023
  • Number of updates: 138
  • Update frequency: every 17.4 days
  • Top authors: xootix (100%)

Code review

54 tests

User reviews

361 reviews

Install metrics

60,000+ active /631,066 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.00MB] [CPU: ▼3.32ms] Passed 4 tests

An overview of server-side resources used by Side Cart Woocommerce (Ajax)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.33 ▼6.98
Dashboard /wp-admin3.31 ▲0.0149.47 ▼3.57
Posts /wp-admin/edit.php3.36 ▲0.0050.77 ▼0.42
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.48 ▼2.30
Media Library /wp-admin/upload.php3.23 ▲0.0033.20 ▼0.33

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 55 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Side Cart Woocommerce (Ajax): an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▲0.291.58 ▼0.4938.58 ▼3.26
Dashboard /wp-admin2,195 ▲185.64 ▲0.0196.63 ▼3.5143.46 ▼0.05
Posts /wp-admin/edit.php2,103 ▲32.02 ▲0.0143.59 ▲3.5039.29 ▲0.30
Add New Post /wp-admin/post-new.php1,526 ▼1123.36 ▲0.04607.83 ▼8.9651.44 ▼1.28
Media Library /wp-admin/upload.php1,394 ▼94.18 ▼0.06100.54 ▲1.0942.61 ▼0.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/side-cart-woocommerce/templates/global/inline-style.php
    • > /wp-content/plugins/side-cart-woocommerce/admin/templates/preview/xoo-wsc-header-preview.php
    • > /wp-content/plugins/side-cart-woocommerce/admin/templates/xoo-wsc-tab-info.php
    • > /wp-content/plugins/side-cart-woocommerce/includes/xoo-framework/admin/templates/global/setting-upload.php
    • > /wp-content/plugins/side-cart-woocommerce/admin/templates/xoo-wsc-tab-pro.php
  • 139× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/side-cart-woocommerce/templates/global/inline-style.php on line 56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/side-cart-woocommerce/admin/views/settings/advanced.php:39
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/side-cart-woocommerce/templates/global/inline-style.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/side-cart-woocommerce/templates/global/inline-style.php on line 49
    • > PHP Notice
      Undefined variable: sy in wp-content/plugins/side-cart-woocommerce/templates/global/inline-style.php on line 15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/side-cart-woocommerce/templates/global/inline-style.php on line 16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/side-cart-woocommerce/templates/global/inline-style.php on line 53
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/side-cart-woocommerce/templates/global/inline-style.php on line 67
    • > PHP Notice
      Undefined variable: sy in wp-content/plugins/side-cart-woocommerce/templates/global/inline-style.php on line 11
    • > PHP Notice
      Undefined variable: sy in wp-content/plugins/side-cart-woocommerce/templates/global/inline-style.php on line 55

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: floating cart, cart popup, slider, woocommerce, woocommerce cart

side-cart-woocommerce/xoo-wsc-main.php 92% from 13 tests

"Side Cart Woocommerce (Ajax)" version 2.4.7'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:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("side-cart-woocommerce.php" instead of "xoo-wsc-main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected6,679 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
PHP371,4032314,100
CSS4327311,422
JavaScript3415531,079
SVG10058
XML14020

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity29.56
▷ Minimum class complexity2.00
▷ Maximum class complexity119.00
Average method complexity3.48
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods103
▷ Static methods1817.48%
▷ Public methods10198.06%
▷ Protected methods10.97%
▷ Private methods10.97%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants13
▷ Global constants13100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/arrow-right.png0.45KB0.21KB▼ 54.53%
assets/images/arrow-left.png0.45KB0.21KB▼ 54.62%