78% shipping-labels-for-woo

Code Review | WooCommerce Shipping Label

WordPress plugin WooCommerce Shipping Label scored78%from 54 tests.

About plugin

  • Plugin page: shipping-labels-f...
  • Plugin version: 2.3.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.6
  • WordPress version: 6.3.1
  • First release: Mar 15, 2016
  • Latest release: Feb 28, 2022
  • Number of updates: 86
  • Update frequency: every 25.3 days
  • Top authors: WooForce (40.7%)xadapter (26.74%)webtoffee (24.42%)mujeebur (11.63%)

Code review

54 tests

User reviews

11 reviews

Install metrics

1,000+ active /60,008 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by WooCommerce Shipping Label
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.15 ▲3.46
Dashboard /wp-admin3.31 ▲0.0048.53 ▲0.30
Posts /wp-admin/edit.php3.36 ▲0.0045.28 ▼0.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.46 ▼19.56
Media Library /wp-admin/upload.php3.23 ▲0.0033.11 ▼3.58

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 98 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Shipping Label
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.41 ▲0.091.69 ▲0.1141.98 ▼2.08
Dashboard /wp-admin2,192 ▲155.55 ▼0.0982.21 ▼5.1838.89 ▼0.03
Posts /wp-admin/edit.php2,097 ▼61.94 ▼0.1133.89 ▼3.1334.04 ▼0.67
Add New Post /wp-admin/post-new.php1,533 ▼423.30 ▲4.87667.95 ▲69.9653.58 ▼17.78
Media Library /wp-admin/upload.php1,400 ▼04.16 ▼0.0594.67 ▲0.6242.45 ▼3.81

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/shipping-labels-for-woo/wf-template/wf-4-6-template-footer-label.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/shipping-labels-for-woo/includes/wf_print_invoice_welcome.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shipping-labels-for-woo/includes/settings/generic_settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shipping-labels-for-woo/wf-template/wf-4-6-template-header-label.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_get() in wp-content/plugins/shipping-labels-for-woo/includes/settings/go-to-pdf-basic.php:3
    • > PHP Warning
      Use of undefined constant WT_PKL_SH_PLUGIN_URL - assumed 'WT_PKL_SH_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/shipping-labels-for-woo/includes/settings/go-to-pdf-basic.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/shipping-labels-for-woo/wf-template/wf-4-6-template-body-label.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/shipping-labels-for-woo/market.php:73

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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
9 plugin tags: pdf shipping label, print shipping label, print, slip, shipping...

shipping-labels-for-woo/wf-woocommerce-packing-list.php 92% from 13 tests

The primary PHP file in "WooCommerce Shipping Label" version 2.3.8 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("shipping-labels-for-woo.php" instead of "wf-woocommerce-packing-list.php")

Code Analysis Passed 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 detected26,841 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
CSS152336817,167
JavaScript151,0844423,727
PHP302903433,626
PO File34716721,116
SVG400986
Sass3120219

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity65.62
▷ Minimum class complexity4.00
▷ Maximum class complexity337.00
Average method complexity4.29
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods157
▷ Static methods74.46%
▷ Public methods11271.34%
▷ Protected methods3824.20%
▷ Private methods74.46%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/Label-print-icon.png0.74KB0.88KB0.00%
assets/images/icon-128x128.png62.47KB28.34KB▼ 54.64%
assets/images/webtoffee-logo_small.png4.04KB2.85KB▼ 29.40%
assets/images/pdf-icon.png1.66KB1.41KB▼ 15.05%