77% elex-shipengine-shipping-method

Code Review | ELEX ShipEngine UPS & FedEx Shipping Method

WordPress plugin ELEX ShipEngine UPS & FedEx Shipping Method scored77%from 54 tests.

About plugin

  • Plugin page: elex-shipengine-s...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-6.2
  • WordPress version: 6.3.1
  • First release: Sep 14, 2021
  • Latest release: Jul 3, 2023
  • Number of updates: 19
  • Update frequency: every 34.8 days
  • Top authors: elextensions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,691 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.81ms] Passed 4 tests

An overview of server-side resources used by ELEX ShipEngine UPS & FedEx Shipping Method
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0243.36 ▲0.11
Dashboard /wp-admin3.33 ▼0.0254.31 ▼13.31
Posts /wp-admin/edit.php3.38 ▲0.0250.31 ▼1.63
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.01 ▼20.42
Media Library /wp-admin/upload.php3.26 ▲0.0238.96 ▲0.49

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for ELEX ShipEngine UPS & FedEx Shipping Method
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.15 ▼0.131.86 ▲0.2045.69 ▲4.91
Dashboard /wp-admin2,201 ▲275.59 ▲0.0296.64 ▲2.0041.02 ▼0.33
Posts /wp-admin/edit.php2,107 ▲42.02 ▲0.0241.64 ▲3.8436.98 ▼1.06
Add New Post /wp-admin/post-new.php1,532 ▲423.05 ▼0.05653.48 ▼34.0154.68 ▼3.41
Media Library /wp-admin/upload.php1,409 ▲94.18 ▲0.0597.21 ▼16.3242.68 ▼3.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/elex-shipengine-shipping-method/review_and_troubleshoot_notify/resources/logo.php
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/elex-shipengine-shipping-method/includes/market.php:49
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/elex-shipengine-shipping-method/includes/class-wf-shipping-shipengine.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/elex-shipengine-shipping-method/includes/html-wf-services.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/elex-shipengine-shipping-method/review_and_troubleshoot_notify/resources/troubleshoot.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/elex-shipengine-shipping-method/review_and_troubleshoot_notify/resources/review.php:58

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Screenshot #3 (Domestic Rates) image missing
  • Donate link: Invalid URI ("")
The official readme.txt might help

elex-shipengine-shipping-method/shipengine-woocommerce-shipping.php 85% from 13 tests

This is the main PHP file of "ELEX ShipEngine UPS & FedEx Shipping Method" version 1.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Requires at least: Required version must match the one declared in readme.txt ("3.0.1" instead of "2.6.0")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("elex-shipengine-shipping-method.php" instead of "shipengine-woocommerce-shipping.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin11,498 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
CSS21,746279,496
PHP142591951,914
JavaScript212388

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity30.29
▷ Minimum class complexity2.00
▷ Maximum class complexity155.00
Average method complexity5.18
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods49
▷ Static methods48.16%
▷ Public methods3979.59%
▷ Protected methods00.00%
▷ Private methods1020.41%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.94MB with 0.70MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/dhl.png75.26KB17.95KB▼ 76.15%
resources/images/prod-logos.png138.04KB37.87KB▼ 72.57%
resources/images/address_validation.png93.76KB25.80KB▼ 72.48%
resources/images/australia_post.png82.67KB20.31KB▼ 75.44%
resources/images/hide_shipping_method.png81.41KB18.67KB▼ 77.06%