83% wc-quantity-plus-minus-button

Code Review | Quantity Plus Minus Button for WooCommerce by CodeAstrology

WordPress plugin Quantity Plus Minus Button for WooCommerce by CodeAstrology scored83%from 54 tests.

About plugin

  • Plugin page: wc-quantity-plus-...
  • Plugin version: 1.1.9
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jul 1, 2020
  • Latest release: Oct 12, 2023
  • Number of updates: 46
  • Update frequency: every 26.0 days
  • Top authors: codersaiful (80.43%)codeastrology (17.39%)unikforce (6.52%)

Code review

54 tests

User reviews

18 reviews

Install metrics

10,000+ active /111,534 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.98ms] Passed 4 tests

Server-side resources used by Quantity Plus Minus Button for WooCommerce by CodeAstrology
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0438.80 ▼0.29
Dashboard /wp-admin3.34 ▲0.0343.96 ▼5.13
Posts /wp-admin/edit.php3.46 ▲0.1050.14 ▼1.48
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.12 ▼17.00
Media Library /wp-admin/upload.php3.27 ▲0.0335.53 ▲0.45

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 82 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
wqpmb_configs
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Quantity Plus Minus Button for WooCommerce by CodeAstrology
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲4614.20 ▼0.161.70 ▲0.1443.54 ▼0.46
Dashboard /wp-admin2,213 ▲365.55 ▼0.1186.45 ▼2.3339.86 ▼2.36
Posts /wp-admin/edit.php2,118 ▲182.01 ▼0.0241.19 ▲3.1137.14 ▲1.00
Add New Post /wp-admin/post-new.php1,539 ▲1122.97 ▲0.09671.20 ▲19.8355.55 ▲4.78
Media Library /wp-admin/upload.php1,421 ▲184.24 ▼0.03106.95 ▲10.5345.78 ▲0.28

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • wqpmb_configs
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CA_Framework\\Form\\Inc\\Field_Base' not found in wp-content/plugins/wc-quantity-plus-minus-button/framework/ca-framework/form/fields/select.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WQPMB\\Core\\Base' not found in wp-content/plugins/wc-quantity-plus-minus-button/admin/page-loader.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CA_Framework\\Form\\Inc\\Field_Base' not found in wp-content/plugins/wc-quantity-plus-minus-button/framework/ca-framework/form/inc/input-base.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wc-quantity-plus-minus-button/admin/html/live-support.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'CA_Framework\\Form\\Inc\\Form_Base' not found in wp-content/plugins/wc-quantity-plus-minus-button/framework/ca-framework/form/form-bk.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wc-quantity-plus-minus-button/admin/html/button-settings.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CA_Framework\\Form\\Inc\\Form_Base' not found in wp-content/plugins/wc-quantity-plus-minus-button/framework/ca-framework/form/form.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'CA_Framework\\Form\\Inc\\Field_Base' not found in wp-content/plugins/wc-quantity-plus-minus-button/framework/ca-framework/form/inc/field.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-quantity-plus-minus-button/includes/load-scripts.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/wc-quantity-plus-minus-button/admin/html/main-page.php:7

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 86% 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: You can take inspiration from this readme.txt

wc-quantity-plus-minus-button/init.php 77% from 13 tests

Analyzing the main PHP file in "Quantity Plus Minus Button for WooCommerce by CodeAstrology" version 1.1.9
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-quantity-plus-minus-button.php" instead of "init.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path folder was not found ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected5,912 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP356528442,781
CSS111641071,896
HTML191480
JSON100478
JavaScript42441141
SVG177089
Markdown18047

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity7.21
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces12
Interfaces0
Traits0
Classes24
▷ Abstract classes14.17%
▷ Concrete classes2395.83%
▷ Final classes00.00%
Methods124
▷ Static methods2318.55%
▷ Public methods11088.71%
▷ Protected methods00.00%
▷ Private methods1411.29%
Functions20
▷ Named functions1890.00%
▷ Anonymous functions210.00%
Constants11
▷ Global constants1090.91%
▷ Class constants19.09%
▷ Public constants1100.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
20 PNG files occupy 0.14MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/products/woo-min-max-quantity-step-control-single.png5.11KB2.92KB▼ 43.00%
assets/images/logo.png4.27KB2.94KB▼ 31.10%
assets/images/social/linkedin.png1.05KB0.96KB▼ 8.47%
assets/images/social/yelp.png2.77KB2.04KB▼ 26.35%
assets/images/plus-minus-small.png1.98KB1.29KB▼ 35.06%