89% woocommerce-bulk-discount

Code Review | WooCommerce Bulk Discount

WordPress plugin WooCommerce Bulk Discount scored89%from 54 tests.

About plugin

  • Plugin page: woocommerce-bulk-...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.0-5.6
  • WordPress version: 6.3.1
  • First release: Jul 4, 2013
  • Latest release: Feb 1, 2021
  • Number of updates: 148
  • Update frequency: every 18.7 days
  • Top authors: Rene Puchinger (100%)

Code review

54 tests

User reviews

107 reviews

Install metrics

10,000+ active /238,217 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

A check of server-side resources used by WooCommerce Bulk Discount
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.14 ▼3.17
Dashboard /wp-admin3.31 ▲0.0145.94 ▼4.44
Posts /wp-admin/edit.php3.42 ▲0.0750.20 ▲2.86
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.23 ▼9.26
Media Library /wp-admin/upload.php3.23 ▲0.0036.46 ▲4.94

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Bulk Discount
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6813.15 ▼1.435.18 ▲3.3345.96 ▲2.57
Dashboard /wp-admin2,206 ▲154.86 ▼0.0598.82 ▼18.0538.84 ▼5.20
Posts /wp-admin/edit.php2,092 ▲242.01 ▼0.0339.91 ▲3.2936.74 ▲3.07
Add New Post /wp-admin/post-new.php1,533 ▼023.17 ▲0.31668.49 ▲10.2751.60 ▲1.61
Media Library /wp-admin/upload.php1,388 ▼34.29 ▲0.1097.79 ▼2.8143.80 ▼3.13

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 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)
Good news, no errors were detected

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

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 93% 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
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Bulk Discount Settings page.), #2 (Setting the discount lines (see FAQ for further explanation). Often only one discount line is sufficient.), #3 (Showing an example of flat bulk discount visibility on the cart page.), #4 (Bulk discount is visible on the Checkout Page as well.), #5 (Bulk Discount is visible in WooCommerce e-mails.), #6 (Example of percentage bulk discount visibility on the cart page.)
The official readme.txt is a good inspiration

woocommerce-bulk-discount/woocommerce-bulk-discount.php 92% from 13 tests

"WooCommerce Bulk Discount" version 3.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "3.7.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin943 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP1198157695
PO File27898227
CSS25021

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity156.00
▷ Minimum class complexity156.00
▷ Maximum class complexity156.00
Average method complexity5.43
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods35
▷ Static methods00.00%
▷ Public methods2468.57%
▷ Protected methods1131.43%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.27MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-6.png34.96KB11.08KB▼ 68.32%
screenshot-4.png38.22KB12.60KB▼ 67.03%
screenshot-2.png35.92KB14.49KB▼ 59.67%
screenshot-3.png35.96KB12.09KB▼ 66.39%
screenshot-5.png38.86KB17.48KB▼ 55.01%