84% per-product-shipping-for-wc

Code Review | Per Product Shipping for WooCommerce

WordPress plugin Per Product Shipping for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: per-product-shipp...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.0
  • WordPress version: 6.3.1
  • First release: Mar 30, 2022
  • Latest release: Jul 23, 2022
  • Number of updates: 7
  • Update frequency: every 16.4 days
  • Top authors: waseem_senjer (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /659 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.08MB] [CPU: ▼7.93ms] Passed 4 tests

Server-side resources used by Per Product Shipping for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0949.97 ▲11.15
Dashboard /wp-admin3.38 ▲0.0845.14 ▼3.50
Posts /wp-admin/edit.php3.50 ▲0.1446.23 ▼11.07
Add New Post /wp-admin/post-new.php5.96 ▲0.0882.12 ▼13.41
Media Library /wp-admin/upload.php3.31 ▲0.0834.08 ▼3.73

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Per Product Shipping for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.171.77 ▲0.2541.06 ▲1.50
Dashboard /wp-admin2,195 ▲185.57 ▼0.0580.36 ▼21.8236.88 ▼6.79
Posts /wp-admin/edit.php2,100 ▼32.02 ▲0.0233.44 ▼4.6434.43 ▼0.34
Add New Post /wp-admin/post-new.php1,526 ▼1123.16 ▲0.16628.18 ▼66.3649.35 ▼3.13
Media Library /wp-admin/upload.php1,400 ▲34.18 ▼0.1095.15 ▼1.6443.34 ▼3.71

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Please fix the following items
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PerProduct\\Api\\Endpoints\\WPRPP_Abstract_Endpoint' not found in wp-content/plugins/per-product-shipping-for-wc/api/endpoints/class-wprpp-sort-rules-endpoint.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PerProduct\\Api\\Endpoints\\WPRPP_Abstract_Endpoint' not found in wp-content/plugins/per-product-shipping-for-wc/api/endpoints/class-wprpp-create-rule-endpoint.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/per-product-shipping-for-wc/core/class-wprpp-per-product-shipping-method.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PerProduct\\Api\\Endpoints\\WPRPP_Abstract_Endpoint' not found in wp-content/plugins/per-product-shipping-for-wc/api/endpoints/class-wprpp-search-products-endpoint.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function self_admin_url() in wp-content/plugins/per-product-shipping-for-wc/app/placeholder.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PerProduct\\Api\\Endpoints\\Errors\\WPRPP_Error' not found in wp-content/plugins/per-product-shipping-for-wc/api/endpoints/errors/class-wprpp-generic-error.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PerProduct\\Api\\Endpoints\\WPRPP_Abstract_Endpoint' not found in wp-content/plugins/per-product-shipping-for-wc/api/endpoints/class-wprpp-update-rule-endpoint.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PerProduct\\Api\\Endpoints\\WPRPP_Abstract_Endpoint' not found in wp-content/plugins/per-product-shipping-for-wc/api/endpoints/class-wprpp-delete-rule-endpoint.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PerProduct\\Api\\Endpoints\\WPRPP_Abstract_Endpoint' not found in wp-content/plugins/per-product-shipping-for-wc/api/endpoints/class-wprpp-load-rules-endpoint.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% 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
7 plugin tags: woocommerce extension, per product shipping, shipping method, woocommerce, admin...

per-product-shipping-for-wc/per-product-shipping-for-wc.php 85% from 13 tests

Analyzing the main PHP file in "Per Product Shipping for WooCommerce" version 1.0.1
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0.0" instead of "3.0")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin656 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP19232162651
JavaScript10174
CSS1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity4.31
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.98
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes16
▷ Abstract classes212.50%
▷ Concrete classes1487.50%
▷ Final classes00.00%
Methods57
▷ Static methods712.28%
▷ Public methods5189.47%
▷ Protected methods35.26%
▷ Private methods35.26%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected