83% woocommerce-wholesale-prices

Code Review | Wholesale Suite – WooCommerce Wholesale Prices, B2B, Catalog Mode, Order Form, Wholesale User Roles, Dynamic Pricing & More

WordPress plugin Wholesale Suite – WooCommerce Wholesale Prices, B2B, Catalog Mode, Order Form, Wholesale User Roles, Dynamic Pricing & More scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-whole...
  • Plugin version: 2.1.10.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4.1
  • WordPress version: 6.3.1
  • First release: May 14, 2015
  • Latest release: Nov 20, 2023
  • Number of updates: 186
  • Update frequency: every 16.8 days
  • Top authors: jkohlbach (77.42%)paulgrymera (13.98%)rymera01 (9.14%)junixdev (1.08%)

Code review

54 tests

User reviews

476 reviews

Install metrics

20,000+ active /740,581 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.11MB] [CPU: ▼6.06ms] Passed 4 tests

This is a short check of server-side resources used by Wholesale Suite – WooCommerce Wholesale Prices, B2B, Catalog Mode, Order Form, Wholesale User Roles, Dynamic Pricing & More
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1234.48 ▼4.15
Dashboard /wp-admin3.43 ▲0.0844.90 ▼17.63
Posts /wp-admin/edit.php3.54 ▲0.1946.01 ▼4.78
Add New Post /wp-admin/post-new.php6.01 ▲0.1292.07 ▲2.32
Media Library /wp-admin/upload.php3.35 ▲0.1236.83 ▲4.79

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 402 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
wwp_running
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Wholesale Suite – WooCommerce Wholesale Prices, B2B, Catalog Mode, Order Form, Wholesale User Roles, Dynamic Pricing & More
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6314.28 ▼0.461.79 ▼0.3542.72 ▲0.37
Dashboard /wp-admin2,218 ▲415.63 ▲0.0591.56 ▼9.5242.97 ▲0.24
Posts /wp-admin/edit.php2,121 ▲212.15 ▲0.1341.53 ▲4.3838.43 ▲6.43
Add New Post /wp-admin/post-new.php1,546 ▲2023.25 ▲0.24582.57 ▼118.4745.21 ▼11.85
Media Library /wp-admin/upload.php1,423 ▲234.15 ▼0.0995.12 ▼7.1644.62 ▼0.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/woocommerce-wholesale-prices/views/view-wwp-help-page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_deactivation_hook() in wp-content/plugins/woocommerce-wholesale-prices/woocommerce-wholesale-prices.bootstrap.php:67
    • > PHP Warning
      Use of undefined constant WWP_IMAGES_URL - assumed 'WWP_IMAGES_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-wholesale-prices/views/view-wwp-about-page.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-wholesale-prices/views/view-wwp-about-page.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-wholesale-prices/views/backend/product/single/view-wwp-product-wholesale-role-visibility-filter.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Donate link: Invalid URI found ("")
You can look at the official readme.txt

woocommerce-wholesale-prices/woocommerce-wholesale-prices.bootstrap.php 85% from 13 tests

"Wholesale Suite – WooCommerce Wholesale Prices, B2B, Catalog Mode, Order Form, Wholesale User Roles, Dynamic Pricing & More" version 2.1.10.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.2" instead of "5.2")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woocommerce-wholesale-prices.php" instead of "woocommerce-wholesale-prices.bootstrap.php")

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 detected21,484 lines of code in 363 files:
LanguageFilesBlank linesComment linesLines of code
PHP863,2697,19911,237
JSON4002,462
CSS36319642,387
PO File21,0221,7022,250
JavaScript2023903881,567
TypeScript20113271,174
Markdown2560146
Sass6230144
SVG10153
HTML12823
YAML26021
XML10020

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity27.76
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity3.54
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes55
▷ Abstract classes00.00%
▷ Concrete classes55100.00%
▷ Final classes11.82%
Methods568
▷ Static methods11219.72%
▷ Public methods51089.79%
▷ Protected methods254.40%
▷ Private methods335.81%
Functions13
▷ Named functions430.77%
▷ Anonymous functions969.23%
Constants54
▷ Global constants2953.70%
▷ Class constants2546.30%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
20 PNG files occupy 0.22MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/upgrade-page-wwpp-box.png32.72KB11.79KB▼ 63.97%
images/wws-free-ebook.png10.13KB4.15KB▼ 59.00%
js/lib/chosen/chosen-sprite.png0.53KB0.88KB0.00%
images/wws-page-icons.png10.04KB3.07KB▼ 69.41%
images/logo.png7.72KB5.14KB▼ 33.46%