93% add-to-cart-button-manipulation-for-woocommerce

Code Review | Add to Cart Button Manipulation for WooCommerce

WordPress plugin Add to Cart Button Manipulation for WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: add-to-cart-butto...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 5.9.2
  • First release: Mar 28, 2019
  • Latest release: Aug 7, 2021
  • Number of updates: 17
  • Update frequency: every 51.8 days
  • Top authors: wpgenie2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 661 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.02MB] [CPU: ▼297.98ms] Passed 4 tests

This is a short check of server-side resources used by Add to Cart Button Manipulation for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.4061.38 ▲36.20
Dashboard /wp-admin3.41 ▲0.0037.01 ▲0.30
Posts /wp-admin/edit.php3.64 ▲0.0042.00 ▲0.18
Add New Post /wp-admin/post-new.php6.91 ▼0.0999.70 ▼1,188.15
Media Library /wp-admin/upload.php3.29 ▲0.0024.03 ▼4.23

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 27 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Add to Cart Button Manipulation for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲5115.88 ▼0.136.58 ▼0.263.27 ▲0.95
Dashboard /wp-admin2,888 ▲276.13 ▼0.06111.68 ▼17.79159.09 ▼2.21
Posts /wp-admin/edit.php2,688 ▲313.24 ▲0.0064.95 ▲0.30144.12 ▲2.94
Add New Post /wp-admin/post-new.php1,668 ▲718.55 ▲2.62393.02 ▼11.39162.85 ▲2.02
Media Library /wp-admin/upload.php1,701 ▲35.49 ▼0.01131.47 ▼4.53183.55 ▼3.19

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just 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 __() in wp-content/plugins/add-to-cart-button-manipulation-for-woocommerce/public/templates/single-product/wc_atcbm_available_text.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention: The official readme.txt might help

add-to-cart-button-manipulation-for-woocommerce/wc-atcbm.php 69% from 13 tests

Analyzing the main PHP file in "Add to Cart Button Manipulation for WooCommerce" version 1.0.1
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("add-to-cart-button-manipulation-for-woocommerce.php" instead of "wc-atcbm.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 160 characters long)
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "3.0")

Code Analysis Passed 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 plugin560 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP13240570460
CSS217457
JavaScript6143743

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity6.88
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods36
▷ Static methods25.56%
▷ Public methods3186.11%
▷ Protected methods00.00%
▷ Private methods513.89%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected