10% sticky-add-to-cart-for-woo

Code Review | Sticky add to cart for Woo

WordPress plugin Sticky add to cart for Woo scored 10% from 53 tests.

About plugin

  • Plugin page: sticky-add-to-car...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.2.2
  • WordPress version: 5.8.1
  • First release: Apr 25, 2019
  • Latest release: Jul 6, 2019
  • Number of updates: 6
  • Update frequency: every 13.3 days
  • Top authors: johnc1979 (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 1,462 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/sticky-add-to-cart-for-woo/satcwoo.php+58
    Use of undefined constant woocommerce - assumed 'woocommerce' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▲4.36MB] [CPU: ▼288.36ms] Passed 4 tests

A check of server-side resources used by Sticky add to cart for Woo
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /7.99 ▲5.2725.42 ▲4.31
Dashboard /wp-admin8.01 ▲4.9629.27 ▼7.85
Posts /wp-admin/edit.php8.01 ▲4.9024.76 ▼21.15
Add New Post /wp-admin/post-new.php8.01 ▲2.5825.74 ▼1,112.00
Media Library /wp-admin/upload.php8.01 ▲5.0024.22 ▼12.45
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius8.0124.42
Sticky add to cart for woo /wp-admin/admin.php?page=sticky_add_to_cart_for_woo8.0124.88

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 223 new files
Database: no new tables, 5 new options
New WordPress options
fs_accounts
fs_gdpr
fs_active_plugins
fs_api_cache
fs_debug_mode

Browser metrics Passed 4 tests

An overview of browser requirements for Sticky add to cart for Woo
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,388 ▼21816.07 ▲0.549.41 ▲2.5210.64 ▼36.23
Dashboard /wp-admin2,961 ▲1116.18 ▲0.38139.83 ▲14.36119.23 ▲15.32
Posts /wp-admin/edit.php2,737 ▲342.69 ▼0.0168.32 ▲5.41101.87 ▲19.08
Add New Post /wp-admin/post-new.php1,585 ▼6818.47 ▼0.33366.79 ▼4.85105.19 ▼3.56
Media Library /wp-admin/upload.php1,803 ▲315.00 ▼0.01145.42 ▼3.60125.94 ▲6.51
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius1,4652.0957.4681.05
Sticky add to cart for woo /wp-admin/admin.php?page=sticky_add_to_cart_for_woo1,2712.1754.7396.15

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/sticky-add-to-cart-for-woo/satcwoo.php+58
    Use of undefined constant woocommerce - assumed 'woocommerce' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 5 options in the database
    • fs_active_plugins
    • fs_api_cache
    • fs_accounts
    • fs_debug_mode
    • fs_gdpr

Smoke tests 25% 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)
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sticky_add_to_cart_for_woo
    • > Warning in wp-content/plugins/sticky-add-to-cart-for-woo/satcwoo.php+58
    Use of undefined constant woocommerce - assumed 'woocommerce' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sticky_add_to_cart_for_woo
    • > Warning in wp-content/plugins/sticky-add-to-cart-for-woo/public/class-satcwoo-public.php+108
    include(class-redirection.php): failed to open stream: No such file or directory
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sticky_add_to_cart_for_woo
    • > Warning in wp-content/plugins/sticky-add-to-cart-for-woo/public/class-satcwoo-public.php+108
    include(): Failed opening 'class-redirection.php' for inclusion (include_path='.:/usr/share/php')

SRP 0% 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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sticky-add-to-cart-for-woo/freemius/templates/ajax-loader.php
    • > /wp-content/plugins/sticky-add-to-cart-for-woo/public/partials/satcwoo-public-display.php
    • > /wp-content/plugins/sticky-add-to-cart-for-woo/admin/partials/satcwoo-admin-display.php
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sticky-add-to-cart-for-woo/public/class-general-display.php:2
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/sticky-add-to-cart-for-woo/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sticky-add-to-cart-for-woo/admin/class-satcwoo-admin.php:114
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sticky-add-to-cart-for-woo/public/class-style-options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sticky-add-to-cart-for-woo/public/class-mobile-display.php:7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/sticky-add-to-cart-for-woo/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/sticky-add-to-cart-for-woo/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/sticky-add-to-cart-for-woo/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sticky-add-to-cart-for-woo/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sticky-add-to-cart-for-woo/freemius/templates/account/partials/addon.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === sticky-add-to-cart-for-woo === )
  • Screenshots: These screenshots lack descriptions #3, #4 in sticky-add-to-cart-for-woo/assets to your readme.txt
  • Donate link: Invalid URI found ("")
Please take inspiration from this readme.txt

sticky-add-to-cart-for-woo/satcwoo.php 85% from 13 tests

The entry point to "Sticky add to cart for Woo" version 1.0.2 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("sticky-add-to-cart-for-woo.php" instead of "satcwoo.php")

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin46,001 lines of code in 175 files:
LanguageFilesBlank linesComment linesLines of code
PHP1206,94615,93230,484
PO File105,7106,91312,558
Sass28399772,515
JavaScript548124224
CSS124498220

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,609)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity72.00
▷ Minimum class complexity1.00
▷ Maximum class complexity2,609.00
Average method complexity4.45
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods1,103
▷ Static methods17215.59%
▷ Public methods76769.54%
▷ Protected methods151.36%
▷ Private methods32129.10%
Functions123
▷ Named functions123100.00%
▷ Anonymous functions00.00%
Constants120
▷ Global constants9780.83%
▷ Class constants2319.17%
▷ Public constants23100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/sticky-add-to-cart-for-woo.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%