77% custom-add-to-cart-button-for-woocommerce

Code Review | Ultimate Custom Add To Cart Button (Ajax) For WooCommerce by Binary Carpenter

WordPress plugin Ultimate Custom Add To Cart Button (Ajax) For WooCommerce by Binary Carpenter scored77%from 54 tests.

About plugin

  • Plugin page: custom-add-to-car...
  • Plugin version: 1.222.13
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Jan 19, 2019
  • Latest release: Nov 15, 2023
  • Number of updates: 62
  • Update frequency: every 28.5 days
  • Top authors: bc2018 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /55,842 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.27MB] [CPU: ▼3.80ms] Passed 4 tests

Server-side resources used by Ultimate Custom Add To Cart Button (Ajax) For WooCommerce by Binary Carpenter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2738.34 ▼1.18
Dashboard /wp-admin3.58 ▲0.2747.38 ▼4.18
Posts /wp-admin/edit.php3.69 ▲0.3351.39 ▲4.28
Add New Post /wp-admin/post-new.php6.16 ▲0.2793.90 ▼10.93
Media Library /wp-admin/upload.php3.50 ▲0.2735.28 ▲1.10

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 48 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Ultimate Custom Add To Cart Button (Ajax) For WooCommerce by Binary Carpenter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.14 ▼0.241.72 ▼0.0338.03 ▼5.66
Dashboard /wp-admin2,195 ▲185.61 ▲0.0291.43 ▼13.2640.86 ▼1.74
Posts /wp-admin/edit.php2,079 ▼241.98 ▲0.0539.54 ▲4.5134.67 ▼3.08
Add New Post /wp-admin/post-new.php1,526 ▼1023.31 ▼0.07679.49 ▲70.4548.37 ▼7.20
Media Library /wp-admin/upload.php1,400 ▲64.16 ▼0.0598.20 ▼1.9342.42 ▼2.51

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

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)
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/custom-add-to-cart-button-for-woocommerce/ui/download-styles.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BinaryCarpenter\\BC_ATC\\get_option() in wp-content/plugins/custom-add-to-cart-button-for-woocommerce/inc/BC_ATC_Options.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'BinaryCarpenter\\BC_ATC\\Config' not found in wp-content/plugins/custom-add-to-cart-button-for-woocommerce/ui/main-ui.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/custom-add-to-cart-button-for-woocommerce/ui/create-style.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'BinaryCarpenter\\BC_ATC\\Config' not found in wp-content/plugins/custom-add-to-cart-button-for-woocommerce/ui/manage-buttons.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: custom add to cart button, add to cart button, ajax add to cart button, add to cart, woocommerce

custom-add-to-cart-button-for-woocommerce/index.php 69% from 13 tests

The main PHP script in "Ultimate Custom Add To Cart Button (Ajax) For WooCommerce by Binary Carpenter" version 1.222.13 is automatically included on every request by WordPress
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("5.0" instead of "5.0.0")
  • Requires PHP: Required version must match the one declared in readme.txt ("5.6" instead of "7.0")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-add-to-cart-button-for-woocommerce.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,553 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP125981972,356
SVG1300105
Sass219188
CSS2002
JavaScript2022

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity27.14
▷ Minimum class complexity1.00
▷ Maximum class complexity162.00
Average method complexity5.31
▷ Minimum method complexity1.00
▷ Maximum method complexity64.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods43
▷ Static methods1023.26%
▷ Public methods4093.02%
▷ Protected methods00.00%
▷ Private methods36.98%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants17
▷ Global constants00.00%
▷ Class constants17100.00%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
14 PNG files occupy 0.12MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bundle/css/images/subtract.png14.39KB0.16KB▼ 98.91%
bundle/css/images/owl.video.play.png4.86KB2.74KB▼ 43.61%
bundle/css/images/next_button.png16.98KB1.68KB▼ 90.09%
bundle/css/images/bc-atc-qty-style-01.png6.59KB1.28KB▼ 80.61%
bundle/css/images/bc-atc-qty-style-06.png2.28KB1.04KB▼ 54.37%