72% local-shipping-labels-for-woocommerce

Code Review | Local Shipping Labels for WooCommerce

WordPress plugin Local Shipping Labels for WooCommerce scored72%from 54 tests.

About plugin

  • Plugin page: local-shipping-la...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.3
  • WordPress version: 6.3.1
  • First release: Apr 15, 2019
  • Latest release: Nov 20, 2019
  • Number of updates: 5
  • Update frequency: every 44.6 days
  • Top authors: woofx (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /1,398 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼5.97ms] Passed 4 tests

A check of server-side resources used by Local Shipping Labels for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1440.44 ▼7.29
Dashboard /wp-admin3.46 ▲0.1545.91 ▼3.00
Posts /wp-admin/edit.php3.57 ▲0.2148.73 ▲0.62
Add New Post /wp-admin/post-new.php6.04 ▲0.1592.12 ▼13.55
Media Library /wp-admin/upload.php3.38 ▲0.1534.80 ▼0.03
Local Shipping Labels /wp-admin/options-general.php?page=local-shipping-labels-for-woocommerce3.3530.81

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Local Shipping Labels for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.25 ▼1.131.89 ▲0.1543.53 ▼3.58
Dashboard /wp-admin2,210 ▲225.82 ▲0.9497.10 ▼8.9540.50 ▼5.10
Posts /wp-admin/edit.php2,093 ▲41.98 ▼0.0239.13 ▼3.0034.33 ▼0.70
Add New Post /wp-admin/post-new.php1,536 ▲1722.99 ▼0.27674.88 ▲44.4251.43 ▼6.20
Media Library /wp-admin/upload.php1,395 ▲44.20 ▼0.01100.66 ▼0.2245.41 ▼1.86
Local Shipping Labels /wp-admin/options-general.php?page=local-shipping-labels-for-woocommerce8191.7025.6352.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=local-shipping-labels-for-woocommerce
    • > Notice in wp-content/plugins/local-shipping-labels-for-woocommerce/admin/Settings.php+83
    Undefined index: items
    • > GET request to /wp-admin/options-general.php?page=local-shipping-labels-for-woocommerce
    • > Notice in wp-content/plugins/local-shipping-labels-for-woocommerce/admin/Settings.php+88
    Undefined index: billing_2
    • > GET request to /wp-admin/options-general.php?page=local-shipping-labels-for-woocommerce
    • > Notice in wp-content/plugins/local-shipping-labels-for-woocommerce/admin/Settings.php+93
    Undefined index: country

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/local-shipping-labels-for-woocommerce/vendor/sabberworm/php-css-parser/tests/quickdump.php
    • > /wp-content/plugins/local-shipping-labels-for-woocommerce/admin/partials/admin-submenu-page.php
    • > /wp-content/plugins/local-shipping-labels-for-woocommerce/admin/partials/admin-tab-support.php
  • 132× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/local-shipping-labels-for-woocommerce/vendor/phenx/php-svg-lib/tests/Svg/StyleTest.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Positioner\\AbstractPositioner' not found in wp-content/plugins/local-shipping-labels-for-woocommerce/vendor/dompdf/dompdf/src/Positioner/Absolute.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/local-shipping-labels-for-woocommerce/vendor/dompdf/dompdf/src/FrameDecorator/NullFrameDecorator.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/local-shipping-labels-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/Table/Type/glyf.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\PrimitiveValue' not found in wp-content/plugins/local-shipping-labels-for-woocommerce/vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Size.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/local-shipping-labels-for-woocommerce/vendor/phenx/php-svg-lib/src/Svg/Tag/Polyline.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/local-shipping-labels-for-woocommerce/vendor/dompdf/dompdf/src/FrameReflower/Image.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Positioner\\AbstractPositioner' not found in wp-content/plugins/local-shipping-labels-for-woocommerce/vendor/dompdf/dompdf/src/Positioner/TableCell.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/local-shipping-labels-for-woocommerce/vendor/dompdf/dompdf/src/FrameDecorator/Text.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/local-shipping-labels-for-woocommerce/vendor/dompdf/dompdf/src/FrameReflower/Table.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Donate link: Invalid URI ("woofx.kaizenflow.xyz")
You can take inspiration from this readme.txt

local-shipping-labels-for-woocommerce/local-shipping-labels-for-woocommerce.php Passed 13 tests

"Local Shipping Labels for WooCommerce" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
83 characters long description:
Print shipping labels for local deliveries. Print multiple labels in a single page.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected36,863 lines of code in 262 files:
LanguageFilesBlank linesComment linesLines of code
PHP2088,55515,93634,701
Markdown62550909
CSS3113460650
JSON700347
XML532186
YAML312245
HTML10017
SVG1008

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity34.16
▷ Minimum class complexity1.00
▷ Maximum class complexity765.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces36
Interfaces5
Traits0
Classes187
▷ Abstract classes126.42%
▷ Concrete classes17593.58%
▷ Final classes00.00%
Methods2,017
▷ Static methods864.26%
▷ Public methods1,72485.47%
▷ Protected methods1929.52%
▷ Private methods1015.01%
Functions18
▷ Named functions316.67%
▷ Anonymous functions1583.33%
Constants158
▷ Global constants31.90%
▷ Class constants15598.10%
▷ Public constants155100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%