67% elex-reachship-multi-carrier-conditional-shipping

Code Review | ReachShip WooCommerce Multi-Carrier & Conditional Shipping

WordPress plugin ReachShip WooCommerce Multi-Carrier & Conditional Shipping scored67%from 54 tests.

About plugin

  • Plugin page: elex-reachship-mu...
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-6.4
  • WordPress version: 6.3.1
  • First release: Apr 27, 2023
  • Latest release: Nov 28, 2023
  • Number of updates: 9
  • Update frequency: every 24.1 days
  • Top authors: elextensions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /525 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

An overview of server-side resources used by ReachShip WooCommerce Multi-Carrier & Conditional Shipping
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.36 ▼4.13
Dashboard /wp-admin3.31 ▲0.0047.09 ▼8.03
Posts /wp-admin/edit.php3.36 ▲0.0059.63 ▼1.68
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.87 ▼15.72
Media Library /wp-admin/upload.php3.24 ▲0.0035.21 ▼0.59

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 503 new files
Database: 4 new tables, 10 new options
New tables
wp_reachship_auto_label_generation_shipments
wp_reachship_shipments
wp_reachship_shipment_meta
wp_reachship_bulk_shipment_labels
New WordPress options
elex-reachship-multi-carrier-conditional-shipping/elex-reachship-multi-carrier-conditional-shipping.php_activation_date
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
reachship_db_migrate_auspost_service_run_only_once
elex_reachship_onboarding_complete
widget_recent-comments
reachship_db_migrate_onboarding_flow_run_only_once

Browser metrics Passed 4 tests

A check of browser resources used by ReachShip WooCommerce Multi-Carrier & Conditional Shipping
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5314.25 ▼0.101.96 ▲0.3236.49 ▼1.57
Dashboard /wp-admin2,198 ▲175.62 ▼0.1297.43 ▼7.0542.03 ▲1.04
Posts /wp-admin/edit.php2,100 ▼31.97 ▲0.0139.29 ▼6.4536.99 ▼3.92
Add New Post /wp-admin/post-new.php1,526 ▼623.34 ▲0.30687.65 ▲58.9958.13 ▲13.28
Media Library /wp-admin/upload.php1,394 ▼64.19 ▼0.0997.42 ▲0.1643.47 ▲2.35

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% 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
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_reachship_shipment_meta
    • wp_reachship_auto_label_generation_shipments
    • wp_reachship_shipments
    • wp_reachship_bulk_shipment_labels
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • reachship_db_migrate_auspost_service_run_only_once
    • widget_theysaidso_widget
    • can_compress_scripts
    • elex_reachship_onboarding_complete
    • widget_recent-posts
    • reachship_db_migrate_onboarding_flow_run_only_once
    • widget_recent-comments
    • theysaidso_admin_options
    • elex-reachship-multi-carrier-conditional-shipping/elex-reachship-multi-carrier-conditional-shipping.php_activation_date
    • db_upgraded

Smoke tests 50% 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 0% 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× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/includes/review/review_and_troubleshoot_notify/resources/logo.php
    • > /wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/setasign/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/setasign/fpdf/tutorial/tuto1.php
    • > /wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/setasign/fpdf/tutorial/tuto4.php
    • > /wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/setasign/fpdf/tutorial/tuto7.php
    • > /wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/setasign/fpdf/tutorial/tuto6.php
    • > /wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/setasign/fpdf/tutorial/tuto5.php
    • > /wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/setasign/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/setasign/fpdf/tutorial/tuto2.php
  • 87× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/setasign/fpdi/src/PdfParser/Type/PdfHexString.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'WpOrg\\Requests\\Auth' not found in wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/rmccue/requests/src/Auth/Basic.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\PdfParserException' not found in wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReferenceException.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WpFluent\\QueryBuilder\\Adapters\\BaseAdapter' not found in wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/wp-fluent/src/QueryBuilder/Adapters/Mysql.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\FpdiException' not found in wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/setasign/fpdi/src/PdfReader/PdfReaderException.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/rmccue/requests/src/Exception/Http/Status418.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Utility\\CaseInsensitiveDictionary' not found in wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/rmccue/requests/src/Response/Headers.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/rmccue/requests/src/Exception/Http/Status428.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WpOrg\\Requests\\Exception\\Http' not found in wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/rmccue/requests/src/Exception/Http/Status412.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'WpOrg\\Requests\\Transport' not found in wp-content/plugins/elex-reachship-multi-carrier-conditional-shipping/vendor/rmccue/requests/src/Transport/Curl.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Invalid URI found ("")
The official readme.txt is a good inspiration

elex-reachship-multi-carrier-conditional-shipping/elex-reachship-multi-carrier-conditional-shipping.php 77% from 13 tests

"ReachShip WooCommerce Multi-Carrier & Conditional Shipping" version 2.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: Please don't use more than 140 characters for the plugin description (currently 187 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "2.6.0")

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
Everything looks great! No dangerous files found in this plugin35,673 lines of code in 441 files:
LanguageFilesBlank linesComment linesLines of code
PHP3055,68415,73029,276
HTML597203,257
Markdown2574302,431
JSON600495
JavaScript39192182
CSS70032

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity16.33
▷ Minimum class complexity1.00
▷ Maximum class complexity342.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity100.00
Code structure
Namespaces38
Interfaces7
Traits2
Classes246
▷ Abstract classes31.22%
▷ Concrete classes24398.78%
▷ Final classes4518.52%
Methods1,705
▷ Static methods1438.39%
▷ Public methods1,56891.96%
▷ Protected methods1227.16%
▷ Private methods150.88%
Functions65
▷ Named functions2741.54%
▷ Anonymous functions3858.46%
Constants76
▷ Global constants56.58%
▷ Class constants7193.42%
▷ Public constants71100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
react/build/images/illustration-onboard.5831d806.png25.26KB8.37KB▼ 66.86%
react/build/images/reachship-logo.cfee0919.png4.38KB4.61KB0.00%
react/build/images/flags.99f63ae7.png27.46KB29.21KB0.00%
vendor/setasign/fpdf/tutorial/logo.png2.32KB2.26KB▼ 2.57%