89% user-role-based-shipping-method

Code Review | User role based shipping methods

WordPress plugin User role based shipping methods scored89%from 54 tests.

About plugin

  • Plugin page: user-role-based-s...
  • Plugin version: 2.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 19, 2018
  • Latest release: Sep 12, 2023
  • Number of updates: 29
  • Update frequency: every 62.7 days
  • Top authors: pluginvallies (82.76%)techsarai (20.69%)

Code review

54 tests

User reviews

8 reviews

Install metrics

700+ active /6,884 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
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by User role based shipping methods
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.62 ▲1.27
Dashboard /wp-admin3.31 ▲0.0053.15 ▲5.10
Posts /wp-admin/edit.php3.36 ▲0.0052.64 ▲2.60
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.36 ▼13.44
Media Library /wp-admin/upload.php3.23 ▲0.0036.83 ▲1.77

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by User role based shipping methods
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5414.40 ▲0.012.03 ▼0.0847.06 ▲1.05
Dashboard /wp-admin2,206 ▲185.79 ▲0.88104.45 ▼2.2842.28 ▼3.76
Posts /wp-admin/edit.php2,086 ▼62.05 ▼0.0040.83 ▼3.5731.86 ▼1.31
Add New Post /wp-admin/post-new.php1,537 ▲2323.10 ▲5.71647.19 ▲2.9565.34 ▲13.03
Media Library /wp-admin/upload.php1,388 ▲34.21 ▼0.01107.59 ▼12.2643.02 ▼3.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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 a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Donate link: Invalid URI ("")
You can look at the official readme.txt

user-role-based-shipping-method/pvalley-user-role-based-shipping.php 85% from 13 tests

Analyzing the main PHP file in "User role based shipping methods" version 2.0.1
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("user-role-based-shipping-method.php" instead of "pvalley-user-role-based-shipping.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin418 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP871142418

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.54
Average class complexity9.57
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity3.61
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes457.14%
Methods23
▷ Static methods626.09%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants120.00%
▷ Class constants480.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin