84% prices-by-roles-for-woocommerce

Code Review | Prices by role for Woocommerce

WordPress plugin Prices by role for Woocommerce scored 84% from 54 tests.

About plugin

  • Plugin page: prices-by-roles-f...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.8
  • WordPress version: 6.3.1
  • First release: Jun 23, 2017
  • Latest release: Jun 23, 2017
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: mespinoza (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 576 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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.00ms] Passed 4 tests

This is a short check of server-side resources used by Prices by role for Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.10 ▼9.60
Dashboard /wp-admin3.33 ▲0.0246.17 ▼0.94
Posts /wp-admin/edit.php3.38 ▲0.0251.01 ▲3.45
Add New Post /wp-admin/post-new.php5.91 ▲0.0286.70 ▲3.19
Media Library /wp-admin/upload.php3.25 ▲0.0233.09 ▼0.64

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Prices by role for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▼0.151.73 ▼0.1436.09 ▼13.60
Dashboard /wp-admin2,206 ▲185.78 ▲0.89100.12 ▼12.0340.89 ▼6.97
Posts /wp-admin/edit.php2,089 ▼31.97 ▼0.0436.26 ▼11.4529.81 ▼16.61
Add New Post /wp-admin/post-new.php1,533 ▼023.09 ▲0.04640.06 ▼37.8669.99 ▲12.33
Media Library /wp-admin/upload.php1,388 ▼04.31 ▲0.1296.25 ▼4.6843.97 ▼0.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/prices-by-roles-for-woocommerce/mrec_prices_by_roles.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: discounts by role, wholesaler, prices by roles, discount, woocommerce

prices-by-roles-for-woocommerce/mrec_prices_by_roles.php 85% from 13 tests

The main file in "Prices by role for Woocommerce" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("prices-by-roles-for-woocommerce.php" instead of "mrec_prices_by_roles.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected87 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1163487

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants0
▷ Global constants00.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
No PNG files were detected