89% wholesalex

Code Review | WholesaleX - WooCommerce Wholesale Plugin (Wholesale Prices, Dynamic Pricing, Tiered Pricing)

WordPress plugin WholesaleX - WooCommerce Wholesale Plugin (Wholesale Prices, Dynamic Pricing, Tiered Pricing) scored89%from 54 tests.

About plugin

  • Plugin page: wholesalex
  • Plugin version: 1.2.17
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 10, 2022
  • Latest release: Nov 29, 2023
  • Number of updates: 47
  • Update frequency: every 8.4 days
  • Top authors: wpxpo (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

800+ active /15,261 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.03MB] [CPU: ▼0.07ms] Passed 4 tests

A check of server-side resources used by WholesaleX - WooCommerce Wholesale Plugin (Wholesale Prices, Dynamic Pricing, Tiered Pricing)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0333.96 ▼10.32
Dashboard /wp-admin3.34 ▲0.0452.77 ▲2.73
Posts /wp-admin/edit.php3.45 ▲0.1051.19 ▲2.50
Add New Post /wp-admin/post-new.php5.92 ▲0.0394.30 ▲4.80
Media Library /wp-admin/upload.php3.26 ▲0.0338.92 ▲5.71
Setup Wizard /wp-admin/admin.php?page=wholesalex-setup-wizard3.2531.74

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 136 new files
Database: no new tables, 10 new options
New WordPress options
__wholesalex_single_product_db_update_v2
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
wholesalex_settings
can_compress_scripts
widget_recent-comments
wholesalex_installation_date
_wholesalex_roles
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WholesaleX - WooCommerce Wholesale Plugin (Wholesale Prices, Dynamic Pricing, Tiered Pricing)
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲5114.72 ▲0.631.85 ▲0.0044.41 ▼0.39
Dashboard /wp-admin2,215 ▲515.53 ▼0.0389.18 ▼25.2442.38 ▲4.03
Posts /wp-admin/edit.php2,127 ▲241.95 ▲0.0140.47 ▼4.9937.61 ▼1.28
Add New Post /wp-admin/post-new.php1,549 ▲2323.51 ▼0.10624.22 ▼71.1646.99 ▲4.16
Media Library /wp-admin/upload.php1,423 ▲294.21 ▲0.0395.20 ▼1.5242.78 ▲1.60
Setup Wizard /wp-admin/admin.php?page=wholesalex-setup-wizard8632.4846.8237.96

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 10 options in the database
    • can_compress_scripts
    • wholesalex_settings
    • __wholesalex_single_product_db_update_v2
    • db_upgraded
    • _wholesalex_roles
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • wholesalex_installation_date
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The SRP test was a success

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (WholesaleX Dashboard), #2 (User Roles), #3 (Dynamic Rules Builder), #4 (Registration Form Builder), #5 (Product Single Rules), #6 (Product Single Frontend)
The official readme.txt is a good inspiration

wholesalex/wholesalex.php 92% from 13 tests

The main PHP script in "WholesaleX - WooCommerce Wholesale Plugin (Wholesale Prices, Dynamic Pricing, Tiered Pricing)" version 1.2.17 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 218 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected19,751 lines of code in 119 files:
LanguageFilesBlank linesComment linesLines of code
PHP572,8895,57817,095
CSS21461201,524
SVG4184892
JavaScript193539240

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 120)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity67.40
▷ Minimum class complexity1.00
▷ Maximum class complexity863.00
Average method complexity5.47
▷ Minimum method complexity1.00
▷ Maximum method complexity120.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes42
▷ Abstract classes24.76%
▷ Concrete classes4095.24%
▷ Final classes00.00%
Methods618
▷ Static methods274.37%
▷ Public methods53185.92%
▷ Protected methods8012.94%
▷ Private methods71.13%
Functions33
▷ Named functions824.24%
▷ Anonymous functions2575.76%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
13 compressed PNG files occupy 0.33MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/setup-wizard/play.png13.99KB13.98KB0.05%
assets/img/setup-wizard/footer_banner.png44.17KB43.85KB▼ 0.73%
assets/img/layout_six.png13.63KB13.63KB0.03%
assets/img/setup-wizard/intro.png28.02KB28.02KB0.01%
assets/img/layout_seven.png12.00KB12.00KB0.00%