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

Code Review | Remove Add to Cart Button for WooCommerce

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

About plugin

  • Plugin page: remove-add-to-car...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3.2
  • WordPress version: 6.3.1
  • First release: Aug 8, 2020
  • Latest release: Oct 28, 2023
  • Number of updates: 25
  • Update frequency: every 47.1 days
  • Top authors: sumon086 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /3,341 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/remove-add-to-cart-button-for-woocommerce/includes/freemius/require.php+16
    require_once(wp-content/plugins/remove-add-to-cart-button-for-woocommerce/includes/freemius/includes/fs-html-escaping-functions.php): failed to open stream: No such file or directory

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

An overview of server-side resources used by Remove Add to Cart Button for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.94 ▼1.33
Dashboard /wp-admin3.31 ▼0.0444.75 ▼16.53
Posts /wp-admin/edit.php3.36 ▲0.0043.42 ▼2.31
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.59 ▼18.97
Media Library /wp-admin/upload.php3.23 ▲0.0033.65 ▲2.06

Server storage [IO: ▲4.14MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 190 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
fs_active_plugins
widget_theysaidso_widget
fs_debug_mode
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Remove Add to Cart Button for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.151.65 ▼0.0346.45 ▲2.44
Dashboard /wp-admin2,198 ▲275.58 ▼0.0294.27 ▼8.7741.99 ▲0.37
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0333.40 ▼1.6335.58 ▼0.71
Add New Post /wp-admin/post-new.php1,526 ▼1123.08 ▲4.81686.31 ▲53.1153.46 ▼9.46
Media Library /wp-admin/upload.php1,400 ▼04.18 ▼0.0292.83 ▼0.5343.15 ▲2.31

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • fs_active_plugins
    • fs_debug_mode
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Donate link: Please fix this invalid url: "#"
You can look at the official readme.txt

remove-add-to-cart-button-for-woocommerce/remove-add-to-cart-button-woocommerce.php 77% from 13 tests

The main PHP file in "Remove Add to Cart Button for WooCommerce" ver. 1.0.4 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("remove-add-to-cart-button-for-woocommerce.php" instead of "remove-add-to-cart-button-woocommerce.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 208 characters long)

Code Analysis 97% from 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 detected32,242 lines of code in 135 files:
LanguageFilesBlank linesComment linesLines of code
PHP1177,52317,00131,695
JavaScript45086248
Markdown1680214
CSS121458
JSON10027

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity83.21
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.64
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods1,203
▷ Static methods19516.21%
▷ Public methods83369.24%
▷ Protected methods151.25%
▷ Private methods35529.51%
Functions102
▷ Named functions102100.00%
▷ Anonymous functions00.00%
Constants131
▷ Global constants9975.57%
▷ Class constants3224.43%
▷ Public constants32100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 1.18MB with 0.69MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png120.74KB47.99KB▼ 60.25%
assets/screenshot-4.png116.29KB47.57KB▼ 59.09%
assets/screenshot-1.png137.12KB50.72KB▼ 63.01%
includes/freemius/assets/img/remove-add-to-cart-button-for-woocommerce.png8.62KB3.44KB▼ 60.10%
assets/screenshot-5.png68.09KB34.24KB▼ 49.71%