10% smart-shipment-tracking

Code Review | Smart Shipment Tracking

WordPress plugin Smart Shipment Tracking scored 10% from 54 tests.

About plugin

  • Plugin page: smart-shipment-tr...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.4.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6.1
  • WordPress version: 5.8.1
  • First release: Mar 26, 2020
  • Latest release: Feb 20, 2021
  • Number of updates: 12
  • Update frequency: every 27.6 days
  • Top authors: triadmark (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 935 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/smart-shipment-tracking/includes/class-smart-shipment-tracking-install.php+83
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/smart-shipment-tracking/includes/class-smart-shipment-tracking-install.php:83
    Stack trace:
    #0 wp-content/plugins/smart-shipment-tracking/includes/class-smart-shipment-tracking-install.php(49): wfsxc_Install->shippment_tracking_install()
    #1 wp-content/plugins/smart-shipment-tracking/includes/class-smart-shipment-tracking-install.php(27): wfsxc_Install->init()
    #2 wp-content/plugins/smart-shipment-tracking/includes/class-smart-shipment-tracking-activator.php(11): wfsxc_Install->__construct()
    #3 wp-content/plugins/smart-shipment-tracking/smart-shipment-tracking.php(29): Tracking_Addon_Activator::activate()
    #4 wp-includes/class-wp-hook.php(303): wfsxc3dsa_activatewootracking()
    #5 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #6 wp-includes/plugin.php(470): WP_Hook->do_action()
    #7 /

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

Server-side resources used by Smart Shipment Tracking
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0025.45 ▼1.34
Dashboard /wp-admin3.06 ▼0.0033.27 ▼18.56
Posts /wp-admin/edit.php3.11 ▲0.0032.82 ▼1.58
Add New Post /wp-admin/post-new.php5.42 ▼0.0270.56 ▼589.76
Media Library /wp-admin/upload.php3.00 ▲0.0023.62 ▼0.48

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 317 new files
Database: 1 new table, 2 new options
New tables
wp_wfsxc_shippment_provider
New WordPress options
send_email
create_shipped_status

Browser metrics Passed 4 tests

Smart Shipment Tracking: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,676 ▲7515.59 ▼0.025.99 ▲0.0274.52 ▼17.08
Dashboard /wp-admin2,930 ▲316.16 ▼0.03116.28 ▼34.70167.04 ▼28.11
Posts /wp-admin/edit.php2,740 ▼03.24 ▲0.0161.78 ▼1.69139.44 ▼2.87
Add New Post /wp-admin/post-new.php3,735 ▼8118.54 ▼0.84438.68 ▲10.10163.07 ▼6.49
Media Library /wp-admin/upload.php1,752 ▼35.49 ▼0.04156.29 ▲9.59184.70 ▼2.87

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_wfsxc_shippment_provider
  • The uninstall procedure has failed, leaving 2 options in the database
    • send_email
    • create_shipped_status

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/smart-shipment-tracking/admin/emails/shipped-new-order.php
    • > /wp-content/plugins/smart-shipment-tracking/public/partials/plugin-name-public-display.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/smart-shipment-tracking/admin/partials/admin_options_addons.php on line 9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/smart-shipment-tracking/admin/partials/admin_options_settings_part.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_get() in wp-content/plugins/smart-shipment-tracking/admin/partials/woo-ship_admin_sidebar.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_get() in wp-content/plugins/smart-shipment-tracking/admin/partials/woo-ship_admin_sidebar.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/smart-shipment-tracking/admin/partials/admin_download_sample_sheet.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/smart-shipment-tracking/admin/partials/admin_options_settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/smart-shipment-tracking/admin/partials/admin_options_shipping_provider.php:12
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/smart-shipment-tracking/admin/partials/admin_options_addons.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/smart-shipment-tracking/admin/partials/woo-tracking-addon-admin-display.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/smart-shipment-tracking/admin/partials/admin_options_bulk_upload.php:6

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
Please take inspiration from this readme.txt

smart-shipment-tracking/smart-shipment-tracking.php 92% from 13 tests

The main PHP file in "Smart Shipment Tracking" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 172 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin12,838 lines of code in 63 files:
LanguageFilesBlank linesComment linesLines of code
PHP291,5502104,872
JavaScript266605074,439
CSS8121423,527

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity28.92
▷ Minimum class complexity1.00
▷ Maximum class complexity135.00
Average method complexity3.65
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods137
▷ Static methods107.30%
▷ Public methods13094.89%
▷ Protected methods00.00%
▷ Private methods75.11%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
242 PNG files occupy 3.24MB with 1.55MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/provider-img/malaysia-post.png3.46KB2.12KB▼ 38.70%
admin/provider-img/sicepat.png20.67KB2.27KB▼ 89.03%
admin/provider-img/shadowfax.png1.86KB1.13KB▼ 39.29%
admin/provider-img/spee-dee.png4.39KB3.22KB▼ 26.58%
admin/provider-img/laos-post.png3.51KB1.88KB▼ 46.33%