78% octolize-royal-mail-shipping

Code Review | Shipping Live Rates for Royal Mail for WooCommerce

WordPress plugin Shipping Live Rates for Royal Mail for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: octolize-royal-ma...
  • Plugin version: 1.3.15
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Jul 4, 2022
  • Latest release: Nov 7, 2023
  • Number of updates: 57
  • Update frequency: every 8.7 days
  • Top authors: octolize (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,941 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.63MB] [CPU: ▼0.22ms] Passed 4 tests

Server-side resources used by Shipping Live Rates for Royal Mail for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6449.66 ▲7.37
Dashboard /wp-admin3.94 ▲0.6351.06 ▼1.76
Posts /wp-admin/edit.php3.99 ▲0.6349.55 ▲0.60
Add New Post /wp-admin/post-new.php6.52 ▲0.6389.98 ▼5.76
Media Library /wp-admin/upload.php3.86 ▲0.6341.18 ▲6.06

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 1,152 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
wpdesk_requirements_plugins_data
can_compress_scripts
plugin_activation_octolize-royal-mail-shipping/octolize-royal-mail-shipping.php

Browser metrics Passed 4 tests

A check of browser resources used by Shipping Live Rates for Royal Mail for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3314.67 ▲0.391.68 ▼0.1143.31 ▼0.40
Dashboard /wp-admin2,197 ▲165.62 ▼0.0790.99 ▼15.1938.56 ▼6.16
Posts /wp-admin/edit.php2,105 ▲21.94 ▼0.0239.79 ▼2.1136.19 ▲3.73
Add New Post /wp-admin/post-new.php1,531 ▲523.20 ▲0.00683.10 ▲72.8251.08 ▲0.17
Media Library /wp-admin/upload.php1,408 ▲54.13 ▼0.0594.28 ▼5.7541.30 ▼7.24

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • db_upgraded
    • can_compress_scripts
    • plugin_activation_octolize-royal-mail-shipping/octolize-royal-mail-shipping.php
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • wpdesk_requirements_plugins_data
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-custom-origin.php
    • > /wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/octolize/wp-royal-mail-shipping-method/src/WooCommerceShipping/RoyalMail/view/shipping-method-script.php
    • > /wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-fallback.php
    • > /wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-free-shipping.php
    • > /wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-custom-services.php
  • 512× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingRoyalMailVendor\\WPDesk\\WooCommerceShipping\\CustomFields\\CustomField' not found in wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/CustomFields/ApiStatus/FieldApiStatus.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingRoyalMailVendor\\WPDesk\\Persistence\\PersistentContainer' not found in wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/wpdesk/wp-persistence/src/Adapter/ArrayContainer.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingRoyalMailVendor\\Symfony\\Contracts\\Translation\\TranslatorInterface' not found in wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/symfony/translation/IdentityTranslator.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingRoyalMailVendor\\Symfony\\Component\\Console\\Input\\ArgvInput' not found in wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/symfony/console/Input/StringInput.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingRoyalMailVendor\\Symfony\\Component\\DomCrawler\\AbstractUriElement' not found in wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/symfony/dom-crawler/Image.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingRoyalMailVendor\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/monolog/monolog/src/Monolog/Handler/RedisHandler.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingRoyalMailVendor\\Symfony\\Component\\Console\\Command\\Command' not found in wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/symfony/console/Command/LazyCommand.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingRoyalMailVendor\\RoyalMailPriceCalculator\\Services\\DomesticService' not found in wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/octolize/royal-mail-price-calculator/src/Services/SignedForSecondClassService.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingRoyalMailVendor\\Symfony\\Component\\Translation\\Provider\\AbstractProviderFactory' not found in wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/symfony/translation/Provider/NullProviderFactory.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingRoyalMailVendor\\RoyalMailPriceCalculator\\Services\\InternationalService' not found in wp-content/plugins/octolize-royal-mail-shipping/vendor_prefixed/octolize/royal-mail-price-calculator/src/Services/InternationalSigned.php:5

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)
There were no browser issues found

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
6 plugin tags: royal mail rates, royal mail live rates, royal mail woocommerce, royal mail, uk shipping...

octolize-royal-mail-shipping/octolize-royal-mail-shipping.php 85% from 13 tests

The principal PHP file in "Shipping Live Rates for Royal Mail for WooCommerce" v. 1.3.15 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • 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
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.5" instead of "5.8")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected55,029 lines of code in 1,092 files:
LanguageFilesBlank linesComment linesLines of code
PHP9352,17231,18650,790
JSON52002,407
YAML63131,299
JavaScript101931188
SVG2200179
CSS8252141
Markdown25025

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity9.65
▷ Minimum class complexity1.00
▷ Maximum class complexity299.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces187
Interfaces151
Traits29
Classes690
▷ Abstract classes426.09%
▷ Concrete classes64893.91%
▷ Final classes7211.11%
Methods4,333
▷ Static methods3347.71%
▷ Public methods3,34877.27%
▷ Protected methods3959.12%
▷ Private methods59013.62%
Functions313
▷ Named functions16452.40%
▷ Anonymous functions14947.60%
Constants494
▷ Global constants173.44%
▷ Class constants47796.56%
▷ Public constants39883.44%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.10MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.pl.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/flexibleshipping.com.png5.63KB3.68KB▼ 34.58%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/octolize.com.png88.91KB39.07KB▼ 56.06%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo@2x.png4.17KB4.47KB0.00%