10% add-to-cart-button-for-woocommerce

Code Review | Add to Cart Button Pro for WooCommerce

WordPress plugin Add to Cart Button Pro for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: add-to-cart-butto...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 13, 2020
  • Latest release: Jun 21, 2023
  • Number of updates: 10
  • Update frequency: every 122.6 days
  • Top authors: frohadpro (60%)webbykey (50%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /3,023 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/add-to-cart-button-for-woocommerce/includes/class-addtocart.php+204
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲1.84MB] [CPU: ▲2.74ms] Passed 4 tests

A check of server-side resources used by Add to Cart Button Pro for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.5034.00 ▼11.60
Dashboard /wp-admin5.62 ▲2.3266.73 ▲18.20
Posts /wp-admin/edit.php5.77 ▲2.4163.02 ▲8.29
Add New Post /wp-admin/post-new.php8.03 ▲2.1497.43 ▲0.71
Media Library /wp-admin/upload.php5.61 ▲2.3848.43 ▲13.54
Add to Cart Button /wp-admin/edit.php?post_type=add_to_cart_cpt3.6433.00

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 79 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
_addtocart_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Add to Cart Button Pro for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,726 ▼2016.26 ▲1.880.50 ▼1.2518.44 ▼25.44
Dashboard /wp-admin2,467 ▲2856.69 ▲1.81142.56 ▲33.2544.06 ▲3.29
Posts /wp-admin/edit.php2,375 ▲2864.07 ▲2.0359.27 ▲17.5832.63 ▼3.14
Add New Post /wp-admin/post-new.php1,634 ▲10624.09 ▲5.71657.93 ▲33.5048.25 ▼10.45
Media Library /wp-admin/upload.php1,514 ▲1265.38 ▲1.2286.24 ▼16.0943.89 ▼4.63
Add to Cart Button /wp-admin/edit.php?post_type=add_to_cart_cpt280.440.083.86
Advanced Settings /wp-admin/edit.php?post_type=add_to_cart_cpt#tab=4280.440.224.18
Sticky Button on Product Page /wp-admin/edit.php?post_type=add_to_cart_cpt#tab=3280.440.093.59
Button on Shop page /wp-admin/edit.php?post_type=add_to_cart_cpt#tab=1280.440.064.17
Button on Product Page /wp-admin/edit.php?post_type=add_to_cart_cpt#tab=2280.440.083.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • _addtocart_options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

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
Good news, no errors were detected

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=add_to_cart_cpt
    • > Network (severe)
    wp-admin/edit.php?post_type=add_to_cart_cpt - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/edit.php?post_type=add_to_cart_cpt#tab=4
    • > Network (severe)
    wp-admin/edit.php?post_type=add_to_cart_cpt#tab=4 - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/edit.php?post_type=add_to_cart_cpt#tab=3
    • > Network (severe)
    wp-admin/edit.php?post_type=add_to_cart_cpt#tab=3 - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/edit.php?post_type=add_to_cart_cpt#tab=1
    • > Network (severe)
    wp-admin/edit.php?post_type=add_to_cart_cpt#tab=1 - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/edit.php?post_type=add_to_cart_cpt#tab=2
    • > Network (severe)
    wp-admin/edit.php?post_type=add_to_cart_cpt#tab=2 - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: sticky add to cart, add to cart button, custom add to cart button woocommerce, woocommerce, add to cart

add-to-cart-button-for-woocommerce/wk-add-to-cart-button-pro.php 85% from 13 tests

Analyzing the main PHP file in "Add to Cart Button Pro for WooCommerce" version 1.1.0
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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("add-to-cart-button-for-woocommerce.php" instead of "wk-add-to-cart-button-pro.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
Success! There were no dangerous files found in this plugin15,162 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP491,2481,1974,798
CSS72884623,913
JavaScript51,1923343,778
SVG3002,673

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity21.63
▷ Minimum class complexity1.00
▷ Maximum class complexity121.00
Average method complexity6.50
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes25.71%
▷ Concrete classes3394.29%
▷ Final classes00.00%
Methods132
▷ Static methods2518.94%
▷ Public methods12594.70%
▷ Protected methods10.76%
▷ Private methods64.55%
Functions29
▷ Named functions2896.55%
▷ Anonymous functions13.45%
Constants3
▷ Global constants3100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/atc-framework/assets/images/checkerboard.png2.29KB2.54KB0.00%