78% pluginops-advanced-shipping

Code Review | WooCommerce Advanced Shipping

WordPress plugin WooCommerce Advanced Shipping scored 78% from 54 tests.

About plugin

  • Plugin page: pluginops-advance...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.4
  • WordPress version: 6.3.1
  • First release: Jun 26, 2020
  • Latest release: Jun 26, 2020
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: umarbajwa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 593 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.86ms] Passed 4 tests

A check of server-side resources used by WooCommerce Advanced Shipping
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.82 ▼2.18
Dashboard /wp-admin3.33 ▲0.0244.43 ▼6.69
Posts /wp-admin/edit.php3.38 ▲0.0248.55 ▼0.41
Add New Post /wp-admin/post-new.php5.91 ▲0.0293.04 ▼2.16
Media Library /wp-admin/upload.php3.25 ▲0.0236.36 ▲2.26

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 1,962 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Advanced Shipping
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.29 ▼1.014.59 ▲2.8343.18 ▼2.55
Dashboard /wp-admin2,206 ▲184.86 ▲0.02109.09 ▲2.3437.90 ▼2.92
Posts /wp-admin/edit.php2,092 ▼02.01 ▲0.0241.94 ▲3.1035.13 ▲0.30
Add New Post /wp-admin/post-new.php1,537 ▲1823.20 ▼0.16694.68 ▲3.5253.05 ▼8.02
Media Library /wp-admin/upload.php1,382 ▼34.23 ▲0.07100.87 ▲2.0241.89 ▼2.65

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/pluginops-advanced-shipping/admin/views/settings/shipping-services.php
    • > /wp-content/plugins/pluginops-advanced-shipping/admin/views/settings/services/ups.php
    • > /wp-content/plugins/pluginops-advanced-shipping/admin/views/settings/services/fedex.php
    • > /wp-content/plugins/pluginops-advanced-shipping/admin/views/settings/services/usps.php
    • > /wp-content/plugins/pluginops-advanced-shipping/admin/views/settings/services/table-rate.php
    • > /wp-content/plugins/pluginops-advanced-shipping/admin/views/settings/services/flat-box.php
  • 1893× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'FedEx\\AbstractSimpleType' not found in wp-content/plugins/pluginops-advanced-shipping/includes/FedEx/OpenShipService/SimpleType/CompletedEtdType.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FedEx\\AbstractComplexType' not found in wp-content/plugins/pluginops-advanced-shipping/includes/FedEx/OpenShipService/ComplexType/ExportDetail.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'FedEx\\AbstractSimpleType' not found in wp-content/plugins/pluginops-advanced-shipping/includes/FedEx/CloseService/SimpleType/CloseWithDocumentsProcessingOptionType.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FedEx\\AbstractSimpleType' not found in wp-content/plugins/pluginops-advanced-shipping/includes/FedEx/RateService/SimpleType/BarcodeSymbologyType.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FedEx\\AbstractSimpleType' not found in wp-content/plugins/pluginops-advanced-shipping/includes/FedEx/TrackService/SimpleType/TrackReturnLabelType.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FedEx\\AbstractComplexType' not found in wp-content/plugins/pluginops-advanced-shipping/includes/FedEx/ShipService/ComplexType/CustomLabelGraphicEntry.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FedEx\\AbstractComplexType' not found in wp-content/plugins/pluginops-advanced-shipping/includes/FedEx/OpenShipService/ComplexType/Tax.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FedEx\\AbstractComplexType' not found in wp-content/plugins/pluginops-advanced-shipping/includes/FedEx/ShipService/ComplexType/ExportDeclarationDetail.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'FedEx\\AbstractSimpleType' not found in wp-content/plugins/pluginops-advanced-shipping/includes/FedEx/OpenShipService/SimpleType/CustomerSpecifiedLabelGenerationOptionType.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FedEx\\AbstractComplexType' not found in wp-content/plugins/pluginops-advanced-shipping/includes/FedEx/PickupService/ComplexType/SpecialEquipmentLineItem.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

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
3 plugin tags: fedex, woocommerce, usps

pluginops-advanced-shipping/pluginops-advanced-shipping.php 85% from 13 tests

The main PHP file in "WooCommerce Advanced Shipping" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Git Repository: There should be no Git repositories present in your plugin
  • Description: Please keep the plugin description shorter than 140 characters (currently 164 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin50,711 lines of code in 1,939 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,93212,06259,57048,433
XML2001,496
JavaScript38172464
CSS2274318

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 118)
Cyclomatic complexity
Average complexity per logical line of code0.03
Average class complexity1.29
▷ Minimum class complexity1.00
▷ Maximum class complexity121.00
Average method complexity1.09
▷ Minimum method complexity1.00
▷ Maximum method complexity118.00
Code structure
Namespaces58
Interfaces4
Traits0
Classes1,920
▷ Abstract classes40.21%
▷ Concrete classes1,91699.79%
▷ Final classes00.00%
Methods5,666
▷ Static methods250.44%
▷ Public methods5,62599.28%
▷ Protected methods270.48%
▷ Private methods140.25%
Functions11
▷ Named functions00.00%
▷ Anonymous functions11100.00%
Constants4,732
▷ Global constants10.02%
▷ Class constants4,73199.98%
▷ Public constants4,731100.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
2 PNG files occupy 0.37MB with 0.24MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/shipping-icon.png309.82KB99.85KB▼ 67.77%
admin/images/save-help-text.png73.90KB30.69KB▼ 58.47%