90% price-by-user-role-for-woocommerce

Code Review | Product Prices by User Roles for WooCommerce

WordPress plugin Product Prices by User Roles for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: price-by-user-rol...
  • Plugin version: 1.7.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2
  • WordPress version: 6.3.1
  • First release: Jan 25, 2017
  • Latest release: Jul 18, 2023
  • Number of updates: 34
  • Update frequency: every 69.5 days
  • Top authors: tychesoftwares (70.59%)algoritmika (32.35%)

Code review

54 tests

User reviews

10 reviews

Install metrics

2,000+ active /36,168 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
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.71ms] Passed 4 tests

An overview of server-side resources used by Product Prices by User Roles for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /59.30 ▲55.7911,585,500.44 ▲11,585,456.68
Dashboard /wp-admin3.37 ▲0.0257.51 ▲1.38
Posts /wp-admin/edit.php3.48 ▲0.0853.43 ▼3.82
Add New Post /wp-admin/post-new.php5.95 ▲0.0290.21 ▼17.93
Media Library /wp-admin/upload.php3.29 ▲0.0242.84 ▲5.53

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Prices by User Roles for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.17 ▼0.392.01 ▲0.4146.19 ▲5.73
Dashboard /wp-admin2,198 ▲185.62 ▼0.0393.70 ▲5.2442.86 ▲0.29
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0535.87 ▼4.0333.68 ▼1.21
Add New Post /wp-admin/post-new.php1,531 ▲522.94 ▼0.10671.36 ▼8.2056.84 ▼3.09
Media Library /wp-admin/upload.php1,403 ▲34.31 ▲0.1897.27 ▼9.9142.56 ▼5.91

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

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

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: woocommerce, price by user role, user role, role based pricing

price-by-user-role-for-woocommerce/price-by-user-role-for-woocommerce.php 92% from 13 tests

The primary PHP file in "Product Prices by User Roles for WooCommerce" version 1.7.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Requires PHP: Required version must match the one declared in readme.txt ("7.3" instead of "5.6")

Code Analysis Passed 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 detected1,517 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP101786211,266
JavaScript4517251

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity22.12
▷ Minimum class complexity1.00
▷ Maximum class complexity83.00
Average method complexity4.45
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods49
▷ Static methods12.04%
▷ Public methods49100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin