78% wc-shipping-option-by-user-role

Code Review | WC Shipping Option by User Role

WordPress plugin WC Shipping Option by User Role scored78%from 54 tests.

About plugin

  • Plugin page: wc-shipping-optio...
  • Plugin version: 1.0.0
  • PHP compatiblity: 6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.3
  • WordPress version: 6.3.1
  • First release: Jul 24, 2018
  • Latest release: Oct 31, 2022
  • Number of updates: 6
  • Update frequency: every 260.0 days
  • Top authors: deepintowp (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /1,119 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
This plugin's installer ran successfully

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

An overview of server-side resources used by WC Shipping Option by User Role
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.73 ▼3.54
Dashboard /wp-admin3.32 ▼0.0352.64 ▼16.27
Posts /wp-admin/edit.php3.37 ▲0.0150.78 ▼1.00
Add New Post /wp-admin/post-new.php5.90 ▲0.0198.17 ▼7.04
Media Library /wp-admin/upload.php3.24 ▲0.0135.64 ▲0.99

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WC Shipping Option by User Role
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.71 ▲0.061.95 ▼0.0141.14 ▼4.32
Dashboard /wp-admin2,198 ▲215.62 ▲0.0591.20 ▼8.0041.66 ▼2.78
Posts /wp-admin/edit.php2,103 ▲32.04 ▲0.0339.68 ▼0.4139.47 ▲2.28
Add New Post /wp-admin/post-new.php1,534 ▲618.28 ▼5.02722.66 ▲0.8665.43 ▲3.99
Media Library /wp-admin/upload.php1,400 ▲64.19 ▼0.10100.09 ▼9.2247.49 ▲2.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wc-shipping-option-by-user-role/wc-shipping-option-by-user-role.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wc-shipping-option-by-user-role/views/settings_page.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: woocommerce shipping, woocommerce user based shipping, shipping by user role

wc-shipping-option-by-user-role/wc-shipping-option-by-user-role.php 92% from 13 tests

Analyzing the main PHP file in "WC Shipping Option by User Role" version 1.0.0
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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 detected282 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP975130282

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity4.25
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
PNG images were not found in this plugin