77% sticky-add-to-cart-for-woocommerce

Code Review | Sticky add to cart for WooCommerce

WordPress plugin Sticky add to cart for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: sticky-add-to-car...
  • Plugin version: 1.7
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 9, 2017
  • Latest release: Sep 4, 2023
  • Number of updates: 25
  • Update frequency: every 91.2 days
  • Top authors: Magnigenie (96%)kshirod patel (8%)

Code review

54 tests

User reviews

10 reviews

Install metrics

200+ active /20,349 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼5.73ms] Passed 4 tests

Analyzing server-side resources used by Sticky add to cart for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.00 ▼1.23
Dashboard /wp-admin3.31 ▼0.0447.64 ▼8.79
Posts /wp-admin/edit.php3.36 ▲0.0046.11 ▼1.49
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.64 ▼11.42
Media Library /wp-admin/upload.php3.23 ▲0.0037.27 ▲0.45

Server storage [IO: ▲0.57MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sticky add to cart for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7313.87 ▼0.371.74 ▲0.0339.65 ▼4.95
Dashboard /wp-admin2,198 ▲205.64 ▼0.0285.90 ▼17.1037.31 ▼6.42
Posts /wp-admin/edit.php2,103 ▲32.00 ▼0.0440.66 ▲0.4037.30 ▼3.46
Add New Post /wp-admin/post-new.php1,527 ▲122.92 ▲0.02631.47 ▲25.9964.42 ▼24.83
Media Library /wp-admin/upload.php1,400 ▲34.17 ▼0.1498.83 ▼8.2841.78 ▼3.21

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • wsac_optionsframework

Smoke tests 50% 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)
Good news, no errors were detected

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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sticky-add-to-cart-for-woocommerce/inc/options-framework.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sticky-add-to-cart-for-woocommerce/inc/options.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sticky-add-to-cart-for-woocommerce/inc/includes/class-options-sanitization.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: woocommerce, add to cart, sticky add to cart, woocommerce sticky bar

sticky-add-to-cart-for-woocommerce/woocommerce-sticky-add-cart.php 69% from 13 tests

Analyzing the main PHP file in "Sticky add to cart for WooCommerce" version 1.7
You should first fix the following items:
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sticky-add-to-cart-for-woocommerce.php" instead of "woocommerce-sticky-add-cart.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: Please prefix the domain path with a forward slash character ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected8,775 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript61,6665775,607
PHP124485291,862
CSS879181,176
SVG101130

PHP code Passed 2 tests

A short review 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.34
Average class complexity27.29
▷ Minimum class complexity1.00
▷ Maximum class complexity100.00
Average method complexity5.97
▷ Minimum method complexity1.00
▷ Maximum method complexity97.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods37
▷ Static methods513.51%
▷ Public methods37100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/assets/images/check_flat/default.png2.96KB1.57KB▼ 47.12%
inc/assets/img/btn-down.png2.41KB1.11KB▼ 53.89%
inc/assets/img/controls.png2.19KB0.95KB▼ 56.49%
inc/assets/images/controls.png2.19KB0.95KB▼ 56.49%
inc/assets/images/btn-up.png2.41KB1.10KB▼ 54.16%