10% role-based-bulk-quantity-pricing

Code Review | Role Based Bulk Quantity Pricing

WordPress plugin Role Based Bulk Quantity Pricing scored10%from 54 tests.

About plugin

  • Plugin page: role-based-bulk-q...
  • Plugin version: 1.1.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: Jun 14, 2023
  • Latest release: Aug 14, 2023
  • Number of updates: 14
  • Update frequency: every 4.5 days
  • Top authors: kevinamorim (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /230 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/role-based-bulk-quantity-pricing/freemius/require.php+16
    require_once(wp-content/plugins/role-based-bulk-quantity-pricing/freemius/includes/fs-html-escaping-functions.php): failed to open stream: No such file or directory

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.42ms] Passed 4 tests

This is a short check of server-side resources used by Role Based Bulk Quantity Pricing
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.39 ▼5.54
Dashboard /wp-admin3.31 ▲0.0067.75 ▲17.71
Posts /wp-admin/edit.php3.36 ▲0.0052.68 ▼0.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.34 ▼16.62
Media Library /wp-admin/upload.php3.23 ▲0.0034.57 ▼11.07

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 209 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
fs_active_plugins
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
fs_debug_mode
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Role Based Bulk Quantity Pricing
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.47 ▲0.092.05 ▼0.3039.69 ▼3.21
Dashboard /wp-admin2,206 ▲215.83 ▼0.03101.07 ▲0.0039.31 ▼2.71
Posts /wp-admin/edit.php2,092 ▼02.06 ▲0.0439.99 ▲0.5335.64 ▼1.85
Add New Post /wp-admin/post-new.php1,537 ▲2323.15 ▲5.66668.51 ▼46.9653.35 ▼18.58
Media Library /wp-admin/upload.php1,391 ▲34.18 ▲0.0299.13 ▼12.8646.80 ▲1.52

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

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

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
Even though no errors were found, 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 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed: Please take inspiration from this readme.txt

role-based-bulk-quantity-pricing/role-based-bulk-quantity-pricing.php Passed 13 tests

The main PHP file in "Role Based Bulk Quantity Pricing" ver. 1.1.7 adds more information about the plugin and also serves as the entry point for this plugin
70 characters long description:
Use a CSV file to set bulk quantity pricing by roles, for WooCommerce.

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 detected35,434 lines of code in 160 files:
LanguageFilesBlank linesComment linesLines of code
PHP1348,38717,29434,507
JavaScript510766471
Markdown1680214
PO File15161151
CSS187790
SVG1001

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity72.53
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.44
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes64
▷ Abstract classes46.25%
▷ Concrete classes6093.75%
▷ Final classes00.00%
Methods1,359
▷ Static methods20014.72%
▷ Public methods95770.42%
▷ Protected methods181.32%
▷ Private methods38428.26%
Functions103
▷ Named functions103100.00%
▷ Anonymous functions00.00%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.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.44MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png196.13KB43.38KB▼ 77.88%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/img/logo.png8.77KB4.33KB▼ 50.60%
assets/screenshot-2.png218.82KB54.11KB▼ 75.27%