84% advanced-add-to-cart-for-woocommerce

Code Review | Advanced Add To Cart for WooCommerce

WordPress plugin Advanced Add To Cart for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: advanced-add-to-c...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0.3
  • WordPress version: 6.3.1
  • First release: Jan 14, 2022
  • Latest release: Nov 28, 2022
  • Number of updates: 8
  • Update frequency: every 40.5 days
  • Top authors: antondrob2 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /639 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.03MB] [CPU: ▼4.68ms] Passed 4 tests

Server-side resources used by Advanced Add To Cart for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.11 ▲2.39
Dashboard /wp-admin3.34 ▲0.0442.05 ▼6.40
Posts /wp-admin/edit.php3.39 ▲0.0347.05 ▼2.21
Add New Post /wp-admin/post-new.php5.92 ▲0.0379.93 ▼10.17
Media Library /wp-admin/upload.php3.26 ▲0.0336.00 ▲0.06

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Add To Cart for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲17613.59 ▼0.798.54 ▲6.7535.18 ▼14.29
Dashboard /wp-admin2,209 ▲214.88 ▼0.98112.24 ▲5.6844.39 ▲2.30
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0238.41 ▼0.6434.42 ▼0.51
Add New Post /wp-admin/post-new.php1,546 ▲1218.22 ▼4.82609.08 ▼64.9553.66 ▼5.11
Media Library /wp-admin/upload.php1,385 ▼34.29 ▲0.0199.07 ▼9.9243.15 ▼0.36

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% 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 50% 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× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/advanced-add-to-cart-for-woocommerce/advanced-add-to-cart.php:28

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: add to cart, dynamic add to cart, ajax add to cart

advanced-add-to-cart-for-woocommerce/advanced-add-to-cart.php 85% from 13 tests

The primary PHP file in "Advanced Add To Cart for WooCommerce" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and 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 ("advanced-add-to-cart-for-woocommerce.php" instead of "advanced-add-to-cart.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 detected285 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12810132
JavaScript1151112
CSS15041

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods114.29%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin