68% sherpa-on-demand

Code Review | Sherpa Delivery for WooCommerce

WordPress plugin Sherpa Delivery for WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: sherpa-on-demand
  • Plugin version: 3.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 6.3.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 22, 2020
  • Latest release: Oct 3, 2023
  • Number of updates: 46
  • Update frequency: every 26.1 days
  • Top authors: sherpadelivery (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,597 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.26MB] [CPU: ▼0.18ms] Passed 4 tests

A check of server-side resources used by Sherpa Delivery for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2741.35 ▼0.54
Dashboard /wp-admin3.56 ▲0.2646.72 ▼2.23
Posts /wp-admin/edit.php3.68 ▲0.3247.17 ▼1.58
Add New Post /wp-admin/post-new.php6.14 ▲0.2690.35 ▲6.20
Media Library /wp-admin/upload.php3.48 ▲0.2636.58 ▲3.63

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 86 new files
Database: 1 new table, 7 new options
New tables
wp_sherpa_entity_options
New WordPress options
my_plugin_db_version
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sherpa Delivery for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.58 ▼1.001.69 ▼0.3838.15 ▼8.90
Dashboard /wp-admin2,213 ▲254.86 ▼1.0299.89 ▼2.1538.15 ▼1.61
Posts /wp-admin/edit.php2,092 ▲32.04 ▼0.0040.17 ▲1.2335.12 ▼5.63
Add New Post /wp-admin/post-new.php1,541 ▲2723.22 ▲5.40624.39 ▼34.9966.57 ▲10.94
Media Library /wp-admin/upload.php1,395 ▲74.20 ▲0.04102.91 ▼4.9943.27 ▼2.83

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-admin/includes/plugin.php+1242
    Constant WP_UNINSTALL_PLUGIN already defined
  • This plugin does not fully uninstall, leaving 7 options in the database
    • my_plugin_db_version
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/sherpa-on-demand/includes/Sherpa/Api/Endpoints/Deliveries.php
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Sherpa_Configurations' not found in wp-content/plugins/sherpa-on-demand/templates/adminhtml/services.php:51
    • > PHP Fatal error
      Uncaught Error: Class 'Sherpa_Configurations' not found in wp-content/plugins/sherpa-on-demand/templates/frontend/cart/shipping-sherpa.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Sherpa_Configurations' not found in wp-content/plugins/sherpa-on-demand/templates/adminhtml/html.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sherpa-on-demand/sherpa.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WC() in wp-content/plugins/sherpa-on-demand/includes/Sherpa/Sherpa.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Sherpa_Abstract' not found in wp-content/plugins/sherpa-on-demand/includes/Sherpa/Rate.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Sherpa_Abstract' not found in wp-content/plugins/sherpa-on-demand/includes/Sherpa/Quote.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sherpa-on-demand/templates/adminhtml/shipping-services.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Sherpa_Varien_Io_Abstract' not found in wp-content/plugins/sherpa-on-demand/includes/Sherpa/Varien/Io/File.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Sherpa_Api_Abstract' not found in wp-content/plugins/sherpa-on-demand/includes/Sherpa/Api/Request.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 23 tag instead of maximum 10
You can look at the official readme.txt

sherpa-on-demand/sherpa.php 85% from 13 tests

The main file in "Sherpa Delivery for WooCommerce" v. 3.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sherpa-on-demand.php" instead of "sherpa.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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected14,686 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
CSS91,8021156,416
PHP341,2961,3925,958
JavaScript71301301,416
SVG100655
Sass1483241

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.45
Average class complexity33.13
▷ Minimum class complexity1.00
▷ Maximum class complexity231.00
Average method complexity4.40
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes23
▷ Abstract classes313.04%
▷ Concrete classes2086.96%
▷ Final classes00.00%
Methods211
▷ Static methods125.69%
▷ Public methods17482.46%
▷ Protected methods2511.85%
▷ Private methods125.69%
Functions12
▷ Named functions541.67%
▷ Anonymous functions758.33%
Constants56
▷ Global constants1526.79%
▷ Class constants4173.21%
▷ Public constants41100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
17 PNG files occupy 0.21MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/sherpa_van.png192.52KB60.98KB▼ 68.33%
assets/images/help.png1.58KB0.78KB▼ 50.34%
assets/css/images/icon-cal.png0.36KB0.34KB▼ 6.25%
assets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.31KB0.18KB▼ 42.95%
assets/css/images/ui-bg_glass_75_e6e6e6_1x400.png0.29KB0.15KB▼ 49.83%