78% sticky-add-to-cart-woo

Code Review | Simple Sticky Add To Cart For WooCommerce

WordPress plugin Simple Sticky Add To Cart For WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: sticky-add-to-car...
  • Plugin version: 1.4.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 30, 2020
  • Latest release: Nov 12, 2023
  • Number of updates: 69
  • Update frequency: every 16.1 days
  • Top authors: sharaz (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

1,000+ active /22,661 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼10.53ms] Passed 4 tests

An overview of server-side resources used by Simple Sticky Add To Cart For WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0432.87 ▼20.78
Dashboard /wp-admin3.35 ▲0.0051.24 ▼9.33
Posts /wp-admin/edit.php3.47 ▲0.1047.57 ▲4.84
Add New Post /wp-admin/post-new.php5.93 ▲0.0483.72 ▼16.86
Media Library /wp-admin/upload.php3.27 ▲0.0438.35 ▲7.63

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 54 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Sticky Add To Cart For WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5314.67 ▲0.511.69 ▼0.0637.14 ▼6.75
Dashboard /wp-admin2,205 ▲255.51 ▼0.1491.15 ▼2.8740.74 ▼2.70
Posts /wp-admin/edit.php2,110 ▲102.03 ▲0.0640.84 ▼0.0739.79 ▼0.48
Add New Post /wp-admin/post-new.php1,536 ▼823.17 ▼2.14678.53 ▼2.9553.97 ▼22.32
Media Library /wp-admin/upload.php1,413 ▲104.18 ▼0.0398.43 ▼2.3043.35 ▼0.64

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

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

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sticky-add-to-cart-woo/public/partials/wsatc-public-display.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/sticky-add-to-cart-woo/admin/partials/wsatc-admin-analytics-counter.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_product() in wp-content/plugins/sticky-add-to-cart-woo/public/partials/wsatc-custom-css.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sticky-add-to-cart-woo/admin/reports/class-wsatc-analytics.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/sticky-add-to-cart-woo/admin/partials/wsatc-admin-analytics-display.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/sticky-add-to-cart-woo/admin/partials/wsatc-size-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/sticky-add-to-cart-woo/admin/partials/wsatc-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/sticky-add-to-cart-woo/admin/partials/wsatc-setting-tabs.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function solbox_wsatc_feedback\\is_admin() in wp-content/plugins/sticky-add-to-cart-woo/lib/solbox-plugin-deactivation-survey/deactivate-feedback-form.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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: sticky add to cart, stick bar for woocommerce, woocommerce sticky bar, woocommerce upsells, woocommerce

sticky-add-to-cart-woo/woo-sticky-add-to-cart.php 77% from 13 tests

The main PHP file in "Simple Sticky Add To Cart For WooCommerce" ver. 1.4.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 281 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sticky-add-to-cart-woo.php" instead of "woo-sticky-add-to-cart.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected3,668 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP202808711,923
Sass21130662
JavaScript886128549
CSS710347453
JSON10048
SVG20117
Markdown110016

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity17.12
▷ Minimum class complexity1.00
▷ Maximum class complexity82.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods55
▷ Static methods35.45%
▷ Public methods4989.09%
▷ Protected methods00.00%
▷ Private methods610.91%
Functions16
▷ Named functions1487.50%
▷ Anonymous functions212.50%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/ctr-icon.png3.48KB2.39KB▼ 31.32%
assets/img/analytics-image.png36.91KB15.40KB▼ 58.28%
assets/img/views-icon.png2.98KB1.93KB▼ 35.02%
assets/img/clicks-icon.png2.92KB1.80KB▼ 38.31%
assets/img/ui-icons.png6.84KB4.18KB▼ 38.90%