83% shipping-label-generator-with-ups

Code Review | Shipping Label PDF Generator With UPS For Woocommerce

WordPress plugin Shipping Label PDF Generator With UPS For Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: shipping-label-ge...
  • Plugin version: 1.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 23, 2022
  • Latest release: Dec 27, 2022
  • Number of updates: 8
  • Update frequency: every 0.5 days
  • Top authors: saiful96 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /256 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.54MB] [CPU: ▼4.96ms] Passed 4 tests

Server-side resources used by Shipping Label PDF Generator With UPS For Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.02 ▲0.5637.20 ▼0.88
Dashboard /wp-admin3.87 ▲0.5247.81 ▼7.78
Posts /wp-admin/edit.php3.92 ▲0.5651.75 ▲6.50
Add New Post /wp-admin/post-new.php6.39 ▲0.5083.49 ▼17.53
Media Library /wp-admin/upload.php3.79 ▲0.5638.08 ▲6.36

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 365 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Shipping Label PDF Generator With UPS For Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9513.31 ▼1.095.03 ▲3.3541.73 ▲1.81
Dashboard /wp-admin2,219 ▲345.80 ▲0.86101.94 ▼10.3043.45 ▲2.40
Posts /wp-admin/edit.php2,105 ▲162.04 ▼0.0237.15 ▲0.7531.18 ▼2.70
Add New Post /wp-admin/post-new.php1,527 ▼617.47 ▼5.65703.22 ▲79.3059.94 ▲6.21
Media Library /wp-admin/upload.php1,404 ▲164.16 ▼0.0694.13 ▼4.8342.38 ▼0.27

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 134× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/shipping-label-generator-with-ups/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Ups\odeInterface' not found in wp-content/plugins/shipping-label-generator-with-ups/vendor/gabrielbull/ups-api/src/Entity/Pickup.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestFactoryInterface' not found in wp-content/plugins/shipping-label-generator-with-ups/vendor/guzzlehttp/psr7/src/HttpFactory.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Ups\odeInterface' not found in wp-content/plugins/shipping-label-generator-with-ups/vendor/gabrielbull/ups-api/src/Entity/ShipmentServiceOptions.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/shipping-label-generator-with-ups/vendor/guzzlehttp/promises/src/AggregateException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Ups\odeInterface' not found in wp-content/plugins/shipping-label-generator-with-ups/vendor/gabrielbull/ups-api/src/Entity/LabelMethod.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Ups\odeInterface' not found in wp-content/plugins/shipping-label-generator-with-ups/vendor/gabrielbull/ups-api/src/Entity/Tradeability/QueryRequest.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/shipping-label-generator-with-ups/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Trait 'Ups\\Entity\\ServiceSummaryTrait' not found in wp-content/plugins/shipping-label-generator-with-ups/vendor/gabrielbull/ups-api/src/Entity/ServiceSummary.php on line 5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/shipping-label-generator-with-ups/vendor/psr/http-message/src/ServerRequestInterface.php:43

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Add API\'s info to the settings field. Note: (Screenshots in the /assets/screenshot-1.png directory)), #2 (Add shipper information to the settings field. Note: (Screenshots in the /assets/screenshot-2.png directory)), #3 (You can find the pdf shipping label at orders list page. Note: (Screenshots in the /assets/screenshot-3.png directory))
You can look at the official readme.txt

shipping-label-generator-with-ups/shipping-label-generator-ups.php 85% from 13 tests

The main PHP script in "Shipping Label PDF Generator With UPS For Woocommerce" version 1.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("shipping-label-generator-with-ups.php" instead of "shipping-label-generator-ups.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "5.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected26,854 lines of code in 342 files:
LanguageFilesBlank linesComment linesLines of code
PHP3025,02812,01021,963
Markdown141,17303,537
JSON13001,026
XSD600277
YAML25038
make1409
XML4004

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity10.82
▷ Minimum class complexity1.00
▷ Maximum class complexity342.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity72.00
Code structure
Namespaces18
Interfaces31
Traits7
Classes237
▷ Abstract classes31.27%
▷ Concrete classes23498.73%
▷ Final classes3514.96%
Methods1,954
▷ Static methods1437.32%
▷ Public methods1,76390.23%
▷ Protected methods502.56%
▷ Private methods1417.22%
Functions126
▷ Named functions3426.98%
▷ Anonymous functions9273.02%
Constants423
▷ Global constants00.00%
▷ Class constants423100.00%
▷ Public constants41297.40%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.42MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png12.43KB5.12KB▼ 58.79%
assets/banner-772x250.png62.43KB23.32KB▼ 62.64%
(invalid) assets/banner-1544x500.png80.98KB0.00KB▼ 100.00%
assets/icon-128x128.png6.65KB2.75KB▼ 58.67%
assets/Screenshot-1.png58.84KB17.19KB▼ 70.79%