84% shipping-method-for-hermes-germany-and-wc

Code Review | Shipping Method for Hermes Germany and WooCommerce

WordPress plugin Shipping Method for Hermes Germany and WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: shipping-method-f...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.0
  • WordPress version: 6.3.1
  • First release: Jul 27, 2020
  • Latest release: Jul 23, 2022
  • Number of updates: 10
  • Update frequency: every 72.6 days
  • Top authors: waseem_senjer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 979 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

A check of server-side resources used by Shipping Method for Hermes Germany and WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.83 ▼2.45
Dashboard /wp-admin3.31 ▲0.0043.77 ▼3.75
Posts /wp-admin/edit.php3.36 ▲0.0047.85 ▼0.80
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.14 ▼2.67
Media Library /wp-admin/upload.php3.23 ▲0.0038.21 ▲0.70

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 91 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Shipping Method for Hermes Germany and WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.22 ▼1.374.84 ▲3.1142.84 ▼5.61
Dashboard /wp-admin2,206 ▲154.88 ▼0.14122.10 ▲20.7244.87 ▲0.55
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0338.88 ▲2.5335.16 ▲2.44
Add New Post /wp-admin/post-new.php1,544 ▲218.12 ▼0.37577.41 ▼33.8849.70 ▼5.74
Media Library /wp-admin/upload.php1,388 ▲34.21 ▲0.0293.96 ▼2.7142.07 ▼0.81

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 39× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'WPRuby\\Hermes\\DVDoug\\BoxPacker\\Item' not found in wp-content/plugins/shipping-method-for-hermes-germany-and-wc/includes/class-wpruby-hermes-item.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WPRuby\\Hermes\\DVDoug\\BoxPacker\\Test\\TestItem' not found in wp-content/plugins/shipping-method-for-hermes-germany-and-wc/vendor/dvdoug/boxpacker/tests/Test/ConstrainedTestItem.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'WPRuby\\Hermes\\Psr\\Log\\LoggerAwareInterface' not found in wp-content/plugins/shipping-method-for-hermes-germany-and-wc/vendor/dvdoug/boxpacker/src/OrientatedItemSorter.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WPRuby\\Hermes\\DVDoug\\BoxPacker\oBoxesAvailableException' not found in wp-content/plugins/shipping-method-for-hermes-germany-and-wc/vendor/dvdoug/boxpacker/src/ItemTooLargeException.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/shipping-method-for-hermes-germany-and-wc/includes/class-wpruby-hermes-calculate-shipping-price.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'WPRuby\\Hermes\\Psr\\Log\\LoggerAwareInterface' not found in wp-content/plugins/shipping-method-for-hermes-germany-and-wc/vendor/dvdoug/boxpacker/src/Packer.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/shipping-method-for-hermes-germany-and-wc/wpruby-hermes-shipping-for-woocommerce.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'WPRuby\\Hermes\\Psr\\Log\\LoggerInterface' not found in wp-content/plugins/shipping-method-for-hermes-germany-and-wc/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WPRuby\\Hermes\\DVDoug\\BoxPacker\\Test\\TestItem' not found in wp-content/plugins/shipping-method-for-hermes-germany-and-wc/vendor/dvdoug/boxpacker/tests/Test/TestConstrainedTestItem.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'WPRuby\\Hermes\\DVDoug\\BoxPacker\\Item' not found in wp-content/plugins/shipping-method-for-hermes-germany-and-wc/vendor/dvdoug/boxpacker/src/ConstrainedPlacementItem.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: germany, admin, shipping method, woocommerce, woocommerce extension...

shipping-method-for-hermes-germany-and-wc/wpruby-hermes-shipping-for-woocommerce.php 85% from 13 tests

The entry point to "Shipping Method for Hermes Germany and WooCommerce" version 1.0.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "3.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("shipping-method-for-hermes-germany-and-wc.php" instead of "wpruby-hermes-shipping-for-woocommerce.php")

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
Success! There were no dangerous files found in this plugin5,301 lines of code in 82 files:
LanguageFilesBlank linesComment linesLines of code
PHP651,0192,6144,441
JSON100335
Cucumber2200148
reStructuredText788183136
YAML391102
PO File1344081
Python1399240
XML13016
INI1002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity5.85
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces6
Traits2
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods366
▷ Static methods123.28%
▷ Public methods33691.80%
▷ Protected methods51.37%
▷ Private methods256.83%
Functions16
▷ Named functions16.25%
▷ Anonymous functions1593.75%
Constants9
▷ Global constants111.11%
▷ Class constants888.89%
▷ Public constants8100.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
No PNG images were found in this plugin