83% 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 scored83%from 54 tests.

About plugin

  • Plugin page: add-to-cart-butto...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4
  • WordPress version: 6.3.1
  • First release: Mar 28, 2019
  • Latest release: Oct 25, 2023
  • Number of updates: 24
  • Update frequency: every 70.4 days
  • Top authors: wpgenie2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,048 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼11.46ms] Passed 4 tests

Analyzing server-side resources used by Add to Cart Button Manipulation for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.34 ▼2.77
Dashboard /wp-admin3.31 ▼0.0444.22 ▼13.52
Posts /wp-admin/edit.php3.36 ▲0.0045.29 ▼4.00
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.67 ▼25.56
Media Library /wp-admin/upload.php3.23 ▲0.0031.11 ▼0.76

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Add to Cart Button Manipulation for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.41 ▼0.201.61 ▼0.1136.75 ▼4.51
Dashboard /wp-admin2,192 ▲185.63 ▲0.0591.83 ▲2.3441.79 ▼1.39
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0241.78 ▲6.8038.97 ▲2.72
Add New Post /wp-admin/post-new.php1,526 ▼1222.98 ▲4.72655.72 ▲28.4451.74 ▼23.86
Media Library /wp-admin/upload.php1,394 ▲34.18 ▲0.0197.82 ▼11.2244.04 ▼3.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% 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× 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 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes: You can look at the official readme.txt

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

"Add to Cart Button Manipulation for WooCommerce" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("add-to-cart-button-manipulation-for-woocommerce.php" instead of "wc-atcbm.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 160 characters long)
  • Requires at least: Required version must match the one declared in readme.txt ("4.0" instead of "3.0")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
No dangerous file extensions were detected565 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP13242570465
CSS217457
JavaScript6143743

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
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%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected