78% octolize-australia-post-shipping

Code Review | Shipping Live rates for Australia Post for WooCommerce

WordPress plugin Shipping Live rates for Australia Post for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: octolize-australi...
  • Plugin version: 1.5.12
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Jun 1, 2022
  • Latest release: Nov 7, 2023
  • Number of updates: 53
  • Update frequency: every 9.9 days
  • Top authors: octolize (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /3,085 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.84MB] [CPU: ▼6.42ms] Passed 4 tests

An overview of server-side resources used by Shipping Live rates for Australia Post for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.32 ▲0.8640.74 ▼2.38
Dashboard /wp-admin4.16 ▲0.8151.08 ▼14.02
Posts /wp-admin/edit.php4.27 ▲0.9155.77 ▲7.79
Add New Post /wp-admin/post-new.php6.74 ▲0.8589.33 ▼17.07
Media Library /wp-admin/upload.php4.08 ▲0.8545.98 ▲10.56

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 1,376 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
plugin_activation_octolize-australia-post-shipping/octolize-australia-post-shipping.php
wpdesk_requirements_plugins_data
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Shipping Live rates for Australia Post for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5813.95 ▼0.411.77 ▲0.0240.28 ▼2.61
Dashboard /wp-admin2,200 ▲235.57 ▼0.0390.85 ▼1.3439.09 ▼2.82
Posts /wp-admin/edit.php2,105 ▲21.95 ▼0.0840.32 ▲0.6936.40 ▼1.02
Add New Post /wp-admin/post-new.php1,531 ▲523.49 ▲0.33684.05 ▼0.4456.93 ▲1.69
Media Library /wp-admin/upload.php1,405 ▲24.19 ▼0.07100.01 ▲0.6441.82 ▼0.50

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • wpdesk_requirements_plugins_data
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • plugin_activation_octolize-australia-post-shipping/octolize-australia-post-shipping.php
    • widget_recent-comments
    • widget_theysaidso_widget
    • 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)
Good news, no errors were detected

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
Please fix the following
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-free-shipping.php
    • > /wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-fallback.php
    • > /wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/wpdesk/wp-australia-post-shipping-method/src/WooCommerceShipping/AustraliaPost/view/shipping-method-script.php
    • > /wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-custom-services.php
    • > /wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-custom-origin.php
  • 664× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingAustraliaPostVendor\\Http\\Client\\Common\\BatchClientInterface' not found in wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/php-http/client-common/src/BatchClient.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingAustraliaPostVendor\\Symfony\\Component\\HttpKernel\\DataCollector\\DataCollector' not found in wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/symfony/translation/DataCollector/TranslationDataCollector.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Stringable' not found in wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/symfony/string/LazyString.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingAustraliaPostVendor\\Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/symfony/translation/Dumper/PoFileDumper.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingAustraliaPostVendor\\Symfony\\Component\\Console\\Output\\StreamOutput' not found in wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/symfony/console/Output/ConsoleSectionOutput.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingAustraliaPostVendor\\Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/monolog/monolog/src/Monolog/Processor/TagProcessor.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingAustraliaPostVendor\\Http\\Client\\HttpClient' not found in wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/php-http/client-common/src/HttpMethodsClientInterface.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/wpdesk/wp-helpscout-beacon/src/Beacon/templates/html-beacon-script.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingAustraliaPostVendor\\WPDesk\\PluginBuilder\\Plugin\\Hookable' not found in wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/wpdesk/wp-wpdesk-rating-petition/src/RatingPetitionNotice.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingAustraliaPostVendor\\WPDesk\\AbstractShipping\\Rate\\ShipmentRating' not found in wp-content/plugins/octolize-australia-post-shipping/vendor_prefixed/wpdesk/abstract-shipping/src/AbstractShipping/Rate/ShipmentRatingImplementation.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
5 plugin tags: australia post, australia post shipping, australia post live rates, australia post rates, australia post woocommerce

octolize-australia-post-shipping/octolize-australia-post-shipping.php 92% from 13 tests

The main file in "Shipping Live rates for Australia Post for WooCommerce" v. 1.5.12 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Requires at least: Required version does 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 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected71,069 lines of code in 1,353 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,2452,80241,45267,379
JSON66003,157
JavaScript101931188
SVG2200179
CSS8252141
Markdown25025

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity9.32
▷ Minimum class complexity1.00
▷ Maximum class complexity299.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces248
Interfaces180
Traits41
Classes943
▷ Abstract classes444.67%
▷ Concrete classes89995.33%
▷ Final classes21023.36%
Methods5,699
▷ Static methods5189.09%
▷ Public methods4,47478.51%
▷ Protected methods4237.42%
▷ Private methods80214.07%
Functions505
▷ Named functions22945.35%
▷ Anonymous functions27654.65%
Constants706
▷ Global constants9613.60%
▷ Class constants61086.40%
▷ Public constants55490.82%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 0.12MB with 0.04MB 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.net.png2.36KB2.43KB0.00%
assets/images/beacon.png2.98KB1.76KB▼ 40.99%
assets/images/beacon-better-transparent.png9.82KB0.71KB▼ 92.75%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo@2x.png4.17KB4.47KB0.00%
assets/images/beacon-transparent.png2.13KB1.17KB▼ 45.35%