67% universal-package-systems-shipping-extension

Code Review | Universal Package Systems Shipping Extension

WordPress plugin Universal Package Systems Shipping Extension scored67%from 54 tests.

About plugin

  • Plugin page: universal-package...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.3
  • WordPress version: 6.3.1
  • First release: Feb 15, 2020
  • Latest release: Apr 28, 2020
  • Number of updates: 35
  • Update frequency: every 2.8 days
  • Top authors: icecappacino (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /514 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼2.67ms] Passed 4 tests

A check of server-side resources used by Universal Package Systems Shipping Extension
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3544.11 ▲0.43
Dashboard /wp-admin3.65 ▲0.3455.34 ▲1.85
Posts /wp-admin/edit.php3.70 ▲0.3455.07 ▼2.25
Add New Post /wp-admin/post-new.php6.19 ▲0.3098.11 ▼10.69
Media Library /wp-admin/upload.php3.51 ▲0.2842.20 ▲4.27

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 1,210 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Universal Package Systems Shipping Extension: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲14013.67 ▼0.688.72 ▲7.0441.91 ▼1.91
Dashboard /wp-admin2,196 ▲225.55 ▼0.0292.38 ▼6.5239.50 ▼8.43
Posts /wp-admin/edit.php2,104 ▲41.98 ▲0.0340.91 ▲2.9135.35 ▼1.46
Add New Post /wp-admin/post-new.php1,530 ▲223.41 ▲0.38697.34 ▼0.0559.47 ▲1.86
Media Library /wp-admin/upload.php1,404 ▲44.22 ▲0.04100.39 ▼18.5042.03 ▼9.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/universal-package-systems-shipping-extension/vendor/symfony/translation/Resources/bin/translation-status.php
    • > /wp-content/plugins/universal-package-systems-shipping-extension/admin/partials/wc-upackage_sys-shipping-admin-display.php
  • 164× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/universal-package-systems-shipping-extension/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Loader\\IcuResFileLoader' not found in wp-content/plugins/universal-package-systems-shipping-extension/vendor/symfony/translation/Loader/IcuDatFileLoader.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Discovery\\Exception' not found in wp-content/plugins/universal-package-systems-shipping-extension/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Discovery\\ClassDiscovery' not found in wp-content/plugins/universal-package-systems-shipping-extension/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpKernel\\DataCollector\\DataCollector' not found in wp-content/plugins/universal-package-systems-shipping-extension/vendor/symfony/translation/DataCollector/TranslationDataCollector.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Client\\Exception\\RequestException' not found in wp-content/plugins/universal-package-systems-shipping-extension/vendor/php-http/httplug/src/Exception/NetworkException.php:12
    • > PHP Fatal error
      Trait 'Carbon\\Traits\\Boundaries' not found in wp-content/plugins/universal-package-systems-shipping-extension/vendor/nesbot/carbon/src/Carbon/Traits/Date.php on line 518
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/universal-package-systems-shipping-extension/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/universal-package-systems-shipping-extension/vendor/symfony/translation/Dumper/QtFileDumper.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Reader\\TranslationReaderInterface' not found in wp-content/plugins/universal-package-systems-shipping-extension/vendor/symfony/translation/Reader/TranslationReader.php:23

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: woocommerce, shipping, tobago, trinidad

universal-package-systems-shipping-extension/wc-upackage_sys-shipping.php 77% from 13 tests

This is the main PHP file of "Universal Package Systems Shipping Extension" version 1.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.7" instead of "3.7")
  • Main file name: The principal plugin file should be the same as the plugin slug ("universal-package-systems-shipping-extension.php" instead of "wc-upackage_sys-shipping.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
It is important to fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/universal-package-systems-shipping-extension/vendor/nesbot/carbon/bin/carbon.bat
49,332 lines of code in 979 files:
LanguageFilesBlank linesComment linesLines of code
PHP9177,57728,69740,369
Markdown301,61304,251
XSD392482,803
JSON20001,765
JavaScript3195472
XML10045
Dockerfile18010
make1409
CSS2184
DOS Batch1004

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 139)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity13.60
▷ Minimum class complexity1.00
▷ Maximum class complexity296.00
Average method complexity2.79
▷ Minimum method complexity1.00
▷ Maximum method complexity139.00
Code structure
Namespaces40
Interfaces44
Traits25
Classes187
▷ Abstract classes73.74%
▷ Concrete classes18096.26%
▷ Final classes3016.67%
Methods2,102
▷ Static methods40819.41%
▷ Public methods1,79785.49%
▷ Protected methods1095.19%
▷ Private methods1969.32%
Functions439
▷ Named functions11927.11%
▷ Anonymous functions32072.89%
Constants146
▷ Global constants1812.33%
▷ Class constants12887.67%
▷ Public constants128100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin