87% blu-logistics

Code Review | blu Logistics

WordPress plugin blu Logistics scored 87% from 54 tests.

About plugin

  • Plugin page: blu-logistics
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.9
  • WordPress version: 5.8.1
  • First release: Jul 18, 2017
  • Latest release: Nov 24, 2017
  • Number of updates: 18
  • Update frequency: every 7.6 days
  • Top authors: blulogistics1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 546 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

A check of server-side resources used by blu Logistics
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1234.83 ▲12.91
Dashboard /wp-admin3.06 ▲0.0042.50 ▼1.54
Posts /wp-admin/edit.php3.11 ▲0.0039.06 ▼3.97
Add New Post /wp-admin/post-new.php5.42 ▼0.0188.41 ▼670.31
Media Library /wp-admin/upload.php3.00 ▼0.0129.34 ▼6.27

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 140 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

blu Logistics: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8316.25 ▲0.187.72 ▲0.1649.08 ▲4.82
Dashboard /wp-admin2,969 ▲385.85 ▼0.13144.05 ▼2.17112.92 ▲4.99
Posts /wp-admin/edit.php2,739 ▼02.70 ▲0.0163.00 ▼7.3693.43 ▲6.84
Add New Post /wp-admin/post-new.php1,670 ▼1,96619.15 ▲4.23357.39 ▼48.68106.79 ▼0.51
Media Library /wp-admin/upload.php1,807 ▼05.02 ▼0.02155.91 ▲12.95123.35 ▲0.57

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/blu-logistics/pdf_functions.php
    • > /wp-content/plugins/blu-logistics/blu-logistics-delivery-shipping-method.php
    • > /wp-content/plugins/blu-logistics/admin/label/lib/tcpdf/tools/tcpdf_addfont.php
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: current in wp-content/plugins/blu-logistics/admin/templates/render.inc.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/blu-logistics/admin/label/lib/FPDI-master/fpdi_bridge.php:23
    • > PHP Notice
      Undefined variable: total in wp-content/plugins/blu-logistics/admin/templates/render.inc.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/blu-logistics/admin/label/lib/FPDI-master/fpdi_bridge.php:23
    • > PHP Notice
      Undefined index: data in wp-content/plugins/blu-logistics/admin/label/display_label.php on line 17
    • > PHP Notice
      Undefined index: change_address in wp-content/plugins/blu-logistics/blu-terminal-ajax.php on line 31
    • > PHP Notice
      Undefined variable: rpp in wp-content/plugins/blu-logistics/admin/templates/render.inc.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_head() in wp-content/plugins/blu-logistics/blu-terminal.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/blu-logistics/admin/label/lib/fpdi/fpdi_bridge.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/blu-logistics/admin/label/lib/fpdi/fpdi_bridge.php:23

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Enabled this shipping method), #2 (bluLogistics), #3 (bluHome), #4 (bluPort Parcel), #5 (bluGlobal)
You can take inspiration from this readme.txt

blu-logistics/blu-logistics-delivery-shipping-method.php 92% from 13 tests

The main PHP file in "blu Logistics" ver. 1.0.0 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:
  • Main file name: The principal plugin file should be the same as the plugin slug ("blu-logistics.php" instead of "blu-logistics-delivery-shipping-method.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin54,625 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
PHP663,63414,68854,025
CSS65327435
JSON300100
Markdown124063
JavaScript20172

PHP code 0% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 4,337)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 495)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity191.32
▷ Minimum class complexity1.00
▷ Maximum class complexity4,337.00
Average method complexity9.19
▷ Minimum method complexity1.00
▷ Maximum method complexity495.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes40
▷ Abstract classes00.00%
▷ Concrete classes40100.00%
▷ Final classes00.00%
Methods929
▷ Static methods10711.52%
▷ Public methods60064.59%
▷ Protected methods32935.41%
▷ Private methods00.00%
Functions68
▷ Named functions68100.00%
▷ Anonymous functions00.00%
Constants133
▷ Global constants10578.95%
▷ Class constants2821.05%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
35 compressed PNG files occupy 0.25MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png47.12KB48.63KB0.00%
admin/fancybox/fancy_shadow_sw.png0.33KB0.48KB0.00%
admin/images/label.png0.77KB0.51KB▼ 33.67%
admin/fancybox/fancy_title_right.png0.49KB0.82KB0.00%
admin/images/fancybox_sprite.png1.33KB1.42KB0.00%