78% wpc-price-by-user-role

Code Review | WPC Price by User Role for WooCommerce

WordPress plugin WPC Price by User Role for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: wpc-price-by-user...
  • Plugin version: 2.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 18, 2022
  • Latest release: Oct 1, 2023
  • Number of updates: 18
  • Update frequency: every 22.7 days
  • Top authors: wpclever (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,819 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.09ms] Passed 4 tests

This is a short check of server-side resources used by WPC Price by User Role for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0838.21 ▼1.43
Dashboard /wp-admin3.39 ▲0.0844.04 ▼5.57
Posts /wp-admin/edit.php3.50 ▲0.1446.30 ▲0.50
Add New Post /wp-admin/post-new.php5.99 ▲0.1083.23 ▼5.85
Media Library /wp-admin/upload.php3.31 ▲0.0835.62 ▲1.32
About /wp-admin/admin.php?page=wpclever3.2829.46
Essential Kit /wp-admin/admin.php?page=wpclever-kit3.2831.24

Server storage [IO: ▲0.12MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WPC Price by User Role for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,877 ▲14213.55 ▼0.831.69 ▼0.2742.87 ▲1.91
Dashboard /wp-admin2,280 ▲925.88 ▲0.9795.86 ▼7.7873.59 ▲29.58
Posts /wp-admin/edit.php2,166 ▲772.04 ▲0.0137.69 ▲1.8335.29 ▼1.49
Add New Post /wp-admin/post-new.php1,751 ▲21824.35 ▲1.29643.49 ▼41.3655.57 ▲3.42
Media Library /wp-admin/upload.php1,468 ▲804.28 ▲0.0898.35 ▼9.8371.81 ▲26.64
About /wp-admin/admin.php?page=wpclever1,3932.1229.7735.20
Essential Kit /wp-admin/admin.php?page=wpclever-kit5,7252.1633.8266.70

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wpc-price-by-user-role/wpc-price-by-user-role.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=wpclever-kit
    • > Network (severe)
    https://api.wpclever.net/images/wpc-attribute-groups.png - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 97% 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
Please fix the following attributes: Please take inspiration from this readme.txt

wpc-price-by-user-role/wpc-price-by-user-role.php Passed 13 tests

The main file in "WPC Price by User Role for WooCommerce" v. 2.0.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
99 characters long description:
WPC Price by User Role helps you configure discounts and adjust prices in bulk based on user roles.

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
Success! There were no dangerous files found in this plugin2,962 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
CSS42571491,264
PHP9184351,046
Sass1530366
JavaScript3443257
SVG10029

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity24.17
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods47
▷ Static methods1123.40%
▷ Public methods4697.87%
▷ Protected methods00.00%
▷ Private methods12.13%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants9
▷ Global constants9100.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
No PNG files were detected